mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-10 03:36:21 +00:00
3 components: - network: read eht0 and proxy only DHCP traffic - engine: read DHCP traffic, handle DHCP client state machine, and call the host actuator to change the host config when a lease is obtained host system configuration. - actuator: perform the acutall net syscalls, read and write host configuration files, etc These three components can either be linked together in a single binary (see src/dhcp-client/main.ml) or can be used as 3 binaries communicating over cap-n-proto. Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
16 lines
311 B
OCaml
16 lines
311 B
OCaml
open Lwt.Infix
|
|
|
|
external dhcp_filter: unit -> string = "bpf_filter"
|
|
|
|
module Make (Act: Sdk.Host.S) = struct
|
|
|
|
include Sdk.Net.Rawlink
|
|
|
|
let connect act =
|
|
let filter = dhcp_filter () in
|
|
Act.mac act >>= fun mac ->
|
|
Act.interface act >>= fun intf ->
|
|
Sdk.Net.Rawlink.connect ~filter ~mac intf
|
|
|
|
end
|