Skip to content

Commit

Permalink
Merge pull request #83 from hannesm/less-types
Browse files Browse the repository at this point in the history
remove type ethif and prefix from IP implementation
  • Loading branch information
hannesm authored Sep 16, 2018
2 parents 612735e + 025b3c9 commit 4b90160
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 50 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ env:
global:
- TESTS=true
- PINS="charrua-core.dev:. charrua-unix.dev:. charrua-client.dev:. charrua-client-lwt.dev:. charrua-client-mirage.dev:."
- EXTRA_REMOTES="https://github.com/mirage/mirage-dev.git"
matrix:
- DISTRO="alpine-3.5" OCAML_VERSION="4.03.0" PACKAGE="charrua-client"
- DISTRO="alpine-3.5" OCAML_VERSION="4.03.0" PACKAGE="charrua-client-lwt"
- DISTRO="alpine-3.5" OCAML_VERSION="4.03.0" PACKAGE="charrua-client-mirage"
- DISTRO="alpine-3.5" OCAML_VERSION="4.03.0" PACKAGE="charrua-unix"
- DISTRO="alpine-3.5" OCAML_VERSION="4.04.2" PACKAGE="charrua-core"
- DISTRO="centos-6" OCAML_VERSION="4.04.1" PACKAGE="charrua-unix"
- DISTRO="centos-7" OCAML_VERSION="4.04.0" PACKAGE="charrua-unix"
- DISTRO="debian-stable" OCAML_VERSION="4.04.1" PACKAGE="charrua-unix"
- DISTRO="fedora-25" OCAML_VERSION="4.03.0" PACKAGE="charrua-unix"
- DISTRO="ubuntu-14.04" OCAML_VERSION="4.03.0" PACKAGE="charrua-unix"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.03.0" PACKAGE="charrua-unix"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.04.1" PACKAGE="charrua-unix"
- DISTRO="alpine" OCAML_VERSION="4.06" PACKAGE="charrua-client"
- DISTRO="alpine" OCAML_VERSION="4.06" PACKAGE="charrua-client-lwt"
- DISTRO="alpine" OCAML_VERSION="4.06" PACKAGE="charrua-client-mirage"
- DISTRO="alpine" OCAML_VERSION="4.05" PACKAGE="charrua-unix"
- DISTRO="alpine" OCAML_VERSION="4.06" PACKAGE="charrua-core"
- DISTRO="centos-7" OCAML_VERSION="4.05" PACKAGE="charrua-unix"
- DISTRO="debian-stable" OCAML_VERSION="4.04" PACKAGE="charrua-unix"
- DISTRO="debian-unstable" OCAML_VERSION="4.05" PACKAGE="charrua-unix"
- DISTRO="ubuntu-14.04" OCAML_VERSION="4.04" PACKAGE="charrua-unix"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.05" PACKAGE="charrua-unix"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.04" PACKAGE="charrua-unix"
38 changes: 20 additions & 18 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
v0.9 2017-08-02
---------------
### v0.10 2018-09-16

