package charrua

  1. Overview
  2. Docs

DHCP general data

val client_port : int

DHCP client port 68

val server_port : int

DHCP server port 67

DHCP header opcodes

type op =
  1. | BOOTREQUEST
  2. | BOOTREPLY

Conversions of ops.

val int_to_op : int -> op option
val int_to_op_exn : int -> op
val op_to_int : op -> int
val string_to_op : string -> op option
val op_to_string : op -> string
val sexp_of_op : op -> Sexplib.Sexp.t
val op_of_sexp : Sexplib.Sexp.t -> op

DHCP message type option values

type msgtype =
  1. | DHCPDISCOVER
  2. | DHCPOFFER
  3. | DHCPREQUEST
  4. | DHCPDECLINE
  5. | DHCPACK
  6. | DHCPNAK
  7. | DHCPRELEASE
  8. | DHCPINFORM
  9. | DHCPFORCERENEW
  10. | DHCPLEASEQUERY
  11. | DHCPLEASEUNASSIGNED
  12. | DHCPLEASEUNKNOWN
  13. | DHCPLEASEACTIVE
  14. | DHCPBULKLEASEQUERY
  15. | DHCPLEASEQUERYDONE

Conversions of msgtypes.

val msgtype_to_int : msgtype -> int
val int_to_msgtype : int -> msgtype option
val int_to_msgtype_exn : int -> msgtype
val string_to_msgtype : string -> msgtype option
val msgtype_to_string : msgtype -> string
val sexp_of_msgtype : msgtype -> Sexplib.Sexp.t
val msgtype_of_sexp : Sexplib.Sexp.t -> msgtype

DHCP option codes (names only, for use in parameter requests)

