100 D2Dhcid(
const std::string& data);
108 const std::vector<uint8_t>& wire_fqdn);
115 D2Dhcid(
const std::vector<uint8_t>& clientid_data,
116 const std::vector<uint8_t>& wire_fqdn);
124 const std::vector<uint8_t>& wire_fqdn);
129 std::string
toStr()
const;
139 void fromStr(
const std::string& data);
145 void fromClientId(
const std::vector<uint8_t>& clientid_data,
146 const std::vector<uint8_t>& wire_fqdn);
157 const std::vector<uint8_t>& wire_fqdn);
164 const std::vector<uint8_t>& wire_fqdn);
175 return (this->bytes_ == other.bytes_);
180 return (this->bytes_ != other.bytes_);
185 return (this->bytes_ < other.bytes_);
201 void createDigest(
const uint8_t identifier_type,
202 const std::vector<uint8_t>& identifier_data,
203 const std::vector<uint8_t>& wire_fqdn);
206 std::vector<uint8_t> bytes_;
210 operator<<(std::ostream& os,
const D2Dhcid& dhcid);
217 typedef std::map<std::string, isc::data::ConstElementPtr>
ElementMap;
259 const bool forward_change,
const bool reverse_change,
260 const std::string& fqdn,
const std::string& ip_address,
262 const uint64_t lease_expires_on,
263 const uint32_t lease_length,
264 const bool conflict_resolution =
true);
406 static NameChangeRequestPtr
fromJSON(
const std::string& json);
412 std::string
toJSON()
const;
438 return (change_type_);
458 return (forward_change_);
480 return (reverse_change_);
508 void setFqdn(
const std::string& value);
522 return (ip_io_address_.
toText());
529 return (ip_io_address_);
536 return (ip_io_address_.
isV4());
543 return (ip_io_address_.
isV6());
574 void setDhcid(
const std::string& value);
596 return (dhcid_.
toStr());
604 return (lease_expires_on_);
644 return (lease_length_);
664 return (conflict_resolution_);
704 const ElementMap& element_map)
const;
710 std::string
toText()
const;
720 bool forward_change_;
723 bool reverse_change_;
745 uint64_t lease_expires_on_;
748 uint32_t lease_length_;
751 bool conflict_resolution_;
std::map< std::string, isc::data::ConstElementPtr > ElementMap
Defines a map of Elements, keyed by their string name.
std::string getLeaseExpiresOnStr() const
Fetches the request lease expiration as string.
void fromDUID(const isc::dhcp::DUID &duid, const std::vector< uint8_t > &wire_fqdn)
Sets the DHCID value based on the DUID and FQDN.
bool operator==(const NameChangeRequest &b)
std::string toStr() const
Returns the DHCID value as a string of hexadecimal digits.
NameChangeType
Defines the types of DNS updates that can be requested.
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...
NameChangeType getChangeType() const
Fetches the request change type.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
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.
bool useConflictResolution() const
Checks if conflict resolution is enabled.
bool isV4() const
Returns true if the lease address is a IPv4 lease.
bool isReverseChange() const
Checks reverse change flag.
void setStatus(const NameChangeStatus value)
Sets the request status to the given value.
NameChangeFormat
Defines the list of data wire formats supported.
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...
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.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
const D2Dhcid & getDhcid() const
Fetches the request DHCID.
static NameChangeRequestPtr fromJSON(const std::string &json)
Static method for creating a NameChangeRequest from a string containing a JSON rendition of a request...
bool isV4() const
Convenience function to check for an IPv4 address.
Holds DUID (DHCPv6 Unique Identifier)
uint64_t getLeaseExpiresOn() const
Fetches the request lease expiration.
D2Dhcid()
Default constructor.
Exception thrown when NameChangeRequest marshalling error occurs.
void validateContent()
Validates the content of a populated request.
void setFqdn(const std::string &value)
Sets the FQDN to the given value.
void setLeaseLength(const uint32_t value)
Sets the lease length to the given value.
Exception thrown when there is an error occurred during computation of the DHCID. ...
bool operator!=(const D2Dhcid &other) const
Compares two D2Dhcids for inequality.
bool operator!=(const NameChangeRequest &b)
const asiolink::IOAddress & getIpIoAddress() const
Fetches the request IP address as an IOAddress.
NameChangeRequest()
Default Constructor.
NameChangeStatus
Defines the runtime processing status values for requests.
boost::shared_ptr< const Element > ConstElementPtr
bool isV6() const
Returns true if the lease address is a IPv6 lease.
std::string toJSON() const
Instance method for marshalling the contents of the request into a string of JSON text...
void setReverseChange(const bool value)
Sets the reverse change flag to the given value.
std::string getRequestId() const
Fetches the request ID.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void setConflictResolution(const bool value)
Sets the conflict resolution flag to the given value.
This is a base class for exceptions thrown from the DNS library module.
NameChangeStatus getStatus() const
Fetches the request status.
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::string getIpAddress() const
Fetches the request IP address string.
const std::string getFqdn() const
Fetches the request FQDN.
std::ostream & operator<<(std::ostream &os, const D2Dhcid &dhcid)
bool operator<(const D2Dhcid &other) const
Compares two D2Dhcids lexically.
void setLeaseExpiresOn(const std::string &value)
Sets the lease expiration based on the given string.
std::string ncrFormatToString(NameChangeFormat format)
Function which converts NameChangeFormat enums to text labels.
DhcidRdataComputeError(const char *file, size_t line, const char *what)
Container class for handling the DHCID value within a NameChangeRequest.
std::string toText() const
Convert the address to a string.
NameChangeFormat stringToNcrFormat(const std::string &fmt_str)
Function which converts labels to NameChangeFormat enum values.
bool isV6() const
Convenience function to check for an IPv6 address.
uint32_t getLeaseLength() const
Fetches the request lease length.
std::string toText() const
Returns a text rendition of the contents of the request.
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.
The IOAddress class represents an IP addresses (version agnostic)
void setIpAddress(const std::string &value)
Sets the IP address to the given value.
void setChangeType(const NameChangeType value)
Sets the change type to the given value.
Represents a DHCP-DDNS client request.
bool operator==(const D2Dhcid &other) const
Compares two D2Dhcids for equality.
void setForwardChange(const bool value)
Sets the forward change flag to the given value.
void setDhcid(const std::string &value)
Sets the DHCID based on the given string value.
NcrMessageError(const char *file, size_t line, const char *what)
const std::vector< uint8_t > & getBytes() const
Returns a reference to the DHCID byte vector.
bool isForwardChange() const
Checks forward change flag.
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.