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) {
758 std::pair<isc::asiolink::IOAddress, uint8_t> pair = subnet->get();
759 addrs.push_back(pair.first);
770 const Lease6& first_lease = *(*leases.begin());
772 cd_option->addOption(opt);
775 time_t now = time(0);
777 if (first_lease.
cltt_ < now) {
778 elapsed = now - first_lease.
cltt_;
786 cd_option->addOption(opt);
790 for (
auto const& lease : leases) {
791 if (lease->cltt_ < now) {
792 elapsed = now - lease->cltt_;
799 uint32_t preferred = lease->preferred_lft_;
800 if (elapsed < preferred) {
801 preferred -= elapsed;
804 uint32_t valid = lease->valid_lft_;
805 if (elapsed < valid) {
816 lease->addr_, lease->prefixlen_,
820 cd_option->addOption(lease_opt);
833 cd_option->addOption(opt);
836 time_t now = time(0);
838 if (lease->cltt_ < now) {
839 elapsed = now - lease->cltt_;
847 cd_option->addOption(opt);
850 uint32_t preferred = lease->preferred_lft_;
851 if (elapsed < preferred) {
852 preferred -= elapsed;
855 uint32_t valid = lease->valid_lft_;
856 if (elapsed < valid) {
867 lease->addr_, lease->prefixlen_,
870 cd_option->addOption(lease_opt);
875 cd_option->addOption(relay_opt);
884 std::vector<RelayInfoPtr> relay_infos;
896 if (!extended_info) {
904 relay_info = extended_info->get(
"relays");
912 if (relay_infos.empty()) {
917 }
catch (
const std::exception& ex) {
929 rd_option->writeAddress(relay_infos.front()->peeraddr_, 0);
932 size_t innermost = relay_infos.size() - 1;
937 for (
size_t i = relay_infos.size(); i > 0; --i) {
938 relay_infos[i - 1]->relay_msg_len_ = len;
944 + relay_infos[0]->relay_msg_len_);
946 for (
size_t i = 0; i < relay_infos.size(); ++i) {
952 buffer_out.
writeData(&(relay->linkaddr_.toBytes()[0]),
953 isc::asiolink::V6ADDRESS_LEN);
954 buffer_out.
writeData(&relay->peeraddr_.toBytes()[0],
955 isc::asiolink::V6ADDRESS_LEN);
958 for (
auto const& opt : relay->options_) {
959 (opt.second)->pack(buffer_out);
974 rd_option->writeBinary(relay_buffer, 1);
988 for (
auto const& opt : relay.
options_) {
989 len += (opt.second)->len();
997 std::vector<RelayInfoPtr>& relay_infos) {
999 isc_throw(
BadValue,
"parseRelayInfoList: relay-info element empty or not a list");
1002 for (
auto const& relay : relay_info->listValue()) {
1004 relay_infos.push_back(
info);
1010 if (!relay_elem || (relay_elem->getType() !=
Element::map)) {
1015 auto elem = relay_elem->get(
"hop");
1021 relay_info->hop_count_ =
static_cast<uint8_t
>(elem->intValue());
1022 }
catch (
const std::exception& ex) {
1026 elem = relay_elem->get(
"peer");
1032 relay_info->peeraddr_ =
IOAddress(elem->stringValue());
1033 if (!relay_info->peeraddr_.isV6()) {
1036 }
catch (
const std::exception& ex) {
1040 elem = relay_elem->get(
"link");
1046 relay_info->linkaddr_ =
IOAddress(elem->stringValue());
1047 if (!relay_info->linkaddr_.isV6()) {
1050 }
catch (
const std::exception& ex) {
1055 elem = relay_elem->get(
"options");
1058 std::string hex_str = elem->stringValue();
1063 relay_info->options_));
1064 }
catch (
const std::exception& ex) {
1069 return (relay_info);
1075 if (client_server_id) {
1078 client_duid.reset(
new DUID(client_server_id->getData()));
1079 }
catch (
const std::exception& ex) {
1081 static_cast<int64_t
>(1));
1089 static_cast<int64_t
>(1));
1091 }
else if (*client_duid != *server_id) {
1093 static_cast<int64_t
>(1));
1095 << query->getRemoteAddr() <<
", unknown server-id: "
1096 << (client_server_id ? client_server_id->toText() :
"malformed"));
1108 }
catch (
const std::exception& ex) {
1119 .arg(response->getRemoteAddr())
1120 .arg(response->getRemotePort());
1124 static_cast<int64_t
>(1));
1125 }
catch (
const std::exception& ex) {
1128 .arg(response->getIface())
1129 .arg(response->getRemoteAddr())
1130 .arg(response->getRemotePort())
1141 const std::string message) {
1148 std::stringstream label;
1151 DuidPtr client_id = packet->getClientId();
1152 label <<
"type: " << packet->getName()
1153 <<
", client id: " << (client_id ? client_id->toText() :
"<none>")
1154 <<
", requester: " << packet->getRemoteAddr()
1155 <<
", transid: " << packet->getTransid();
1157 }
catch (
const std::exception& ex) {
1159 label <<
"label error" << ex.what();
1162 return (label.str());
1168 size_t upgraded = 0;
1174 upgraded = lease_mgr.upgradeExtendedInfo6(page_size);
1175 }
catch (
const std::exception& ex) {
1183 std::ostringstream msg;
1184 msg <<
"Upgraded " << upgraded <<
" lease";
1185 if (upgraded != 1) {
1201 for (
auto const& subnet : *subnets) {
1203 for (
auto const& pool : pools) {
1204 Pool6Ptr p6 = boost::dynamic_pointer_cast<Pool6>(pool);
1216 std::ostringstream oss;
1219 auto first_one =
true;
1220 for (
auto const& it : boost::adaptors::reverse(prefix_lengths)) {
1227 oss <<
" " <<
static_cast<int>(it);
DUID(const std::vector< uint8_t > &data)
Constructor from vector.
Option6IAAddr(uint16_t type, const isc::asiolink::IOAddress &addr, uint32_t preferred, uint32_t valid)
Constructor, used for options constructed (during transmission).
Option6IAPrefix(uint16_t type, const isc::asiolink::IOAddress &addr, uint8_t prefix_length, uint32_t preferred, uint32_t valid)
Constructor, used for options constructed (during transmission).
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.
IOAddress(const std::string &address_str)
Constructor from string.
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.
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.
LeasePageSize(const size_t page_size)
Constructor.
static const OptionDefinition & D6O_LQ_RELAY_DATA_DEF()
Get definition of D6O_LQ_RELAY_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, size_t rec_level=0)
Parses provided buffer as DHCPv6 options and creates Option objects.
static const OptionDefinition & D6O_CLIENT_DATA_DEF()
Get definition of D6O_CLIENT_DATA option.
Option6AddrLst(uint16_t type, const AddressContainer &addrs)
Constructor used during option generation.
std::vector< isc::asiolink::IOAddress > AddressContainer
a container for (IPv6) addresses
Option6StatusCode(const uint16_t status_code, const std::string &status_message)
Constructor, used for options constructed (during transmission).
OptionCustom(const OptionDefinition &def, Universe u)
Constructor, used for options to be sent.
Base class representing a DHCP option definition.
static const size_t OPTION6_HDR_LEN
length of any DHCPv6 option header
Option(Universe u, uint16_t type)
ctor, used for options constructed, usually during transmission
Pkt6(uint8_t msg_type, uint32_t transid, DHCPv6Proto proto=UDP)
Constructor, used in replying to a message.
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(const int status_code, const std::string &text, const ConstElementPtr &arg)
Creates a standard config/command level answer message.
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 constexpr 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