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_;
Defines elements for storing the names of client classes.
The IOAddress class represents an IP addresses (version agnostic)
static const IOAddress & IPV4_ZERO_ADDRESS()
Returns an address set to all zeros.
bool operator!=(const AuthKey &other) const
inequality operator
std::string getAuthKey()
return auth key
std::string ToText() const
return text format for keys
static std::string getRandomKeyString()
Random string is generated by default will be used for the keys to be used for signing Reconfigure Me...
void setAuthKey(const std::string &key)
set auth key value
static const uint8_t KEY_LEN
Length of the key - 128 bits.
bool operator==(const AuthKey &other) const
equality operator
Container for storing client class names.
Represents a device with IPv4 and/or IPv6 reservations.
void addClientClass4(const std::string &class_name)
Adds new client class for DHCPv4.
void setServerHostname(const std::string &server_host_name)
Sets new value for server hostname (sname).
void setHostId(HostID id)
Sets Host ID (primary key in MySQL, PostgreSQL and Cassandra backends)
const ClientClasses & getClientClasses6() const
Returns classes which DHCPv6 client is associated with.
CfgOptionPtr getCfgOption4()
Returns pointer to the DHCPv4 option data configuration for this host.
void setNegative(bool negative)
Sets the negative cached flag.
std::string toText() const
Returns information about the host in the textual format.
void addClientClass6(const std::string &class_name)
Adds new client class for DHCPv6.
SubnetID getIPv4SubnetID() const
Returns subnet identifier for IPv4 reservation.
IdentifierType
Type of the host identifier.
@ IDENT_FLEX
Flexible host identifier.
IdentifierType getIdentifierType() const
Returns the identifier type.
void setIdentifier(const uint8_t *identifier, const size_t len, const IdentifierType &type)
Replaces currently used identifier with a new identifier.
SubnetID getIPv6SubnetID() const
Returns subnet identifier for IPv6 reservations.
void setHostname(const std::string &hostname)
Sets new hostname.
const asiolink::IOAddress & getIPv4Reservation() const
Returns reserved IPv4 address.
static const IdentifierType LAST_IDENTIFIER_TYPE
Constant pointing to the last identifier of the IdentifierType enumeration.
const std::string & getHostname() const
Returns reserved hostname.
IPv6ResrvRange getIPv6Reservations() const
Returns all IPv6 reservations.
const std::string & getBootFileName() const
Returns value of boot file name (file).
bool hasIPv6Reservation() const
Checks if there is at least one IPv6 reservation for this host.
const std::vector< uint8_t > & getIdentifier() const
Returns the identifier in a binary form.
isc::data::ElementPtr toElement6() const
Unparses (converts to Element representation) IPv6 host.
ConstCfgOptionPtr getCfgOption4() const
Returns const pointer to the DHCPv4 option data configuration for this host.
void addReservation(const IPv6Resrv &reservation)
Adds new IPv6 reservation.
const ClientClasses & getClientClasses4() const
Returns classes which DHCPv4 client is associated with.
static std::string getIdentifierName(const IdentifierType &type)
Returns name of the identifier of a specified type.
const std::string & getServerHostname() const
Returns value of server hostname (sname).
void setBootFileName(const std::string &boot_file_name)
Sets new value for boot file name (file).
void setNextServer(const asiolink::IOAddress &next_server)
Sets new value for next server field (siaddr).
CfgOptionPtr getCfgOption6()
Returns pointer to the DHCPv6 option data configuration for this host.
bool hasReservation(const IPv6Resrv &reservation) const
Checks if specified IPv6 reservation exists for the host.
const asiolink::IOAddress & getNextServer() const
Returns value of next server field (siaddr).
ConstCfgOptionPtr getCfgOption6() const
Returns const pointer to the DHCPv6 option data configuration for this host.
std::string getIdentifierAsText() const
Returns host identifier in a textual form.
AuthKey getKey() const
Returns the key.
isc::data::ElementPtr toElement4() const
Unparses (converts to Element representation) IPv4 host.
DuidPtr getDuid() const
Returns DUID for which the reservations are made.
void setIPv4SubnetID(const SubnetID ipv4_subnet_id)
Sets new IPv4 subnet identifier.
void removeIPv4Reservation()
Removes the IPv4 reservation.
void setIPv6SubnetID(const SubnetID ipv6_subnet_id)
Sets new IPv6 subnet identifier.
HWAddrPtr getHWAddress() const
Returns hardware address for which the reservations are made.
void setKey(const AuthKey &key)
sets key.
HostID getHostId() const
Returns Host ID (primary key in MySQL, PostgreSQL and Cassandra backends)
bool getNegative() const
Return the negative cache flag value.
void setIPv4Reservation(const asiolink::IOAddress &address)
Sets new IPv4 reservation.
IPv6 reservation for a host.
void set(const Type &type, const asiolink::IOAddress &prefix, const uint8_t prefix_len)
Sets a new prefix and prefix length.
const asiolink::IOAddress & getPrefix() const
Returns prefix for the reservation.
Type getType() const
Returns reservation type.
Type
Type of the reservation.
uint8_t getPrefixLen() const
Returns prefix length.
std::string toText() const
Returns information about the reservation in the textual format.
bool operator==(const IPv6Resrv &other) const
Equality operator.
bool operator!=(const IPv6Resrv &other) const
Inequality operator.
boost::shared_ptr< Element > ElementPtr
IPv6ResrvCollection::const_iterator IPv6ResrvIterator
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
boost::shared_ptr< DUID > DuidPtr
std::pair< IPv6ResrvIterator, IPv6ResrvIterator > IPv6ResrvRange
std::vector< HostPtr > HostCollection
Collection of the Host objects.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
std::multimap< IPv6Resrv::Type, IPv6Resrv > IPv6ResrvCollection
Collection of IPv6 reservations for the host.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
uint64_t HostID
HostID (used only when storing in MySQL, PostgreSQL or Cassandra)
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
std::pair< IPv6Resrv::Type, IPv6Resrv > IPv6ResrvTuple
boost::shared_ptr< const CfgOption > ConstCfgOptionPtr
Const pointer.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Base class for user context.