* charrua-unix: safe-string support (@haesbaert)
* Behave like a windows 10 (default requested options) (#76 @juga0)
* Document code using comments (#76 @juga0, #78 @yomimono)
* Support private_classless_static_route option (#76 @juga0)
* Adjust to tcpip 3.5.0 and mirage-protocols-lwt 1.4.0 changes mirage-qubes-ipv4
Static_ipv4.Make now requires a Random device and a monotonic clock
connect requires a Mclock.t
Mirage_protocols_lwt.IPV4 does not define the type alias ethif (#83 @hannesm)

### v0.9 2017-08-02

* core: re-implement UDP checksum on input (#63 @haesbaert)
* client: implement renewal logic (breaking API change) (#60 @yomimono)
* client: split mirage sublibrary into lwt sublibrary (timing logic) and mirage sublibrary (shims for MirageOS APIs) (#60 @yomimono)
* numerous test and build bugfixes (#68 #64 #61 @samoht, #67 #66 #65 @djs55)

v0.8 2017-06-12
---------------
### v0.8 2017-06-12

* Port to Jbuilder (#57 @avsm).

v0.7 2017-14-04
---------------
### v0.7 2017-14-04

* Fixed a bug where only the first tuple from an option list would be parsed
* Fixed parsing of long option lists
* Fixed parsing for options 120 and 121
* Updated copyrights

v0.6 2017-04-01
---------------
### v0.6 2017-04-01

* `Dhcp_wire.buf_of_pkt` now correctly rejects empty options
* `Dhcp_wire.options_of_buf` now enforces minimun length on all cases
* Fixed option code for `Bcmcs_controller_ipv4_addr`
* **CRITICAL** Fixed a bug where `dhcp_flags` was read from the wrong offset
This bug was present in versions 0.4 and 0.5

v0.5 2017-03-14
---------------
### v0.5 2017-03-14

* Topkg support added
* Time type on input_pkt changed to int32
* Bump tcpip support to version 3.1.0

v0.4 2017-01-21
---------------
### v0.4 2017-01-21

* MirageOS3 compatibility
* Ocaml 4.02.3 deprecated
Expand All @@ -48,8 +53,7 @@ v0.4 2017-01-21
* Improved default lease time
* Fixed cases where pkt_of_buf could raise an exception

v0.3 2016-04-02
---------------
### v0.3 2016-04-02

* Fixed uninitialized data on packet parsing, normalized to zero
* Lease.database moved out of Config.t
Expand All @@ -60,15 +64,13 @@ v0.3 2016-04-02
* Convert to ppx
* Minor bug fixes

v0.2 2015-11-10
---------------
### v0.2 2015-11-10

* Custom exceptions removed, only Invalid_argument now
* Improved mli documentation
* Major rewrite
* Support ocaml 4.01

v0.1 2015-10-09
---------------
### v0.1 2015-10-09

* Initial release
6 changes: 3 additions & 3 deletions charrua-client-lwt.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ build-test: ["jbuilder" "runtest" "-p" name "-j" jobs]

depends: [
"jbuilder" {build & >= "1.0+beta9"}
"ounit" {test}
"alcotest" {test}
"charrua-core" {>= "0.9"}
"charrua-client" {>= "0.9"}
"cstruct-unix" {test}
"charrua-core" {>= "0.10"}
"charrua-client" {>= "0.10"}
"cstruct" {>="3.0.2"}
"ipaddr"
"rresult"
Expand Down
10 changes: 5 additions & 5 deletions charrua-client-mirage.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ build-test: ["jbuilder" "runtest" "-p" name "-j" jobs]

depends: [
"jbuilder" {build & >= "1.0+beta9"}
"ounit" {test}
"alcotest" {test}
"charrua-core" {>= "0.9"}
"charrua-client-lwt" {>= "0.9"}
"charrua-client" {>= "0.9"}
"charrua-core" {>= "0.10"}
"charrua-client-lwt" {>= "0.10"}
"charrua-client" {>= "0.10"}
"cstruct" {>="3.0.2"}
"ipaddr"
"rresult"
"mirage-random" {>= "1.0.0"}
"mirage-clock"
"duration"
"logs"
"tcpip" {>= "3.2.0"}
"tcpip" {>= "3.5.0"}
"fmt"
"lwt"
"mirage-types-lwt" {>="3.0.0"}
Expand Down
4 changes: 2 additions & 2 deletions charrua-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ build-test: [

depends: [
"jbuilder" {build & >= "1.0+beta9"}
"ounit" {test}
"alcotest" {test}
"charrua-core" {>= "0.9"}
"cstruct-unix" {test}
"charrua-core" {>= "0.10"}
"cstruct" {>="3.0.2"}
"ipaddr"
]
Expand Down
2 changes: 1 addition & 1 deletion charrua-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build: [
depends: [
"jbuilder" {build & >="1.0+beta9"}
"lwt" {>="3.0.0"}
"charrua-core" {>= "0.9"}
"charrua-core" {>= "0.10"}
"cstruct-unix"
"cmdliner"
"rawlink"
Expand Down
9 changes: 4 additions & 5 deletions client/mirage/dhcp_ipv4.ml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
open Lwt.Infix
open Mirage_protocols_lwt

module Make(Dhcp_client : DHCP_CLIENT) (Ethif : ETHIF)(Arp : ARP) = struct
module Make(Dhcp_client : DHCP_CLIENT) (R : Mirage_random.C) (C : Mirage_clock.MCLOCK) (Ethif : ETHIF)(Arp : ARP) = struct
(* for now, just wrap a static ipv4 *)
module I = Static_ipv4.Make(Ethif)(Arp)
include I
let connect dhcp ethif arp =
include Static_ipv4.Make(R)(C)(Ethif)(Arp)
let connect dhcp clock ethif arp =
Lwt_stream.last_new dhcp >>= fun (config : ipv4_config) ->
I.connect ~ip:config.address ~network:config.network ~gateway:config.gateway ethif arp
connect ~ip:config.address ~network:config.network ~gateway:config.gateway clock ethif arp
end
6 changes: 3 additions & 3 deletions client/mirage/dhcp_ipv4.mli
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)

module Make (D: Mirage_protocols_lwt.DHCP_CLIENT) (E:Mirage_types_lwt.ETHIF) (A: Mirage_types_lwt.ARP) : sig
include Mirage_types_lwt.IPV4 with type ethif = E.t
val connect : D.t -> ethif -> A.t -> t Lwt.t
module Make (D: Mirage_protocols_lwt.DHCP_CLIENT) (R : Mirage_random.C) (C : Mirage_clock.MCLOCK) (E:Mirage_types_lwt.ETHIF) (A: Mirage_types_lwt.ARP) : sig
include Mirage_types_lwt.IPV4
val connect : D.t -> C.t -> E.t -> A.t -> t Lwt.t
(** Connect to an ipv4 device using information from a DHCP lease. *)
end
2 changes: 1 addition & 1 deletion client/mirage/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(library
((name dhcp_client_mirage)
(public_name charrua-client-mirage)
(libraries (charrua-client-lwt mirage-types-lwt))
(libraries (charrua-client-lwt mirage-types-lwt mirage-protocols-lwt mirage-clock mirage-random))
(wrapped false)))

0 comments on commit 4b90160

Please sign in to comment.