Kea 2.5.8
isc::dhcp::ClientId Class Reference

Holds Client identifier or client IPv4 address. More...

#include <duid.h>

+ Inheritance diagram for isc::dhcp::ClientId:

Public Member Functions

 ClientId (const std::vector< uint8_t > &data)
 Constructor based on vector<uint8_t>
 
 ClientId (const uint8_t *data, size_t len)
 Constructor based on array and array size.
 
const std::vector< uint8_t > & getClientId () const
 Returns reference to the client-id data.
 
- Public Member Functions inherited from isc::dhcp::IdentifierType< 2, 255 >
 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 ClientIdPtr fromText (const std::string &text)
 Create client identifier from the textual format.
 
- Static Public Member Functions inherited from isc::dhcp::IdentifierType< 2, 255 >
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_CLIENT_ID_LEN = IdentifierType::getMaxSize()
 Maximum size of a client ID.
 
static constexpr size_t MIN_CLIENT_ID_LEN = IdentifierType::getMinSize()
 Minimum size of a client ID.
 

Additional Inherited Members

- Protected Member Functions inherited from isc::dhcp::IdentifierBaseType
virtual ~IdentifierBaseType ()=0
 Pure virtual destructor.
 
- Protected Attributes inherited from isc::dhcp::IdentifierType< 2, 255 >
std::vector< uint8_t > data_
 The actual content of the Identifier.
 

Detailed Description

Holds Client identifier or client IPv4 address.

This class is intended to be a generic IPv4 client identifier. It can hold a client-id

Definition at line 222 of file duid.h.

Constructor & Destructor Documentation

◆ ClientId() [1/2]

isc::dhcp::ClientId::ClientId ( const std::vector< uint8_t > &  data)

Constructor based on vector<uint8_t>

Parameters
dataThe data used to create the ClientId

Definition at line 63 of file duid.cc.

◆ ClientId() [2/2]

isc::dhcp::ClientId::ClientId ( const uint8_t *  data,
size_t  len 
)

Constructor based on array and array size.

Parameters
dataThe data used to create the ClientId
lenThe data len used to create the ClientId

Definition at line 66 of file duid.cc.

Member Function Documentation

◆ fromText()

ClientIdPtr isc::dhcp::ClientId::fromText ( const std::string &  text)
static

Create client identifier from the textual format.

This static function creates the instance of the ClientId from the textual format.

Parameters
textClient identifier in the textual format.
Returns
Pointer to the instance of the ClientId.
Exceptions
isc::BadValueif parsing the client identifier failed.
isc::OutOfRangeif the client identifier is truncated.

Definition at line 73 of file duid.cc.

References isc::dhcp::IdentifierType< min_size, max_size >::fromText().

Referenced by isc::dhcp::Lease4::fromElement(), isc::lease_cmds::LeaseCmdsImpl::getParameters(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByClientIdHandler(), and isc::lease_cmds::Lease4Parser::parse().

+ Here is the call graph for this function:

◆ getClientId()

const std::vector< uint8_t > & isc::dhcp::ClientId::getClientId ( ) const

Returns reference to the client-id data.

Warning
Since this function returns a reference to the vector (not a copy) the returned object must be used with caution because it remains valid only for the time period when the object which returned it is valid.
Returns
A reference to a vector holding a client identifier.

Definition at line 69 of file duid.cc.

References isc::dhcp::IdentifierType< 2, 255 >::data_.

Referenced by isc::dhcp::MySqlLeaseMgr::getLease4(), and isc::dhcp::PgSqlLeaseMgr::getLease4().

Member Data Documentation

◆ MAX_CLIENT_ID_LEN

constexpr size_t isc::dhcp::ClientId::MAX_CLIENT_ID_LEN = IdentifierType::getMaxSize()
staticconstexpr

Maximum size of a client ID.

Note
RFC 2131 does not specify an upper length of a client ID, but the byte used to specify the option size byte can only go up to 255.

Definition at line 235 of file duid.h.

Referenced by isc::dhcp::Host::getIdentifierMaxLength().

◆ MIN_CLIENT_ID_LEN

constexpr size_t isc::dhcp::ClientId::MIN_CLIENT_ID_LEN = IdentifierType::getMinSize()
staticconstexpr

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 229 of file duid.h.


The documentation for this class was generated from the following files: