Kea 2.7.5
|
Holds DUID (DHCPv6 Unique Identifier) More...
#include <duid.h>
Public Types | |
enum | DUIDType { DUID_UNKNOWN = 0 , DUID_LLT = 1 , DUID_EN = 2 , DUID_LL = 3 , DUID_UUID = 4 , DUID_MAX } |
specifies DUID type More... | |
Public Member Functions | |
DUID (const std::vector< uint8_t > &data) | |
Constructor from vector. | |
DUID (const uint8_t *data, size_t len) | |
Constructor from array and array size. | |
const std::vector< uint8_t > & | getDuid () const |
Returns a const reference to the actual DUID value. | |
DUIDType | getType () const |
Returns the DUID type. | |
Public Member Functions inherited from isc::dhcp::IdentifierType< 3, 130 > | |
IdentifierType (const std::vector< uint8_t > &data) | |
Constructor from vector. | |
IdentifierType (const uint8_t *data, size_t len) | |
Constructor from array and array size. | |
bool | operator!= (const IdentifierType &other) const |
Compares two identifiers for inequality. | |
bool | operator== (const IdentifierType &other) const |
Compares two identifiers for equality. | |
std::string | toText () const |
Returns textual representation of the identifier (e.g. | |
Static Public Member Functions | |
static const DUID & | EMPTY () |
Defines the constant "empty" DUID. | |
static DUID | fromText (const std::string &text) |
Create DUID from the textual format. | |
Static Public Member Functions inherited from isc::dhcp::IdentifierType< 3, 130 > | |
static std::vector< uint8_t > | fromText (const std::string &text) |
This static function parses an Identifier specified in the textual format. | |
static constexpr size_t | getMaxSize () |
Return the maximum size of the acceptable data. | |
static constexpr size_t | getMinSize () |
Return the minimum size of the acceptable data. | |
Static Public Attributes | |
static constexpr size_t | MAX_DUID_LEN = IdentifierType::getMaxSize() |
maximum duid size | |
static constexpr size_t | MIN_DUID_LEN = IdentifierType::getMinSize() |
minimum duid size | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::dhcp::IdentifierBaseType | |
virtual | ~IdentifierBaseType ()=0 |
Pure virtual destructor. | |
Protected Attributes inherited from isc::dhcp::IdentifierType< 3, 130 > | |
std::vector< uint8_t > | data_ |
The actual content of the Identifier. | |
Holds DUID (DHCPv6 Unique Identifier)
This class holds DUID, that is used in client-id, server-id and several other options. It is used to identify DHCPv6 entity.
specifies DUID type
isc::dhcp::DUID::DUID | ( | const std::vector< uint8_t > & | data | ) |
Constructor from vector.
data | The data used to create the DUID |
Definition at line 27 of file duid.cc.
Referenced by fromText().
isc::dhcp::DUID::DUID | ( | const uint8_t * | data, |
size_t | len ) |
|
static |
Defines the constant "empty" DUID.
In general, empty DUID is not allowed. The only case where it is really valid is to designate declined IPv6 Leases. We have a broad assumption that the Lease->duid_ must always be set. However, declined lease doesn't have any DUID associated with it. Hence we need a way to indicate that fact.
Definition at line 55 of file duid.cc.
Referenced by isc::dhcp::CSVLeaseFile6::append(), isc::dhcp::Lease6::decline(), and isc::dhcp::CSVLeaseFile6::next().
|
static |
Create DUID from the textual format.
This static function parses a DUID specified in the textual format.
text | DUID in the hexadecimal format with digits representing individual bytes separated by colons. |
isc::BadValue | if parsing the DUID failed. |
Definition at line 50 of file duid.cc.
References DUID(), and isc::dhcp::IdentifierType< min_size, max_size >::fromText().
Referenced by isc::dhcp::Lease6::fromElement(), isc::lease_cmds::LeaseCmdsImpl::getParameters(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByDuidHandler(), and isc::lease_cmds::Lease6Parser::parse().
const std::vector< uint8_t > & isc::dhcp::DUID::getDuid | ( | ) | const |
Returns a const reference to the actual DUID value.
Definition at line 33 of file duid.cc.
References isc::dhcp::IdentifierType< 3, 130 >::data_.
Referenced by user_chk::UserRegistry::findUser(), and isc::dhcp_ddns::D2Dhcid::fromDUID().
DUID::DUIDType isc::dhcp::DUID::getType | ( | ) | const |
Returns the DUID type.
Definition at line 37 of file duid.cc.
References isc::dhcp::IdentifierType< 3, 130 >::data_, DUID_MAX, and DUID_UNKNOWN.
|
staticconstexpr |
maximum duid size
The maximum DUID size specified in RFC 8415, section 11.1 is 130: 2 fixed octets for the type + 128 maximum octets for the value.
Definition at line 155 of file duid.h.
Referenced by isc::dhcp::Host::getIdentifierMaxLength(), and isc::dhcp::Dhcpv6Srv::sanityCheckDUID().
|
staticconstexpr |
minimum duid size
The minimal DUID size specified in RFC 8415, section 11.1 is 3: 2 fixed octets for the type + 1 minimum octet for the value.
Definition at line 149 of file duid.h.
Referenced by isc::dhcp::Dhcpv6Srv::sanityCheckDUID().