26#include <boost/algorithm/string/case_conv.hpp>
139 const std::vector<uint8_t>& wire_fqdn);
146 D2Dhcid(
const std::vector<uint8_t>& clientid_data,
147 const std::vector<uint8_t>& wire_fqdn);
155 const std::vector<uint8_t>& wire_fqdn);
160 std::string
toStr()
const;
176 void fromClientId(
const std::vector<uint8_t>& clientid_data,
177 const std::vector<uint8_t>& wire_fqdn);
188 const std::vector<uint8_t>& wire_fqdn);
195 const std::vector<uint8_t>& wire_fqdn);
206 return (this->bytes_ == other.bytes_);
211 return (this->bytes_ != other.bytes_);
216 return (this->bytes_ < other.bytes_);
232 void createDigest(
const uint8_t identifier_type,
233 const std::vector<uint8_t>& identifier_data,
234 const std::vector<uint8_t>& wire_fqdn);
237 std::vector<uint8_t> bytes_;
241operator<<(std::ostream& os,
const D2Dhcid& dhcid);
243class NameChangeRequest;
248typedef std::map<std::string, isc::data::ConstElementPtr>
ElementMap;
289 const bool forward_change,
const bool reverse_change,
290 const std::string& fqdn,
const std::string& ip_address,
292 const uint32_t lease_length,
472 std::string
toJSON()
const;
498 return (change_type_);
518 return (forward_change_);
540 return (reverse_change_);
561 const std::string&
getFqdn()
const {
569 return (boost::algorithm::to_lower_copy(fqdn_));
575 void setFqdn(
const std::string& value);
589 return (ip_io_address_.toText());
593 return (ip_io_address_);
600 return (ip_io_address_);
607 return (ip_io_address_.isV4());
614 return (ip_io_address_.isV6());
650 void setDhcid(
const std::string& value);
672 return (dhcid_.toStr());
679 return (lease_length_);
699 return (conflict_resolution_mode_);
745 next_ncr_ = next_ncr;
769 std::string
toText()
const;
779 bool forward_change_;
782 bool reverse_change_;
804 uint32_t lease_length_;
This is a base class for exceptions thrown from the DNS library module.
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The IOAddress class represents an IP addresses (version agnostic).
Holds DUID (DHCPv6 Unique Identifier).
Container class for handling the DHCID value within a NameChangeRequest.
bool operator<(const D2Dhcid &other) const
Compares two D2Dhcids lexically.
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.
bool operator==(const D2Dhcid &other) const
Compares two D2Dhcids for equality.
bool operator!=(const D2Dhcid &other) const
Compares two D2Dhcids for inequality.
void fromDUID(const isc::dhcp::DUID &duid, const std::vector< uint8_t > &wire_fqdn)
Sets the DHCID value based on the DUID and FQDN.
const std::vector< uint8_t > & getBytes() const
Returns a reference to the DHCID byte vector.
D2Dhcid()
Default constructor.
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 fromStr(const std::string &data)
Sets the DHCID value based on the given string.
std::string toStr() const
Returns the DHCID value as a string of hexadecimal digits.
DhcidRdataComputeError(const char *file, size_t line, const char *what)
Represents a DHCP-DDNS client request.
bool operator==(const NameChangeRequest &b) const
bool operator!=(const NameChangeRequest &b) const
void setStatus(const NameChangeStatus value)
Sets the request status to the given value.
bool isV6() const
Returns true if the lease address is a IPv6 lease.
const std::string & getFqdn() const
Fetches the request FQDN.
void setChangeType(const NameChangeType value)
Sets the change type to the given value.
std::string toText() const
Returns a text rendition of the contents of the request.
uint32_t getLeaseLength() const
Fetches the request lease length.
const asiolink::IOAddress & getIpIoAddress() const
Fetches the request IP address as an IOAddress.
void setIpAddress(const std::string &value)
Sets the IP address to the given value.
void translateUseConflictResolution(isc::data::ConstElementPtr element)
Sets the conflict resolution mode based on the value of the given boolean Element.
const D2Dhcid & getDhcid() const
Fetches the request DHCID.
NameChangeRequestPtr getNextNcr() const
Fetches the next NCR (if one).
void setDhcid(const std::string &value)
Sets the DHCID based on the given string value.
std::string toJSON() const
Instance method for marshalling the contents of the request into a string of JSON text.
ConflictResolutionMode getConflictResolutionMode() const
Fetches the conflict resolution mode.
std::string getIpAddress() const
Fetches the request IP address string.
void setFqdn(const std::string &value)
Sets the FQDN to the given value.
void setReverseChange(const bool value)
Sets the reverse change flag to the given value.
void setNextNcr(NameChangeRequestPtr next_ncr)
Fetches the next NCR (if one).
void setLeaseLength(const uint32_t value)
Sets the lease length to the given value.
const asiolink::IOAddress & getIOAddress() const
void toFormat(const NameChangeFormat format, isc::util::OutputBuffer &buffer) const
Instance method for marshalling the contents of the request into the given buffer in the given format...
NameChangeRequest()
Default Constructor.
NameChangeType getChangeType() const
Fetches the request change type.
static NameChangeRequestPtr fromJSON(const std::string &json)
Static method for creating a NameChangeRequest from a string containing a JSON rendition of a request...
void setForwardChange(const bool value)
Sets the forward change flag to the given value.
isc::data::ConstElementPtr getElement(const std::string &name, const ElementMap &element_map) const
Given a name, finds and returns an element from a map of elements.
void setConflictResolutionMode(const ConflictResolutionMode value)
Sets the conflict resolution mode to the given value.
std::string getRequestId() const
Fetches the request ID.
bool isForwardChange() const
Checks forward change flag.
NameChangeStatus getStatus() const
Fetches the request status.
bool isV4() const
Returns true if the lease address is a IPv4 lease.
static NameChangeRequestPtr fromFormat(const NameChangeFormat format, isc::util::InputBuffer &buffer)
Static method for creating a NameChangeRequest from a buffer containing a marshalled request in a giv...
void validateContent()
Validates the content of a populated request.
bool isReverseChange() const
Checks reverse change flag.
std::string getFqdnLower() const
Fetches the request FQDN lower-cased.
NcrMessageError(const char *file, size_t line, const char *what)
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
boost::shared_ptr< const Element > ConstElementPtr
NameChangeFormat
Defines the list of data wire formats supported.
NameChangeStatus
Defines the runtime processing status values for requests.
NameChangeType
Defines the types of DNS updates that can be requested.
@ CHECK_EXISTS_WITH_DHCID
std::map< std::string, isc::data::ConstElementPtr > ElementMap
Defines a map of Elements, keyed by their string name.
std::ostream & operator<<(std::ostream &os, const D2Dhcid &dhcid)
NameChangeFormat stringToNcrFormat(const std::string &fmt_str)
Function which converts labels to NameChangeFormat enum values.
ConflictResolutionMode StringToConflictResolutionMode(const std::string &mode_str)
Function which converts string to ConflictResolutionMode enum values.
std::string ConflictResolutionModeToString(const ConflictResolutionMode &mode)
Function which converts ConflictResolutionMode enums to text labels.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
std::string ncrFormatToString(NameChangeFormat format)
Function which converts NameChangeFormat enums to text labels.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Defines the logger used by the top-level component of kea-lfc.