ex_dhcp v0.1.5 ExDhcp.Options.Basic View Source

This module implements the following DHCP options encodings:

option atomDHCP option codetype / codec
:subnet_mask1ip
:routers3iplist
:domain_name_servers6iplist
:host_name12string
:broadcast_address28ip
:requested_address50ip
:lease_time51integer
:message_type53encode_message_type/1
decode_message_type/1
:server54ip
:parameter_request_list55encode_parameter_list/1
decode_parameter_list/1
:message56string
:max_message_size57integer
:renewal_time58integer
:rebinding_time59integer
:vendor_class_identifier60string
:client_identifier61string
:client_system93string
:client_ndi94encode_client_ndi/1
decode_client_ndi/1
:uuid_guid97string
:forcerenew_nonce_capable145boolean

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

Link to this type

client_ndi_type() View Source
client_ndi_type() :: {byte(), byte(), byte()}

Erlang triple format for client_ndi information.

Link to this type

message_types() View Source
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

Link to this function

decode_client_ndi(data) View Source
decode_client_ndi(binary()) :: client_ndi_type()

Decodes the client_ndi information (code 94) from the DHCP binary format into an erlang triple.

Link to this function

decode_message_type(data) View Source
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 codeatom
1:discover
2:offer
3:request
4:decline
5:ack
6:nak
7:release
8:inform
Link to this function

decode_parameter_list(data) View Source
decode_parameter_list(binary()) :: list()

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.

Link to this function

encode_client_ndi(bin) View Source
encode_client_ndi(client_ndi_type() | binary()) :: binary()

Encodes the client_ndi information (code 94) from an erlang triple into the DHCP binary format.

Link to this function

encode_message_type(type) View Source
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.

Link to this function

encode_parameter_list(lst) View Source
encode_parameter_list(list()) :: binary()

Encodes the parameter_request_list (code 55) into the DHCP binary format.

See decode_parameter_list/1 for details.