Kea 2.7.5
|
Container class for handling the DHCID value within a NameChangeRequest. More...
#include <ncr_msg.h>
Public Member Functions | |
D2Dhcid () | |
Default constructor. | |
D2Dhcid (const isc::dhcp::DUID &duid, const std::vector< uint8_t > &wire_fqdn) | |
Constructor, creates an instance of the D2Dhcid from the isc::dhcp::DUID . | |
D2Dhcid (const isc::dhcp::HWAddrPtr &hwaddr, const std::vector< uint8_t > &wire_fqdn) | |
Constructor, creates an instance of the D2Dhcid from the HW address. | |
D2Dhcid (const std::string &data) | |
Constructor - Creates a new instance, populated by converting a given string of digits into an array of unsigned bytes. | |
D2Dhcid (const std::vector< uint8_t > &clientid_data, const std::vector< uint8_t > &wire_fqdn) | |
Constructor, creates an instance of the D2Dhcid from the client identifier carried in the Client Identifier option. | |
void | fromClientId (const std::vector< uint8_t > &clientid_data, const std::vector< uint8_t > &wire_fqdn) |
Sets the DHCID value based on the Client Identifier. | |
void | fromDUID (const isc::dhcp::DUID &duid, const std::vector< uint8_t > &wire_fqdn) |
Sets the DHCID value based on the DUID and FQDN. | |
void | fromHWAddr (const isc::dhcp::HWAddrPtr &hwaddr, const std::vector< uint8_t > &wire_fqdn) |
Sets the DHCID value based on the HW address and FQDN. | |
void | fromStr (const std::string &data) |
Sets the DHCID value based on the given string. | |
const std::vector< uint8_t > & | getBytes () const |
Returns a reference to the DHCID byte vector. | |
bool | operator!= (const D2Dhcid &other) const |
Compares two D2Dhcids for inequality. | |
bool | operator< (const D2Dhcid &other) const |
Compares two D2Dhcids lexically. | |
bool | operator== (const D2Dhcid &other) const |
Compares two D2Dhcids for equality. | |
std::string | toStr () const |
Returns the DHCID value as a string of hexadecimal digits. | |
Container class for handling the DHCID value within a NameChangeRequest.
It provides conversion to and from string for JSON formatting, but stores the data internally as unsigned bytes.
isc::dhcp_ddns::D2Dhcid::D2Dhcid | ( | ) |
Default constructor.
Definition at line 101 of file ncr_msg.cc.
isc::dhcp_ddns::D2Dhcid::D2Dhcid | ( | const std::string & | data | ) |
Constructor - Creates a new instance, populated by converting a given string of digits into an array of unsigned bytes.
data | is a string of hexadecimal digits. The format is simply a contiguous stream of digits, with no delimiters. For example a string containing "14A3" converts to a byte array containing: 0x14, 0xA3. |
NcrMessageError | if the input data contains non-digits or there is an odd number of digits. |
Definition at line 104 of file ncr_msg.cc.
References fromStr().
isc::dhcp_ddns::D2Dhcid::D2Dhcid | ( | const isc::dhcp::HWAddrPtr & | hwaddr, |
const std::vector< uint8_t > & | wire_fqdn ) |
Constructor, creates an instance of the D2Dhcid
from the HW address.
hwaddr | A pointer to the object encapsulating HW address. |
wire_fqdn | A on-wire canonical representation of the FQDN. |
Definition at line 108 of file ncr_msg.cc.
References fromHWAddr().
isc::dhcp_ddns::D2Dhcid::D2Dhcid | ( | const std::vector< uint8_t > & | clientid_data, |
const std::vector< uint8_t > & | wire_fqdn ) |
Constructor, creates an instance of the D2Dhcid
from the client identifier carried in the Client Identifier option.
clientid_data | Holds the raw bytes representing client identifier. |
wire_fqdn | A on-wire canonical representation of the FQDN. |
Definition at line 113 of file ncr_msg.cc.
References fromClientId().
isc::dhcp_ddns::D2Dhcid::D2Dhcid | ( | const isc::dhcp::DUID & | duid, |
const std::vector< uint8_t > & | wire_fqdn ) |
Constructor, creates an instance of the D2Dhcid
from the isc::dhcp::DUID
.
duid | An object representing DUID. |
wire_fqdn | A on-wire canonical representation of the FQDN. |
Definition at line 118 of file ncr_msg.cc.
References fromDUID().
void isc::dhcp_ddns::D2Dhcid::fromClientId | ( | const std::vector< uint8_t > & | clientid_data, |
const std::vector< uint8_t > & | wire_fqdn ) |
Sets the DHCID value based on the Client Identifier.
clientid_data | Holds the raw bytes representing client identifier. |
wire_fqdn | A on-wire canonical representation of the FQDN. |
Definition at line 140 of file ncr_msg.cc.
References isc_throw.
Referenced by D2Dhcid().
void isc::dhcp_ddns::D2Dhcid::fromDUID | ( | const isc::dhcp::DUID & | duid, |
const std::vector< uint8_t > & | wire_fqdn ) |
Sets the DHCID value based on the DUID and FQDN.
This function requires that the FQDN conforms to the section 3.5 of the RFC4701, which says that the FQDN must be in lowercase. This function doesn't validate if it really converted.
duid | A isc::dhcp::DUID object encapsulating DUID. |
wire_fqdn | A on-wire canonical representation of the FQDN. |
Definition at line 191 of file ncr_msg.cc.
References isc::dhcp::DUID::getDuid().
Referenced by D2Dhcid().
void isc::dhcp_ddns::D2Dhcid::fromHWAddr | ( | const isc::dhcp::HWAddrPtr & | hwaddr, |
const std::vector< uint8_t > & | wire_fqdn ) |
Sets the DHCID value based on the HW address and FQDN.
hwaddr | A pointer to the object encapsulating HW address. |
wire_fqdn | A on-wire canonical representation of the FQDN. |
Definition at line 171 of file ncr_msg.cc.
References isc_throw.
Referenced by D2Dhcid().
void isc::dhcp_ddns::D2Dhcid::fromStr | ( | const std::string & | data | ) |
Sets the DHCID value based on the given string.
data | is a string of hexadecimal digits. The format is simply a contiguous stream of digits, with no delimiters. For example a string containing "14A3" converts to a byte array containing: 0x14, 0xA3. |
NcrMessageError | if the input data contains non-digits or there is an odd number of digits. |
Definition at line 125 of file ncr_msg.cc.
References isc::util::encode::decodeHex(), isc_throw, and isc::Exception::what().
Referenced by D2Dhcid(), and isc::dhcp_ddns::NameChangeRequest::setDhcid().
|
inline |
Returns a reference to the DHCID byte vector.
Definition at line 196 of file ncr_msg.h.
Referenced by isc::dhcp_ddns::NameChangeRequest::validateContent().
|
inline |
|
inline |
|
inline |
std::string isc::dhcp_ddns::D2Dhcid::toStr | ( | ) | const |
Returns the DHCID value as a string of hexadecimal digits.
Definition at line 135 of file ncr_msg.cc.
References isc::util::encode::encodeHex().
Referenced by isc::d2::D2UpdateMgr::makeTransaction(), and isc::dhcp_ddns::NameChangeRequest::toText().