type option_code =
  1. | PAD
  2. | SUBNET_MASK
  3. | TIME_OFFSET
  4. | ROUTERS
  5. | TIME_SERVERS
  6. | NAME_SERVERS
  7. | DNS_SERVERS
  8. | LOG_SERVERS
  9. | COOKIE_SERVERS
  10. | LPR_SERVERS
  11. | IMPRESS_SERVERS
  12. | RSCLOCATION_SERVERS
  13. | HOSTNAME
  14. | BOOTFILE_SIZE
  15. | MERIT_DUMPFILE
  16. | DOMAIN_NAME
  17. | SWAP_SERVER
  18. | ROOT_PATH
  19. | EXTENSION_PATH
  20. | IPFORWARDING
  21. | NLSR
  22. | POLICY_FILTERS
  23. | MAX_DATAGRAM
  24. | DEFAULT_IP_TTL
  25. | PMTU_AGEING_TIMO
  26. | PMTU_PLATEAU_TABLE
  27. | INTERFACE_MTU
  28. | ALL_SUBNETS_LOCAL
  29. | BROADCAST_ADDR
  30. | PERFORM_MASK_DISCOVERY
  31. | MASK_SUPPLIER
  32. | PERFORM_ROUTER_DISC
  33. | ROUTER_SOL_ADDR
  34. | STATIC_ROUTES
  35. | TRAILER_ENCAPSULATION
  36. | ARP_CACHE_TIMO
  37. | ETHERNET_ENCAPSULATION
  38. | TCP_DEFAULT_TTL
  39. | TCP_KEEPALIVE_INTERVAL
  40. | TCP_KEEPALIVE_GARBAGE
  41. | NIS_DOMAIN
  42. | NIS_SERVERS
  43. | NTP_SERVERS
  44. | VENDOR_SPECIFIC
  45. | NETBIOS_NAME_SERVERS
  46. | NETBIOS_DATAGRAM_DISTRIB_SERVERS
  47. | NETBIOS_NODE
  48. | NETBIOS_SCOPE
  49. | XWINDOW_FONT_SERVERS
  50. | XWINDOW_DISPLAY_MANAGERS
  51. | REQUEST_IP
  52. | IP_LEASE_TIME
  53. | OPTION_OVERLOAD
  54. | MESSAGE_TYPE
  55. | SERVER_IDENTIFIER
  56. | PARAMETER_REQUESTS
  57. | MESSAGE
  58. | MAX_MESSAGE
  59. | RENEWAL_T1
  60. | REBINDING_T2
  61. | VENDOR_CLASS_ID
  62. | CLIENT_ID
  63. | NETWARE_IP_DOMAIN
  64. | NETWARE_IP_OPTION
  65. | NIS_PLUS_DOMAIN
  66. | NIS_PLUS_SERVERS
  67. | TFTP_SERVER_NAME
  68. | BOOTFILE_NAME
  69. | MOBILE_IP_HOME_AGENT
  70. | SMTP_SERVERS
  71. | POP3_SERVERS
  72. | NNTP_SERVERS
  73. | WWW_SERVERS
  74. | FINGER_SERVERS
  75. | IRC_SERVERS
  76. | STREETTALK_SERVERS
  77. | STREETTALK_DA
  78. | USER_CLASS
  79. | DIRECTORY_AGENT
  80. | SERVICE_SCOPE
  81. | RAPID_COMMIT
  82. | CLIENT_FQDN
  83. | RELAY_AGENT_INFORMATION
  84. | ISNS
  85. | UNASSIGNED_84
  86. | NDS_SERVERS
  87. | NDS_TREE_NAME
  88. | NDS_CONTEXT
  89. | BCMCS_CONTROLLER_DOMAIN_NAME_LIST
  90. | BCMCS_CONTROLLER_IPV4_ADDR
  91. | AUTHENTICATION
  92. | CLIENT_LAST_TRANSACTION_TIME
  93. | ASSOCIATED_IPS
  94. | CLIENT_SYSTEM
  95. | CLIENT_NDI
  96. | LDAP
  97. | UNASSIGNED_96
  98. | UUID_GUID
  99. | USER_AUTH
  100. | GEOCONF_CIVIC
  101. | PCODE
  102. | TCODE
  103. | UNASSIGNED_102
  104. | UNASSIGNED_103
  105. | UNASSIGNED_104
  106. | UNASSIGNED_105
  107. | UNASSIGNED_106
  108. | UNASSIGNED_107
  109. | UNASSIGNED_108
  110. | UNASSIGNED_109
  111. | UNASSIGNED_110
  112. | UNASSIGNED_111
  113. | NETINFO_ADDRESS
  114. | NETINFO_TAG
  115. | URL
  116. | UNASSIGNED_115
  117. | AUTO_CONFIG
  118. | SUBNET_SELECTION
  119. | SIP_SERVERS
  120. | CLASSLESS_STATIC_ROUTE
  121. | CCC
  122. | GEOCONF
  123. | VI_VENDOR_CLASS
  124. | VI_VENDOR_INFO
  125. | UNASSIGNED_126
  126. | UNASSIGNED_127
  127. | PXE_128
  128. | PXE_129
  129. | PXE_130
  130. | PXE_131
  131. | PXE_132
  132. | PXE_133
  133. | PXE_134
  134. | PXE_135
  135. | PANA_AGENT
  136. | V4_LOST
  137. | CAPWAP_AC_V4
  138. | IPV4_ADDRESS_MOS
  139. | IPV4_FQDN_MOS
  140. | SIP_UA_DOMAINS
  141. | IPV4_ADDRESS_ANDSF
  142. | UNASSIGNED_143
  143. | GEOLOCK
  144. | FORCENEW_NONCE_CAPABLE
  145. | RDNSS_SELECTION
  146. | UNASSIGNED_147
  147. | UNASSIGNED_148
  148. | UNASSIGNED_149
  149. | MISC_150
  150. | STATUS_CODE
  151. | ABSOLUTE_TIME
  152. | START_TIME_OF_STATE
  153. | QUERY_START_TIME
  154. | QUERY_END_TIME
  155. | DHCP_STATE
  156. | DATA_SOURCE
  157. | V4_PCP_SERVER
  158. | V4_PORTPARAMS
  159. | DHCP_CAPTIVE_PORTAL
  160. | UNASSIGNED_161
  161. | UNASSIGNED_162
  162. | UNASSIGNED_163
  163. | UNASSIGNED_164
  164. | UNASSIGNED_165
  165. | UNASSIGNED_166
  166. | UNASSIGNED_167
  167. | UNASSIGNED_168
  168. | UNASSIGNED_169
  169. | UNASSIGNED_170
  170. | UNASSIGNED_171
  171. | UNASSIGNED_172
  172. | UNASSIGNED_173
  173. | UNASSIGNED_174
  174. | ETHERBOOT_175
  175. | IP_TELEFONE
  176. | ETHERBOOT_177
  177. | UNASSIGNED_178
  178. | UNASSIGNED_179
  179. | UNASSIGNED_180
  180. | UNASSIGNED_181
  181. | UNASSIGNED_182
  182. | UNASSIGNED_183
  183. | UNASSIGNED_184
  184. | UNASSIGNED_185
  185. | UNASSIGNED_186
  186. | UNASSIGNED_187
  187. | UNASSIGNED_188
  188. | UNASSIGNED_189
  189. | UNASSIGNED_190
  190. | UNASSIGNED_191
  191. | UNASSIGNED_192
  192. | UNASSIGNED_193
  193. | UNASSIGNED_194
  194. | UNASSIGNED_195
  195. | UNASSIGNED_196
  196. | UNASSIGNED_197
  197. | UNASSIGNED_198
  198. | UNASSIGNED_199
  199. | UNASSIGNED_200
  200. | UNASSIGNED_201
  201. | UNASSIGNED_202
  202. | UNASSIGNED_203
  203. | UNASSIGNED_204
  204. | UNASSIGNED_205
  205. | UNASSIGNED_206
  206. | UNASSIGNED_207
  207. | PXE_LINUX
  208. | CONFIGURATION_FILE
  209. | PATH_PREFIX
  210. | REBOOT_TIME
  211. | OPTION_6RD
  212. | V4_ACCESS_DOMAIN
  213. | UNASSIGNED_214
  214. | UNASSIGNED_215
  215. | UNASSIGNED_216
  216. | UNASSIGNED_217
  217. | UNASSIGNED_218
  218. | UNASSIGNED_219
  219. | SUBNET_ALLOCATION
  220. | VIRTUAL_SUBNET_SELECTION
  221. | UNASSIGNED_222
  222. | UNASSIGNED_223
  223. | RESERVED_224
  224. | RESERVED_225
  225. | RESERVED_226
  226. | RESERVED_227
  227. | RESERVED_228
  228. | RESERVED_229
  229. | RESERVED_230
  230. | RESERVED_231
  231. | RESERVED_232
  232. | RESERVED_233
  233. | RESERVED_234
  234. | RESERVED_235
  235. | RESERVED_236
  236. | RESERVED_237
  237. | RESERVED_238
  238. | RESERVED_239
  239. | RESERVED_240
  240. | RESERVED_241
  241. | RESERVED_242
  242. | RESERVED_243
  243. | RESERVED_244
  244. | RESERVED_245
  245. | RESERVED_246
  246. | RESERVED_247
  247. | RESERVED_248
  248. | PRIVATE_CLASSLESS_STATIC_ROUTE
  249. | RESERVED_250
  250. | RESERVED_251
  251. | WEB_PROXY_AUTO_DISC
  252. | RESERVED_253
  253. | RESERVED_254
  254. | END
    (*

    The type of a dhcp parameter request, these are all the values according to iana

    *)

