Kea
1.9.9-git
|
Holds Client identifier or client IPv4 address. More...
#include <duid.h>
Public Member Functions | |
ClientId (const std::vector< uint8_t > &clientid) | |
Constructor based on vector<uint8_t> More... | |
ClientId (const uint8_t *clientid, size_t len) | |
Constructor based on array and array size. More... | |
const std::vector< uint8_t > & | getClientId () const |
Returns reference to the client-id data. More... | |
bool | operator!= (const ClientId &other) const |
Compares two client-ids for inequality. More... | |
bool | operator== (const ClientId &other) const |
Compares two client-ids for equality. More... | |
std::string | toText () const |
Returns textual representation of a DUID (e.g. 00:01:02:03:ff) More... | |
Public Member Functions inherited from isc::dhcp::DUID | |
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 ClientIdPtr | fromText (const std::string &text) |
Create client identifier from the textual format. More... | |
Static Public Member Functions inherited from isc::dhcp::DUID | |
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_CLIENT_ID_LEN = DUID::MAX_DUID_LEN |
Maximum size of a client ID. More... | |
static const size_t | MIN_CLIENT_ID_LEN = 2 |
Minimum size of a client ID. More... | |
Static Public Attributes inherited from isc::dhcp::DUID | |
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... | |
Additional Inherited Members | |
Public Types inherited from isc::dhcp::DUID | |
enum | DUIDType { DUID_UNKNOWN = 0, DUID_LLT = 1, DUID_EN = 2, DUID_LL = 3, DUID_UUID = 4, DUID_MAX } |
specifies DUID type More... | |
Protected Attributes inherited from isc::dhcp::DUID | |
std::vector< uint8_t > | duid_ |
The actual content of the DUID. More... | |
Holds Client identifier or client IPv4 address.
This class is intended to be a generic IPv4 client identifier. It can hold a client-id
isc::dhcp::ClientId::ClientId | ( | const std::vector< uint8_t > & | clientid | ) |
Constructor based on vector<uint8_t>
Definition at line 99 of file duid.cc.
References isc_throw, and MIN_CLIENT_ID_LEN.
Referenced by fromText().
isc::dhcp::ClientId::ClientId | ( | const uint8_t * | clientid, |
size_t | len | ||
) |
Constructor based on array and array size.
Definition at line 108 of file duid.cc.
References isc_throw, and MIN_CLIENT_ID_LEN.
|
static |
Create client identifier from the textual format.
This static function creates the instance of the ClientId
from the textual format. Internally it calls DUID::fromText
. The format of the input must match the format of the DUID in DUID::fromText
.
text | Client identifier in the textual format. |
ClientId
. isc::BadValue | if parsing the client identifier failed. |
isc::OutOfRange | if the client identifier is truncated. |
Definition at line 132 of file duid.cc.
References ClientId(), and isc::util::str::decodeFormattedHexString().
Referenced by isc::dhcp::Lease4::fromElement(), isc::lease_cmds::LeaseCmdsImpl::getParameters(), and isc::lease_cmds::LeaseCmdsImpl::leaseGetByClientIdHandler().
const std::vector< uint8_t > & isc::dhcp::ClientId::getClientId | ( | ) | const |
Returns reference to the client-id data.
Definition at line 117 of file duid.cc.
References isc::dhcp::DUID::duid_.
Referenced by isc::dhcp::CqlLeaseMgr::getLease4(), isc::dhcp::PgSqlLeaseMgr::getLease4(), and isc::dhcp::MySqlLeaseMgr::getLease4().
bool isc::dhcp::ClientId::operator!= | ( | const ClientId & | other | ) | const |
Compares two client-ids for inequality.
Definition at line 144 of file duid.cc.
References isc::dhcp::DUID::duid_.
bool isc::dhcp::ClientId::operator== | ( | const ClientId & | other | ) | const |
Compares two client-ids for equality.
Definition at line 139 of file duid.cc.
References isc::dhcp::DUID::duid_.
std::string isc::dhcp::ClientId::toText | ( | ) | const |
Returns textual representation of a DUID (e.g. 00:01:02:03:ff)
Definition at line 122 of file duid.cc.
References isc::dhcp::DUID::toText().
Referenced by isc::dhcp::CqlLeaseMgr::getLease4(), isc::dhcp::Memfile_LeaseMgr::getLease4(), isc::dhcp::PgSqlLeaseMgr::getLease4(), and isc::dhcp::MySqlLeaseMgr::getLease4().
|
static |
Maximum size of a client ID.
This is the same as the maximum size of the underlying DUID.
Definition at line 128 of file duid.h.
Referenced by isc::dhcp::CqlLease4Exchange::retrieve().
|
static |
Minimum size of a client ID.
Excerpt from RFC2132, section 9.14. The code for this option is 61, and its minimum length is 2.
Definition at line 118 of file duid.h.
Referenced by ClientId().