package charrua-client
DHCP client implementation
Install
dune-project
Dependency
Authors
Maintainers
Sources
charrua-2.1.1.tbz
sha256=5c6ad4b357037c4a0424d9db0a55f539ce639d02993e660e8c2879c5a11dee58
sha512=82a0ad98fdb27472b6506dce9756338e1f68a3f993560917505504a7b05471fa8af73228db1304f9fe2281a7b2ca16730588ca2e5aab9d04ffdd42ecb5a67452
doc/src/charrua-client.mirage/dhcp_ipv4.ml.html
Source file dhcp_ipv4.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
open Lwt.Infix let src = Logs.Src.create "dhcp_client_mirage" module Log = (val Logs.src_log src : Logs.LOG) module Make (Network : Mirage_net.S) (E : Ethernet.S) (Arp : Arp.S) = struct (* for now, just wrap a static ipv4 *) module DHCP = Dhcp_client_mirage.Make(Network) include Static_ipv4.Make(E)(Arp) let connect ?(no_init = false) ?cidr ?gateway ?options ?requests net ethernet arp = (match cidr, no_init with | None, false -> Option.iter (fun g -> Log.warn (fun m -> m "No CIDR provided, but a gateway %a, which will be ignored (requesting a DHCP lease)" Ipaddr.V4.pp g)) gateway; let requests = match requests with | None -> Dhcp_wire.[ SUBNET_MASK; ROUTERS ] | Some s -> s in DHCP.connect ?options ~requests net >>= fun dhcp -> Lwt_stream.last_new dhcp | None, true -> Lwt.return (Ipaddr.V4.(Prefix.make 32 localhost), gateway) | Some ip, _ -> Lwt.return (ip, gateway)) >>= fun (cidr, gateway) -> connect ~no_init ~cidr ?gateway ethernet arp end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>