Conversions of DHCP option_codes.

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 sexp_of_option_code : option_code -> Sexplib.Sexp.t
val option_code_of_sexp : Sexplib.Sexp.t -> option_code
val string_to_option_code : string -> option_code option
val option_code_to_string : option_code -> string

DHCP hardware type

type htype =
  1. | Ethernet_10mb
  2. | Other

Conversions of htype.

val htype_of_sexp : Sexplib.Sexp.t -> htype
val sexp_of_htype : htype -> Sexplib.Sexp.t

DHCP header flags

type flags =
  1. | Broadcast
  2. | Unicast

Conversions of flags.

val flags_of_sexp : Sexplib.Sexp.t -> flags
val sexp_of_flags : flags -> Sexplib.Sexp.t

DHCP Client identifier

type client_id =
  1. | Hwaddr of Macaddr.t
  2. | 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_of_sexp : Sexplib.Sexp.t -> client_id
val sexp_of_client_id : client_id -> Sexplib.Sexp.t
val client_id_to_string : client_id -> string

DHCP options

type dhcp_option =
  1. | Pad
  2. | Subnet_mask of Ipaddr.V4.t
  3. | Time_offset of int32
  4. | Routers of Ipaddr.V4.t list
  5. | Time_servers of Ipaddr.V4.t list
  6. | Name_servers of Ipaddr.V4.t list
  7. | Dns_servers of Ipaddr.V4.t list
  8. | Log_servers of Ipaddr.V4.t list
  9. | Cookie_servers of Ipaddr.V4.t list
  10. | Lpr_servers of Ipaddr.V4.t list
  11. | Impress_servers of Ipaddr.V4.t list
  12. | Rsclocation_servers of Ipaddr.V4.t list
  13. | Hostname of string
  14. | Bootfile_size of int
  15. | Merit_dumpfile of string
  16. | Domain_name of string
  17. | Swap_server of Ipaddr.V4.t
  18. | Root_path of string
  19. | Extension_path of string
  20. | Ipforwarding of bool
  21. | Nlsr of bool
  22. | Policy_filters of Ipaddr.V4.Prefix.t list
  23. | Max_datagram of int
  24. | Default_ip_ttl of int
  25. | Pmtu_ageing_timo of int32
  26. | Pmtu_plateau_table of int list
  27. | Interface_mtu of int
  28. | All_subnets_local of bool
  29. | Broadcast_addr of Ipaddr.V4.t
  30. | Perform_mask_discovery of bool
  31. | Mask_supplier of bool
  32. | Perform_router_disc of bool
  33. | Router_sol_addr of Ipaddr.V4.t
  34. | Static_routes of (Ipaddr.V4.t * Ipaddr.V4.t) list
  35. | Trailer_encapsulation of bool
  36. | Arp_cache_timo of int32
  37. | Ethernet_encapsulation of bool
  38. | Tcp_default_ttl of int
  39. | Tcp_keepalive_interval of int32
  40. | Tcp_keepalive_garbage of int
  41. | Nis_domain of string
  42. | Nis_servers of Ipaddr.V4.t list
  43. | Ntp_servers of Ipaddr.V4.t list
  44. | Vendor_specific of string
  45. | Netbios_name_servers of Ipaddr.V4.t list
  46. | Netbios_datagram_distrib_servers of Ipaddr.V4.t list
  47. | Netbios_node of int
  48. | Netbios_scope of string
  49. | Xwindow_font_servers of Ipaddr.V4.t list
  50. | Xwindow_display_managers of Ipaddr.V4.t list
  51. | Request_ip of Ipaddr.V4.t
  52. | Ip_lease_time of int32
  53. | Option_overload of int
  54. | Message_type of msgtype
  55. | Server_identifier of Ipaddr.V4.t
  56. | Parameter_requests of option_code list
  57. | Message of string
  58. | Max_message of int
  59. | Renewal_t1 of int32
  60. | Rebinding_t2 of int32
  61. | Vendor_class_id of string
  62. | Client_id of client_id
  63. | Netware_ip_domain of string
  64. | Netware_ip_option of string
  65. | Nis_plus_domain of string
  66. | Nis_plus_servers of Ipaddr.V4.t list
  67. | Tftp_server_name of string
  68. | Bootfile_name of string
  69. | Mobile_ip_home_agent of Ipaddr.V4.t list
  70. | Smtp_servers of Ipaddr.V4.t list
  71. | Pop3_servers of Ipaddr.V4.t list
  72. | Nntp_servers of Ipaddr.V4.t list
  73. | Www_servers of Ipaddr.V4.t list
  74. | Finger_servers of Ipaddr.V4.t list
  75. | Irc_servers of Ipaddr.V4.t list
  76. | Streettalk_servers of Ipaddr.V4.t list
  77. | Streettalk_da of Ipaddr.V4.t list
  78. | User_class of string
  79. | Directory_agent of string
  80. | Service_scope of string
  81. | Rapid_commit
  82. | Client_fqdn of string
  83. | Relay_agent_information of string
  84. | Isns of string
  85. | Nds_servers of string
  86. | Nds_tree_name of string
  87. | Nds_context of string
  88. | Bcmcs_controller_domain_name_list of string
  89. | Bcmcs_controller_ipv4_addrs of Ipaddr.V4.t list
  90. | Authentication of string
  91. | Client_last_transaction_time of int32
  92. | Associated_ips of Ipaddr.V4.t list
  93. | Client_system of string
  94. | Client_ndi of string
  95. | Ldap of string
  96. | Uuid_guid of string
  97. | User_auth of string
  98. | Geoconf_civic of string
  99. | Pcode of string
  100. | Tcode of string
  101. | Netinfo_address of string
  102. | Netinfo_tag of string
  103. | Url of string
  104. | Auto_config of int
  105. | Subnet_selection of Ipaddr.V4.t
  106. | Sip_servers of string
  107. | Classless_static_route of string
  108. | Ccc of string
  109. | Geoconf of string
  110. | Vi_vendor_class of string
  111. | Vi_vendor_info of string
  112. | Pxe_128 of string
  113. | Pxe_129 of string
  114. | Pxe_130 of string
  115. | Pxe_131 of string
  116. | Pxe_132 of string
  117. | Pxe_133 of string
  118. | Pxe_134 of string
  119. | Pxe_135 of string
  120. | Pana_agent of string
  121. | V4_lost of string
  122. | Capwap_ac_v4 of string
  123. | Ipv4_address_mos of string
  124. | Ipv4_fqdn_mos of string
  125. | Sip_ua_domains of string
  126. | Ipv4_address_andsf of string
  127. | Geolock of string
  128. | Forcenew_nonce_capable of string
  129. | Rdnss_selection of string
  130. | Misc_150 of string
  131. | Status_code of string
  132. | Absolute_time of int32
  133. | Start_time_of_state of int32
  134. | Query_start_time of int32
  135. | Query_end_time of int32
  136. | Dhcp_state of int
  137. | Data_source of int
  138. | V4_pcp_server of string
  139. | V4_portparams of string
  140. | Dhcp_captive_portal of string
  141. | Etherboot_175 of string
  142. | Ip_telefone of string
  143. | Etherboot_177 of string
  144. | Pxe_linux of int32
  145. | Configuration_file of string
  146. | Path_prefix of string
  147. | Reboot_time of int32
  148. | Option_6rd of string
  149. | V4_access_domain of string
  150. | Subnet_allocation of int
  151. | Virtual_subnet_selection of string
  152. | Private_classless_static_route of string
  153. | Web_proxy_auto_disc of string
  154. | End
  155. | Unassigned of option_code * string

