18 #include <boost/shared_ptr.hpp> 79 std::string
ToText()
const;
132 const uint8_t prefix_len = 128);
141 return (prefix_len_);
162 const uint8_t prefix_len);
165 std::string
toText()
const;
294 Host(
const uint8_t* identifier,
const size_t identifier_len,
298 const std::string& hostname =
"",
299 const std::string& dhcp4_client_classes =
"",
300 const std::string& dhcp6_client_classes =
"",
302 const std::string& server_host_name =
"",
303 const std::string& boot_file_name =
"",
346 Host(
const std::string& identifier,
const std::string& identifier_name,
349 const std::string& hostname =
"",
350 const std::string& dhcp4_client_classes =
"",
351 const std::string& dhcp6_client_classes =
"",
353 const std::string& server_host_name =
"",
354 const std::string& boot_file_name =
"",
367 void setIdentifier(
const uint8_t* identifier,
const size_t len,
380 void setIdentifier(
const std::string& identifier,
const std::string& name);
425 const uint8_t* value,
426 const size_t length);
432 ipv4_subnet_id_ = ipv4_subnet_id;
439 ipv6_subnet_id_ = ipv6_subnet_id;
444 return (ipv4_subnet_id_);
449 return (ipv6_subnet_id_);
471 return (ipv4_reservation_);
510 hostname_ = hostname;
525 return (dhcp4_client_classes_);
535 return (dhcp6_client_classes_);
548 return (next_server_);
560 return (server_host_name_);
572 return (boot_file_name_);
581 return (cfg_option4_);
587 return (cfg_option4_);
596 return (cfg_option6_);
602 return (cfg_option6_);
606 std::string
toText()
const;
626 negative_ = negative;
672 const std::string& class_name);
677 std::vector<uint8_t> identifier_value_;
687 std::string hostname_;
695 std::string server_host_name_;
697 std::string boot_file_name_;
boost::shared_ptr< DUID > DuidPtr
AuthKey getKey() const
Returns the key.
void setAuthKey(const std::string &key)
set auth key value
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
void setIdentifier(const uint8_t *identifier, const size_t len, const IdentifierType &type)
Replaces currently used identifier with a new identifier.
static std::string getRandomKeyString()
Random string is generated by default will be used for the keys to be used for signing Reconfigure Me...
void setHostname(const std::string &hostname)
Sets new hostname.
uint8_t getPrefixLen() const
Returns prefix length.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
std::string toText() const
Returns information about the reservation in the textual format.
const std::string & getHostname() const
Returns reserved hostname.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
Base class for user context.
boost::shared_ptr< const CfgOption > ConstCfgOptionPtr
Const pointer.
void setKey(const AuthKey &key)
sets key.
Defines elements for storing the names of client classes.
bool getNegative() const
Return the negative cache flag value.
const std::string & getBootFileName() const
Returns value of boot file name (file).
HostID getHostId() const
Returns Host ID (primary key in MySQL, PostgreSQL and Cassandra backends)
IPv6Resrv(const Type &type, const asiolink::IOAddress &prefix, const uint8_t prefix_len=128)
Constructor.
boost::shared_ptr< Element > ElementPtr
IPv6ResrvRange getIPv6Reservations() const
Returns all IPv6 reservations.
std::vector< HostPtr > HostCollection
Collection of the Host objects.
static std::string getIdentifierName(const IdentifierType &type)
Returns name of the identifier of a specified type.
isc::data::ElementPtr toElement6() const
Unparses (converts to Element representation) IPv6 host.
IPv6 reservation for a host.
CfgOptionPtr getCfgOption6()
Returns pointer to the DHCPv6 option data configuration for this host.
const ClientClasses & getClientClasses6() const
Returns classes which DHCPv6 client is associated with.
const asiolink::IOAddress & getNextServer() const
Returns value of next server field (siaddr).
void setHostId(HostID id)
Sets Host ID (primary key in MySQL, PostgreSQL and Cassandra backends)
std::pair< IPv6ResrvIterator, IPv6ResrvIterator > IPv6ResrvRange
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
std::multimap< IPv6Resrv::Type, IPv6Resrv > IPv6ResrvCollection
Collection of IPv6 reservations for the host.
std::string getIdentifierAsText() const
Returns host identifier in a textual form.
void addClientClass4(const std::string &class_name)
Adds new client class for DHCPv4.
Host(const uint8_t *identifier, const size_t identifier_len, const IdentifierType &identifier_type, const SubnetID ipv4_subnet_id, const SubnetID ipv6_subnet_id, const asiolink::IOAddress &ipv4_reservation, const std::string &hostname="", const std::string &dhcp4_client_classes="", const std::string &dhcp6_client_classes="", const asiolink::IOAddress &next_server=asiolink::IOAddress::IPV4_ZERO_ADDRESS(), const std::string &server_host_name="", const std::string &boot_file_name="", const AuthKey &auth_key=AuthKey(""))
Constructor.
static const uint8_t KEY_LEN
Length of the key - 128 bits.
const std::string & getServerHostname() const
Returns value of server hostname (sname).
SubnetID getIPv4SubnetID() const
Returns subnet identifier for IPv4 reservation.
static const IOAddress & IPV4_ZERO_ADDRESS()
Returns an address set to all zeros.
Flexible host identifier.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
DuidPtr getDuid() const
Returns DUID for which the reservations are made.
bool operator!=(const AuthKey &other) const
inequality operator
void setServerHostname(const std::string &server_host_name)
Sets new value for server hostname (sname).
Represents a device with IPv4 and/or IPv6 reservations.
Type
Type of the reservation.
IPv6ResrvCollection::const_iterator IPv6ResrvIterator
const asiolink::IOAddress & getIPv4Reservation() const
Returns reserved IPv4 address.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Type getType() const
Returns reservation type.
bool operator!=(const IPv6Resrv &other) const
Inequality operator.
HWAddrPtr getHWAddress() const
Returns hardware address for which the reservations are made.
void set(const Type &type, const asiolink::IOAddress &prefix, const uint8_t prefix_len)
Sets a new prefix and prefix length.
ConstCfgOptionPtr getCfgOption4() const
Returns const pointer to the DHCPv4 option data configuration for this host.
isc::data::ElementPtr toElement4() const
Unparses (converts to Element representation) IPv4 host.
std::string getAuthKey()
return auth key
void addReservation(const IPv6Resrv &reservation)
Adds new IPv6 reservation.
bool operator==(const AuthKey &other) const
equality operator
SubnetID getIPv6SubnetID() const
Returns subnet identifier for IPv6 reservations.
void addClientClass6(const std::string &class_name)
Adds new client class for DHCPv6.
IdentifierType getIdentifierType() const
Returns the identifier type.
bool operator==(const IPv6Resrv &other) const
Equality operator.
const ClientClasses & getClientClasses4() const
Returns classes which DHCPv4 client is associated with.
void setBootFileName(const std::string &boot_file_name)
Sets new value for boot file name (file).
std::string toText() const
Returns information about the host in the textual format.
std::string ToText() const
return text format for keys
void setIPv4Reservation(const asiolink::IOAddress &address)
Sets new IPv4 reservation.
void removeIPv4Reservation()
Removes the IPv4 reservation.
bool hasReservation(const IPv6Resrv &reservation) const
Checks if specified IPv6 reservation exists for the host.
IdentifierType
Type of the host identifier.
const std::vector< uint8_t > & getIdentifier() const
Returns the identifier in a binary form.
std::pair< IPv6Resrv::Type, IPv6Resrv > IPv6ResrvTuple
The IOAddress class represents an IP addresses (version agnostic)
void setIPv4SubnetID(const SubnetID ipv4_subnet_id)
Sets new IPv4 subnet identifier.
static const IdentifierType LAST_IDENTIFIER_TYPE
Constant pointing to the last identifier of the IdentifierType enumeration.
uint64_t HostID
HostID (used only when storing in MySQL, PostgreSQL or Cassandra)
void setNextServer(const asiolink::IOAddress &next_server)
Sets new value for next server field (siaddr).
Container for storing client class names.
const asiolink::IOAddress & getPrefix() const
Returns prefix for the reservation.
ConstCfgOptionPtr getCfgOption6() const
Returns const pointer to the DHCPv6 option data configuration for this host.
bool hasIPv6Reservation() const
Checks if there is at least one IPv6 reservation for this host.
CfgOptionPtr getCfgOption4()
Returns pointer to the DHCPv4 option data configuration for this host.
void setIPv6SubnetID(const SubnetID ipv6_subnet_id)
Sets new IPv6 subnet identifier.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
void setNegative(bool negative)
Sets the negative cached flag.