package tcpip

  1. Overview
  2. Docs

Parameters

module Time : V1_LWT.TIME
module Random : V1.RANDOM
module Udp : V1_LWT.UDPV4

Signature

type offer = {
  1. ip_addr : Ipaddr.V4.t;
  2. netmask : Ipaddr.V4.t option;
  3. gateways : Ipaddr.V4.t list;
  4. dns : Ipaddr.V4.t list;
  5. lease : int32;
  6. xid : int32;
}
type state =
  1. | Disabled
  2. | Request_sent of int32
  3. | Offer_accepted of offer
  4. | Lease_held of offer
  5. | Shutting_down
type t = {
  1. c : Console.t;
  2. udp : Udp.t;
  3. mac : Macaddr.t;
  4. mutable state : state;
  5. new_offer : offer -> unit Lwt.t;
}
val sizeof_dhcp : int
val get_dhcp_op : Cstruct.t -> Cstruct.uint8
val set_dhcp_op : Cstruct.t -> Cstruct.uint8 -> unit
val get_dhcp_htype : Cstruct.t -> Cstruct.uint8
val set_dhcp_htype : Cstruct.t -> Cstruct.uint8 -> unit
val get_dhcp_hlen : Cstruct.t -> Cstruct.uint8
val set_dhcp_hlen : Cstruct.t -> Cstruct.uint8 -> unit
val get_dhcp_hops : Cstruct.t -> Cstruct.uint8
val set_dhcp_hops : Cstruct.t -> Cstruct.uint8 -> unit
val get_dhcp_xid : Cstruct.t -> Cstruct.uint32
val set_dhcp_xid : Cstruct.t -> Cstruct.uint32 -> unit
val get_dhcp_secs : Cstruct.t -> Cstruct.uint16
val set_dhcp_secs : Cstruct.t -> Cstruct.uint16 -> unit
val get_dhcp_flags : Cstruct.t -> Cstruct.uint16
val set_dhcp_flags : Cstruct.t -> Cstruct.uint16 -> unit
val get_dhcp_ciaddr : Cstruct.t -> Cstruct.uint32
val set_dhcp_ciaddr : Cstruct.t -> Cstruct.uint32 -> unit
val get_dhcp_yiaddr : Cstruct.t -> Cstruct.uint32
val set_dhcp_yiaddr : Cstruct.t -> Cstruct.uint32 -> unit
val get_dhcp_siaddr : Cstruct.t -> Cstruct.uint32
val set_dhcp_siaddr : Cstruct.t -> Cstruct.uint32 -> unit
val get_dhcp_giaddr : Cstruct.t -> Cstruct.uint32
val set_dhcp_giaddr : Cstruct.t -> Cstruct.uint32 -> unit
val get_dhcp_chaddr : Cstruct.t -> Cstruct.t
val copy_dhcp_chaddr : Cstruct.t -> string
val set_dhcp_chaddr : string -> int -> Cstruct.t -> unit
val blit_dhcp_chaddr : Cstruct.t -> int -> Cstruct.t -> unit
val get_dhcp_sname : Cstruct.t -> Cstruct.t
val copy_dhcp_sname : Cstruct.t -> string
val set_dhcp_sname : string -> int -> Cstruct.t -> unit
val blit_dhcp_sname : Cstruct.t -> int -> Cstruct.t -> unit
val get_dhcp_file : Cstruct.t -> Cstruct.t
val copy_dhcp_file : Cstruct.t -> string
val set_dhcp_file : string -> int -> Cstruct.t -> unit
val blit_dhcp_file : Cstruct.t -> int -> Cstruct.t -> unit
val hexdump_dhcp_to_buffer : Buffer.t -> Cstruct.t -> unit
val hexdump_dhcp : Cstruct.t -> unit
type mode =
  1. | BootRequest
  2. | BootReply
val int_to_mode : int -> mode option
val mode_to_int : mode -> int
val mode_to_string : mode -> string
val string_to_mode : string -> mode option
val output_broadcast : t -> xid:Cstruct.uint32 -> yiaddr:Ipaddr.V4.t -> siaddr:Ipaddr.V4.t -> options:Dhcpv4_option.Packet.p -> unit Lwt.t
val input : t -> src:'a -> dst:'b -> src_port:'c -> Cstruct.t -> unit Lwt.t
val start_discovery : t -> unit Lwt.t
val dhcp_thread : t -> unit Console.io
val create : Console.t -> Macaddr.t -> Udp.t -> t * offer Lwt_stream.t
val listen : t -> dst_port:int -> (src:'a -> dst:'b -> src_port:'c -> Cstruct.t -> unit Lwt.t) option