Not all options are currently implemented.

Conversions of dhcp_option.

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

val collect_options : ('a -> 'b list option) -> 'a list -> 'b list

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 dhcp_option_of_sexp : Sexplib.Sexp.t -> dhcp_option
val sexp_of_dhcp_option : dhcp_option -> Sexplib.Sexp.t
val dhcp_option_to_string : dhcp_option -> string
val collect_associated_ips : dhcp_option list -> Ipaddr.V4.t list
val collect_bcmcs_controller_ipv4_addrs : dhcp_option list -> Ipaddr.V4.t list
val collect_dns_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_finger_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_impress_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_name_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_rsc_location_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_static_routes : dhcp_option list -> (Ipaddr.V4.t * Ipaddr.V4.t) list
val collect_streettalk_da : dhcp_option list -> Ipaddr.V4.t list
val collect_streettalk_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_time_servers : dhcp_option list -> Ipaddr.V4.t list
val collect_www_servers : dhcp_option list -> 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_absolute_time : dhcp_option list -> int32 option
val find_all_subnets_local : dhcp_option list -> bool option
val find_arp_cache_timo : dhcp_option list -> int32 option
val find_authentication : dhcp_option list -> string option
val find_auto_config : dhcp_option list -> int option
val find_bcmcs_controller_domain_name : dhcp_option list -> string 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_capwap_ac_v4 : dhcp_option list -> string option
val find_ccc : dhcp_option list -> string 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_last_transaction_time : dhcp_option list -> int32 option
val find_client_ndi : dhcp_option list -> string option
val find_client_system : dhcp_option list -> string option
val find_configuration_file : dhcp_option list -> string option
val find_data_source : dhcp_option list -> int option
val find_default_ip_ttl : dhcp_option list -> int option
val find_dhcp_captive_portal : dhcp_option list -> string option
val find_dhcp_state : dhcp_option list -> int option
val find_directory_agent : dhcp_option list -> string option
val find_domain_name : dhcp_option list -> string option
val find_etherboot_175 : dhcp_option list -> string option
val find_etherboot_177 : 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_forcenew_nonce_capable : dhcp_option list -> string option
val find_geoconf : dhcp_option list -> string option
val find_geoconf_civic : dhcp_option list -> string option
val find_geolock : 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_ip_telefone : dhcp_option list -> string option
val find_ipforwarding : dhcp_option list -> bool option
val find_ipv4_address_andsf : dhcp_option list -> string option
val find_ipv4_address_mos : dhcp_option list -> string option
val find_ipv4_fqdn_mos : dhcp_option list -> string option
val find_isns : dhcp_option list -> string option
val find_ldap : dhcp_option list -> string option
val find_mask_supplier : 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_merit_dumpfile : dhcp_option list -> string 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_nds_context : dhcp_option list -> string option
val find_nds_servers : dhcp_option list -> string option
val find_nds_tree_name : dhcp_option list -> string option
val find_netbios_node : dhcp_option list -> int option
val find_netbios_scope : dhcp_option list -> string option
val find_netinfo_address : dhcp_option list -> string option
val find_netinfo_tag : dhcp_option list -> string option
val find_netware_ip_domain : dhcp_option list -> string option
val find_netware_ip_option : 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_6rd : dhcp_option list -> string option
val find_option_overload : dhcp_option list -> int option
val find_pana_agent : dhcp_option list -> string option
val find_path_prefix : dhcp_option list -> string option
val find_pcode : dhcp_option list -> string option
val find_perform_mask_discovery : dhcp_option list -> bool option
val find_perform_router_disc : dhcp_option list -> bool option
val find_pmtu_ageing_timo : dhcp_option list -> int32 option
val find_pmtu_plateau_table : dhcp_option list -> int list option
val collect_pop3_servers : dhcp_option list -> Ipaddr.V4.t list
val find_private_classless_static_route : dhcp_option list -> string option
val find_pxe_128 : dhcp_option list -> string option
val find_pxe_129 : dhcp_option list -> string option
val find_pxe_130 : dhcp_option list -> string option
val find_pxe_131 : dhcp_option list -> string option
val find_pxe_132 : dhcp_option list -> string option
val find_pxe_133 : dhcp_option list -> string option
val find_pxe_134 : dhcp_option list -> string option
val find_pxe_135 : dhcp_option list -> string option
val find_pxe_linux : dhcp_option list -> int32 option
val find_query_end_time : dhcp_option list -> int32 option
val find_query_start_time : dhcp_option list -> int32 option
val find_rapid_commit : dhcp_option list -> dhcp_option option
val find_rdnss_selection : dhcp_option list -> string option
val find_rebinding_t2 : dhcp_option list -> int32 option
val find_reboot_time : 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_service_scope : dhcp_option list -> string option
val find_sip_servers : dhcp_option list -> string option
val find_sip_ua_domains : dhcp_option list -> string option
val collect_smtp_servers : dhcp_option list -> Ipaddr.V4.t list
val find_start_time_of_state : dhcp_option list -> int32 option
val find_status_code : dhcp_option list -> string option
val find_subnet_allocation : dhcp_option list -> int option
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_tcp_default_ttl : dhcp_option list -> int option
val find_tcp_keepalive_garbage : 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_url : dhcp_option list -> string option
val find_user_auth : dhcp_option list -> string option
val find_user_class : dhcp_option list -> string option
val find_uuid_guid : dhcp_option list -> string option
val find_v4_access_domain : dhcp_option list -> string option
val find_v4_lost : dhcp_option list -> string option
val find_v4_pcp_server : dhcp_option list -> string option
val find_v4_portparams : 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_class : dhcp_option list -> string option
val find_vi_vendor_info : dhcp_option list -> string option
val find_virtual_subnet_selection : dhcp_option list -> string option
val find_web_proxy_auto_disc : dhcp_option list -> string option
val find_unassigned : option_code -> dhcp_option list -> (option_code * string) option
val collect_unassigned : option_code -> dhcp_option list -> (option_code * string) list

