 |
Kea
1.5.0
|
Go to the documentation of this file.
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;
257 const bool forward_change,
const bool reverse_change,
258 const std::string& fqdn,
const std::string& ip_address,
260 const uint64_t lease_expires_on,
261 const uint32_t lease_length);
404 std::string
toJSON()
const;
430 return (change_type_);
450 return (forward_change_);
472 return (reverse_change_);
500 void setFqdn(
const std::string& value);
514 return (ip_io_address_.
toText());
521 return (ip_io_address_);
528 return (ip_io_address_.
isV4());
535 return (ip_io_address_.
isV6());
566 void setDhcid(
const std::string& value);
588 return (dhcid_.
toStr());
596 return (lease_expires_on_);
636 return (lease_length_);
680 std::string
toText()
const;
690 bool forward_change_;
693 bool reverse_change_;
715 uint64_t lease_expires_on_;
718 uint32_t lease_length_;
std::string toStr() const
Returns the DHCID value as a string of hexadecimal digits.
NameChangeRequest()
Default Constructor.
void validateContent()
Validates the content of a populated request.
bool isForwardChange() const
Checks forward change flag.
void setLeaseExpiresOn(const std::string &value)
Sets the lease expiration based on the given string.
void setChangeType(const NameChangeType value)
Sets the change type to the given value.
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...
The IOAddress class represents an IP addresses (version agnostic)
static NameChangeRequestPtr fromJSON(const std::string &json)
Static method for creating a NameChangeRequest from a string containing a JSON rendition of a request...
NcrMessageError(const char *file, size_t line, const char *what)
const D2Dhcid & getDhcid() const
Fetches the request DHCID.
bool operator==(const D2Dhcid &other) const
Compares two D2Dhcids for equality.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
Container class for handling the DHCID value within a NameChangeRequest.
const asiolink::IOAddress & getIpIoAddress() const
Fetches the request IP address as an IOAddress.
bool isV6() const
Convenience function to check for an IPv6 address.
std::string toText() const
Returns a text rendition of the contents of the request.
const std::vector< uint8_t > & getBytes() const
Returns a reference to the DHCID byte vector.
NameChangeType getChangeType() const
Fetches the request change type.
NameChangeType
Defines the types of DNS updates that can be requested.
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 lexically.
void setReverseChange(const bool value)
Sets the reverse change flag to the given value.
This is a base class for exceptions thrown from the DNS library module.
DhcidRdataComputeError(const char *file, size_t line, const char *what)
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::string getRequestId() const
Fetches the request ID.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
D2Dhcid()
Default constructor.
std::string toJSON() const
Instance method for marshalling the contents of the request into a string of JSON text.
bool operator!=(const D2Dhcid &other) const
Compares two D2Dhcids for inequality.
void setStatus(const NameChangeStatus value)
Sets the request status to the given value.
std::string getIpAddress() const
Fetches the request IP address string.
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.
NameChangeStatus getStatus() const
Fetches the request status.
bool isV6() const
Returns true if the lease address is a IPv6 lease.
bool operator!=(const NameChangeRequest &b)
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void setForwardChange(const bool value)
Sets the forward change flag to the given value.
uint64_t getLeaseExpiresOn() const
Fetches the request lease expiration.
Exception thrown when NameChangeRequest marshalling error occurs.
void setDhcid(const std::string &value)
Sets the DHCID based on the given string value.
void setIpAddress(const std::string &value)
Sets the IP address to the given value.
std::map< std::string, isc::data::ConstElementPtr > ElementMap
Defines a map of Elements, keyed by their string name.
Represents a DHCP-DDNS client request.
std::string toText() const
Convert the address to a string.
void setFqdn(const std::string &value)
Sets the FQDN to the given value.
void fromStr(const std::string &data)
Sets the DHCID value 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...
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 fromClientId(const std::vector< uint8_t > &clientid_data, const std::vector< uint8_t > &wire_fqdn)
Sets the DHCID value based on the Client Identifier.
NameChangeFormat stringToNcrFormat(const std::string &fmt_str)
Function which converts labels to NameChangeFormat enum values.
std::string getLeaseExpiresOnStr() const
Fetches the request lease expiration as string.
void setLeaseLength(const uint32_t value)
Sets the lease length to the given value.
const std::string getFqdn() const
Fetches the request FQDN.
bool isReverseChange() const
Checks reverse change flag.
std::ostream & operator<<(std::ostream &os, const D2Dhcid &dhcid)
NameChangeStatus
Defines the runtime processing status values for requests.
Holds DUID (DHCPv6 Unique Identifier)
boost::shared_ptr< const Element > ConstElementPtr
bool operator==(const NameChangeRequest &b)
bool isV4() const
Convenience function to check for an IPv4 address.
void fromDUID(const isc::dhcp::DUID &duid, const std::vector< uint8_t > &wire_fqdn)
Sets the DHCID value based on the DUID and FQDN.
std::string ncrFormatToString(NameChangeFormat format)
Function which converts NameChangeFormat enums to text labels.
Exception thrown when there is an error occurred during computation of the DHCID.
NameChangeFormat
Defines the list of data wire formats supported.
uint32_t getLeaseLength() const
Fetches the request lease length.