Kea
1.9.9-git
|
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 > &duid) | |
Constructor from vector. More... | |
DUID (const uint8_t *duid, size_t len) | |
Constructor from array and array size. More... | |
const std::vector< uint8_t > & | getDuid () const |
Returns a const reference to the actual DUID value. More... | |
DUIDType | getType () const |
Returns the DUID type. More... | |
bool | operator!= (const DUID &other) const |
Compares two DUIDs for inequality. More... | |
bool | operator== (const DUID &other) const |
Compares two DUIDs for equality. More... | |
std::string | toText () const |
Returns textual representation of a DUID (e.g. 00:01:02:03:ff) More... | |
Static Public Member Functions | |
static const DUID & | EMPTY () |
Defines the constant "empty" DUID. More... | |
static DUID | fromText (const std::string &text) |
Create DUID from the textual format. More... | |
Static Public Attributes | |
static const size_t | MAX_DUID_LEN = 128 |
maximum duid size As defined in RFC 8415, section 11.1 More... | |
static const size_t | MIN_DUID_LEN = 1 |
minimum duid size The minimal DUID size specified in RFC 8415 is 1. More... | |
Protected Attributes | |
std::vector< uint8_t > | duid_ |
The actual content of the DUID. More... | |
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 > & | duid | ) |
Constructor from vector.
Definition at line 23 of file duid.cc.
References duid_, isc_throw, and MAX_DUID_LEN.
Referenced by fromText().
isc::dhcp::DUID::DUID | ( | const uint8_t * | duid, |
size_t | len | ||
) |
Constructor from array and array size.
Definition at line 34 of file duid.cc.
References duid_, isc_throw, and MAX_DUID_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 69 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 62 of file duid.cc.
References isc::util::str::decodeFormattedHexString(), and DUID().
Referenced by isc::dhcp::Lease6::fromElement(), isc::lease_cmds::LeaseCmdsImpl::getParameters(), and isc::lease_cmds::LeaseCmdsImpl::leaseGetByDuidHandler().
const std::vector< uint8_t > & isc::dhcp::DUID::getDuid | ( | ) | const |
Returns a const reference to the actual DUID value.
Definition at line 46 of file duid.cc.
References duid_.
Referenced by user_chk::UserRegistry::findUser(), isc::dhcp_ddns::D2Dhcid::fromDUID(), isc::dhcp::Lease6::fromElement(), isc::dhcp::CqlLeaseMgr::getLeases6(), isc::dhcp::PgSqlLeaseMgr::getLeases6(), and isc::dhcp::MySqlLeaseMgr::getLeases6().
DUID::DUIDType isc::dhcp::DUID::getType | ( | ) | const |
bool isc::dhcp::DUID::operator!= | ( | const DUID & | other | ) | const |
bool isc::dhcp::DUID::operator== | ( | const DUID & | other | ) | const |
std::string isc::dhcp::DUID::toText | ( | ) | const |
Returns textual representation of a DUID (e.g. 00:01:02:03:ff)
Definition at line 75 of file duid.cc.
References duid_.
Referenced by isc::dhcp::LeaseMgr::getLease6(), isc::dhcp::CqlLeaseMgr::getLeases6(), isc::dhcp::Memfile_LeaseMgr::getLeases6(), isc::dhcp::PgSqlLeaseMgr::getLeases6(), isc::dhcp::MySqlLeaseMgr::getLeases6(), isc::dhcp::hash_value(), isc::dhcp::CqlHostExchange::hostKey(), and isc::dhcp::ClientId::toText().
|
protected |
The actual content of the DUID.
Definition at line 99 of file duid.h.
Referenced by DUID(), isc::dhcp::Lease6::fromElement(), isc::dhcp::ClientId::getClientId(), getDuid(), getType(), operator!=(), isc::dhcp::ClientId::operator!=(), operator==(), isc::dhcp::ClientId::operator==(), and toText().
|
static |
maximum duid size As defined in RFC 8415, section 11.1
Definition at line 31 of file duid.h.
Referenced by DUID(), isc::dhcp::CqlHostExchange::hostKey(), isc::dhcp::CqlHostExchange::prepareExchange(), isc::dhcp::CqlLease6Exchange::retrieve(), and isc::dhcp::Dhcpv6Srv::sanityCheckDUID().
|
static |