Module Dhcp_server.Config

type host = {
hostname : string;
options : Dhcp_wire.dhcp_option list;
fixed_addr : Ipaddr.V4.t option;
hw_addr : Macaddr.t;
}

host config section entry.

val sexp_of_host : host -> Ppx_sexp_conv_lib.Sexp.t
val host_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> host
type t = {
options : Dhcp_wire.dhcp_option list;
hostname : string;
default_lease_time : int32;
max_lease_time : int32;
ip_addr : Ipaddr.V4.t;
mac_addr : Macaddr.t;
network : Ipaddr.V4.Prefix.t;
range : (Ipaddr.V4.t * Ipaddr.V4.t) option;
hosts : host list;
}

Server configuration

include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
val parse : string -> (Ipaddr.V4.t * Macaddr.t) -> t

parse cf (addr * mac) Creates a server configuration by parsing cf as an ISC dhcpd.conf file, currently only the options at sample/dhcpd.conf are supported. addr and mac are the prefix address and mac address to be used for building replies, it must match one subnet section in cf. Raises Not_found if the (addr * mac) tuple does not match any network section.

val make : ?hostname:string -> ?default_lease_time:int -> ?max_lease_time:int -> ?hosts:host list -> addr_tuple:(Ipaddr.V4.t * Macaddr.t) -> network:Ipaddr.V4.Prefix.t -> range:(Ipaddr.V4.t * Ipaddr.V4.t) option -> options:Dhcp_wire.dhcp_option list -> unit -> t