Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mirage/mirage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ba1e6e8ba19c
Choose a base ref
...
head repository: mirage/mirage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 75f0bc33d48e
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Nov 3, 2018

  1. Copy the full SHA
    e8d6314 View commit details

Commits on Nov 14, 2018

  1. Merge pull request #938 from hannesm/charrua-client

    adapt to charrua-client changes: Dhcp_client requires a random device now
    hannesm authored Nov 14, 2018
    Copy the full SHA
    75f0bc3 View commit details
Showing with 12 additions and 8 deletions.
  1. +1 −1 lib/mirage.mli
  2. +4 −4 lib/mirage_impl_ip.ml
  3. +4 −1 lib/mirage_impl_ip.mli
  4. +2 −2 lib/mirage_impl_stackv4.ml
  5. +1 −0 lib/mirage_impl_stackv4.mli
2 changes: 1 addition & 1 deletion lib/mirage.mli
Original file line number Diff line number Diff line change
@@ -395,7 +395,7 @@ val qubes_ipv4_stack: ?group:string -> ?qubesdb:qubesdb impl -> ?arp:(ethernet i

(** Build a stackv4 by obtaining a DHCP lease, using the lease to
* build an ipv4, then building a stack on top of that. *)
val dhcp_ipv4_stack: ?group:string -> ?time:time impl -> ?arp:(ethernet impl -> arpv4 impl) -> network impl -> stackv4 impl
val dhcp_ipv4_stack: ?group:string -> ?random:random impl -> ?time:time impl -> ?arp:(ethernet impl -> arpv4 impl) -> network impl -> stackv4 impl

(** Build a stackv4 by checking the {!Key.V4.network}, and {!Key.V4.gateway} keys
* for ipv4 configuration information, filling in unspecified information from [?config],
8 changes: 4 additions & 4 deletions lib/mirage_impl_ip.ml
Original file line number Diff line number Diff line change
@@ -59,13 +59,13 @@ let ipv4_keyed_conf ?network ?gateway () = impl @@ object

let dhcp_conf = impl @@ object
inherit base_configurable
method ty = time @-> network @-> Mirage_impl_dhcp.dhcp
method ty = random @-> time @-> network @-> Mirage_impl_dhcp.dhcp
method name = "dhcp_client"
method module_name = "Dhcp_client_mirage.Make"
method! packages = Key.pure [ package ~min:"0.10" "charrua-client-mirage" ]
method! connect _ modname = function
| [ _time; network ] -> Fmt.strf "%s.connect %s " modname network
| _ -> failwith (connect_err "dhcp" 2)
| [ _random; _time; network ] -> Fmt.strf "%s.connect %s " modname network
| _ -> failwith (connect_err "dhcp" 3)
end

let ipv4_dhcp_conf = impl @@ object
@@ -82,7 +82,7 @@ let ipv4_dhcp_conf = impl @@ object
end


let dhcp time net = dhcp_conf $ time $ net
let dhcp random time net = dhcp_conf $ random $ time $ net
let ipv4_of_dhcp
?(random = default_random)
?(clock = default_monotonic_clock) dhcp ethif arp =
5 changes: 4 additions & 1 deletion lib/mirage_impl_ip.mli
Original file line number Diff line number Diff line change
@@ -49,7 +49,10 @@ val create_ipv6 :
-> ipv6 impl

val dhcp :
Mirage_impl_time.time impl -> network impl -> Mirage_impl_dhcp.dhcp impl
random impl
-> Mirage_impl_time.time impl
-> network impl
-> Mirage_impl_dhcp.dhcp impl

val ipv4_of_dhcp :
?random:random impl
4 changes: 2 additions & 2 deletions lib/mirage_impl_stackv4.ml
Original file line number Diff line number Diff line change
@@ -48,8 +48,8 @@ let direct_stackv4
$ direct_udp ~random ip
$ direct_tcp ~clock ~random ~time ip

let dhcp_ipv4_stack ?group ?(time = default_time) ?(arp = arp ?clock:None ?time:None) tap =
let config = dhcp time tap in
let dhcp_ipv4_stack ?group ?(random = default_random) ?(time = default_time) ?(arp = arp ?clock:None ?time:None) tap =
let config = dhcp random time tap in
let e = etif tap in
let a = arp e in
let i = ipv4_of_dhcp config e a in
1 change: 1 addition & 0 deletions lib/mirage_impl_stackv4.mli
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ val qubes_ipv4_stack :

val dhcp_ipv4_stack :
?group:string
-> ?random:Mirage_impl_random.random Functoria.impl
-> ?time:Mirage_impl_time.time Functoria.impl
-> ?arp:( Mirage_impl_ethernet.ethernet Functoria.impl
-> Mirage_impl_arpv4.arpv4 Functoria.impl)