Kea 3.1.4
cfg_iface.cc
Go to the documentation of this file.
1// Copyright (C) 2014-2025 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/cfg_iface.h>
11#include <dhcpsrv/timer_mgr.h>
12#include <util/reconnect_ctl.h>
14#include <util/str.h>
15#include <algorithm>
16#include <functional>
17
18using namespace isc::asiolink;
19using namespace isc::data;
20using namespace isc::util;
21namespace ph = std::placeholders;
22
23namespace isc {
24namespace dhcp {
25
26const char* CfgIface::ALL_IFACES_KEYWORD = "*";
27
29
31 : wildcard_used_(false), socket_type_(SOCKET_RAW), re_detect_(false),
32 service_socket_require_all_(false), service_sockets_retry_wait_time_(5000),
33 service_sockets_max_retries_(0),
34 outbound_iface_(SAME_AS_INBOUND) {
35}
36
37void
41
42bool
43CfgIface::equals(const CfgIface& other) const {
44 return (iface_set_ == other.iface_set_ &&
45 address_map_ == other.address_map_ &&
46 wildcard_used_ == other.wildcard_used_ &&
47 socket_type_ == other.socket_type_);
48}
49
50bool
51CfgIface::multipleAddressesPerInterfaceActive() {
52 for (auto const& iface : IfaceMgr::instance().getIfaces()) {
53 if (iface->countActive4() > 1) {
54 return (true);
55 }
56 }
57 return (false);
58}
59
60void
61CfgIface::openSockets(const uint16_t family, const uint16_t port,
62 const bool use_bcast) {
63 // Close any open sockets because we're going to modify some properties
64 // of the IfaceMgr. Those modifications require that sockets are closed.
66 // The loopback interface can be used only when:
67 // - UDP socket will be used, i.e. not IPv4 and RAW socket
68 // - the loopback interface is in the interface set or the address map.
69 bool loopback_used_ = false;
70 if ((family == AF_INET6) || (socket_type_ == SOCKET_UDP)) {
71 // Check interface set
72 for (auto const& iface_name : iface_set_) {
73 IfacePtr iface = IfaceMgr::instance().getIface(iface_name);
74 if (iface && iface->flag_loopback_) {
75 loopback_used_ = true;
76 }
77 }
78 // Check address map
79 for (auto const& unicast : address_map_) {
80 IfacePtr iface = IfaceMgr::instance().getIface(unicast.first);
81 if (iface && iface->flag_loopback_) {
82 loopback_used_ = true;
83 }
84 }
85 }
86 // If wildcard interface '*' was not specified, set all interfaces to
87 // inactive state. We will later enable them selectively using the
88 // interface names specified by the user. If wildcard interface was
89 // specified, mark all interfaces active. Mark loopback inactive when
90 // not explicitly allowed.
91 setState(family, !wildcard_used_, !loopback_used_);
92 IfaceMgr& iface_mgr = IfaceMgr::instance();
93 // Remove selection of unicast addresses from all interfaces.
94 iface_mgr.clearUnicasts();
95 // Initialize IfaceMgr FDEventHandler.
96 iface_mgr.initializeFDEventHandler();
97 // Allow the loopback interface when required.
98 iface_mgr.setAllowLoopBack(loopback_used_);
99 // For the DHCPv4 server, if the user has selected that raw sockets
100 // should be used, we will try to configure the Interface Manager to
101 // support the direct responses to the clients that don't have the
102 // IP address. This should effectively turn on the use of raw
103 // sockets. However, this may be unsupported on some operating
104 // systems, so there is no guarantee.
105 if ((family == AF_INET) && (!IfaceMgr::instance().isTestMode())) {
106 iface_mgr.setMatchingPacketFilter(socket_type_ == SOCKET_RAW);
107 if ((socket_type_ == SOCKET_RAW) &&
108 !iface_mgr.isDirectResponseSupported()) {
110 }
111 }
112 // If there is no wildcard interface specified, we will have to iterate
113 // over the names specified by the caller and enable them.
114 if (!wildcard_used_) {
115 for (auto const& iface_name : iface_set_) {
116 IfacePtr iface = IfaceMgr::instance().getIface(iface_name);
117 // This shouldn't really happen because we are checking the
118 // names of interfaces when they are being added (use()
119 // function). But, if someone has triggered detection of
120 // interfaces since then, some interfaces may have disappeared.
121 if (iface == NULL) {
123 "fail to open socket on interface '"
124 << iface_name << "' as this interface doesn't"
125 " exist");
126
127 } else if (family == AF_INET) {
128 iface->inactive4_ = false;
129 setIfaceAddrsState(family, true, *iface);
130
131 } else {
132 iface->inactive6_ = false;
133 }
134 }
135 }
136
137 // Select unicast sockets for DHCPv6 or activate specific IPv4 addresses
138 // for DHCPv4.
139 for (auto const& unicast : address_map_) {
140 IfacePtr iface = IfaceMgr::instance().getIface(unicast.first);
141 if (iface == NULL) {
143 "fail to open unicast socket on interface '"
144 << unicast.first << "' as this interface doesn't"
145 " exist");
146 }
147 if (family == AF_INET6) {
148 iface->addUnicast(unicast.second);
149 iface->inactive6_ = false;
150
151 } else {
152 iface->setActive(unicast.second, true);
153 iface->inactive4_ = false;
154 }
155 }
156
157 // Use broadcast only if we're using raw sockets. For the UDP sockets,
158 // we only handle the relayed (unicast) traffic.
159 const bool can_use_bcast = use_bcast && (socket_type_ == SOCKET_RAW);
160
161 // Opening multiple raw sockets handling brodcast traffic on the single
162 // interface may lead to processing the same message multiple times.
163 // We don't prohibit such configuration because raw sockets can as well
164 // handle the relayed traffic. We have to issue a warning, however, to
165 // draw administrator's attention.
166 if (family == AF_INET && can_use_bcast && multipleAddressesPerInterfaceActive()) {
168 }
169
170 reconnect_ctl_ = makeReconnectCtl();
171 auto sopen = openSocketsWithRetry(reconnect_ctl_, family, port, can_use_bcast);
172
173 if (!sopen) {
174 // If no socket were opened, log a warning because the server will
175 // not respond to any queries.
177 }
178}
179
180std::pair<bool, bool>
181CfgIface::openSocketsForFamily(const uint16_t family, const uint16_t port,
182 const bool can_use_bcast, const bool skip_opened) {
183 bool no_errors = true;
184
185 // Set the callbacks which are called when the socket fails to open
186 // for some specific interface.
187 auto error_callback = [&no_errors](const std::string& errmsg) {
188 socketOpenErrorHandler(errmsg);
189 no_errors = false;
190 };
191
193
194 bool sopen = false;
195 if (family == AF_INET) {
196 sopen = IfaceMgr::instance().openSockets4(port, can_use_bcast,
197 error_callback, skip_opened);
198 } else {
199 // use_bcast is ignored for V6.
200 sopen = IfaceMgr::instance().openSockets6(port, error_callback,
201 skip_opened);
202 }
203
204 return (std::make_pair(sopen, no_errors));
205}
206
207ReconnectCtlPtr CfgIface::makeReconnectCtl() const {
208 // Create unique timer name per instance.
209 std::string timer_name = "SocketReopenTimer";
210
211 auto on_fail_action = OnFailAction::SERVE_RETRY_CONTINUE;
213 on_fail_action = OnFailAction::SERVE_RETRY_EXIT;
214 }
215
216 // Add one attempt for an initial call.
217 auto reconnect_ctl = boost::make_shared<ReconnectCtl>("Socket", timer_name,
220 on_fail_action, 0);
221
222 return (reconnect_ctl);
223}
224
225bool
226CfgIface::openSocketsWithRetry(ReconnectCtlPtr reconnect_ctl,
227 const uint16_t family, const uint16_t port,
228 const bool can_use_bcast) {
229 MultiThreadingCriticalSection cs;
230
231 // Skip opened sockets in the retry calls.
232 bool is_initial_call = (reconnect_ctl->retriesLeft() == reconnect_ctl->maxRetries());
233 auto result_pair = openSocketsForFamily(family, port, can_use_bcast, !is_initial_call);
234 bool sopen = result_pair.first;
235 bool has_errors = !result_pair.second;
236
237 auto timer_name = reconnect_ctl->timerName();
238
239 // On the initial call, unregister the previous, pending timer.
240 if (is_initial_call && TimerMgr::instance()->isTimerRegistered(timer_name)) {
241 TimerMgr::instance()->unregisterTimer(timer_name);
242 }
243
244 // Has errors and can retry
245 if (has_errors && reconnect_ctl->retriesLeft() > 0) {
246 // Initial call is excluded from retries counter.
247 reconnect_ctl->checkRetries();
248 // Start the timer.
249 if (!TimerMgr::instance()->isTimerRegistered(timer_name)) {
250 TimerMgr::instance()->registerTimer(timer_name,
251 std::bind(&CfgIface::openSocketsWithRetry,
252 reconnect_ctl, family,
253 port, can_use_bcast),
254 reconnect_ctl->retryInterval(),
256 }
257 TimerMgr::instance()->setup(timer_name);
258 } else {
259 // Cancel the timer.
260 if (TimerMgr::instance()->isTimerRegistered(timer_name)) {
261 TimerMgr::instance()->unregisterTimer(timer_name);
262 }
263 // Has errors but retries exceed
264 if (has_errors) {
266 open_sockets_failed_callback_(reconnect_ctl);
267 }
268 }
269 }
270
271 return (sopen);
272}
273
274void
276 wildcard_used_ = false;
277 iface_set_.clear();
278 address_map_.clear();
279 useSocketType(AF_INET, SOCKET_RAW);
280}
281
282void
283CfgIface::setState(const uint16_t family, const bool inactive,
284 const bool loopback_inactive) const {
285 for (auto const& iface : IfaceMgr::instance().getIfaces()) {
286 bool iface_inactive = iface->flag_loopback_ ? loopback_inactive : inactive;
287 if (family == AF_INET) {
288 iface->inactive4_ = iface_inactive;
289 } else {
290 iface->inactive6_ = iface_inactive;
291 }
292
293 // Activate/deactivate all addresses.
294 setIfaceAddrsState(family, !inactive, *iface);
295 }
296}
297
298void
299CfgIface::setIfaceAddrsState(const uint16_t family, const bool active,
300 Iface& iface) const {
301 // Activate/deactivate all addresses.
302 for (auto const& addr : iface.getAddresses()) {
303 if (addr.get().getFamily() == family) {
304 iface.setActive(addr.get(), active);
305 }
306 }
307}
308
309void
310CfgIface::socketOpenErrorHandler(const std::string& errmsg) {
312}
313
314std::string
316 switch (socket_type_) {
317 case SOCKET_RAW:
318 return ("raw");
319
320 case SOCKET_UDP:
321 return ("udp");
322
323 default:
324 ;
325 }
326
327 isc_throw(Unexpected, "unsupported socket type " << socket_type_);
328}
329
331CfgIface::textToSocketType(const std::string& socket_type_name) const {
332 if (socket_type_name == "udp") {
333 return (SOCKET_UDP);
334
335 } else if (socket_type_name == "raw") {
336 return (SOCKET_RAW);
337
338 } else {
339 isc_throw(InvalidSocketType, "unsupported socket type '"
340 << socket_type_name << "'");
341 }
342}
343
346 return (outbound_iface_);
347}
348
349std::string
351 switch (outbound_iface_) {
352 case SAME_AS_INBOUND:
353 return ("same-as-inbound");
354 case USE_ROUTING:
355 return ("use-routing");
356 default:
357 isc_throw(Unexpected, "unsupported outbound-type " << socket_type_);
358 }
359
360}
361
363CfgIface::textToOutboundIface(const std::string& txt) {
364 if (txt == "same-as-inbound") {
365 return (SAME_AS_INBOUND);
366
367 } else if (txt == "use-routing") {
368 return (USE_ROUTING);
369
370 } else {
371 isc_throw(BadValue, "unsupported outbound interface type '"
372 << txt << "'");
373 }
374}
375
376void
378 outbound_iface_ = outbound_iface;
379}
380
381void
382CfgIface::use(const uint16_t family, const std::string& iface_name) {
383 // The interface name specified may have two formats:
384 // - "interface-name", e.g. eth0
385 // - "interface-name/address", e.g. eth0/10.0.0.1 or eth/2001:db8:1::1
386 // The latter format is used to open unicast socket on the specified
387 // interface. Here we are detecting which format was used and we strip
388 // all extraneous spaces.
389 size_t pos = iface_name.find("/");
390 std::string name;
391 std::string addr_str;
392 // There is no unicast address so the whole string is an interface name.
393 if (pos == std::string::npos) {
394 name = util::str::trim(iface_name);
395 if (name.empty()) {
397 "empty interface name used in configuration");
398
399 } else if (name != ALL_IFACES_KEYWORD) {
400 if (IfaceMgr::instance().getIface(name) == NULL) {
401 isc_throw(NoSuchIface, "interface '" << name
402 << "' doesn't exist in the system");
403 }
404
405 } else if (wildcard_used_) {
406 isc_throw(DuplicateIfaceName, "the wildcard interface '"
407 << ALL_IFACES_KEYWORD << "' can only be specified once");
408
409 } else {
412 wildcard_used_ = true;
413
414 }
415
416 } else {
417 // The interface name includes the address on which the socket should
418 // be opened, and we need to split interface name and the address to
419 // two variables.
420 name = util::str::trim(iface_name.substr(0, pos));
421 addr_str = util::str::trim(iface_name.substr(pos + 1));
422
423 // Interface name must not be empty.
424 if (name.empty()) {
426 "empty interface name specified in the"
427 " interface configuration");
428
429 }
430 // An address following the interface name must not be empty.
431 if (addr_str.empty()) {
433 "empty address specified in the interface"
434 << " configuration");
435
436 }
437
438 // Interface name must not be the wildcard name.
439 if (name == ALL_IFACES_KEYWORD) {
441 "wildcard interface name '" << ALL_IFACES_KEYWORD
442 << "' must not be used in conjunction with an"
443 " address");
444
445 }
446
447 // Interface must exist.
448 IfacePtr iface = IfaceMgr::instance().getIface(name);
449 if (!iface) {
450 isc_throw(NoSuchIface, "interface '" << name
451 << "' doesn't exist in the system");
452
453 }
454
455 // Convert address string. This may throw an exception if the address
456 // is invalid.
457 IOAddress addr(addr_str);
458
459 // Validate V6 address.
460 if (family == AF_INET6) {
461 // Check that the address is a valid unicast address.
462 if (!addr.isV6() || addr.isV6Multicast()) {
463 isc_throw(InvalidIfaceName, "address '" << addr << "' is not"
464 " a valid IPv6 unicast address");
465 }
466
467 // There are valid cases where link local address can be specified to
468 // receive unicast traffic, e.g. sent by relay agent.
469 if (addr.isV6LinkLocal()) {
471 .arg(addr.toText()).arg(name);
472 }
473
474 } else {
475 if (!addr.isV4()) {
476 isc_throw(InvalidIfaceName, "address '" << addr << "' is not"
477 " a valid IPv4 address");
478 }
479 }
480
481 // Interface must have this address assigned.
482 if (!iface->hasAddress(addr)) {
484 "interface '" << name << "' doesn't have address '"
485 << addr << "' assigned");
486 }
487
488 // For the IPv4, if the interface name was specified (instead of the interface-
489 // address tuple) all addresses are already activated. Adding an explicit address
490 // for the interface should result in error.
491 if ((family == AF_INET) && (iface_set_.find(iface->getName()) != iface_set_.end())) {
492 isc_throw(DuplicateIfaceName, "interface '" << iface->getName()
493 << "' has already been selected");
494 }
495
496 // Check if the address hasn't been selected already.
497 std::pair<const std::string, IOAddress> iface_address_tuple(name, addr);
498 if (std::find(address_map_.begin(), address_map_.end(),
499 iface_address_tuple) != address_map_.end()) {
500 isc_throw(DuplicateAddress, "must not select address '"
501 << addr << "' for interface '" << name << "' "
502 "because this address is already selected");
503 }
504
505 if (family == AF_INET6) {
507 .arg(addr.toText()).arg(name);
508
509 } else {
511 .arg(addr.toText()).arg(name);
512 }
513 address_map_.insert(std::pair<std::string, IOAddress>(name, addr));
514 }
515
516 // If interface name was explicitly specified without an address, we will
517 // insert the interface name to the set of enabled interfaces.
518 if ((name != ALL_IFACES_KEYWORD) && addr_str.empty()) {
519 // An interface has been selected or an IPv4 address on this interface
520 // has been selected it is not allowed to select the whole interface.
521 if ((iface_set_.find(name) != iface_set_.end()) ||
522 ((family == AF_INET) && address_map_.count(name) > 0)) {
523 isc_throw(DuplicateIfaceName, "interface '" << name
524 << "' has already been specified");
525 }
526
527 // Log that we're listening on the specific interface and that the
528 // address is not explicitly specified.
529 if (addr_str.empty()) {
531 }
532 iface_set_.insert(name);
533 }
534}
535
536void
537CfgIface::useSocketType(const uint16_t family,
538 const SocketType& socket_type) {
539 if (family != AF_INET) {
540 isc_throw(InvalidSocketType, "socket type must not be specified for"
541 " the DHCPv6 server");
542 }
543 socket_type_ = socket_type;
545 .arg(socketTypeToText());
546}
547
548void
549CfgIface::useSocketType(const uint16_t family,
550 const std::string& socket_type_name) {
551 useSocketType(family, textToSocketType(socket_type_name));
552}
553
557
558 // Set user context
559 contextToElement(result);
560
561 // Set interfaces
563 if (wildcard_used_) {
564 ifaces->add(Element::create(std::string(ALL_IFACES_KEYWORD)));
565 }
566 for (auto const& iface : iface_set_) {
567 ifaces->add(Element::create(iface));
568 }
569 for (auto const& address : address_map_) {
570 std::string spec = address.first + "/" + address.second.toText();
571 ifaces->add(Element::create(spec));
572 }
573 result->set("interfaces", ifaces);
574
575 // Set dhcp-socket-type (no default because it is DHCPv4 specific)
576 // @todo emit raw if and only if DHCPv4
577 if (socket_type_ != SOCKET_RAW) {
578 result->set("dhcp-socket-type", Element::create(std::string("udp")));
579 }
580
581 if (outbound_iface_ != SAME_AS_INBOUND) {
582 result->set("outbound-interface", Element::create(outboundTypeToText()));
583 }
584
585 // Set re-detect
586 result->set("re-detect", Element::create(re_detect_));
587
588 // Set server socket binding
589 if (service_socket_require_all_) {
590 result->set("service-sockets-require-all", Element::create(service_socket_require_all_));
591 }
592
593 if (service_sockets_max_retries_ != 0) {
594 result->set("service-sockets-max-retries", Element::create(static_cast<int>(service_sockets_max_retries_)));
595 // If the max retries parameter is zero, the wait time is not used.
596 result->set("service-sockets-retry-wait-time", Element::create(static_cast<int>(service_sockets_retry_wait_time_)));
597 }
598
599 return (result);
600}
601
602} // end of isc::dhcp namespace
603} // end of isc namespace
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.
static ElementPtr create(const Position &pos=ZERO_POSITION())
Definition data.cc:249
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
Definition data.cc:304
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
Definition data.cc:299
static const char * ALL_IFACES_KEYWORD
Keyword used to enable all interfaces.
Definition cfg_iface.h:155
void closeSockets() const
Convenience function which closes all open sockets.
Definition cfg_iface.cc:38
std::string socketTypeToText() const
Returns the socket type in the textual format.
Definition cfg_iface.cc:315
void reset()
Puts the interface configuration into default state.
Definition cfg_iface.cc:275
uint32_t getServiceSocketsRetryWaitTime() const
Indicates the socket service binding retry interval between attempts.
Definition cfg_iface.h:330
OutboundIface
Indicates how outbound interface is selected for relayed traffic.
Definition cfg_iface.h:143
@ USE_ROUTING
Server uses routing to determine the right interface to send response.
Definition cfg_iface.h:148
@ SAME_AS_INBOUND
Server sends responses over the same interface on which queries are received.
Definition cfg_iface.h:146
OutboundIface getOutboundIface() const
Returns outbound interface selection mode.
Definition cfg_iface.cc:345
CfgIface()
Constructor.
Definition cfg_iface.cc:30
bool getServiceSocketsRequireAll() const
Indicates that Kea must successfully bind all socket services on init.
Definition cfg_iface.h:316
void openSockets(const uint16_t family, const uint16_t port, const bool use_bcast=true)
Tries to open sockets on selected interfaces.
Definition cfg_iface.cc:61
static OutboundIface textToOutboundIface(const std::string &txt)
Converts text to outbound interface selection mode.
Definition cfg_iface.cc:363
void use(const uint16_t family, const std::string &iface_name)
Select interface to be used to receive DHCP traffic.
Definition cfg_iface.cc:382
bool equals(const CfgIface &other) const
Compares two CfgIface objects for equality.
Definition cfg_iface.cc:43
SocketType
Socket type used by the DHCPv4 server.
Definition cfg_iface.h:135
@ SOCKET_UDP
Datagram socket, i.e. IP/UDP socket.
Definition cfg_iface.h:139
@ SOCKET_RAW
Raw socket, used for direct DHCPv4 traffic.
Definition cfg_iface.h:137
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition cfg_iface.cc:555
std::string outboundTypeToText() const
Returns outbound interface selection mode as string.
Definition cfg_iface.cc:350
void setOutboundIface(const OutboundIface &outbound_iface)
Sets outbound interface selection mode.
Definition cfg_iface.cc:377
SocketType textToSocketType(const std::string &socket_type_name) const
Converts the socket type in the textual format to the type represented by the SocketType.
Definition cfg_iface.cc:331
static OpenSocketsFailedCallback open_sockets_failed_callback_
Optional callback function to invoke if all retries of the opening sockets fail.
Definition cfg_iface.h:361
void useSocketType(const uint16_t family, const SocketType &socket_type)
Sets the specified socket type to be used by the server.
Definition cfg_iface.cc:537
std::function< void(util::ReconnectCtlPtr)> OpenSocketsFailedCallback
Represents a callback invoked if all retries of the opening sockets fail.
Definition cfg_iface.h:357
uint32_t getServiceSocketsMaxRetries() const
Indicates the maximum number of service sockets bind attempts.
Definition cfg_iface.h:344
Exception thrown when duplicated address specified.
Definition cfg_iface.h:45
Exception thrown when duplicated interface names specified.
Definition cfg_iface.h:24
Handles network interfaces, transmission and reception.
Definition iface_mgr.h:656
bool openSockets4(const uint16_t port=DHCP4_SERVER_PORT, const bool use_bcast=true, IfaceMgrErrorMsgCallback error_handler=0, const bool skip_opened=false)
Opens IPv4 sockets on detected interfaces.
Definition iface_mgr.cc:497
IfacePtr getIface(const unsigned int ifindex)
Returns interface specified interface index.
Definition iface_mgr.cc:879
bool openSockets6(const uint16_t port=DHCP6_SERVER_PORT, IfaceMgrErrorMsgCallback error_handler=0, const bool skip_opened=false)
Opens IPv6 sockets on detected interfaces.
Definition iface_mgr.cc:627
void detectIfaces(bool update_only=false)
Detects network interfaces.
void clearUnicasts()
Clears unicast addresses on all interfaces.
Definition iface_mgr.cc:926
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:47
void initializeFDEventHandler()
Initialize the FD event handler;.
Definition iface_mgr.cc:208
bool isDirectResponseSupported() const
Check if packet be sent directly to the client having no address.
Definition iface_mgr.cc:319
void closeSockets()
Closes all open sockets.
Definition iface_mgr.cc:286
void setMatchingPacketFilter(const bool direct_response_desired=false)
Set Packet Filter object to handle send/receive packets.
void setAllowLoopBack(const bool allow_loopback)
Allows or disallows the loopback interface.
Definition iface_mgr.h:744
Represents a single network interface.
Definition iface_mgr.h:118
Exception thrown when specified interface name is invalid.
Definition cfg_iface.h:31
Exception thrown when invalid socket type has been specified for the given family.
Definition cfg_iface.h:61
Exception thrown when specified unicast address is not assigned to the interface specified.
Definition cfg_iface.h:53
Exception thrown when specified interface doesn't exist in a system.
Definition cfg_iface.h:38
static const TimerMgrPtr & instance()
Returns pointer to the sole instance of the TimerMgr.
Definition timer_mgr.cc:446
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
Definition macros.h:20
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
Definition macros.h:26
#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_CFGMGR_ADD_IFACE
boost::shared_ptr< Iface > IfacePtr
Type definition for the pointer to an Iface object.
Definition iface_mgr.h:487
const isc::log::MessageID DHCPSRV_CFGMGR_USE_ADDRESS
const isc::log::MessageID DHCPSRV_MULTIPLE_RAW_SOCKETS_PER_IFACE
const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT
const isc::log::MessageID DHCPSRV_CFGMGR_ALL_IFACES_ACTIVE
const isc::log::MessageID DHCPSRV_CFGMGR_UNICAST_LINK_LOCAL
const isc::log::MessageID DHCPSRV_NO_SOCKETS_OPEN
const isc::log::MessageID DHCPSRV_OPEN_SOCKET_FAIL
const int DHCPSRV_DBG_TRACE
DHCP server library logging levels.
Definition dhcpsrv_log.h:26
const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED
const isc::log::MessageID DHCPSRV_CFGMGR_USE_UNICAST
string trim(const string &input)
Trim leading and trailing spaces.
Definition str.cc:32
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.