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