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);
212 class NameChangeRequest;
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);
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_);
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_;
This is a base class for exceptions thrown from the DNS library module.
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)
std::string toText() const
Convert the address to a string.
bool isV6() const
Convenience function to check for an IPv6 address.
bool isV4() const
Convenience function to check for an IPv4 address.
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.
const std::vector< uint8_t > & getBytes() const
Returns a reference to the DHCID byte vector.
void fromDUID(const isc::dhcp::DUID &duid, const std::vector< uint8_t > &wire_fqdn)
Sets the DHCID value based on the DUID and FQDN.
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.
Exception thrown when there is an error occurred during computation of the DHCID.
DhcidRdataComputeError(const char *file, size_t line, const char *what)
Represents a DHCP-DDNS client request.
bool operator==(const NameChangeRequest &b) const
bool useConflictResolution() const
Checks if conflict resolution is enabled.
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.
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.
void setIpAddress(const std::string &value)
Sets the IP address to the given value.
const D2Dhcid & getDhcid() const
Fetches the request DHCID.
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.
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.
const asiolink::IOAddress & getIpIoAddress() const
Fetches the request IP address as an IOAddress.
void setLeaseLength(const uint32_t value)
Sets the lease length to the given value.
void setLeaseExpiresOn(const std::string &value)
Sets the lease expiration based on the given string.
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.
std::string getLeaseExpiresOnStr() const
Fetches the request lease expiration as string.
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.
uint64_t getLeaseExpiresOn() const
Fetches the request lease expiration.
void setConflictResolution(const bool value)
Sets the conflict resolution flag 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.
const std::string getFqdn() const
Fetches the request FQDN.
bool isReverseChange() const
Checks reverse change flag.
Exception thrown when NameChangeRequest marshalling error occurs.
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.
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.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
std::string ncrFormatToString(NameChangeFormat format)
Function which converts NameChangeFormat enums to text labels.
NameChangeType
Defines the types of DNS updates that can be requested.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.
Defines the logger used by the top-level component of kea-lfc.