dhcpkit.ipv6.extensions.relay_echo_request module

Implementation of the Echo Request option as specified in RFC 4994.

class dhcpkit.ipv6.extensions.relay_echo_request.EchoRequestOption(requested_options: Iterable = None)[source]

Bases: dhcpkit.ipv6.options.Option

The relay agent adds options in the Relay Forward message that the server uses to guide its decision making with regard to address assignment, prefix delegation, and configuration parameters. The relay agent also knows which of these options that it will need to efficiently return replies to the client. It uses the relay agent Echo Request option to inform the server of the list of relay agent options that the server must echo back.

The format of the DHCPv6 Relay Agent Echo Request option is shown below:

0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           OPTION_ERO          |           option-len          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    requested-option-code-1    |    requested-option-code-2    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ...                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code
OPTION_ERO (43).
option-len
2 * number of requested options.
requested-option-code-n
The option code for an option requested by the relay agent.
display_requested_options() → List[source]

Provide a nicer output when displaying the requested options.

Returns:A list of option names
load_from(buffer: bytes, offset: int = 0, length: int = None) → int[source]

Load the internal state of this object from the given buffer. The buffer may contain more data after the structured element is parsed. This data is ignored.

Parameters:
  • buffer – The buffer to read data from
  • offset – The offset in the buffer where to start reading
  • length – The amount of data we are allowed to read from the buffer
Returns:

The number of bytes used from the buffer

option_type = 43
requested_options = None

The list of option type numbers that the relay wants to receive back

save() → Union[source]

Save the internal state of this object as a buffer.

Returns:The buffer with the data from this element
validate()[source]

Validate that the contents of this object conform to protocol specs.