ex_dhcp v0.1.5 ExDhcp.Options.Basic View Source
This module implements the following DHCP options encodings:
option atom | DHCP option code | type / codec |
---|---|---|
:subnet_mask | 1 | ip |
:routers | 3 | iplist |
:domain_name_servers | 6 | iplist |
:host_name | 12 | string |
:broadcast_address | 28 | ip |
:requested_address | 50 | ip |
:lease_time | 51 | integer |
:message_type | 53 | encode_message_type/1 decode_message_type/1 |
:server | 54 | ip |
:parameter_request_list | 55 | encode_parameter_list/1 decode_parameter_list/1 |
:message | 56 | string |
:max_message_size | 57 | integer |
:renewal_time | 58 | integer |
:rebinding_time | 59 | integer |
:vendor_class_identifier | 60 | string |
:client_identifier | 61 | string |
:client_system | 93 | string |
:client_ndi | 94 | encode_client_ndi/1 decode_client_ndi/1 |
:uuid_guid | 97 | string |
:forcerenew_nonce_capable | 145 | boolean |
Link to this section Summary
Types
Erlang triple format for client_ndi
information.
DHCP messages must fall into one of these listed categories.
Functions
Decodes the client_ndi
information (code 94) from the DHCP
binary format into an erlang triple.
Decodes the message_type
(code 53) field from a DHCP packet.
Decodes the parameter_request_list
(code 55)
from a DHCP packet.
Encodes the client_ndi
information (code 94) from an erlang
triple into the DHCP binary format.
Encodes the message_type
(code 53) field atom back
into a DHCP binary format.
Encodes the parameter_request_list
(code 55)
into the DHCP binary format.
Link to this section Types
client_ndi_type() View Source
Erlang triple format for client_ndi
information.
message_types()
View Source
message_types() ::
:discover | :offer | :request | :decline | :ack | :nak | :release | :inform
message_types() :: :discover | :offer | :request | :decline | :ack | :nak | :release | :inform
DHCP messages must fall into one of these listed categories.
Link to this section Functions
decode_client_ndi(data)
View Source
decode_client_ndi(binary()) :: client_ndi_type()
decode_client_ndi(binary()) :: client_ndi_type()
Decodes the client_ndi
information (code 94) from the DHCP
binary format into an erlang triple.
decode_message_type(data)
View Source
decode_message_type(binary()) :: message_types() | byte()
decode_message_type(binary()) :: message_types() | byte()
Decodes the message_type
(code 53) field from a DHCP packet.
Translates the value according to the following table:
dhcp code | atom |
---|---|
1 | :discover |
2 | :offer |
3 | :request |
4 | :decline |
5 | :ack |
6 | :nak |
7 | :release |
8 | :inform |
decode_parameter_list(data) View Source
Decodes the parameter_request_list
(code 55)
from a DHCP packet.
Returns a list of integers that represent parameters that the DHCP client is currently requesting from the DHCP server.
The server is not required to respond to them, though if key parameters are missing, the client might send a DHCP decline response.
encode_client_ndi(bin)
View Source
encode_client_ndi(client_ndi_type() | binary()) :: binary()
encode_client_ndi(client_ndi_type() | binary()) :: binary()
Encodes the client_ndi
information (code 94) from an erlang
triple into the DHCP binary format.
encode_message_type(type)
View Source
encode_message_type(message_types() | binary()) :: binary()
encode_message_type(message_types() | binary()) :: binary()
Encodes the message_type
(code 53) field atom back
into a DHCP binary format.
See decode_message_type/1
for the translation table.
encode_parameter_list(lst) View Source
Encodes the parameter_request_list
(code 55)
into the DHCP binary format.
See decode_parameter_list/1
for details.