Kea 2.5.8
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 // Create the options for pool based on the given definitions.
158 for (auto const& pool : other_subnet->getPoolsWritable(Lease::TYPE_V4)) {
159 pool->getCfgOption()->createOptions(cfg_def);
160 }
161
162 // Add the "other" subnet to the our collection of subnets.
163 static_cast<void>(subnets_.insert(other_subnet));
164
165 // If it belongs to a shared network, find the network and
166 // add the subnet to it
167 std::string network_name = other_subnet->getSharedNetworkName();
168 if (!network_name.empty()) {
169 SharedNetwork4Ptr network = networks->getByName(network_name);
170 if (network) {
171 network->add(other_subnet);
172 } else {
173 // This implies the shared-network collection we were given
174 // is out of sync with the subnets we were given.
175 isc_throw(InvalidOperation, "Cannot assign subnet ID of "
176 << other_subnet->getID()
177 << " to shared network: " << network_name
178 << ", network does not exist");
179 }
180 }
181 // Instantiate the configured allocator and its state.
182 other_subnet->createAllocators();
183 }
184}
185
187CfgSubnets4::getByPrefix(const std::string& subnet_text) const {
188 auto const& index = subnets_.get<SubnetPrefixIndexTag>();
189 auto subnet_it = index.find(subnet_text);
190 return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
191}
192
193bool
195 auto const& index = subnets_.get<SubnetServerIdIndexTag>();
196 auto subnet_it = index.find(server_id);
197 return (subnet_it != index.cend());
198}
199
202 SubnetSelector selector;
203 selector.ciaddr_ = query->getCiaddr();
204 selector.giaddr_ = query->getGiaddr();
205 selector.local_address_ = query->getLocalAddr();
206 selector.remote_address_ = query->getRemoteAddr();
207 selector.client_classes_ = query->classes_;
208 selector.iface_name_ = query->getIface();
209
210 // If the link-selection sub-option is present, extract its value.
211 // "The link-selection sub-option is used by any DHCP relay agent
212 // that desires to specify a subnet/link for a DHCP client request
213 // that it is relaying but needs the subnet/link specification to
214 // be different from the IP address the DHCP server should use
215 // when communicating with the relay agent." (RFC 3527)
216 //
217 // Try first Relay Agent Link Selection sub-option
218 OptionPtr rai = query->getOption(DHO_DHCP_AGENT_OPTIONS);
219 if (rai) {
220 OptionCustomPtr rai_custom =
221 boost::dynamic_pointer_cast<OptionCustom>(rai);
222 if (rai_custom) {
223 // If Relay Agent Information Link Selection is ignored in the
224 // configuration, skip returning the related subnet selector here,
225 // and move on to normal subnet selection.
226 bool ignore_link_sel = CfgMgr::instance().getCurrentCfg()->
227 getIgnoreRAILinkSelection();
228 if (!ignore_link_sel) {
229 OptionPtr link_select =
230 rai_custom->getOption(RAI_OPTION_LINK_SELECTION);
231 if (link_select) {
232 OptionBuffer link_select_buf = link_select->getData();
233 if (link_select_buf.size() == sizeof(uint32_t)) {
234 selector.option_select_ =
235 IOAddress::fromBytes(AF_INET, &link_select_buf[0]);
236 return (selector);
237 }
238 }
239 }
240 }
241 }
242 // The query does not include a RAI option or that option does
243 // not contain the link-selection sub-option. Try subnet-selection
244 // option.
245 OptionPtr sbnsel = query->getOption(DHO_SUBNET_SELECTION);
246 if (sbnsel) {
247 OptionCustomPtr oc =
248 boost::dynamic_pointer_cast<OptionCustom>(sbnsel);
249 if (oc) {
250 selector.option_select_ = oc->readAddress();
251 }
252 }
253 return (selector);
254}
255
258 for (auto const& subnet : subnets_) {
259 Cfg4o6& cfg4o6 = subnet->get4o6();
260
261 // Is this an 4o6 subnet at all?
262 if (!cfg4o6.enabled()) {
263 continue; // No? Let's try the next one.
264 }
265
266 // First match criteria: check if we have a prefix/len defined.
267 std::pair<asiolink::IOAddress, uint8_t> pref = cfg4o6.getSubnet4o6();
268 if (!pref.first.isV6Zero()) {
269
270 // Let's check if the IPv6 address is in range
271 IOAddress first = firstAddrInPrefix(pref.first, pref.second);
272 IOAddress last = lastAddrInPrefix(pref.first, pref.second);
273 if ((first <= selector.remote_address_) &&
274 (selector.remote_address_ <= last)) {
275 return (subnet);
276 }
277 }
278
279 // Second match criteria: check if the interface-id matches
280 if (cfg4o6.getInterfaceId() && selector.interface_id_ &&
281 cfg4o6.getInterfaceId()->equals(selector.interface_id_)) {
282 return (subnet);
283 }
284
285 // Third match criteria: check if the interface name matches
286 if (!cfg4o6.getIface4o6().empty() && !selector.iface_name_.empty()
287 && cfg4o6.getIface4o6() == selector.iface_name_) {
288 return (subnet);
289 }
290 }
291
293
294 // Ok, wasn't able to find any matching subnet.
295 return (Subnet4Ptr());
296}
297
300 // First use RAI link select sub-option or subnet select option
301 if (!selector.option_select_.isV4Zero()) {
302 return (selectSubnet(selector.option_select_,
303 selector.client_classes_));
304 } else {
307 }
308
309 // If relayed message has been received, try to match the giaddr with the
310 // relay address specified for a subnet and/or shared network. It is also
311 // possible that the relay address will not match with any of the relay
312 // addresses across all subnets, but we need to verify that for all subnets
313 // before we can try to use the giaddr to match with the subnet prefix.
314 if (!selector.giaddr_.isV4Zero()) {
315 for (auto const& subnet : subnets_) {
316
317 // If relay information is specified for this subnet, it must match.
318 // Otherwise, we ignore this subnet.
319 if (subnet->hasRelays()) {
320 if (!subnet->hasRelayAddress(selector.giaddr_)) {
321 continue;
322 }
323 } else {
324 // Relay information is not specified on the subnet level,
325 // so let's try matching on the shared network level.
326 SharedNetwork4Ptr network;
327 subnet->getSharedNetwork(network);
328 if (!network || !(network->hasRelayAddress(selector.giaddr_))) {
329 continue;
330 }
331 }
332
333 // If a subnet meets the client class criteria return it.
334 if (subnet->clientSupported(selector.client_classes_)) {
337 .arg(subnet->toText())
338 .arg(selector.giaddr_.toText());
339 return (subnet);
340 }
341 }
344 .arg(selector.giaddr_.toText());
345 } else {
348 }
349
350 // If we got to this point it means that we were not able to match the
351 // giaddr with any of the addresses specified for subnets. Let's determine
352 // what address from the client's packet to use to match with the
353 // subnets' prefixes.
354
356 // If there is a giaddr, use it for subnet selection.
357 if (!selector.giaddr_.isV4Zero()) {
358 address = selector.giaddr_;
359
360 // If it is a Renew or Rebind, use the ciaddr.
361 } else if (!selector.ciaddr_.isV4Zero() &&
362 !selector.local_address_.isV4Bcast()) {
363 address = selector.ciaddr_;
364
365 // If ciaddr is not specified, use the source address.
366 } else if (!selector.remote_address_.isV4Zero() &&
367 !selector.local_address_.isV4Bcast()) {
368 address = selector.remote_address_;
369
370 // If local interface name is known, use the local address on this
371 // interface.
372 } else if (!selector.iface_name_.empty()) {
374 // This should never happen in the real life. Hence we throw an
375 // exception.
376 if (iface == NULL) {
377 isc_throw(isc::BadValue, "interface " << selector.iface_name_
378 << " doesn't exist and therefore it is impossible"
379 " to find a suitable subnet for its IPv4 address");
380 }
381
382 // Attempt to select subnet based on the interface name.
383 Subnet4Ptr subnet = selectSubnet(selector.iface_name_,
384 selector.client_classes_);
385
386 // If it matches - great. If not, we'll try to use a different
387 // selection criteria below.
388 if (subnet) {
389 return (subnet);
390 } else {
391 // Let's try to get an address from the local interface and
392 // try to match it to defined subnet.
393 iface->getAddress4(address);
394 }
395 }
396
397 // Unable to find a suitable address to use for subnet selection.
398 if (address.isV4Zero()) {
401
402 return (Subnet4Ptr());
403 }
404
405 // We have identified an address in the client's packet that can be
406 // used for subnet selection. Match this packet with the subnets.
407 return (selectSubnet(address, selector.client_classes_));
408}
409
411CfgSubnets4::selectSubnet(const std::string& iface,
412 const ClientClasses& client_classes) const {
413 for (auto const& subnet : subnets_) {
414 Subnet4Ptr subnet_selected;
415
416 // First, try subnet specific interface name.
417 if (!subnet->getIface(Network4::Inheritance::NONE).empty()) {
418 if (subnet->getIface(Network4::Inheritance::NONE) == iface) {
419 subnet_selected = subnet;
420 }
421
422 } else {
423 // Interface not specified for a subnet, so let's try if
424 // we can match with shared network specific setting of
425 // the interface.
426 SharedNetwork4Ptr network;
427 subnet->getSharedNetwork(network);
428 if (network &&
429 (network->getIface(Network4::Inheritance::NONE) == iface)) {
430 subnet_selected = subnet;
431 }
432 }
433
434 if (subnet_selected) {
435 // If a subnet meets the client class criteria return it.
436 if (subnet_selected->clientSupported(client_classes)) {
439 .arg(subnet->toText())
440 .arg(iface);
441 return (subnet_selected);
442 }
443 }
444 }
445
448 .arg(iface);
449
450 // Failed to find a subnet.
451 return (Subnet4Ptr());
452}
453
455CfgSubnets4::getSubnet(const SubnetID subnet_id) const {
456 auto const& index = subnets_.get<SubnetSubnetIdIndexTag>();
457 auto subnet_it = index.find(subnet_id);
458 return ((subnet_it != index.cend()) ? (*subnet_it) : Subnet4Ptr());
459}
460
463 const ClientClasses& client_classes) const {
464 for (auto const& subnet : subnets_) {
465
466 // Address is in range for the subnet prefix, so return it.
467 if (!subnet->inRange(address)) {
468 continue;
469 }
470
471 // If a subnet meets the client class criteria return it.
472 if (subnet->clientSupported(client_classes)) {
474 .arg(subnet->toText())
475 .arg(address.toText());
476 return (subnet);
477 }
478 }
479
482 .arg(address.toText());
483
484 // Failed to find a subnet.
485 return (Subnet4Ptr());
486}
487
489CfgSubnets4::getLinks(const IOAddress& link_addr) const {
490 SubnetIDSet links;
491 for (auto const& subnet : subnets_) {
492 if (!subnet->inRange(link_addr)) {
493 continue;
494 }
495 links.insert(subnet->getID());
496 }
497 return (links);
498}
499
500void
502 using namespace isc::stats;
503
504 // For each v4 subnet currently configured, remove the statistic.
505 StatsMgr& stats_mgr = StatsMgr::instance();
506 for (auto const& subnet4 : subnets_) {
507 SubnetID subnet_id = subnet4->getID();
508 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
509 "total-addresses"));
510
511 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
512 "assigned-addresses"));
513
514 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
515 "cumulative-assigned-addresses"));
516
517 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
518 "declined-addresses"));
519
520 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
521 "reclaimed-declined-addresses"));
522
523 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
524 "reclaimed-leases"));
525
526 for (auto const& pool : subnet4->getPools(Lease::TYPE_V4)) {
527 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
528 StatsMgr::generateName("pool", pool->getID(),
529 "total-addresses")));
530
531 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
532 StatsMgr::generateName("pool", pool->getID(),
533 "assigned-addresses")));
534
535 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
536 StatsMgr::generateName("pool", pool->getID(),
537 "cumulative-assigned-addresses")));
538
539 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
540 StatsMgr::generateName("pool", pool->getID(),
541 "declined-addresses")));
542
543 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
544 StatsMgr::generateName("pool", pool->getID(),
545 "reclaimed-declined-addresses")));
546
547 stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
548 StatsMgr::generateName("pool", pool->getID(),
549 "reclaimed-leases")));
550 }
551 }
552}
553
554void
556 using namespace isc::stats;
557
558 StatsMgr& stats_mgr = StatsMgr::instance();
559 for (auto const& subnet4 : subnets_) {
560 SubnetID subnet_id = subnet4->getID();
561
562 stats_mgr.setValue(StatsMgr::
563 generateName("subnet", subnet_id, "total-addresses"),
564 int64_t(subnet4->getPoolCapacity(Lease::TYPE_V4)));
565 const std::string& name(StatsMgr::generateName("subnet", subnet_id,
566 "cumulative-assigned-addresses"));
567 if (!stats_mgr.getObservation(name)) {
568 stats_mgr.setValue(name, static_cast<int64_t>(0));
569 }
570
571 const std::string& name_reuses(StatsMgr::generateName("subnet", subnet_id,
572 "v4-lease-reuses"));
573 if (!stats_mgr.getObservation(name_reuses)) {
574 stats_mgr.setValue(name_reuses, int64_t(0));
575 }
576
577 const std::string& name_conflicts(StatsMgr::generateName("subnet", subnet_id,
578 "v4-reservation-conflicts"));
579 if (!stats_mgr.getObservation(name_conflicts)) {
580 stats_mgr.setValue(name_conflicts, static_cast<int64_t>(0));
581 }
582
583 for (auto const& pool : subnet4->getPools(Lease::TYPE_V4)) {
584 const std::string& name_total(StatsMgr::generateName("subnet", subnet_id,
585 StatsMgr::generateName("pool", pool->getID(),
586 "total-addresses")));
587 if (!stats_mgr.getObservation(name_total)) {
588 stats_mgr.setValue(name_total, static_cast<int64_t>(pool->getCapacity()));
589 } else {
590 stats_mgr.addValue(name_total, static_cast<int64_t>(pool->getCapacity()));
591 }
592
593 const std::string& name_ca(StatsMgr::generateName("subnet", subnet_id,
594 StatsMgr::generateName("pool", pool->getID(),
595 "cumulative-assigned-addresses")));
596 if (!stats_mgr.getObservation(name_ca)) {
597 stats_mgr.setValue(name_ca, static_cast<int64_t>(0));
598 }
599 }
600 }
601
602 // Only recount the stats if we have subnets.
603 if (subnets_.begin() != subnets_.end()) {
605 }
606}
607
608void
610 for (auto const& subnet : subnets_) {
611 subnet->initAllocatorsAfterConfigure();
612 }
613}
614
615void
617 subnets_.clear();
618}
619
623 // Iterate subnets
624 for (auto const& subnet : subnets_) {
625 result->add(subnet->toElement());
626 }
627 return (result);
628}
629
630} // end of namespace isc::dhcp
631} // 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
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
Definition: cfgmgr.cc:161
Holds subnets configured for the DHCPv4 server.
Definition: cfg_subnets4.h:33
ConstSubnet4Ptr getBySubnetId(const SubnetID &subnet_id) const
Returns const pointer to a subnet identified by the specified subnet identifier.
Definition: cfg_subnets4.h:138
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.
Definition: cfg_subnets4.cc:67
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.
Definition: cfg_subnets4.cc:89
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.
Definition: cfg_subnets4.cc:46
void initAllocatorsAfterConfigure()
Calls initAllocatorsAfterConfigure for each subnet.
void add(const Subnet4Ptr &subnet)
Adds new subnet to the configuration.
Definition: cfg_subnets4.cc:28
void removeStatistics()
Removes statistics.
const Subnet4Collection * getAll() const
Returns pointer to the collection of all IPv4 subnets.
Definition: cfg_subnets4.h:119
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
IfacePtr getIface(const unsigned int ifindex)
Returns interface specified interface index.
Definition: iface_mgr.cc:879
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition: iface_mgr.cc:54
static TrackingLeaseMgr & instance()
Return current lease manager.
void recountLeaseStats4()
Recalculates per-subnet and global stats for IPv4 leases.
Definition: lease_mgr.cc:72
Statistics Manager class.
ObservationPtr getObservation(const std::string &name) const
Returns an observation.
bool empty() const
Checks if the encapsulated value is empty.
Definition: optional.h:153
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
bool del(const std::string &name)
Removes specified statistic.
void setValue(const std::string &name, const int64_t value)
Records absolute integer observation.
void addValue(const std::string &name, const int64_t value)
Records incremental integer observation.
#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:498
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:183
const isc::log::MessageID DHCPSRV_SUBNET4O6_SELECT_FAILED
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
Definition: subnet.h:495
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:270
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::string > getIface4o6() const
Returns the DHCP4o6 interface.
Definition: cfg_4o6.h:45
util::Optional< std::pair< asiolink::IOAddress, uint8_t > > getSubnet4o6() const
Returns prefix/len for the IPv6 subnet.
Definition: cfg_4o6.h:58
bool enabled() const
Returns whether the DHCP4o6 is enabled or not.
Definition: cfg_4o6.h:33
OptionPtr getInterfaceId() const
Returns the interface-id.
Definition: cfg_4o6.h:72
@ TYPE_V4
IPv4 lease.
Definition: lease.h:50
Tag for the index for searching by subnet prefix.
Definition: subnet.h:817
Subnet selector used to specify parameters used to select a subnet.
asiolink::IOAddress local_address_
Address on which the message was received.
asiolink::IOAddress option_select_
RAI link select or subnet select option.
std::string iface_name_
Name of the interface on which the message was received.
asiolink::IOAddress ciaddr_
ciaddr from the client's message.
ClientClasses client_classes_
Classes that the client belongs to.
asiolink::IOAddress remote_address_
Source address of the message.
OptionPtr interface_id_
Interface id option.
asiolink::IOAddress giaddr_
giaddr from the client's message.
Tag for the index for searching by server identifier.
Definition: subnet.h:820
Tag for the index for searching by subnet identifier.
Definition: subnet.h:814