Kea 2.7.1
cfg_subnets4.cc
Go to the documentation of this file.
1// Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#include <config.h>
8#include <dhcp/iface_mgr.h>
10#include <dhcpsrv/cfgmgr.h>
12#include <dhcpsrv/dhcpsrv_log.h>
15#include <dhcpsrv/subnet_id.h>
16#include <asiolink/io_address.h>
18#include <stats/stats_mgr.h>
19#include <sstream>
20
21using namespace isc::asiolink;
22using namespace isc::data;
23
24namespace isc {
25namespace dhcp {
26
27void
29 if (getBySubnetId(subnet->getID())) {
30 isc_throw(isc::dhcp::DuplicateSubnetID, "ID of the new IPv4 subnet '"
31 << subnet->getID() << "' is already in use");
32
33 } else if (getByPrefix(subnet->toText())) {
36 isc_throw(isc::dhcp::DuplicateSubnetID, "subnet with the prefix of '"
37 << subnet->toText() << "' already exists");
38 }
39
41 .arg(subnet->toText());
42 static_cast<void>(subnets_.insert(subnet));
43}
44
47 // Get the subnet with the same ID.
48 const SubnetID& subnet_id = subnet->getID();
49 auto& index = subnets_.template get<SubnetSubnetIdIndexTag>();
50 auto subnet_it = index.find(subnet_id);
51 if (subnet_it == index.end()) {
52 isc_throw(BadValue, "There is no IPv4 subnet with ID " <<subnet_id);
53 }
54 Subnet4Ptr old = *subnet_it;
55 bool ret = index.replace(subnet_it, subnet);
56
58 .arg(subnet_id).arg(ret);
59 if (ret) {
60 return (old);
61 } else {
62 return (Subnet4Ptr());
63 }
64}
65
66void
68 del(subnet->getID());
69}
70
71void
72CfgSubnets4::del(const SubnetID& subnet_id) {
73 auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
74 auto subnet_it = index.find(subnet_id);
75 if (subnet_it == index.end()) {
76 isc_throw(BadValue, "no subnet with ID of '" << subnet_id
77 << "' found");
78 }
79
80 Subnet4Ptr subnet = *subnet_it;
81
82 index.erase(subnet_it);
83
85 .arg(subnet->toText());
86}
87
88void
90 CfgSubnets4& other) {
91 auto& index_id = subnets_.get<SubnetSubnetIdIndexTag>();
92 auto& index_prefix = subnets_.get<SubnetPrefixIndexTag>();
93
94 // Iterate over the subnets to be merged. They will replace the existing
95 // subnets with the same id. All new subnets will be inserted into the
96 // configuration into which we're merging.
97 auto const& other_subnets = other.getAll();
98 for (auto const& other_subnet : (*other_subnets)) {
99
100 // Check if there is a subnet with the same ID.
101 auto subnet_id_it = index_id.find(other_subnet->getID());
102 if (subnet_id_it != index_id.end()) {
103
104 // Subnet found.
105 auto existing_subnet = *subnet_id_it;
106
107 // If the existing subnet and other subnet
108 // are the same instance skip it.
109 if (existing_subnet == other_subnet) {
110 continue;
111 }
112
113 // Updating the prefix can lead to problems... e.g. pools
114 // and reservations going outside range.
115 // @todo: check prefix change.
116
117 // We're going to replace the existing subnet with the other
118 // version. If it belongs to a shared network, we need
119 // remove it from that network.
120 SharedNetwork4Ptr network;
121 existing_subnet->getSharedNetwork(network);
122 if (network) {
123 network->del(existing_subnet->getID());
124 }
125
126 // Now we remove the existing subnet.
127 index_id.erase(subnet_id_it);
128 }
129
130 // Check if there is a subnet with the same prefix.
131 auto subnet_prefix_it = index_prefix.find(other_subnet->toText());
132 if (subnet_prefix_it != index_prefix.end()) {
133
134 // Subnet found.
135 auto existing_subnet = *subnet_prefix_it;
136
137 // Updating the id can lead to problems... e.g. reservation
138 // for the previous subnet ID.
139 // @todo: check reservations
140
141 // We're going to replace the existing subnet with the other
142 // version. If it belongs to a shared network, we need
143 // remove it from that network.
144 SharedNetwork4Ptr network;
145 existing_subnet->getSharedNetwork(network);
146 if (network) {
147 network->del(existing_subnet->getID());
148 }
149
150 // Now we remove the existing subnet.
151 index_prefix.erase(subnet_prefix_it);
152 }
153
154 // Create the subnet's options based on the given definitions.
155 other_subnet->getCfgOption()->createOptions(cfg_def);
156
157 // Encapsulate options, so that the DHCP server can effectively return
158 // them to the clients without having to encapsulate them for each request.
159 other_subnet->getCfgOption()->encapsulate();
160
161 // Create the options for pool based on the given definitions.
162 for (auto const& pool : other_subnet->getPoolsWritable(Lease::TYPE_V4)) {
163 pool->getCfgOption()->createOptions(cfg_def);
164 pool->getCfgOption()->encapsulate();
165 }
166
167 // Add the "other" subnet to the our collection of subnets.
168 static_cast<void>(subnets_.insert(other_subnet));
169
170 // If it belongs to a shared network, find the network and
171 // add the subnet to it
172 std::string network_name = other_subnet->getSharedNetworkName();
173 if (!network_name.empty()) {
174 SharedNetwork4Ptr network = networks->getByName(network_name);
175 if (network) {
176 network->add(other_subnet);
177 } else {
178 // This implies the shared-network collection we were given
179 // is out of sync with the subnets we were given.
180 isc_throw(InvalidOperation, "Cannot assign subnet ID of "
181 << other_subnet->getID()
182 << " to shared network: " << network_name
183 << ", network does not exist");
184 }
185 }
186 // Instantiate the configured allocator and its state.
187 other_subnet->createAllocators();
188 }
189}
190
192CfgSubnets4::getByPrefix(const std::string& subnet_text) const {
193 auto const& index = subnets_.get<SubnetPrefixIndexTag>();
194 auto subnet_it = index.find(subnet_text);
195 return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
196}
197
198bool
200 auto const& index = subnets_.get<SubnetServerIdIndexTag>();
201 auto subnet_it = index.find(server_id);
202 return (subnet_it != index.cend());
203}
204
207 SubnetSelector selector;
208 selector.ciaddr_ = query->getCiaddr();
209 selector.giaddr_ = query->getGiaddr();
210 selector.local_address_ = query->getLocalAddr();
211 selector.remote_address_ = query->getRemoteAddr();
212 selector.client_classes_ = query->classes_;
213 selector.iface_name_ = query->getIface();
214
215 // If the link-selection sub-option is present, extract its value.
216 // "The link-selection sub-option is used by any DHCP relay agent
217 // that desires to specify a subnet/link for a DHCP client request
218 // that it is relaying but needs the subnet/link specification to
219 // be different from the IP address the DHCP server should use
220 // when communicating with the relay agent." (RFC 3527)
221 //
222 // Try first Relay Agent Link Selection sub-option
223 OptionPtr rai = query->getOption(DHO_DHCP_AGENT_OPTIONS);
224 if (rai) {
225 OptionCustomPtr rai_custom =
226 boost::dynamic_pointer_cast<OptionCustom>(rai);
227 if (rai_custom) {
228 // If Relay Agent Information Link Selection is ignored in the
229 // configuration, skip returning the related subnet selector here,
230 // and move on to normal subnet selection.
231 bool ignore_link_sel = CfgMgr::instance().getCurrentCfg()->
232 getIgnoreRAILinkSelection();
233 if (!ignore_link_sel) {
234 OptionPtr link_select =
235 rai_custom->getOption(RAI_OPTION_LINK_SELECTION);
236 if (link_select) {
237 OptionBuffer link_select_buf = link_select->getData();
238 if (link_select_buf.size() == sizeof(uint32_t)) {
239 selector.option_select_ =
240 IOAddress::fromBytes(AF_INET, &link_select_buf[0]);
241 return (selector);
242 }
243 }
244 }
245 }
246 }
247 // The query does not include a RAI option or that option does
248 // not contain the link-selection sub-option. Try subnet-selection
249 // option.
250 OptionPtr sbnsel = query->getOption(DHO_SUBNET_SELECTION);
251 if (sbnsel) {
252 OptionCustomPtr oc =
253 boost::dynamic_pointer_cast<OptionCustom>(sbnsel);
254 if (oc) {
255 selector.option_select_ = oc->readAddress();
256 }
257 }
258 return (selector);
259}
260
263 for (auto const& subnet : subnets_) {
264 Cfg4o6& cfg4o6 = subnet->get4o6();
265
266 // Is this an 4o6 subnet at all?
267 if (!cfg4o6.enabled()) {
268 continue; // No? Let's try the next one.
269 }
270
271 // First match criteria: check if we have a prefix/len defined.
272 std::pair<asiolink::IOAddress, uint8_t> pref = cfg4o6.getSubnet4o6();
273 if (!pref.first.isV6Zero()) {
274
275 // Let's check if the IPv6 address is in range
276 IOAddress first = firstAddrInPrefix(pref.first, pref.second);
277 IOAddress last = lastAddrInPrefix(pref.first, pref.second);
278 if ((first <= selector.remote_address_) &&
279 (selector.remote_address_ <= last)) {
280 return (subnet);
281 }
282 }
283
284 // Second match criteria: check if the interface-id matches
285 if (cfg4o6.getInterfaceId() && selector.interface_id_ &&
286 cfg4o6.getInterfaceId()->equals(selector.interface_id_)) {
287 return (subnet);
288 }
289
290 // Third match criteria: check if the interface name matches
291 if (!cfg4o6.getIface4o6().empty() && !selector.iface_name_.empty()
292 && cfg4o6.getIface4o6() == selector.iface_name_) {
293 return (subnet);
294 }
295 }
296
298
299 // Ok, wasn't able to find any matching subnet.
300 return (Subnet4Ptr());
301}
302
305 // First use RAI link select sub-option or subnet select option
306 if (!selector.option_select_.isV4Zero()) {
307 return (selectSubnet(selector.option_select_,
308 selector.client_classes_));
309 } else {
312 }
313
314 // If relayed message has been received, try to match the giaddr with the
315 // relay address specified for a subnet and/or shared network. It is also
316 // possible that the relay address will not match with any of the relay
317 // addresses across all subnets, but we need to verify that for all subnets
318 // before we can try to use the giaddr to match with the subnet prefix.
319 if (!selector.giaddr_.isV4Zero()) {
320 for (auto const& subnet : subnets_) {
321
322 // If relay information is specified for this subnet, it must match.
323 // Otherwise, we ignore this subnet.
324 if (subnet->hasRelays()) {
325 if (!subnet->hasRelayAddress(selector.giaddr_)) {
326 continue;
327 }
328 } else {
329 // Relay information is not specified on the subnet level,
330 // so let's try matching on the shared network level.
331 SharedNetwork4Ptr network;
332 subnet->getSharedNetwork(network);
333 if (!network || !(network->hasRelayAddress(selector.giaddr_))) {
334 continue;
335 }
336 }
337
338 // If a subnet meets the client class criteria return it.
339 if (subnet->clientSupported(selector.client_classes_)) {
342 .arg(subnet->toText())
343 .arg(selector.giaddr_.toText());
344 return (subnet);
345 }
346 }
349 .arg(selector.giaddr_.toText());
350 } else {
353 }
354
355 // If we got to this point it means that we were not able to match the
356 // giaddr with any of the addresses specified for subnets. Let's determine
357 // what address from the client's packet to use to match with the
358 // subnets' prefixes.
359
361 // If there is a giaddr, use it for subnet selection.
362 if (!selector.giaddr_.isV4Zero()) {
363 address = selector.giaddr_;
364
365 // If it is a Renew or Rebind, use the ciaddr.
366 } else if (!selector.ciaddr_.isV4Zero() &&
367 !selector.local_address_.isV4Bcast()) {
368 address = selector.ciaddr_;
369
370 // If ciaddr is not specified, use the source address.
371 } else if (!selector.remote_address_.isV4Zero() &&
372 !selector.local_address_.isV4Bcast()) {
373 address = selector.remote_address_;
374
375 // If local interface name is known, use the local address on this
376 // interface.
377 } else if (!selector.iface_name_.empty()) {
378 IfacePtr iface = IfaceMgr::instance().getIface(selector.iface_name_);
379 // This should never happen in the real life. Hence we throw an
380 // exception.
381 if (iface == NULL) {
382 isc_throw(isc::BadValue, "interface " << selector.iface_name_
383 << " doesn't exist and therefore it is impossible"
384 " to find a suitable subnet for its IPv4 address");
385 }
386
387 // Attempt to select subnet based on the interface name.
388 Subnet4Ptr subnet = selectSubnet(selector.iface_name_,
389 selector.client_classes_);
390
391 // If it matches - great. If not, we'll try to use a different
392 // selection criteria below.
393 if (subnet) {
394 return (subnet);
395 } else {
396 // Let's try to get an address from the local interface and
397 // try to match it to defined subnet.
398 iface->getAddress4(address);
399 }
400 }
401
402 // Unable to find a suitable address to use for subnet selection.
403 if (address.isV4Zero()) {
406
407 return (Subnet4Ptr());
408 }
409
410 // We have identified an address in the client's packet that can be
411 // used for subnet selection. Match this packet with the subnets.
412 return (selectSubnet(address, selector.client_classes_));
413}
414
416CfgSubnets4::selectSubnet(const std::string& iface,
417 const ClientClasses& client_classes) const {
418 for (auto const& subnet : subnets_) {
419 Subnet4Ptr subnet_selected;
420
421 // First, try subnet specific interface name.
422 if (!subnet->getIface(Network4::Inheritance::NONE).empty()) {
423 if (subnet->getIface(Network4::Inheritance::NONE) == iface) {
424 subnet_selected = subnet;
425 }
426
427 } else {
428 // Interface not specified for a subnet, so let's try if
429 // we can match with shared network specific setting of
430 // the interface.
431 SharedNetwork4Ptr network;
432 subnet->getSharedNetwork(network);
433 if (network &&
434 (network->getIface(Network4::Inheritance::NONE) == iface)) {
435 subnet_selected = subnet;
436 }
437 }
438
439 if (subnet_selected) {
440 // If a subnet meets the client class criteria return it.
441 if (subnet_selected->clientSupported(client_classes)) {
444 .arg(subnet->toText())
445 .arg(iface);
446 return (subnet_selected);
447 }
448 }
449 }
450
453 .arg(iface);
454
455 // Failed to find a subnet.
456 return (Subnet4Ptr());
457}
458
460CfgSubnets4::getSubnet(const SubnetID subnet_id) const {
461 auto const& index = subnets_.get<SubnetSubnetIdIndexTag>();
462 auto subnet_it = index.find(subnet_id);
463 return ((subnet_it != index.cend()) ? (*subnet_it) : Subnet4Ptr());
464}
465
468 const ClientClasses& client_classes) const {
469 for (auto const& subnet : subnets_) {
470
471 // Address is in range for the subnet prefix, so return it.
472 if (!subnet->inRange(address)) {
473 continue;
474 }
475
476 // If a subnet meets the client class criteria return it.
477 if (subnet->clientSupported(client_classes)) {
479 .arg(subnet->toText())
480 .arg(address.toText());
481 return (subnet);
482 }
483 }
484
487 .arg(address.toText());
488
489 // Failed to find a subnet.
490 return (Subnet4Ptr());
491}
492
494CfgSubnets4::getLinks(const IOAddress& link_addr) const {
495 SubnetIDSet links;
496 for (auto const& subnet : subnets_) {
497 if (!subnet->inRange(link_addr)) {
498 continue;
499 }
500 links.insert(subnet->getID());
501 }
502 return (links);
503}
504
505void
507 using namespace isc::stats;
508
509 // For each v4 subnet currently configured, remove the statistic.
510 StatsMgr& stats_mgr = StatsMgr::instance();
511 for (auto const& subnet4 : subnets_) {
512 SubnetID subnet_id = subnet4->getID();
513 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
514 "total-addresses"));
515
516 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
517 "assigned-addresses"));
518
519 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
520 "cumulative-assigned-addresses"));
521
522 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
523 "declined-addresses"));
524
525 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
526 "reclaimed-declined-addresses"));
527
528 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
529 "reclaimed-leases"));
530
531 for (auto const& pool : subnet4->getPools(Lease::TYPE_V4)) {
532 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
533 StatsMgr::generateName("pool", pool->getID(),
534 "total-addresses")));
535
536 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
537 StatsMgr::generateName("pool", pool->getID(),
538 "assigned-addresses")));
539
540 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
541 StatsMgr::generateName("pool", pool->getID(),
542 "cumulative-assigned-addresses")));
543
544 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
545 StatsMgr::generateName("pool", pool->getID(),
546 "declined-addresses")));
547
548 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
549 StatsMgr::generateName("pool", pool->getID(),
550 "reclaimed-declined-addresses")));
551
552 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
553 StatsMgr::generateName("pool", pool->getID(),
554 "reclaimed-leases")));
555 }
556 }
557}
558
559void
561 using namespace isc::stats;
562
563 StatsMgr& stats_mgr = StatsMgr::instance();
564 for (auto const& subnet4 : subnets_) {
565 SubnetID subnet_id = subnet4->getID();
566
567 stats_mgr.setValue(StatsMgr::
568 generateName("subnet", subnet_id, "total-addresses"),
569 int64_t(subnet4->getPoolCapacity(Lease::TYPE_V4)));
570 const std::string& name(StatsMgr::generateName("subnet", subnet_id,
571 "cumulative-assigned-addresses"));
572 if (!stats_mgr.getObservation(name)) {
573 stats_mgr.setValue(name, static_cast<int64_t>(0));
574 }
575
576 const std::string& name_reuses(StatsMgr::generateName("subnet", subnet_id,
577 "v4-lease-reuses"));
578 if (!stats_mgr.getObservation(name_reuses)) {
579 stats_mgr.setValue(name_reuses, int64_t(0));
580 }
581
582 const std::string& name_conflicts(StatsMgr::generateName("subnet", subnet_id,
583 "v4-reservation-conflicts"));
584 if (!stats_mgr.getObservation(name_conflicts)) {
585 stats_mgr.setValue(name_conflicts, static_cast<int64_t>(0));
586 }
587
588 for (auto const& pool : subnet4->getPools(Lease::TYPE_V4)) {
589 const std::string& name_total(StatsMgr::generateName("subnet", subnet_id,
590 StatsMgr::generateName("pool", pool->getID(),
591 "total-addresses")));
592 if (!stats_mgr.getObservation(name_total)) {
593 stats_mgr.setValue(name_total, static_cast<int64_t>(pool->getCapacity()));
594 } else {
595 stats_mgr.addValue(name_total, static_cast<int64_t>(pool->getCapacity()));
596 }
597
598 const std::string& name_ca(StatsMgr::generateName("subnet", subnet_id,
599 StatsMgr::generateName("pool", pool->getID(),
600 "cumulative-assigned-addresses")));
601 if (!stats_mgr.getObservation(name_ca)) {
602 stats_mgr.setValue(name_ca, static_cast<int64_t>(0));
603 }
604 }
605 }
606
607 // Only recount the stats if we have subnets.
608 if (subnets_.begin() != subnets_.end()) {
609 LeaseMgrFactory::instance().recountLeaseStats4();
610 }
611}
612
613void
615 for (auto const& subnet : subnets_) {
616 subnet->initAllocatorsAfterConfigure();
617 }
618}
619
620void
622 subnets_.clear();
623}
624
628 // Iterate subnets
629 for (auto const& subnet : subnets_) {
630 result->add(subnet->toElement());
631 }
632 return (result);
633}
634
635} // end of namespace isc::dhcp
636} // end of namespace isc
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 if a function is called in a prohibited way.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
Definition data.cc:299
static CfgMgr & instance()
returns a single instance of Configuration Manager
Definition cfgmgr.cc:25
Holds subnets configured for the DHCPv4 server.
ConstSubnet4Ptr getBySubnetId(const SubnetID &subnet_id) const
Returns const pointer to a subnet identified by the specified subnet identifier.
SubnetIDSet getLinks(const asiolink::IOAddress &link_addr) const
Convert a link address into a link set.
void del(const ConstSubnet4Ptr &subnet)
Removes subnet from the configuration.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
void clear()
Clears all subnets from the configuration.
bool hasSubnetWithServerId(const asiolink::IOAddress &server_id) const
Checks if specified server identifier has been specified for any subnet.
ConstSubnet4Ptr getByPrefix(const std::string &subnet_prefix) const
Returns const pointer to a subnet which matches the specified prefix in the canonical form.
void updateStatistics()
Updates statistics.
void merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks4Ptr networks, CfgSubnets4 &other)
Merges specified subnet configuration into this configuration.
Subnet4Ptr selectSubnet4o6(const SubnetSelector &selector) const
Attempts to do subnet selection based on DHCP4o6 information.
Subnet4Ptr selectSubnet(const SubnetSelector &selector) const
Returns a pointer to the selected subnet.
Subnet4Ptr getSubnet(const SubnetID id) const
Returns subnet with specified subnet-id value.
Subnet4Ptr replace(const Subnet4Ptr &subnet)
Replaces subnet in the configuration.
void initAllocatorsAfterConfigure()
Calls initAllocatorsAfterConfigure for each subnet.
void add(const Subnet4Ptr &subnet)
Adds new subnet to the configuration.
void removeStatistics()
Removes statistics.
static SubnetSelector initSelector(const Pkt4Ptr &query)
Build selector from a client's message.
Container for storing client class names.
Definition classify.h:108
Exception thrown upon attempt to add subnet with an ID that belongs to the subnet that already exists...
Definition subnet_id.h:36
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:54
static TrackingLeaseMgr & instance()
Return current lease manager.
Statistics Manager class.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
Definition macros.h:14
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
isc::log::Logger dhcpsrv_logger("dhcpsrv")
DHCP server library Logger.
Definition dhcpsrv_log.h:56
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_BY_INTERFACE_NO_MATCH
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_BY_ADDRESS_NO_MATCH
const isc::log::MessageID DHCPSRV_CFGMGR_SUBNET4_IFACE
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
Definition subnet.h:458
std::set< dhcp::SubnetID > SubnetIDSet
Ordered list aka set of subnetIDs.
Definition subnet_id.h:43
const isc::log::MessageID DHCPSRV_CFGMGR_UPDATE_SUBNET4
const isc::log::MessageID DHCPSRV_CFGMGR_ADD_SUBNET4
@ DHO_DHCP_AGENT_OPTIONS
Definition dhcp4.h:151
@ DHO_SUBNET_SELECTION
Definition dhcp4.h:182
const isc::log::MessageID DHCPSRV_SUBNET4O6_SELECT_FAILED
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
Definition subnet.h:455
boost::shared_ptr< OptionCustom > OptionCustomPtr
A pointer to the OptionCustom object.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
Definition pkt4.h:555
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< Iface > IfacePtr
Type definition for the pointer to an Iface object.
Definition iface_mgr.h:487
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_NO_RELAY_ADDRESS
const isc::log::MessageID DHCPSRV_CFGMGR_DEL_SUBNET4
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_NO_USABLE_ADDRESS
const isc::log::MessageID DHCPSRV_CFGMGR_SUBNET4_ADDR
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_NO_RAI_OPTIONS
const isc::log::MessageID DHCPSRV_CFGMGR_SUBNET4_RELAY
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_BY_RELAY_ADDRESS_NO_MATCH
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
Definition option.h:24
boost::shared_ptr< CfgSharedNetworks4 > CfgSharedNetworks4Ptr
Pointer to the configuration of IPv4 shared networks.
@ RAI_OPTION_LINK_SELECTION
Definition dhcp4.h:269
boost::shared_ptr< SharedNetwork4 > SharedNetwork4Ptr
Pointer to SharedNetwork4 object.
const int DHCPSRV_DBG_TRACE
DHCP server library logging levels.
Definition dhcpsrv_log.h:26
boost::shared_ptr< Option > OptionPtr
Definition option.h:37
Defines the logger used by the top-level component of kea-lfc.
This structure contains information about DHCP4o6 (RFC7341)
Definition cfg_4o6.h:22
util::Optional< std::pair< asiolink::IOAddress, uint8_t > > getSubnet4o6() const
Returns prefix/len for the IPv6 subnet.
Definition cfg_4o6.h:58
@ TYPE_V4
IPv4 lease.
Definition lease.h:50
Tag for the index for searching by subnet prefix.
Definition subnet.h:777
Subnet selector used to specify parameters used to select a subnet.
asiolink::IOAddress ciaddr_
ciaddr from the client's message.
Tag for the index for searching by server identifier.
Definition subnet.h:780
Tag for the index for searching by subnet identifier.
Definition subnet.h:774