dhcpkit.ipv6.extensions.dslite module

Implementation of DS-Lite AFTR Name option as specified in RFC 6334.

class dhcpkit.ipv6.extensions.dslite.AFTRNameOption(fqdn: str = '')[source]

Bases: dhcpkit.ipv6.options.Option

RFC 6334#section-3

The AFTR-Name option consists of option-code and option-len fields (as all DHCPv6 options have), and a variable-length tunnel-endpoint- name field containing a fully qualified domain name that refers to the AFTR to which the client MAY connect.

The AFTR-Name option SHOULD NOT appear in any DHCPv6 messages other than the following: Solicit, Advertise, Request, Renew, Rebind, Information-Request, and Reply.

The format of the AFTR-Name option is shown in the following figure:

 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_AFTR_NAME: 64       |          option-len           |
+-------------------------------+-------------------------------+
|                                                               |
|                  tunnel-endpoint-name (FQDN)                  |
|                                                               |
+---------------------------------------------------------------+
OPTION_AFTR_NAME
64
option-len
Length of the tunnel-endpoint-name field in octets.
tunnel-endpoint-name
A fully qualified domain name of the AFTR tunnel endpoint.
fqdn = None

Domain name of the AFTR tunnel endpoint

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 = 64
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.