Library
Module
Module type
Parameter
Class
Class type
Conversions of op
s.
val int_to_op : int -> op option
val int_to_op_exn : int -> op
val op_to_int : op -> int
val op_to_string : op -> string
Conversions of msgtype
s.
val msgtype_to_int : msgtype -> int
val int_to_msgtype : int -> msgtype option
val int_to_msgtype_exn : int -> msgtype
val msgtype_to_string : msgtype -> string
type option_code =
| PAD
| SUBNET_MASK
| TIME_OFFSET
| ROUTERS
| DNS_SERVERS
| LOG_SERVERS
| LPR_SERVERS
| HOSTNAME
| BOOTFILE_SIZE
| DOMAIN_NAME
| SWAP_SERVER
| ROOT_PATH
| EXTENSION_PATH
| IPFORWARDING
| NLSR
| POLICY_FILTERS
| MAX_DATAGRAM
| DEFAULT_IP_TTL
| INTERFACE_MTU
| ALL_SUBNETS_LOCAL
| BROADCAST_ADDR
| PERFORM_ROUTER_DISC
| ROUTER_SOL_ADDR
| STATIC_ROUTES
| TRAILER_ENCAPSULATION
| ARP_CACHE_TIMO
| ETHERNET_ENCAPSULATION
| TCP_DEFAULT_TTL
| TCP_KEEPALIVE_INTERVAL
| NIS_DOMAIN
| NIS_SERVERS
| NTP_SERVERS
| VENDOR_SPECIFIC
| NETBIOS_NAME_SERVERS
| NETBIOS_DATAGRAM_DISTRIB_SERVERS
| NETBIOS_NODE
| NETBIOS_SCOPE
| XWINDOW_FONT_SERVERS
| XWINDOW_DISPLAY_MANAGERS
| REQUEST_IP
| IP_LEASE_TIME
| OPTION_OVERLOAD
| MESSAGE_TYPE
| SERVER_IDENTIFIER
| PARAMETER_REQUESTS
| MESSAGE
| MAX_MESSAGE
| RENEWAL_T1
| REBINDING_T2
| VENDOR_CLASS_ID
| CLIENT_ID
| NIS_PLUS_DOMAIN
| NIS_PLUS_SERVERS
| TFTP_SERVER_NAME
| BOOTFILE_NAME
| MOBILE_IP_HOME_AGENT
| SMTP_SERVERS
| POP3_SERVERS
| NNTP_SERVERS
| IRC_SERVERS
| USER_CLASS
| RAPID_COMMIT
| CLIENT_FQDN
| RELAY_AGENT_INFORMATION
| CLIENT_SYSTEM
| CLIENT_NDI
| UUID_GUID
| PCODE
| TCODE
| IPV6ONLY
| SUBNET_SELECTION
| DOMAIN_SEARCH
| SIP_SERVERS
| CLASSLESS_STATIC_ROUTE
| VI_VENDOR_INFO
| MISC_150
| PRIVATE_CLASSLESS_STATIC_ROUTE
| WEB_PROXY_AUTO_DISC
| END
| OTHER of int
Conversions of DHCP option_code
s.
val int_to_option_code : int -> option_code option
val int_to_option_code_exn : int -> option_code
val option_code_to_int : option_code -> int
val option_code_to_string : option_code -> string
Conversions of htype
.
val htype_to_string : htype -> string
Conversions of flags
.
val flags_to_string : flags -> string
type client_id =
| Hwaddr of Macaddr.t
| Id of int * string
A client_id is usually a mac address from a dhcp_option
, but it can also be an opaque string. See client_id_of_pkt
.
Conversions of client_id
.
val client_id_to_string : client_id -> string
val string_to_client_id : string -> client_id option
type dhcp_option =
| Pad
| Subnet_mask of Ipaddr.V4.t
| Time_offset of int32
| Routers of Ipaddr.V4.t list
| Dns_servers of Ipaddr.V4.t list
| Log_servers of Ipaddr.V4.t list
| Lpr_servers of Ipaddr.V4.t list
| Hostname of string
| Bootfile_size of int
| Domain_name of string
| Swap_server of Ipaddr.V4.t
| Root_path of string
| Extension_path of string
| Ipforwarding of bool
| Nlsr of bool
| Policy_filters of Ipaddr.V4.Prefix.t list
| Max_datagram of int
| Default_ip_ttl of int
| Interface_mtu of int
| All_subnets_local of bool
| Broadcast_addr of Ipaddr.V4.t
| Perform_router_disc of bool
| Router_sol_addr of Ipaddr.V4.t
| Static_routes of (Ipaddr.V4.t * Ipaddr.V4.t) list
| Trailer_encapsulation of bool
| Arp_cache_timo of int32
| Ethernet_encapsulation of bool
| Tcp_default_ttl of int
| Tcp_keepalive_interval of int32
| Nis_domain of string
| Nis_servers of Ipaddr.V4.t list
| Ntp_servers of Ipaddr.V4.t list
| Vendor_specific of string
| Netbios_name_servers of Ipaddr.V4.t list
| Netbios_datagram_distrib_servers of Ipaddr.V4.t list
| Netbios_node of int
| Netbios_scope of string
| Xwindow_font_servers of Ipaddr.V4.t list
| Xwindow_display_managers of Ipaddr.V4.t list
| Request_ip of Ipaddr.V4.t
| Ip_lease_time of int32
| Option_overload of int
| Message_type of msgtype
| Server_identifier of Ipaddr.V4.t
| Parameter_requests of option_code list
| Message of string
| Max_message of int
| Renewal_t1 of int32
| Rebinding_t2 of int32
| Vendor_class_id of string
| Client_id of client_id
| Nis_plus_domain of string
| Nis_plus_servers of Ipaddr.V4.t list
| Tftp_server_name of string
| Bootfile_name of string
| Mobile_ip_home_agent of Ipaddr.V4.t list
| Smtp_servers of Ipaddr.V4.t list
| Pop3_servers of Ipaddr.V4.t list
| Nntp_servers of Ipaddr.V4.t list
| Irc_servers of Ipaddr.V4.t list
| User_class of string
| Rapid_commit
| Client_fqdn of string
| Relay_agent_information of string
| Client_system of string
| Client_ndi of string
| Uuid_guid of string
| Pcode of string
| Tcode of string
| IPv6_only of int32
| Subnet_selection of Ipaddr.V4.t
| Domain_search of string
| Sip_servers of string
| Classless_static_route of string
| Vi_vendor_info of string
| Misc_150 of string
| Private_classless_static_route of string
| Web_proxy_auto_disc of string
| End
| Other of int * string
Not all options are currently implemented.
*)Conversions of dhcp_option
.
val dhcp_option_to_string : dhcp_option -> string
val buf_of_options : Cstruct.t -> dhcp_option list -> Cstruct.t
val options_of_buf : Cstruct.t -> int -> dhcp_option list
val find_option : (dhcp_option -> 'b option) -> dhcp_option list -> 'b option
find_option f l
finds the first option where f
evaluates to Some
value on list l
collect_options f l
collects all options where f
evaluates to Some
value on list l
, this is useful for list options like Routers
, if multiple list options are found, the resulting list is flattened.
val collect_dns_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_irc_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_log_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_lpr_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_netbios_datagram_distrib_servers :
dhcp_option list ->
Ipaddr.V4.t list
val collect_netbios_name_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_nis_plus_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_nis_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_ntp_servers : dhcp_option list -> Ipaddr.V4.t list
val find_parameter_requests : dhcp_option list -> option_code list option
val collect_policy_filters : dhcp_option list -> Ipaddr.V4.Prefix.t list
val collect_routers : dhcp_option list -> Ipaddr.V4.t list
val collect_static_routes :
dhcp_option list ->
(Ipaddr.V4.t * Ipaddr.V4.t) list
val collect_xwindow_display_managers : dhcp_option list -> Ipaddr.V4.t list
val collect_xwindow_font_servers : dhcp_option list -> Ipaddr.V4.t list
val find_all_subnets_local : dhcp_option list -> bool option
val find_arp_cache_timo : dhcp_option list -> int32 option
val find_bootfile_name : dhcp_option list -> string option
val find_bootfile_size : dhcp_option list -> int option
val find_broadcast_addr : dhcp_option list -> Ipaddr.V4.t option
val find_classless_static_route : dhcp_option list -> string option
val find_client_fqdn : dhcp_option list -> string option
val find_client_id : dhcp_option list -> client_id option
val find_client_ndi : dhcp_option list -> string option
val find_client_system : dhcp_option list -> string option
val find_default_ip_ttl : dhcp_option list -> int option
val find_domain_name : dhcp_option list -> string option
val find_domain_search : dhcp_option list -> string option
val find_ethernet_encapsulation : dhcp_option list -> bool option
val find_extension_path : dhcp_option list -> string option
val find_hostname : dhcp_option list -> string option
val find_interface_mtu : dhcp_option list -> int option
val find_ip_lease_time : dhcp_option list -> int32 option
val find_ipforwarding : dhcp_option list -> bool option
val find_max_datagram : dhcp_option list -> int option
val find_max_message : dhcp_option list -> int option
val find_message : dhcp_option list -> string option
val find_message_type : dhcp_option list -> msgtype option
val find_misc_150 : dhcp_option list -> string option
val collect_mobile_ip_home_agent : dhcp_option list -> Ipaddr.V4.t list
val find_netbios_node : dhcp_option list -> int option
val find_netbios_scope : dhcp_option list -> string option
val find_nis_domain : dhcp_option list -> string option
val find_nis_plus_domain : dhcp_option list -> string option
val find_nlsr : dhcp_option list -> bool option
val collect_nntp_servers : dhcp_option list -> Ipaddr.V4.t list
val find_option_overload : dhcp_option list -> int option
val find_pcode : dhcp_option list -> string option
val find_perform_router_disc : dhcp_option list -> bool option
val collect_pop3_servers : dhcp_option list -> Ipaddr.V4.t list
val find_rapid_commit : dhcp_option list -> dhcp_option option
val find_rebinding_t2 : dhcp_option list -> int32 option
val find_relay_agent_information : dhcp_option list -> string option
val find_renewal_t1 : dhcp_option list -> int32 option
val find_request_ip : dhcp_option list -> Ipaddr.V4.t option
val find_root_path : dhcp_option list -> string option
val find_router_sol_addr : dhcp_option list -> Ipaddr.V4.t option
val find_server_identifier : dhcp_option list -> Ipaddr.V4.t option
val find_sip_servers : dhcp_option list -> string option
val collect_smtp_servers : dhcp_option list -> Ipaddr.V4.t list
val find_subnet_mask : dhcp_option list -> Ipaddr.V4.t option
val find_subnet_selection : dhcp_option list -> Ipaddr.V4.t option
val find_swap_server : dhcp_option list -> Ipaddr.V4.t option
val find_tcode : dhcp_option list -> string option
val find_ipv6only : dhcp_option list -> int32 option
val find_tcp_default_ttl : dhcp_option list -> int option
val find_tcp_keepalive_interval : dhcp_option list -> int32 option
val find_tftp_server_name : dhcp_option list -> string option
val find_time_offset : dhcp_option list -> int32 option
val find_trailer_encapsulation : dhcp_option list -> bool option
val find_user_class : dhcp_option list -> string option
val find_uuid_guid : dhcp_option list -> string option
val find_vendor_class_id : dhcp_option list -> string option
val find_vendor_specific : dhcp_option list -> string option
val find_vi_vendor_info : dhcp_option list -> string option
val find_web_proxy_auto_disc : dhcp_option list -> string option
val find_private_classless_static_route : dhcp_option list -> string option
val find_other : int -> dhcp_option list -> (int * string) option
val collect_other : int -> dhcp_option list -> (int * string) list
type pkt = {
srcmac : Macaddr.t;
dstmac : Macaddr.t;
srcip : Ipaddr.V4.t;
dstip : Ipaddr.V4.t;
srcport : int;
dstport : int;
op : op;
htype : htype;
hlen : int;
hops : int;
xid : int32;
secs : int;
flags : flags;
ciaddr : Ipaddr.V4.t;
yiaddr : Ipaddr.V4.t;
siaddr : Ipaddr.V4.t;
giaddr : Ipaddr.V4.t;
chaddr : Macaddr.t;
sname : string;
file : string;
options : dhcp_option list;
}
Conversions for pkt
.
Helpers.
val is_dhcp : Cstruct.t -> int -> bool
is_dhcp buf len
is true if buf
is an Ethernet frame containing an IPv4 header, UDP header, and DHCP packet.