 |
Kea
1.5.0
|
Go to the documentation of this file.
41 duid_ = std::vector<uint8_t>(data, data + len);
49 if (
duid_.size() < 2) {
62 std::vector<uint8_t> binary;
64 return (
DUID(binary));
69 static std::vector<uint8_t> empty_duid(1,0);
70 static DUID empty(empty_duid);
75 std::stringstream tmp;
78 for (std::vector<uint8_t>::const_iterator it =
duid_.begin();
79 it !=
duid_.end(); ++it) {
83 tmp << std::setw(2) << std::setfill('0') << static_cast<unsigned int>(*it);
102 <<
"), at least 2 is required");
108 :
DUID(clientid, len) {
111 <<
"), at least 2 is required");
132 std::vector<uint8_t> binary;
static ClientIdPtr fromText(const std::string &text)
Create client identifier from the textual format.
bool operator!=(const DUID &other) const
Compares two DUIDs for inequality.
bool operator==(const DUID &other) const
Compares two DUIDs for equality.
@ DUID_MAX
not a real type, just maximum defined value + 1
ClientId(const std::vector< uint8_t > &clientid)
Constructor based on vector<uint8_t>
static const DUID & EMPTY()
Defines the constant "empty" DUID.
static DUID fromText(const std::string &text)
Create DUID from the textual format.
std::vector< uint8_t > duid_
The actual content of the DUID.
std::string toText() const
Returns textual representation of a DUID (e.g. 00:01:02:03:ff)
const std::vector< uint8_t > & getClientId() const
Returns reference to the client-id data.
Defines the logger used by the top-level component of kea-dhcp-ddns.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
@ DUID_UNKNOWN
invalid/unknown type
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Holds Client identifier or client IPv4 address.
std::string toText() const
Returns textual representation of a DUID (e.g. 00:01:02:03:ff)
DUIDType getType() const
Returns the DUID type.
DUIDType
specifies DUID type
const std::vector< uint8_t > & getDuid() const
Returns a const reference to the actual DUID value.
void decodeFormattedHexString(const std::string &hex_string, std::vector< uint8_t > &binary)
Converts a formatted string of hexadecimal digits into a vector.
boost::shared_ptr< ClientId > ClientIdPtr
Shared pointer to a Client ID.
static const size_t MAX_DUID_LEN
maximum duid size As defined in RFC 8415, section 11.1
DUID(const std::vector< uint8_t > &duid)
Constructor from vector.
bool operator==(const ClientId &other) const
Compares two client-ids for equality.
Holds DUID (DHCPv6 Unique Identifier)
static const size_t MIN_CLIENT_ID_LEN
Minimum size of a client ID.
bool operator!=(const ClientId &other) const
Compares two client-ids for inequality.