Kea  2.3.6-git
cfg_subnets4.cc
Go to the documentation of this file.
1 // Copyright (C) 2014-2022 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>
9 #include <dhcp/option_custom.h>
10 #include <dhcpsrv/cfgmgr.h>
11 #include <dhcpsrv/cfg_subnets4.h>
12 #include <dhcpsrv/dhcpsrv_log.h>
14 #include <dhcpsrv/shared_network.h>
15 #include <dhcpsrv/subnet_id.h>
16 #include <asiolink/io_address.h>
18 #include <stats/stats_mgr.h>
19 #include <sstream>
20 
21 using namespace isc::asiolink;
22 using namespace isc::data;
23 
24 namespace isc {
25 namespace dhcp {
26 
27 void
28 CfgSubnets4::add(const Subnet4Ptr& subnet) {
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 
46 CfgSubnets4::replace(const Subnet4Ptr& subnet) {
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 
66 void
67 CfgSubnets4::del(const ConstSubnet4Ptr& subnet) {
68  del(subnet->getID());
69 }
70 
71 void
72 CfgSubnets4::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 
88 void
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  }
182 }
183 
185 CfgSubnets4::getBySubnetId(const SubnetID& subnet_id) const {
186  const auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
187  auto subnet_it = index.find(subnet_id);
188  return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
189 }
190 
192 CfgSubnets4::getByPrefix(const std::string& subnet_text) const {
193  const auto& index = subnets_.get<SubnetPrefixIndexTag>();
194  auto subnet_it = index.find(subnet_text);
195  return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
196 }
197 
198 bool
199 CfgSubnets4::hasSubnetWithServerId(const asiolink::IOAddress& server_id) const {
200  const auto& index = subnets_.get<SubnetServerIdIndexTag>();
201  auto subnet_it = index.find(server_id);
202  return (subnet_it != index.cend());
203 }
204 
206 CfgSubnets4::initSelector(const Pkt4Ptr& query) {
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 
262 CfgSubnets4::selectSubnet4o6(const SubnetSelector& selector) const {
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 
304 CfgSubnets4::selectSubnet(const SubnetSelector& selector) const {
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 
416 CfgSubnets4::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 
460 CfgSubnets4::getSubnet(const SubnetID id) const {
463  for (auto const& subnet : subnets_) {
464  if (subnet->getID() == id) {
465  return (subnet);
466  }
467  }
468  return (Subnet4Ptr());
469 }
470 
472 CfgSubnets4::selectSubnet(const IOAddress& address,
473  const ClientClasses& client_classes) const {
474  for (auto const& subnet : subnets_) {
475 
476  // Address is in range for the subnet prefix, so return it.
477  if (!subnet->inRange(address)) {
478  continue;
479  }
480 
481  // If a subnet meets the client class criteria return it.
482  if (subnet->clientSupported(client_classes)) {
484  .arg(subnet->toText())
485  .arg(address.toText());
486  return (subnet);
487  }
488  }
489 
492  .arg(address.toText());
493 
494  // Failed to find a subnet.
495  return (Subnet4Ptr());
496 }
497 
499 CfgSubnets4::getLinks(const IOAddress& link_addr, uint8_t& link_len) const {
500  SubnetIDSet links;
501  bool link_len_set = false;
502  for (auto const& subnet : subnets_) {
503  if (!subnet->inRange(link_addr)) {
504  continue;
505  }
506  uint8_t plen = subnet->get().second;
507  if (!link_len_set || (plen < link_len)) {
508  link_len_set = true;
509  link_len = plen;
510  }
511  links.insert(subnet->getID());
512  }
513  return (links);
514 }
515 
516 void
517 CfgSubnets4::removeStatistics() {
518  using namespace isc::stats;
519 
520  // For each v4 subnet currently configured, remove the statistic.
521  StatsMgr& stats_mgr = StatsMgr::instance();
522  for (auto const& subnet4 : subnets_) {
523  SubnetID subnet_id = subnet4->getID();
524  stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
525  "total-addresses"));
526 
527  stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
528  "assigned-addresses"));
529 
530  stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
531  "cumulative-assigned-addresses"));
532 
533  stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
534  "declined-addresses"));
535 
536  stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
537  "reclaimed-declined-addresses"));
538 
539  stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
540  "reclaimed-leases"));
541  }
542 }
543 
544 void
545 CfgSubnets4::updateStatistics() {
546  using namespace isc::stats;
547 
548  StatsMgr& stats_mgr = StatsMgr::instance();
549  for (auto const& subnet4 : subnets_) {
550  SubnetID subnet_id = subnet4->getID();
551 
552  stats_mgr.setValue(StatsMgr::
553  generateName("subnet", subnet_id, "total-addresses"),
554  static_cast<int64_t>
555  (subnet4->getPoolCapacity(Lease::TYPE_V4)));
556  std::string name =
557  StatsMgr::generateName("subnet", subnet_id, "cumulative-assigned-addresses");
558  if (!stats_mgr.getObservation(name)) {
559  stats_mgr.setValue(name, static_cast<int64_t>(0));
560  }
561 
562  name = StatsMgr::generateName("subnet", subnet_id, "v4-reservation-conflicts");
563  if (!stats_mgr.getObservation(name)) {
564  stats_mgr.setValue(name, static_cast<int64_t>(0));
565  }
566  }
567 
568  // Only recount the stats if we have subnets.
569  if (subnets_.begin() != subnets_.end()) {
570  LeaseMgrFactory::instance().recountLeaseStats4();
571  }
572 }
573 
574 void
575 CfgSubnets4::initAllocatorsAfterConfigure() {
576  for (auto subnet : subnets_) {
577  subnet->initAllocatorsAfterConfigure();
578  }
579 }
580 
582 CfgSubnets4::toElement() const {
583  ElementPtr result = Element::createList();
584  // Iterate subnets
585  for (auto const& subnet : subnets_) {
586  result->add(subnet->toElement());
587  }
588  return (result);
589 }
590 
591 } // end of namespace isc::dhcp
592 } // end of namespace isc
Exception thrown upon attempt to add subnet with an ID that belongs to the subnet that already exists...
Definition: subnet_id.h:36
asiolink::IOAddress ciaddr_
ciaddr from the client&#39;s message.
asiolink::IOAddress remote_address_
Source address of the message.
ObservationPtr getObservation(const std::string &name) const
Returns an observation.
util::Optional< std::string > getIface4o6() const
Returns the DHCP4o6 interface.
Definition: cfg_4o6.h:45
bool enabled() const
Returns whether the DHCP4o6 is enabled or not.
Definition: cfg_4o6.h:33
boost::shared_ptr< OptionCustom > OptionCustomPtr
A pointer to the OptionCustom object.
Tag for the index for searching by subnet identifier.
Definition: subnet.h:786
const isc::log::MessageID DHCPSRV_CFGMGR_ADD_SUBNET4
const isc::log::MessageID DHCPSRV_SUBNET4O6_SELECT_FAILED
boost::shared_ptr< Iface > IfacePtr
Type definition for the pointer to an Iface object.
Definition: iface_mgr.h:487
asiolink::IOAddress option_select_
RAI link select or subnet select option.
OptionPtr interface_id_
Interface id option.
boost::shared_ptr< Option > OptionPtr
Definition: option.h:36
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
Definition: subnet.h:486
const isc::log::MessageID DHCPSRV_CFGMGR_UPDATE_SUBNET4
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
const isc::log::MessageID DHCPSRV_CFGMGR_SUBNET4_RELAY
asiolink::IOAddress giaddr_
giaddr from the client&#39;s message.
Tag for the index for searching by subnet prefix.
Definition: subnet.h:789
OptionPtr getInterfaceId() const
Returns the interface-id.
Definition: cfg_4o6.h:72
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
util::Optional< std::pair< asiolink::IOAddress, uint8_t > > getSubnet4o6() const
Returns prefix/len for the IPv6 subnet.
Definition: cfg_4o6.h:58
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
Definition: option.h:24
Statistics Manager class.
ClientClasses client_classes_
Classes that the client belongs to.
std::set< dhcp::SubnetID > SubnetIDSet
Ordered list aka set of subnetIDs.
Definition: subnet_id.h:43
Subnet selector used to specify parameters used to select a subnet.
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_NO_RELAY_ADDRESS
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Tag for the index for searching by server identifier.
Definition: subnet.h:792
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
boost::shared_ptr< CfgSharedNetworks4 > CfgSharedNetworks4Ptr
Pointer to the configuration of IPv4 shared networks.
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_BY_ADDRESS_NO_MATCH
This structure contains information about DHCP4o6 (RFC7341)
Definition: cfg_4o6.h:22
bool del(const std::string &name)
Removes specified statistic.
asiolink::IOAddress local_address_
Address on which the message was received.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
Definition: pkt4.h:547
const isc::log::MessageID DHCPSRV_CFGMGR_DEL_SUBNET4
Holds subnets configured for the DHCPv4 server.
Definition: cfg_subnets4.h:33
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_BY_RELAY_ADDRESS_NO_MATCH
boost::shared_ptr< SharedNetwork4 > SharedNetwork4Ptr
Pointer to SharedNetwork4 object.
Defines the logger used by the top-level component of kea-lfc.
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_BY_INTERFACE_NO_MATCH
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
Definition: subnet.h:480
const isc::log::MessageID DHCPSRV_CFGMGR_SUBNET4_IFACE
void merge(ElementPtr element, ConstElementPtr other)
Merges the data from other into element.
Definition: data.cc:1139
A generic exception that is thrown if a function is called in a prohibited way.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
Definition: macros.h:14
std::string iface_name_
Name of the interface on which the message was received.
const int DHCPSRV_DBG_TRACE
DHCP server library logging levels.
Definition: dhcpsrv_log.h:26
isc::log::Logger dhcpsrv_logger("dhcpsrv")
DHCP server library Logger.
Definition: dhcpsrv_log.h:56
Option with defined data fields represented as buffers that can be accessed using data field index...
Definition: option_custom.h:32
bool empty() const
Checks if the encapsulated value is empty.
Definition: optional.h:153
const Subnet4Collection * getAll() const
Returns pointer to the collection of all IPv4 subnets.
Definition: cfg_subnets4.h:119
Container for storing client class names.
Definition: classify.h:108
void setValue(const std::string &name, const int64_t value)
Records absolute integer observation.
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_NO_USABLE_ADDRESS
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:25
const isc::log::MessageID DHCPSRV_CFGMGR_SUBNET4_ADDR
const isc::log::MessageID DHCPSRV_SUBNET4_SELECT_NO_RAI_OPTIONS