package mnet-dhcp
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=efcef0d0452c6b6b5d5a618bff47250fd873d4cd317d0a51ee349c4a5cb84d9a
sha512=5c0d2b5a1967c592138525f6f706457b45833f4f86a98c7cede0128edce4104e227361025bacc4c888bf73499c8438df95d51f990f93515cd4a2ce5f89e01caa
Description
mnet-dhcp provides a DHCP-enabled TCP/IP stack on top of mnet, using the charrua DHCP implementation. The core mnet library stays free of any DHCP dependency: the stack can be configured (and reconfigured) at runtime from DHCP leases, and the user is notified of and may confirm or reject configuration changes.
Added to opam-repository:
README
mnet, a pure OCaml TCP/IP stack for unikernels
mnet is a library that implements certain network layers to provide a TCP/IP stack for an application using utcp. The project essentially requires the reading and writing of Ethernet frames, which is provided by Solo5 and mkernel.
This library implements:
- an IPv4 layer (with ARP)
- an IPv6 layer
- an ICMP layer
- the DNS protocol using
mnet-dns - the TLS protocol using
mnet-tls - the SSH protocol using
mnet-ssh - a DHCP layer using
mnet-dhcp
The aim is to provide a ready-to-use TCP/IP stack implemented entirely in OCaml. Here is an example of how to initialise a TCP/IP stack that configures itself automatically based on an available DHCP server.
let ( let@ ) finally fn = Fun.protect ~finally fn
module RNG = Mirage_crypto_rng.Fortuna
let rng () = Mirage_crypto_rng_mkernel.initialize (module RNG)
let rng = Mkernel.map rng Mkernel.[]
let cfg = Mnet_dhcp.accept_all
let () =
Mkernel.(run [ rng; Mnet_dhcp.stack ~name:"service" cfg ])
@@ fun rng (stack, tcp, udp, lease) () ->
let@ () = fun () -> Mnet_dhcp.kill stack in
let@ () = fun () -> Mirage_crypto_rng_mkernel.kill rng in
...mnet is a replacement for mirage-tcpip, designed to take advantage of effects and our Miou scheduler.