28#include <boost/range/adaptor/reversed.hpp>
29#include <boost/shared_ptr.hpp>
30#include <boost/pointer_cast.hpp>
48 return (first->cltt_ > second->cltt_);
58 setExtendedInfoTablesEnabled(blq_service->getExtendedInfoTablesEnabled());
62 if (!prefix_lengths) {
73 for (
auto const& entry : prefix_lengths->listValue()) {
79 auto plen = entry->intValue();
80 if (plen <= 0 || plen > 128) {
85 }
catch (
const std::exception& ex) {
87 <<
"' is invalid: " << ex.what());
94 Pkt6Ptr query = boost::dynamic_pointer_cast<Pkt6>(base_query);
101 DuidPtr req_clientid = query->getClientId();
105 static_cast<int64_t
>(1));
119 IOAddress requester_ip = query->getRemoteAddr();
124 static_cast<int64_t
>(1));
132 static_cast<int64_t
>(1));
134 "rejecting DHCPV6_LEASEQUERY from unauthorized requester: "
135 << requester_ip.
toText());
144 static_cast<int64_t
>(1));
152 query_type = lq_option->readInteger<uint8_t>(0);
153 query_link_addr = lq_option->readAddress(1);
154 }
catch (
const std::exception& ex) {
158 static_cast<int64_t
>(1));
166 switch (query_type) {
188 query_client_id.reset(
new DUID(opt->getData()));
189 }
catch (
const std::exception& ex) {
194 status_opt =
queryByClientId(query_client_id, query_link_addr, leases);
216 if (prefix_length == 0 || prefix_length > 128) {
217 isc_throw(
BadValue,
"getPrefixFromAddress() - invalid prefix length:" << prefix_length);
221 auto address_bytes = address.
toBytes();
224 auto keep_bytes = prefix_length / 8;
225 std::vector<uint8_t> prefix_bytes(address_bytes.begin(), address_bytes.begin() + keep_bytes);
228 auto keep_bits = prefix_length % 8;
230 static uint8_t masks[] = { 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
232 prefix_bytes.push_back(address_bytes[keep_bytes] & masks[keep_bits - 1]);
236 prefix_bytes.insert(prefix_bytes.end(), 16 - prefix_bytes.size(), 0);
248 if (!lease && prefix_lengths.size()) {
250 for (
auto const& it : boost::adaptors::reverse(prefix_lengths)) {
262 leases.push_back(lease);
276 for (
auto const& subnet : *subnets) {
296 links = subnets->getLinks(link_addr);
309 if (!found_leases.empty()) {
310 for (
auto const& lease : found_leases) {
313 if (!links.empty() && !links.count(lease->subnet_id_)) {
318 leases.push_back(lease);
323 if (!leases.empty()) {
325 std::sort(leases.begin(), leases.end(), cltt_descending);
335 const size_t page_size,
343 links = subnets->getLinks(link_addr);
360 if (found_leases.empty()) {
364 start_addr = found_leases.back()->addr_;
365 for (
auto const& lease : found_leases) {
368 if (!links.empty() && !links.count(lease->subnet_id_)) {
373 leases.push_back(lease);
377 if (!leases.empty()) {
386 const size_t page_size,
396 if (found_leases.empty()) {
401 start_addr = found_leases.back()->addr_;
402 if (start_addr == seen) {
405 for (
auto const& lease : found_leases) {
406 if (lease->addr_ == seen) {
411 if (!links.empty() && !links.count(lease->subnet_id_)) {
417 leases.push_back(lease);
424 const size_t page_size,
432 links = subnets->getLinks(link_addr);
449 if (found_leases.empty()) {
453 start_addr = found_leases.back()->addr_;
454 for (
auto const& lease : found_leases) {
457 if (!links.empty() && !links.count(lease->subnet_id_)) {
462 leases.push_back(lease);
466 if (!leases.empty()) {
475 const size_t page_size,
485 if (found_leases.empty()) {
490 start_addr = found_leases.back()->addr_;
491 if (start_addr == seen) {
494 for (
auto const& lease : found_leases) {
495 if (lease->addr_ == seen) {
500 if (!links.empty() && !links.count(lease->subnet_id_)) {
506 leases.push_back(lease);
512 const size_t page_size,
522 links = subnets->getLinks(link_addr);
531 auto it = links.begin();
532 if (it == links.end()) {
545 if (found_leases.empty()) {
553 start_addr = found_leases.back()->addr_;
554 for (
auto const& lease : found_leases) {
558 leases.push_back(lease);
561 if (!leases.empty()) {
570 const size_t page_size,
578 auto it = links.begin();
579 if (it == links.end()) {
591 if (found_leases.empty()) {
600 start_addr = found_leases.back()->addr_;
601 if (start_addr == seen) {
604 for (
auto const& lease : found_leases) {
605 if (lease->addr_ == seen) {
611 leases.push_back(lease);
614 if (!leases.empty()) {
631 switch (status->getStatusCode()) {
637 if (!leases.empty()) {
640 reply->addOption(client_opt);
648 reply->addOption(opt);
658 reply->addOption(status);
669 reply->addOption(status);
686 reply->setRemoteAddr(query->getRemoteAddr());
687 reply->setRemotePort(query->getRemotePort());
688 reply->setLocalAddr(query->getLocalAddr());
689 reply->setLocalPort(query->getLocalPort());
690 reply->setIface(query->getIface());
691 reply->setIndex(query->getIndex());
693 DuidPtr duid = query->getClientId();
699 reply->addOption(opt);
702 ->getCfgDUID()->getCurrentDuid();
708 reply->addOption(opt);
717 response->setRemoteAddr(query->getRemoteAddr());
718 response->setRemotePort(query->getRemotePort());
727 done->setRemoteAddr(query->getRemoteAddr());
728 done->setRemotePort(query->getRemotePort());
734 if (leases.empty()) {
743 for (
auto const& lease : leases) {
744 if (lease->subnet_id_) {
746 static_cast<void>(links.insert(lease->subnet_id_));
750 if (links.size() > 1) {
753 for (
auto const& link : links) {
755 std::pair<isc::asiolink::IOAddress, uint8_t> pair = subnet->get();
756 addrs.push_back(pair.first);
767 const Lease6& first_lease = *(*leases.begin());
769 cd_option->addOption(opt);
772 time_t now = time(0);
774 if (first_lease.
cltt_ < now) {
775 elapsed = now - first_lease.
cltt_;
783 cd_option->addOption(opt);
787 for (
auto const& lease : leases) {
788 if (lease->cltt_ < now) {
789 elapsed = now - lease->cltt_;
796 uint32_t preferred = lease->preferred_lft_;
797 if (elapsed < preferred) {
798 preferred -= elapsed;
801 uint32_t valid = lease->valid_lft_;
802 if (elapsed < valid) {
813 lease->addr_, lease->prefixlen_,
817 cd_option->addOption(lease_opt);
830 cd_option->addOption(opt);
833 time_t now = time(0);
835 if (lease->cltt_ < now) {
836 elapsed = now - lease->cltt_;
844 cd_option->addOption(opt);
847 uint32_t preferred = lease->preferred_lft_;
848 if (elapsed < preferred) {
849 preferred -= elapsed;
852 uint32_t valid = lease->valid_lft_;
853 if (elapsed < valid) {
864 lease->addr_, lease->prefixlen_,
867 cd_option->addOption(lease_opt);
872 cd_option->addOption(relay_opt);
881 std::vector<RelayInfoPtr> relay_infos;
893 if (!extended_info) {
901 relay_info = extended_info->get(
"relays");
909 if (relay_infos.empty()) {
914 }
catch (
const std::exception& ex) {
926 rd_option->writeAddress(relay_infos.front()->peeraddr_, 0);
929 size_t innermost = relay_infos.size() - 1;
934 for (
size_t i = relay_infos.size(); i > 0; --i) {
935 relay_infos[i - 1]->relay_msg_len_ = len;
941 + relay_infos[0]->relay_msg_len_);
943 for (
size_t i = 0; i < relay_infos.size(); ++i) {
949 buffer_out.
writeData(&(relay->linkaddr_.toBytes()[0]),
950 isc::asiolink::V6ADDRESS_LEN);
951 buffer_out.
writeData(&relay->peeraddr_.toBytes()[0],
952 isc::asiolink::V6ADDRESS_LEN);
955 for (
auto const& opt : relay->options_) {
956 (opt.second)->pack(buffer_out);
971 rd_option->writeBinary(relay_buffer, 1);
985 for (
auto const& opt : relay.
options_) {
986 len += (opt.second)->len();
994 std::vector<RelayInfoPtr>& relay_infos) {
996 isc_throw(
BadValue,
"parseRelayInfoList: relay-info element empty or not a list");
999 for (
auto const& relay : relay_info->listValue()) {
1001 relay_infos.push_back(
info);
1007 if (!relay_elem || (relay_elem->getType() !=
Element::map)) {
1012 auto elem = relay_elem->get(
"hop");
1018 relay_info->hop_count_ =
static_cast<uint8_t
>(elem->intValue());
1019 }
catch (
const std::exception& ex) {
1023 elem = relay_elem->get(
"peer");
1029 relay_info->peeraddr_ =
IOAddress(elem->stringValue());
1030 if (!relay_info->peeraddr_.isV6()) {
1033 }
catch (
const std::exception& ex) {
1037 elem = relay_elem->get(
"link");
1043 relay_info->linkaddr_ =
IOAddress(elem->stringValue());
1044 if (!relay_info->linkaddr_.isV6()) {
1047 }
catch (
const std::exception& ex) {
1052 elem = relay_elem->get(
"options");
1055 std::string hex_str = elem->stringValue();
1060 relay_info->options_));
1061 }
catch (
const std::exception& ex) {
1066 return (relay_info);
1072 if (client_server_id) {
1075 client_duid.reset(
new DUID(client_server_id->getData()));
1076 }
catch (
const std::exception& ex) {
1078 static_cast<int64_t
>(1));
1086 static_cast<int64_t
>(1));
1088 }
else if (*client_duid != *server_id) {
1090 static_cast<int64_t
>(1));
1092 << query->getRemoteAddr() <<
", unknown server-id: "
1093 << (client_server_id ? client_server_id->toText() :
"malformed"));
1105 }
catch (
const std::exception& ex) {
1116 .arg(response->getRemoteAddr())
1117 .arg(response->getRemotePort());
1121 static_cast<int64_t
>(1));
1122 }
catch (
const std::exception& ex) {
1125 .arg(response->getIface())
1126 .arg(response->getRemoteAddr())
1127 .arg(response->getRemotePort())
1138 const std::string message) {
1145 std::stringstream label;
1148 DuidPtr client_id = packet->getClientId();
1149 label <<
"type: " << packet->getName()
1150 <<
", client id: " << (client_id ? client_id->toText() :
"<none>")
1151 <<
", requester: " << packet->getRemoteAddr()
1152 <<
", transid: " << packet->getTransid();
1154 }
catch (
const std::exception& ex) {
1156 label <<
"label error" << ex.what();
1159 return (label.str());
1165 size_t upgraded = 0;
1171 upgraded = lease_mgr.upgradeExtendedInfo6(page_size);
1172 }
catch (
const std::exception& ex) {
1180 std::ostringstream msg;
1181 msg <<
"Upgraded " << upgraded <<
" lease";
1182 if (upgraded != 1) {
1198 for (
auto const& subnet : *subnets) {
1200 for (
auto const& pool : pools) {
1201 Pool6Ptr p6 = boost::dynamic_pointer_cast<Pool6>(pool);
1213 std::ostringstream oss;
1216 auto first_one =
true;
1217 for (
auto const& it : boost::adaptors::reverse(prefix_lengths)) {
1224 oss <<
" " <<
static_cast<int>(it);
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A generic exception that is thrown when an unexpected error condition occurs.
The IOAddress class represents an IP addresses (version agnostic)
std::string toText() const
Convert the address to a string.
std::vector< uint8_t > toBytes() const
Return address as set of bytes.
bool isV6Zero() const
Convenience function to check if it is an IPv4 zero address.
short getFamily() const
Returns the address family.
static const IOAddress & IPV6_ZERO_ADDRESS()
Returns an IPv6 zero address.
static IOAddress fromBytes(short family, const uint8_t *data)
Creates an address from over wire data.
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
Holds DUID (DHCPv6 Unique Identifier)
static IfaceMgr & instance()
IfaceMgr is a singleton class.
bool send(const Pkt6Ptr &pkt)
Sends an IPv6 packet.
static TrackingLeaseMgr & instance()
Return current lease manager.
virtual Lease6Collection getLeases6(Lease::Type type, const DUID &duid, uint32_t iaid) const =0
Returns existing IPv6 leases for a given DUID+IA combination.
virtual Lease6Collection getLeases6ByRelayId(const DUID &relay_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size)=0
Returns existing IPv6 leases with a given relay-id.
virtual Lease6Collection getLeases6ByRemoteId(const OptionBuffer &remote_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size)=0
Returns existing IPv6 leases with a given remote-id.
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const =0
Returns existing IPv6 lease for a given IPv6 address.
Wraps value holding size of the page with leases.
static const OptionDefinition & D6O_LQ_RELAY_DATA_DEF()
Get definition of D6O_LQ_RELAY_DATA option.
static const OptionDefinition & D6O_CLIENT_DATA_DEF()
Get definition of D6O_CLIENT_DATA option.
static size_t unpackOptions6(const OptionBuffer &buf, const std::string &option_space, isc::dhcp::OptionCollection &options, size_t *relay_msg_offset=0, size_t *relay_msg_len=0)
Parses provided buffer as DHCPv6 options and creates Option objects.
DHCPv6 Option class for handling list of IPv6 addresses.
std::vector< isc::asiolink::IOAddress > AddressContainer
a container for (IPv6) addresses
Class that represents IAPREFIX option in DHCPv6.
This class represents Status Code option (13) from RFC 8415.
Option with defined data fields represented as buffers that can be accessed using data field index.
Base class representing a DHCP option definition.
static const size_t OPTION6_HDR_LEN
length of any DHCPv6 option header
Represents a DHCPv6 packet.
static const size_t DHCPV6_RELAY_HDR_LEN
specifies relay DHCPv6 packet header length (over UDP)
Per-packet callout handle.
void setArgument(const std::string &name, T value)
Set argument.
static BulkLeaseQueryServicePtr instance()
Returns a pointer to the sole instance of the BulkLeaseQueryService, can return null.
static void testServerId(const dhcp::Pkt6Ptr &query)
Validates the server-id of a received DHCPV6_LEASEQUERY.
static RelayInfoPtr parseRelayInfo(data::ConstElementPtr relay)
Converts an Element::map into an Pkt6::RelayInfo instance.
static void queryByRelayIdNext(const dhcp::DuidPtr &relay_id, asiolink::IOAddress &start_addr, const size_t page_size, const dhcp::SubnetIDSet &links, dhcp::Lease6Collection &leases)
Subsequent query for active leases matching a relay id (i.e.
static uint16_t getRelayOverhead(const dhcp::Pkt6::RelayInfo &relay, bool innermost)
Calculates the packed size (in octets) of a given RelayInfo.
static asiolink::IOAddress getPrefixFromAddress(const asiolink::IOAddress &address, const uint8_t prefix_length)
Creates a prefix of a given length from an address.
void addPrefixLength(uint8_t prefix_len)
Add a prefix to the list of prefix lengths.
static dhcp::Pkt6Ptr initDone(const dhcp::Pkt6Ptr &query)
Creates the final query done response.
static std::string dumpPrefixLengthList(const PrefixLengthList &prefix_lengths)
Dump the given list of prefix lengths to a string.
static dhcp::Option6StatusCodePtr queryByRemoteIdStart(const dhcp::OptionBuffer &remote_id, asiolink::IOAddress &start_addr, const size_t page_size, const asiolink::IOAddress &link_addr, dhcp::SubnetIDSet &links, dhcp::Lease6Collection &leases)
Initial query for active leases matching a remote id.
LeaseQueryImpl6(const data::ConstElementPtr config)
Constructor.
void sendResponse(const dhcp::Pkt6Ptr &response) const
Sends a response to the requester.
static dhcp::Option6StatusCodePtr queryByRelayIdStart(const dhcp::DuidPtr &relay_id, asiolink::IOAddress &start_addr, const size_t page_size, const asiolink::IOAddress &link_addr, dhcp::SubnetIDSet &links, dhcp::Lease6Collection &leases)
Initial query for active leases matching a relay id (i.e.
PrefixLengthList prefix_lens_
List of PD prefix lengths to use when searching for leases by address.
static dhcp::Option6StatusCodePtr makeStatusOption(const DHCPv6StatusCode &status_code, const std::string message="")
Constructs a D6O_STATUS_CODE option.
static dhcp::Option6StatusCodePtr queryByLinkStart(asiolink::IOAddress &start_addr, const size_t page_size, const asiolink::IOAddress &link_addr, dhcp::SubnetIDSet &links, dhcp::Lease6Collection &leases)
Initial query for active leases of a given link.
static dhcp::OptionPtr makeClientOption(dhcp::Lease6Collection &leases)
Constructs a client option based on a collection of leases.
void clearPrefixLengthList()
Empty the prefix length list.
static dhcp::OptionPtr makeRelayOption(const dhcp::Lease6 &lease)
Constructs a D6O_LQ_RELAY_DATA option from a lease user-context.
static std::string leaseQueryLabel(const dhcp::Pkt6Ptr &packet)
Convenience method for generating per packet logging info.
static dhcp::Option6StatusCodePtr queryByIpAddress(const asiolink::IOAddress &iaaddr, dhcp::Lease6Collection &leases, const PrefixLengthList &prefix_lengths=PrefixLengthList())
Queries for an active lease matching an ip address.
virtual void send(const dhcp::Pkt6Ptr &response) const
Wrapper around the call to IfaceMgr::send().
static dhcp::Pkt6Ptr buildReply(const dhcp::Option6StatusCodePtr &status, const dhcp::Pkt6Ptr &query, dhcp::Lease6Collection &leases)
Creates a lease query reply packet.
static void queryByLinkNext(asiolink::IOAddress &start_addr, const size_t page_size, dhcp::SubnetIDSet &links, dhcp::Lease6Collection &leases)
Subsequent query for active leases of a given link.
virtual void processQuery(isc::dhcp::PktPtr base_query, bool &invalid) const
Processes a single DHCPv6 client Lease Query.
static dhcp::Pkt6Ptr initReply(const dhcp::Pkt6Ptr &query)
Creates the initial query reply.
void populatePrefixLengthList(dhcp::SrvConfigPtr cfg)
Populates the prefix length list from the given configuration.
static dhcp::Option6StatusCodePtr queryByClientId(const dhcp::DuidPtr &client_id, const asiolink::IOAddress &link_addr, dhcp::Lease6Collection &leases)
Queries for active leases matching a client id (i.e.
static void parseRelayInfoList(data::ConstElementPtr relays, std::vector< RelayInfoPtr > &relay_infos)
Converts an Element::list into a list of Pkt6::RelayInfo instances.
static void queryByRemoteIdNext(const dhcp::OptionBuffer &remote_id, asiolink::IOAddress &start_addr, const size_t page_size, const dhcp::SubnetIDSet &links, dhcp::Lease6Collection &leases)
Subsequent query for active leases matching a remote id.
bool build_prefix_lens_
True if the prefix length should be gleaned from configured pools.
static int upgradeHandler(hooks::CalloutHandle &handle)
Upgrade extended information.
static dhcp::Pkt6Ptr initData(const dhcp::Pkt6Ptr &query)
Creates the query data response.
LeaseQueryImpl(uint16_t family, const isc::data::ConstElementPtr config)
Constructor.
bool isRequester(const isc::asiolink::IOAddress &address) const
Checks if the given address belongs to a valid requester.
static size_t PageSize
Page size to commands.
static StatsMgr & instance()
Statistics Manager accessor method.
RAII class creating a critical section.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void writeUint8(uint8_t data)
Write an unsigned 8-bit integer into the buffer.
void writeUint16(uint16_t data)
Write an unsigned 16-bit integer in host byte order into the buffer in network byte order.
void writeData(const void *data, size_t len)
Copy an arbitrary length of data into the buffer.
const std::vector< uint8_t > & getVector() const
Return the buffer.
This file contains several functions and constants that are used for handling commands and responses ...
@ STATUS_UnknownQueryType
@ DHCPV6_LEASEQUERY_REPLY
#define LQ6QT_BY_CLIENTID
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
OptionInt< uint32_t > OptionUint32
void addValue(const std::string &name, const int64_t value)
Records incremental integer observation.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< isc::dhcp::Pkt > PktPtr
A pointer to either Pkt4 or Pkt6 packet.
std::set< dhcp::SubnetID > SubnetIDSet
Ordered list aka set of subnetIDs.
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
boost::shared_ptr< OptionCustom > OptionCustomPtr
A pointer to the OptionCustom object.
boost::shared_ptr< DUID > DuidPtr
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
boost::multi_index_container< Subnet6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > > > Subnet6Collection
A collection of Subnet6 objects.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
std::vector< PoolPtr > PoolCollection
a container for either IPv4 or IPv6 Pools
boost::shared_ptr< Option6AddrLst > Option6AddrLstPtr
Pointer to the Option6AddrLst object.
boost::shared_ptr< CfgSubnets6 > CfgSubnets6Ptr
Non-const pointer.
boost::shared_ptr< Option6StatusCode > Option6StatusCodePtr
Pointer to the isc::dhcp::Option6StatusCode.
boost::shared_ptr< Option6IAAddr > Option6IAAddrPtr
A pointer to the isc::dhcp::Option6IAAddr object.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
boost::shared_ptr< Option > OptionPtr
boost::shared_ptr< Pool6 > Pool6Ptr
a pointer an IPv6 Pool
const isc::log::MessageID DHCP6_LEASE_QUERY_REPLY_SENT
std::set< uint8_t > PrefixLengthList
Defines an ordered list of prefix lengths.
boost::shared_ptr< dhcp::Pkt6::RelayInfo > RelayInfoPtr
Defines a shared pointer to a Pkt6::RelayInfo.
const isc::log::MessageID DHCP6_LEASE_QUERY_PACKET_PACK_FAILED
const isc::log::MessageID DHCP6_LEASE_QUERY_REPLY_SEND_FAILED
const isc::log::MessageID DHCP6_LEASE_QUERY_PREFIX_LENGTH_LIST
isc::log::Logger lease_query_logger("lease-query-hooks")
const isc::log::MessageID DHCP6_LEASE_QUERY_ERROR_GETTING_RELAY_INFO
const int DBGLVL_TRACE_BASIC
Trace basic operations.
void decodeFormattedHexString(const string &hex_string, vector< uint8_t > &binary)
Converts a formatted string of hexadecimal digits into a vector.
Defines the logger used by the top-level component of kea-lfc.
#define DHCP6_OPTION_SPACE
data::ConstElementPtr getContext() const
Returns const pointer to the user context.
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy an Element map.
Structure that holds a lease for IPv6 address and/or prefix.
virtual std::string toText() const
Convert Lease to Printable Form.
DuidPtr duid_
Client identifier.
static const uint32_t STATE_DEFAULT
A lease in the default state.
@ TYPE_PD
the lease contains IPv6 prefix (for prefix delegation)
@ TYPE_NA
the lease contains non-temporary IPv6 address
time_t cltt_
Client last transmission time.
structure that describes a single relay information
isc::dhcp::OptionCollection options_
options received from a specified relay, except relay-msg option