127 D2Dhcid(
const std::string& data);
135 const std::vector<uint8_t>& wire_fqdn);
142 D2Dhcid(
const std::vector<uint8_t>& clientid_data,
143 const std::vector<uint8_t>& wire_fqdn);
151 const std::vector<uint8_t>& wire_fqdn);
156 std::string
toStr()
const;
166 void fromStr(
const std::string& data);
172 void fromClientId(
const std::vector<uint8_t>& clientid_data,
173 const std::vector<uint8_t>& wire_fqdn);
184 const std::vector<uint8_t>& wire_fqdn);
191 const std::vector<uint8_t>& wire_fqdn);
202 return (this->bytes_ == other.bytes_);
207 return (this->bytes_ != other.bytes_);
212 return (this->bytes_ < other.bytes_);
228 void createDigest(
const uint8_t identifier_type,
229 const std::vector<uint8_t>& identifier_data,
230 const std::vector<uint8_t>& wire_fqdn);
233 std::vector<uint8_t> bytes_;
237operator<<(std::ostream& os,
const D2Dhcid& dhcid);
239class NameChangeRequest;
244typedef std::map<std::string, isc::data::ConstElementPtr>
ElementMap;
287 const bool forward_change,
const bool reverse_change,
288 const std::string& fqdn,
const std::string& ip_address,
290 const uint64_t lease_expires_on,
291 const uint32_t lease_length,
441 std::string
toJSON()
const;
467 return (change_type_);
487 return (forward_change_);
509 return (reverse_change_);
530 const std::string
getFqdn()
const {
537 void setFqdn(
const std::string& value);
551 return (ip_io_address_.
toText());
558 return (ip_io_address_);
565 return (ip_io_address_.
isV4());
572 return (ip_io_address_.
isV6());
603 void setDhcid(
const std::string& value);
625 return (dhcid_.
toStr());
633 return (lease_expires_on_);
673 return (lease_length_);
693 return (conflict_resolution_mode_);
751 std::string
toText()
const;
761 bool forward_change_;
764 bool reverse_change_;
786 uint64_t lease_expires_on_;
789 uint32_t lease_length_;
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.
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.
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 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.
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.
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 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 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.
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.
@ 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.
NameChangeType
Defines the types of DNS updates that can be requested.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Defines the logger used by the top-level component of kea-lfc.