DHCP Packet - fixed-length fields, plus a variable-length list of options

type pkt = {
  1. srcmac : Macaddr.t;
  2. dstmac : Macaddr.t;
  3. srcip : Ipaddr.V4.t;
  4. dstip : Ipaddr.V4.t;
  5. srcport : int;
  6. dstport : int;
  7. op : op;
  8. htype : htype;
  9. hlen : int;
  10. hops : int;
  11. xid : int32;
  12. secs : int;
  13. flags : flags;
  14. ciaddr : Ipaddr.V4.t;
  15. yiaddr : Ipaddr.V4.t;
  16. siaddr : Ipaddr.V4.t;
  17. giaddr : Ipaddr.V4.t;
  18. chaddr : Macaddr.t;
  19. sname : string;
  20. file : string;
  21. options : dhcp_option list;
}

Conversions for pkt.

val pkt_of_buf : Cstruct.t -> int -> (pkt, string) result
val buf_of_pkt : pkt -> Cstruct.t
val pkt_into_buf : pkt -> Cstruct.t -> int
val pkt_of_sexp : Sexplib.Sexp.t -> pkt
val sexp_of_pkt : pkt -> Sexplib.Sexp.t
val client_id_of_pkt : pkt -> client_id
val pkt_to_string : pkt -> string

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.

OCaml

Innovation. Community. Security.