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();
 
  110    IOAddress requester_ip = query->getRemoteAddr();
 
  119                 "rejecting DHCPV6_LEASEQUERY from unauthorized requester: " 
  120                  << requester_ip.
toText());
 
  134        query_type = lq_option->readInteger<uint8_t>(0);
 
  135        query_link_addr = lq_option->readAddress(1);
 
  136    } 
catch (
const std::exception& ex) {
 
  145    switch (query_type) {
 
  167            query_client_id.reset(
new DUID(opt->getData()));
 
  168        } 
catch (
const std::exception& ex) {
 
  173        status_opt = 
queryByClientId(query_client_id, query_link_addr, leases);
 
 
  195    if (prefix_length == 0 || prefix_length > 128) {
 
  196        isc_throw(
BadValue, 
"getPrefixFromAddress() - invalid prefix length:" << prefix_length);
 
  200    auto address_bytes = address.
toBytes();
 
  203    auto keep_bytes = prefix_length / 8;
 
  204    std::vector<uint8_t> prefix_bytes(address_bytes.begin(), address_bytes.begin() + keep_bytes);
 
  207    auto keep_bits = prefix_length % 8;
 
  209    static uint8_t masks[] = { 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
 
  211        prefix_bytes.push_back(address_bytes[keep_bytes] & masks[keep_bits - 1]);
 
  215    prefix_bytes.insert(prefix_bytes.end(), 16 - prefix_bytes.size(), 0);
 
 
  227    if (!lease && prefix_lengths.size()) {
 
  229        for (
auto const& it : boost::adaptors::reverse(prefix_lengths)) {
 
  241            leases.push_back(lease);
 
  255    for (
auto const& subnet : *subnets) {
 
 
  275        links = subnets->getLinks(link_addr);
 
  288    if (!found_leases.empty()) {
 
  289        for (
auto const& lease : found_leases) {
 
  292                if (!links.empty() && !links.count(lease->subnet_id_)) {
 
  297                leases.push_back(lease);
 
  302    if (!leases.empty()) {
 
  304        std::sort(leases.begin(), leases.end(), cltt_descending);
 
 
  314                                     const size_t page_size,
 
  322        links = subnets->getLinks(link_addr);
 
  339        if (found_leases.empty()) {
 
  343        start_addr = found_leases.back()->addr_;
 
  344        for (
auto const& lease : found_leases) {
 
  347                if (!links.empty() && !links.count(lease->subnet_id_)) {
 
  352                leases.push_back(lease);
 
  356        if (!leases.empty()) {
 
 
  365                                    const size_t page_size,
 
  375    if (found_leases.empty()) {
 
  380    start_addr = found_leases.back()->addr_;
 
  381    if (start_addr == seen) {
 
  384    for (
auto const& lease : found_leases) {
 
  385        if (lease->addr_ == seen) {
 
  390            if (!links.empty() && !links.count(lease->subnet_id_)) {
 
  396        leases.push_back(lease);
 
 
  403                                      const size_t page_size,
 
  411        links = subnets->getLinks(link_addr);
 
  428        if (found_leases.empty()) {
 
  432        start_addr = found_leases.back()->addr_;
 
  433        for (
auto const& lease : found_leases) {
 
  436                if (!links.empty() && !links.count(lease->subnet_id_)) {
 
  441                leases.push_back(lease);
 
  445        if (!leases.empty()) {
 
 
  454                                     const size_t page_size,
 
  464    if (found_leases.empty()) {
 
  469    start_addr = found_leases.back()->addr_;
 
  470    if (start_addr == seen) {
 
  473    for (
auto const& lease : found_leases) {
 
  474        if (lease->addr_ == seen) {
 
  479            if (!links.empty() && !links.count(lease->subnet_id_)) {
 
  485        leases.push_back(lease);
 
 
  491                                  const size_t page_size,
 
  501    links = subnets->getLinks(link_addr);
 
  510        auto it = links.begin();
 
  511        if (it == links.end()) {
 
  524            if (found_leases.empty()) {
 
  532            start_addr = found_leases.back()->addr_;
 
  533            for (
auto const& lease : found_leases) {
 
  537                    leases.push_back(lease);
 
  540            if (!leases.empty()) {
 
 
  549                                 const size_t page_size,
 
  557        auto it = links.begin();
 
  558        if (it == links.end()) {
 
  570            if (found_leases.empty()) {
 
  579            start_addr = found_leases.back()->addr_;
 
  580            if (start_addr == seen) {
 
  583            for (
auto const& lease : found_leases) {
 
  584                if (lease->addr_ == seen) {
 
  590                    leases.push_back(lease);
 
  593            if (!leases.empty()) {
 
 
  610    switch (status->getStatusCode()) {
 
  616            if (!leases.empty()) {
 
  619                reply->addOption(client_opt);
 
  627                        reply->addOption(opt);
 
  637            reply->addOption(status);
 
  648            reply->addOption(status);
 
 
  665    reply->setRemoteAddr(query->getRemoteAddr());
 
  666    reply->setRemotePort(query->getRemotePort());
 
  667    reply->setLocalAddr(query->getLocalAddr());
 
  668    reply->setLocalPort(query->getLocalPort());
 
  669    reply->setIface(query->getIface());
 
  670    reply->setIndex(query->getIndex());
 
  672    DuidPtr duid = query->getClientId();
 
  678    reply->addOption(opt);
 
  681                        ->getCfgDUID()->getCurrentDuid();
 
  687    reply->addOption(opt);
 
 
  696    response->setRemoteAddr(query->getRemoteAddr());
 
  697    response->setRemotePort(query->getRemotePort());
 
 
  706    done->setRemoteAddr(query->getRemoteAddr());
 
  707    done->setRemotePort(query->getRemotePort());
 
 
  713    if (leases.empty()) {
 
  722    for (
auto const& lease : leases) {
 
  723        if (lease->subnet_id_) {
 
  725            static_cast<void>(links.insert(lease->subnet_id_));
 
  729    if (links.size() > 1) {
 
  732        for (
auto const& link : links) {
 
  734            std::pair<isc::asiolink::IOAddress, uint8_t> pair = subnet->get();
 
  735            addrs.push_back(pair.first);
 
  746    const Lease6& first_lease = *(*leases.begin());
 
  748    cd_option->addOption(opt);
 
  751    time_t now = time(0);
 
  753    if (first_lease.
cltt_ < now) {
 
  754        elapsed = now - first_lease.
cltt_;
 
  762    cd_option->addOption(opt);
 
  766    for (
auto const& lease : leases) {
 
  767        if (lease->cltt_ < now) {
 
  768            elapsed = now - lease->cltt_;
 
  775        uint32_t preferred = lease->preferred_lft_;
 
  776        if (elapsed < preferred) {
 
  777            preferred -= elapsed;
 
  780        uint32_t valid = lease->valid_lft_;
 
  781        if (elapsed < valid) {
 
  792                                                lease->addr_, lease->prefixlen_,
 
  796        cd_option->addOption(lease_opt);
 
 
  809    cd_option->addOption(opt);
 
  812    time_t now = time(0);
 
  814    if (lease->cltt_ < now) {
 
  815        elapsed = now - lease->cltt_;
 
  823    cd_option->addOption(opt);
 
  826    uint32_t preferred = lease->preferred_lft_;
 
  827    if (elapsed < preferred) {
 
  828        preferred -= elapsed;
 
  831    uint32_t valid = lease->valid_lft_;
 
  832    if (elapsed < valid) {
 
  843                                            lease->addr_, lease->prefixlen_,
 
  846    cd_option->addOption(lease_opt);
 
  851        cd_option->addOption(relay_opt);
 
 
  860    std::vector<RelayInfoPtr> relay_infos;
 
  872        if (!extended_info) {
 
  880            relay_info = extended_info->get(
"relays");
 
  888        if (relay_infos.empty()) {
 
  893    } 
catch (
const std::exception& ex) {
 
  905    rd_option->writeAddress(relay_infos.front()->peeraddr_, 0);
 
  908    size_t innermost = relay_infos.size() - 1;
 
  913    for (
size_t i = relay_infos.size(); i > 0; --i) {
 
  914        relay_infos[i - 1]->relay_msg_len_ = len;
 
  920                                       + relay_infos[0]->relay_msg_len_);
 
  922    for (
size_t i = 0; i < relay_infos.size(); ++i) {
 
  928        buffer_out.
writeData(&(relay->linkaddr_.toBytes()[0]),
 
  929                             isc::asiolink::V6ADDRESS_LEN);
 
  930        buffer_out.
writeData(&relay->peeraddr_.toBytes()[0],
 
  931                              isc::asiolink::V6ADDRESS_LEN);
 
  934        for (
auto const& opt : relay->options_) {
 
  935            (opt.second)->pack(buffer_out);
 
  950    rd_option->writeBinary(relay_buffer, 1);
 
 
  964    for (
auto const& opt : relay.
options_) {
 
  965        len += (opt.second)->len();
 
 
  973                                    std::vector<RelayInfoPtr>& relay_infos) {
 
  975        isc_throw(
BadValue, 
"parseRelayInfoList: relay-info element empty or not a list");
 
  978    for (
auto const& relay : relay_info->listValue()) {
 
  980        relay_infos.push_back(
info);
 
 
  986    if (!relay_elem || (relay_elem->getType() != 
Element::map)) {
 
  991    auto elem = relay_elem->get(
"hop");
 
  997        relay_info->hop_count_ = 
static_cast<uint8_t
>(elem->intValue());
 
  998    } 
catch (
const std::exception& ex) {
 
 1002    elem = relay_elem->get(
"peer");
 
 1008        relay_info->peeraddr_ = 
IOAddress(elem->stringValue());
 
 1009        if (!relay_info->peeraddr_.isV6()) {
 
 1012    } 
catch (
const std::exception& ex) {
 
 1016    elem = relay_elem->get(
"link");
 
 1022        relay_info->linkaddr_ = 
IOAddress(elem->stringValue());
 
 1023        if (!relay_info->linkaddr_.isV6()) {
 
 1026    } 
catch (
const std::exception& ex) {
 
 1031    elem = relay_elem->get(
"options");
 
 1034            std::string hex_str = elem->stringValue();
 
 1039                                                      relay_info->options_));
 
 1040        } 
catch (
const std::exception& ex) {
 
 1045    return (relay_info);
 
 
 1051    if (client_server_id) {
 
 1054            client_duid.reset(
new DUID(client_server_id->getData()));
 
 1055        } 
catch (
const std::exception& ex) {
 
 1063        } 
else if (*client_duid != *server_id) {
 
 1065                      << query->getRemoteAddr() << 
", unknown server-id: " 
 1066                      << (client_server_id ? client_server_id->toText() : 
"malformed"));
 
 
 1078    } 
catch (
const std::exception& ex) {
 
 1089                  .arg(response->getRemoteAddr())
 
 1090                  .arg(response->getRemotePort());
 
 1094                                      static_cast<int64_t
>(1));
 
 1095    } 
catch (
const std::exception& ex) {
 
 1098                  .arg(response->getIface())
 
 1099                  .arg(response->getRemoteAddr())
 
 1100                  .arg(response->getRemotePort())
 
 
 1111                                  const std::string message) {
 
 
 1118    std::stringstream label;
 
 1121        DuidPtr client_id = packet->getClientId();
 
 1122        label << 
"type: " << packet->getName()
 
 1123              << 
", client id: " << (client_id ? client_id->toText() : 
"<none>")
 
 1124              << 
", requester: " << packet->getRemoteAddr()
 
 1125              << 
", transid: " << packet->getTransid();
 
 1127    } 
catch (
const std::exception& ex) {
 
 1129        label << 
"label error" << ex.what();
 
 1132    return (label.str());
 
 
 1138    size_t upgraded = 0;
 
 1144        upgraded = lease_mgr.upgradeExtendedInfo6(page_size);
 
 1145    } 
catch (
const std::exception& ex) {
 
 1153    std::ostringstream msg;
 
 1154    msg << 
"Upgraded " << upgraded << 
" lease";
 
 1155    if (upgraded != 1) {
 
 
 1171        for (
auto const& subnet : *subnets) {
 
 1173            for (
auto const& pool : pools) {
 
 1174                Pool6Ptr p6 = boost::dynamic_pointer_cast<Pool6>(pool);
 
 
 1186    std::ostringstream oss;
 
 1189    auto first_one = 
true;
 
 1190    for (
auto const& it : boost::adaptors::reverse(prefix_lengths)) {
 
 1197        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.
virtual void processQuery(dhcp::PktPtr base_query) const
Processes a single DHCPv6 client Lease Query.
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.
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