Kea 1.5.0
iface_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2011-2018 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#ifndef IFACE_MGR_H
8#define IFACE_MGR_H
9
10#include <asiolink/io_address.h>
11#include <dhcp/dhcp4.h>
12#include <dhcp/dhcp6.h>
13#include <dhcp/pkt4.h>
14#include <dhcp/pkt6.h>
17#include <dhcp/pkt_filter.h>
18#include <dhcp/pkt_filter6.h>
19#include <util/optional_value.h>
20#include <util/watch_socket.h>
22
23#include <boost/function.hpp>
24#include <boost/noncopyable.hpp>
25#include <boost/scoped_array.hpp>
26#include <boost/shared_ptr.hpp>
27
28#include <list>
29#include <vector>
30
31namespace isc {
32
33namespace dhcp {
34
35
38public:
39 IfaceDetectError(const char* file, size_t line, const char* what) :
40 isc::Exception(file, line, what) { };
41};
42
45public:
46 PacketFilterChangeDenied(const char* file, size_t line, const char* what) :
47 isc::Exception(file, line, what) { };
48};
49
52public:
53 SignalInterruptOnSelect(const char* file, size_t line, const char* what) :
54 isc::Exception(file, line, what) { };
55};
56
60public:
61 SocketConfigError(const char* file, size_t line, const char* what) :
62 isc::Exception(file, line, what) { };
63};
64
67class SocketReadError : public Exception {
68public:
69 SocketReadError(const char* file, size_t line, const char* what) :
70 isc::Exception(file, line, what) { };
71};
72
76public:
77 SocketWriteError(const char* file, size_t line, const char* what) :
78 isc::Exception(file, line, what) { };
79};
80
82class IfaceNotFound : public Exception {
83public:
84 IfaceNotFound(const char* file, size_t line, const char* what) :
85 isc::Exception(file, line, what) { };
86};
87
89class SocketNotFound : public Exception {
90public:
91 SocketNotFound(const char* file, size_t line, const char* what) :
92 isc::Exception(file, line, what) { };
93};
94
114class Iface : public boost::noncopyable {
115public:
116
118 static const unsigned int MAX_MAC_LEN = 20;
119
122
124 typedef std::list<Address> AddressCollection;
125
135 typedef std::list<SocketInfo> SocketCollection;
136
143 Iface(const std::string& name, int ifindex);
144
146 ~Iface() { }
147
149 void closeSockets();
150
170 void closeSockets(const uint16_t family);
171
175 std::string getFullName() const;
176
180 std::string getPlainMac() const;
181
186 void setMac(const uint8_t* mac, size_t macLen);
187
191 size_t getMacLen() const { return mac_len_; }
192
197 const uint8_t* getMac() const { return mac_; }
198
206 void setFlags(uint64_t flags);
207
211 uint16_t getIndex() const { return ifindex_; }
212
216 std::string getName() const { return name_; };
217
221 void setHWType(uint16_t type ) { hardware_type_ = type; }
222
226 uint16_t getHWType() const { return hardware_type_; }
227
246 const AddressCollection& getAddresses() const { return addrs_; }
247
257 bool getAddress4(isc::asiolink::IOAddress& address) const;
258
263 bool hasAddress(const isc::asiolink::IOAddress& address) const;
264
271 void addAddress(const isc::asiolink::IOAddress& addr);
272
284 void setActive(const isc::asiolink::IOAddress& address, const bool active);
285
294 void setActive(const bool active);
295
297 unsigned int countActive4() const;
298
308 bool delAddress(const isc::asiolink::IOAddress& addr);
309
313 void addSocket(const SocketInfo& sock) {
314 sockets_.push_back(sock);
315 }
316
324 bool delSocket(uint16_t sockfd);
325
339 const SocketCollection& getSockets() const { return sockets_; }
340
346 unicasts_.clear();
347 }
348
353 void addUnicast(const isc::asiolink::IOAddress& addr);
354
359 return unicasts_;
360 }
361
371 uint8_t* getReadBuffer() {
372 if (read_buffer_.empty()) {
373 return NULL;
374 }
375 return (&read_buffer_[0]);
376 }
377
379 size_t getReadBufferSize() const {
380 return (read_buffer_.size());
381 }
382
386 void resizeReadBuffer(const size_t new_size) {
387 read_buffer_.resize(new_size);
388 }
389
390protected:
393
395 std::string name_;
396
399
402
405
408
410 size_t mac_len_;
411
414
415public:
418
421
424
428
431
434
439 uint64_t flags_;
440
444
448
449private:
450
454 std::vector<uint8_t> read_buffer_;
455};
456
457typedef boost::shared_ptr<Iface> IfacePtr;
458
460class IfaceMgr;
461
463typedef boost::shared_ptr<IfaceMgr> IfaceMgrPtr;
464
469typedef
470boost::function<void(const std::string& errmsg)> IfaceMgrErrorMsgCallback;
471
478class IfaceMgr : public boost::noncopyable {
479public:
481 typedef boost::function<void ()> SocketCallback;
482
487
490 };
491
493 typedef std::list<SocketCallbackInfo> SocketCallbackInfoContainer;
494
502 static const uint32_t RCVBUFSIZE = 1500;
503
504 // TODO performance improvement: we may change this into
505 // 2 maps (ifindex-indexed and name-indexed) and
506 // also hide it (make it public make tests easier for now)
507
509 typedef std::list<IfacePtr> IfaceCollection;
510
515 static IfaceMgr& instance();
516
527 static const IfaceMgrPtr& instancePtr();
528
532 virtual ~IfaceMgr();
533
543 void setTestMode(const bool test_mode) {
544 test_mode_ = test_mode;
545 }
546
550 bool isTestMode() const {
551 return (test_mode_);
552 }
553
559 void setAllowLoopBack(const bool allow_loopback) {
560 allow_loopback_ = allow_loopback;
561 }
562
571 bool isDirectResponseSupported() const;
572
580 IfacePtr getIface(int ifindex);
581
588 IfacePtr getIface(const std::string& ifname);
589
597 const IfaceCollection& getIfaces() { return (ifaces_); }
598
605 void clearIfaces();
606
613
615 void clearUnicasts();
616
630 uint16_t getSocket(const isc::dhcp::Pkt6& pkt);
631
646
650 void printIfaces(std::ostream& out = std::cout);
651
663 bool send(const Pkt6Ptr& pkt);
664
676 bool send(const Pkt4Ptr& pkt);
677
689 Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec = 0);
690
702 Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec = 0);
703
722 int openSocket(const std::string& ifname,
723 const isc::asiolink::IOAddress& addr,
724 const uint16_t port,
725 const bool receive_bcast = false,
726 const bool send_bcast = false);
727
745 int openSocketFromIface(const std::string& ifname,
746 const uint16_t port,
747 const uint8_t family);
748
764 const uint16_t port);
765
781 const uint16_t port);
782
783
829 bool openSockets6(const uint16_t port = DHCP6_SERVER_PORT,
830 IfaceMgrErrorMsgCallback error_handler = 0);
831
900 bool openSockets4(const uint16_t port = DHCP4_SERVER_PORT,
901 const bool use_bcast = true,
902 IfaceMgrErrorMsgCallback error_handler = 0);
903
910 void closeSockets();
911
915 uint16_t countIfaces() { return ifaces_.size(); }
916
924 void addExternalSocket(int socketfd, SocketCallback callback);
925
927 void deleteExternalSocket(int socketfd);
928
931
947 void setPacketFilter(const PktFilterPtr& packet_filter);
948
969 void setPacketFilter(const PktFilter6Ptr& packet_filter);
970
987 void setMatchingPacketFilter(const bool direct_response_desired = false);
988
994 void addInterface(const IfacePtr& iface) {
995 ifaces_.push_back(iface);
996 }
997
1004 bool hasOpenSocket(const uint16_t family) const;
1005
1017 bool hasOpenSocket(const isc::asiolink::IOAddress& addr) const;
1018
1023 return (packet_queue_mgr4_);
1024 }
1025
1033 return (packet_queue_mgr4_->getPacketQueue());
1034 }
1035
1040 return (packet_queue_mgr6_);
1041 }
1042
1050 return (packet_queue_mgr6_->getPacketQueue());
1051 }
1052
1063 void startDHCPReceiver(const uint16_t family);
1064
1069 void stopDHCPReceiver();
1070
1074 return (dhcp_receiver_ != 0 && dhcp_receiver_->isRunning());
1075 }
1076
1090 bool configureDHCPPacketQueue(const uint16_t family,
1091 data::ConstElementPtr queue_control);
1092
1100 static void addFDtoSet(int fd, int& maxfd, fd_set* sockets);
1101
1102 // don't use private, we need derived classes in tests
1103protected:
1104
1109 IfaceMgr();
1110
1124 int openSocket4(Iface& iface, const isc::asiolink::IOAddress& addr,
1125 const uint16_t port, const bool receive_bcast = false,
1126 const bool send_bcast = false);
1127
1148 Pkt4Ptr receive4Direct(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1149
1170 Pkt4Ptr receive4Indirect(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1171
1187 uint16_t port, const bool join_multicast);
1188
1209 Pkt6Ptr receive6Direct(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1210
1231 Pkt6Ptr receive6Indirect(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1232
1233
1240 void stubDetectIfaces();
1241
1242 // TODO: having 2 maps (ifindex->iface and ifname->iface would)
1243 // probably be better for performance reasons
1244
1247
1248 // TODO: Also keep this interface on Iface once interface detection
1249 // is implemented. We may need it e.g. to close all sockets on
1250 // specific interface
1251 //int recvsock_; // TODO: should be fd_set eventually, but we have only
1252 //int sendsock_; // 2 sockets for now. Will do for until next release
1253
1254 // We can't use the same socket, as receiving socket
1255 // is bound to multicast address. And we all know what happens
1256 // to people who try to use multicast as source address.
1257
1258private:
1274 getLocalAddress(const isc::asiolink::IOAddress& remote_addr,
1275 const uint16_t port);
1276
1277
1295 bool openMulticastSocket(Iface& iface,
1296 const isc::asiolink::IOAddress& addr,
1297 const uint16_t port,
1298 IfaceMgrErrorMsgCallback error_handler = 0);
1299
1309 void receiveDHCP4Packets();
1310
1321 void receiveDHCP4Packet(Iface& iface, const SocketInfo& socket_info);
1322
1332 void receiveDHCP6Packets();
1333
1343 void receiveDHCP6Packet(const SocketInfo& socket_info);
1344
1353 PktFilterPtr packet_filter_;
1354
1359 PktFilter6Ptr packet_filter6_;
1360
1362 SocketCallbackInfoContainer callbacks_;
1363
1365 bool test_mode_;
1366
1368 bool allow_loopback_;
1369
1371 PacketQueueMgr4Ptr packet_queue_mgr4_;
1372
1374 PacketQueueMgr6Ptr packet_queue_mgr6_;
1375
1378};
1379
1380}; // namespace isc::dhcp
1381}; // namespace isc
1382
1383#endif // IFACE_MGR_H
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
IfaceMgr exception thrown thrown when interface detection fails.
Definition: iface_mgr.h:37
IfaceDetectError(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:39
Handles network interfaces, transmission and reception.
Definition: iface_mgr.h:478
void clearIfaces()
Removes detected interfaces.
Definition: iface_mgr.cc:772
const IfaceCollection & getIfaces()
Returns container with all interfaces.
Definition: iface_mgr.h:597
static void addFDtoSet(int fd, int &maxfd, fd_set *sockets)
Convenience method for adding an descriptor to a set.
Definition: iface_mgr.cc:1197
void deleteExternalSocket(int socketfd)
Deletes external socket.
Definition: iface_mgr.cc:339
Pkt6Ptr receive6Indirect(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv6 packets indirectly or data from external sockets.
Definition: iface_mgr.cc:1310
PacketQueueMgr6Ptr getPacketQueueMgr6()
Fetches the DHCPv6 packet queue manager.
Definition: iface_mgr.h:1039
bool openSockets6(const uint16_t port=DHCP6_SERVER_PORT, IfaceMgrErrorMsgCallback error_handler=0)
Opens IPv6 sockets on detected interfaces.
Definition: iface_mgr.cc:606
int openSocket(const std::string &ifname, const isc::asiolink::IOAddress &addr, const uint16_t port, const bool receive_bcast=false, const bool send_bcast=false)
Opens UDP/IP socket and binds it to address, interface and port.
Definition: iface_mgr.cc:783
int openSocketFromAddress(const isc::asiolink::IOAddress &addr, const uint16_t port)
Opens UDP/IP socket and binds to address specified.
Definition: iface_mgr.cc:843
void printIfaces(std::ostream &out=std::cout)
Debugging method that prints out all available interfaces.
Definition: iface_mgr.cc:728
uint16_t countIfaces()
Returns number of detected interfaces.
Definition: iface_mgr.h:915
int openSocket4(Iface &iface, const isc::asiolink::IOAddress &addr, const uint16_t port, const bool receive_bcast=false, const bool send_bcast=false)
Opens IPv4 socket.
Definition: iface_mgr.cc:940
void setPacketFilter(const PktFilterPtr &packet_filter)
Set packet filter object to handle sending and receiving DHCPv4 messages.
Definition: iface_mgr.cc:355
int openSocketFromIface(const std::string &ifname, const uint16_t port, const uint8_t family)
Opens UDP/IP socket and binds it to interface specified.
Definition: iface_mgr.cc:802
Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets or data from external sockets.
Definition: iface_mgr.cc:1188
uint16_t getSocket(const isc::dhcp::Pkt6 &pkt)
Return most suitable socket for transmitting specified IPv6 packet.
Definition: iface_mgr.cc:1622
IfaceCollection ifaces_
List of available interfaces.
Definition: iface_mgr.h:1246
void startDHCPReceiver(const uint16_t family)
Starts DHCP packet receiver.
Definition: iface_mgr.cc:694
PacketQueueMgr4Ptr getPacketQueueMgr4()
Fetches the DHCPv4 packet queue manager.
Definition: iface_mgr.h:1022
void clearUnicasts()
Clears unicast addresses on all interfaces.
Definition: iface_mgr.cc:777
void detectIfaces()
Detects network interfaces.
std::list< IfacePtr > IfaceCollection
Type that holds a list of pointers to interfaces.
Definition: iface_mgr.h:509
bool openSockets4(const uint16_t port=DHCP4_SERVER_PORT, const bool use_bcast=true, IfaceMgrErrorMsgCallback error_handler=0)
Opens IPv4 sockets on detected interfaces.
Definition: iface_mgr.cc:477
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition: iface_mgr.cc:53
bool isDHCPReceiverRunning() const
Returns true if there is a receiver exists and its thread is currently running.
Definition: iface_mgr.h:1073
bool hasOpenSocket(const uint16_t family) const
Checks if there is at least one socket of the specified family open.
Definition: iface_mgr.cc:397
virtual ~IfaceMgr()
Destructor.
Definition: iface_mgr.cc:307
boost::function< void()> SocketCallback
Defines callback used when data is received over external sockets.
Definition: iface_mgr.h:481
int openSocket6(Iface &iface, const isc::asiolink::IOAddress &addr, uint16_t port, const bool join_multicast)
Opens IPv6 socket.
bool isTestMode() const
Checks if the IfaceMgr is in the test mode.
Definition: iface_mgr.h:550
bool configureDHCPPacketQueue(const uint16_t family, data::ConstElementPtr queue_control)
Configures DHCP packet queue.
Definition: iface_mgr.cc:1712
void stubDetectIfaces()
Stub implementation of network interface detection.
Definition: iface_mgr.cc:438
int openSocketFromRemoteAddress(const isc::asiolink::IOAddress &remote_addr, const uint16_t port)
Opens UDP/IP socket to be used to connect to remote address.
Definition: iface_mgr.cc:866
std::list< SocketCallbackInfo > SocketCallbackInfoContainer
Defines storage container for callbacks for external sockets.
Definition: iface_mgr.h:493
Pkt6Ptr receive6Direct(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv6 packets directly or data from external sockets.
Definition: iface_mgr.cc:1209
bool isDirectResponseSupported() const
Check if packet be sent directly to the client having no address.
Definition: iface_mgr.cc:312
void addExternalSocket(int socketfd, SocketCallback callback)
Adds external socket and a callback.
Definition: iface_mgr.cc:317
void addInterface(const IfacePtr &iface)
Adds an interface to list of known interfaces.
Definition: iface_mgr.h:994
IfaceMgr()
Protected constructor.
Definition: iface_mgr.cc:182
IfacePtr getIface(int ifindex)
Returns interface specified interface index.
Definition: iface_mgr.cc:752
bool send(const Pkt6Ptr &pkt)
Sends an IPv6 packet.
Definition: iface_mgr.cc:953
Pkt4Ptr receive4Indirect(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets indirectly or data from external sockets.
Definition: iface_mgr.cc:985
void closeSockets()
Closes all open sockets.
Definition: iface_mgr.cc:282
PacketQueue6Ptr getPacketQueue6()
Fetches the DHCPv6 receiver packet queue.
Definition: iface_mgr.h:1049
static const IfaceMgrPtr & instancePtr()
Returns pointer to the sole instance of the interface manager.
Definition: iface_mgr.cc:58
static const uint32_t RCVBUFSIZE
Packet reception buffer size.
Definition: iface_mgr.h:502
void deleteAllExternalSockets()
Deletes all external sockets.
Definition: iface_mgr.cc:350
void setMatchingPacketFilter(const bool direct_response_desired=false)
Set Packet Filter object to handle send/receive packets.
void stopDHCPReceiver()
Stops the DHCP packet receiver.
Definition: iface_mgr.cc:291
Pkt4Ptr receive4Direct(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets directly or data from external sockets.
Definition: iface_mgr.cc:1085
void setTestMode(const bool test_mode)
Sets or clears the test mode for IfaceMgr.
Definition: iface_mgr.h:543
PacketQueue4Ptr getPacketQueue4()
Fetches the DHCPv4 receiver packet queue.
Definition: iface_mgr.h:1032
void setAllowLoopBack(const bool allow_loopback)
Allows or disallows the loopback interface.
Definition: iface_mgr.h:559
Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets or data from external sockets.
Definition: iface_mgr.cc:977
IfaceMgr exception thrown when there is no suitable interface.
Definition: iface_mgr.h:82
IfaceNotFound(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:84
Represents a single network interface.
Definition: iface_mgr.h:114
size_t getReadBufferSize() const
Returns the current size of the socket read buffer.
Definition: iface_mgr.h:379
std::string getPlainMac() const
Returns link-layer address a plain text.
Definition: iface_mgr.cc:127
size_t getMacLen() const
Returns MAC length.
Definition: iface_mgr.h:191
uint64_t flags_
Interface flags (this value is as is returned by OS, it may mean different things on different OSes).
Definition: iface_mgr.h:439
bool inactive4_
Indicates that IPv4 sockets should (true) or should not (false) be opened on this interface.
Definition: iface_mgr.h:443
size_t mac_len_
Length of link-layer address (usually 6).
Definition: iface_mgr.h:410
~Iface()
Destructor.
Definition: iface_mgr.h:146
AddressCollection addrs_
List of assigned addresses.
Definition: iface_mgr.h:401
std::string getFullName() const
Returns full interface name as "ifname/ifindex" string.
Definition: iface_mgr.cc:120
std::string name_
Network interface name.
Definition: iface_mgr.h:395
const AddressCollection & getUnicasts() const
Returns a container of addresses the server should listen on.
Definition: iface_mgr.h:358
util::OptionalValue< asiolink::IOAddress > Address
Address type.
Definition: iface_mgr.h:121
uint16_t hardware_type_
Hardware type.
Definition: iface_mgr.h:413
SocketCollection sockets_
Socket used to send data.
Definition: iface_mgr.h:392
const AddressCollection & getAddresses() const
Returns all addresses available on an interface.
Definition: iface_mgr.h:246
uint8_t * getReadBuffer()
Returns the pointer to the buffer used for data reading.
Definition: iface_mgr.h:371
bool flag_multicast_
Flag specifies if selected interface is multicast capable.
Definition: iface_mgr.h:430
void setActive(const isc::asiolink::IOAddress &address, const bool active)
Activates or deactivates address for the interface.
Definition: iface_mgr.cc:251
std::string getName() const
Returns interface name.
Definition: iface_mgr.h:216
void setFlags(uint64_t flags)
Sets flag_*_ fields based on bitmask value returned by OS.
void clearUnicasts()
Removes any unicast addresses.
Definition: iface_mgr.h:345
uint16_t getHWType() const
Returns hardware type of the interface.
Definition: iface_mgr.h:226
bool delAddress(const isc::asiolink::IOAddress &addr)
Deletes an address from an interface.
Definition: iface_mgr.cc:154
bool hasAddress(const isc::asiolink::IOAddress &address) const
Check if the interface has the specified address assigned.
Definition: iface_mgr.cc:236
void setMac(const uint8_t *mac, size_t macLen)
Sets MAC address of the interface.
Definition: iface_mgr.cc:141
bool flag_running_
Flag specifies if selected interface is running (e.g.
Definition: iface_mgr.h:427
void resizeReadBuffer(const size_t new_size)
Reallocates the socket read buffer.
Definition: iface_mgr.h:386
bool delSocket(uint16_t sockfd)
Closes socket.
Definition: iface_mgr.cc:165
std::list< Address > AddressCollection
Type that defines list of addresses.
Definition: iface_mgr.h:124
const SocketCollection & getSockets() const
Returns collection of all sockets added to interface.
Definition: iface_mgr.h:339
bool inactive6_
Indicates that IPv6 sockets should (true) or should not (false) be opened on this interface.
Definition: iface_mgr.h:447
std::list< SocketInfo > SocketCollection
Type that holds a list of socket information.
Definition: iface_mgr.h:135
static const unsigned int MAX_MAC_LEN
Maximum MAC address length (Infiniband uses 20 bytes)
Definition: iface_mgr.h:118
bool flag_loopback_
Specifies if selected interface is loopback.
Definition: iface_mgr.h:420
void addUnicast(const isc::asiolink::IOAddress &addr)
Adds unicast the server should listen on.
Definition: iface_mgr.cc:209
unsigned int countActive4() const
Returns a number of activated IPv4 addresses on the interface.
Definition: iface_mgr.cc:272
uint8_t mac_[MAX_MAC_LEN]
Link-layer address.
Definition: iface_mgr.h:407
void addAddress(const isc::asiolink::IOAddress &addr)
Adds an address to an interface.
Definition: iface_mgr.cc:246
void closeSockets()
Closes all open sockets on interface.
Definition: iface_mgr.cc:73
void addSocket(const SocketInfo &sock)
Adds socket descriptor to an interface.
Definition: iface_mgr.h:313
int ifindex_
Interface index (a value that uniquely identifies an interface).
Definition: iface_mgr.h:398
bool flag_up_
Specifies if selected interface is up.
Definition: iface_mgr.h:423
bool flag_broadcast_
Flag specifies if selected interface is broadcast capable.
Definition: iface_mgr.h:433
void setHWType(uint16_t type)
Sets up hardware type of the interface.
Definition: iface_mgr.h:221
const uint8_t * getMac() const
Returns pointer to MAC address.
Definition: iface_mgr.h:197
uint16_t getIndex() const
Returns interface index.
Definition: iface_mgr.h:211
AddressCollection unicasts_
List of unicast addresses the server should listen on.
Definition: iface_mgr.h:404
bool getAddress4(isc::asiolink::IOAddress &address) const
Returns IPv4 address assigned to the interface.
Definition: iface_mgr.cc:220
Exception thrown when it is not allowed to set new Packet Filter.
Definition: iface_mgr.h:44
PacketFilterChangeDenied(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:46
Represents DHCPv4 packet.
Definition: pkt4.h:38
Represents a DHCPv6 packet.
Definition: pkt6.h:44
Exception thrown when a call to select is interrupted by a signal.
Definition: iface_mgr.h:51
SignalInterruptOnSelect(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:53
IfaceMgr exception thrown thrown when socket opening or configuration failed.
Definition: iface_mgr.h:59
SocketConfigError(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:61
IfaceMgr exception thrown when there is no suitable socket found.
Definition: iface_mgr.h:89
SocketNotFound(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:91
IfaceMgr exception thrown thrown when error occurred during reading data from socket.
Definition: iface_mgr.h:67
SocketReadError(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:69
IfaceMgr exception thrown thrown when error occurred during sending data through socket.
Definition: iface_mgr.h:75
SocketWriteError(const char *file, size_t line, const char *what)
Definition: iface_mgr.h:77
Simple class representing an optional value.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< IfaceMgr > IfaceMgrPtr
Type definition for the pointer to the IfaceMgr.
Definition: iface_mgr.h:463
boost::shared_ptr< PacketQueue< Pkt4Ptr > > PacketQueue4Ptr
Defines pointer to the DHCPv4 queue interface used at the application level.
Definition: packet_queue.h:134
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
Definition: pkt4.h:546
boost::shared_ptr< PktFilter > PktFilterPtr
Pointer to a PktFilter object.
Definition: pkt_filter.h:134
boost::shared_ptr< Iface > IfacePtr
Definition: iface_mgr.h:457
boost::function< void(const std::string &errmsg)> IfaceMgrErrorMsgCallback
This type describes the callback function invoked when error occurs in the IfaceMgr.
Definition: iface_mgr.h:470
boost::shared_ptr< PacketQueue< Pkt6Ptr > > PacketQueue6Ptr
Defines pointer to the DHCPv6 queue interface used at the application level.
Definition: packet_queue.h:139
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
Definition: pkt6.h:31
boost::shared_ptr< PktFilter6 > PktFilter6Ptr
Pointer to a PktFilter object.
Definition: pkt_filter6.h:136
boost::shared_ptr< PacketQueueMgr4 > PacketQueueMgr4Ptr
Defines a shared pointer to PacketQueueMgr4.
boost::shared_ptr< PacketQueueMgr6 > PacketQueueMgr6Ptr
Defines a shared pointer to PacketQueueMgr6.
boost::shared_ptr< WatchedThread > WatchedThreadPtr
Defines a pointer to a WatchedThread.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Keeps callback information for external sockets.
Definition: iface_mgr.h:484
SocketCallback callback_
A callback that will be called when data arrives over socket_.
Definition: iface_mgr.h:489
int socket_
Socket descriptor of the external socket.
Definition: iface_mgr.h:486
Holds information about socket.
Definition: socket_info.h:19
Defines the class, WatchSocket.