Implementation of Subscriber-ID option as specified in RFC 4580.
SubscriberIdOption(subscriber_id: bytes = b'')¶
The subscriber-id information allows the service provider to assign/ activate subscriber-specific actions; e.g., assignment of specific IP addresses, prefixes, DNS configuration, trigger accounting, etc. This option is de-coupled from the access network’s physical structure, so a subscriber that moves from one access-point to another, for example, would not require reconfiguration at the service provider’s DHCPv6 servers.
The subscriber-id information is only intended for use within a single administrative domain and is only exchanged between the relay agents and DHCPv6 servers within that domain. Therefore, the format and encoding of the data in the option is not standardized, and this specification does not establish any semantic requirements on the data. This specification only defines the option for conveying this information from relay agents to DHCPv6 servers.
However, as the DHCPv4 Subscriber-ID suboption  specifies Network Virtual Terminal (NVT) American Standard Code for Information Interchange (ASCII)  encoded data, in environments where both DHCPv4  and DHCPv6 are being used, it may be beneficial to use that encoding.
The format of the DHCPv6 Relay Agent Subscriber-ID 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_SUBSCRIBER_ID | option-len | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . subscriber-id . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- OPTION_SUBSCRIBER_ID (38)
- length, in octets, of the subscriber-id field. The minimum length is 1 octet.
- The subscriber’s identity.
load_from(buffer: bytes, offset: int = 0, length: int = None) → int¶
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.
- 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
The number of bytes used from the buffer
save() → Union¶
Save the internal state of this object as a buffer.
Returns: The buffer with the data from this element
The subscriber-id as bytes
Validate that the contents of this object conform to protocol specs.