Kea: iface_mgr.h Source File

| Kea 3.2.0-git

iface_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2011-2026 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>
15#include <dhcp/packet_queue_mgr4.h>
16#include <dhcp/packet_queue_mgr6.h>
17#include <dhcp/pkt_filter.h>
18#include <dhcp/pkt_filter6.h>
19#include <util/fd_event_handler_factory.h>
20#include <util/optional.h>
21#include <util/watch_socket.h>
22#include <util/watched_thread.h>
23
24#include <boost/multi_index/hashed_index.hpp>
25#include <boost/multi_index/member.hpp>
26#include <boost/multi_index/mem_fun.hpp>
27#include <boost/multi_index/sequenced_index.hpp>
28#include <boost/multi_index_container.hpp>
29#include <boost/noncopyable.hpp>
30#include <boost/scoped_array.hpp>
31#include <boost/shared_ptr.hpp>
32
33#include <atomic>
34#include <functional>
35#include <list>
36#include <mutex>
37#include <thread>
38#include <vector>
39
40namespace isc {
41namespace dhcp {
42
44 class IfaceDetectError : public Exception {
45public:
46 IfaceDetectError(const char* file, size_t line, const char* what) :
47 isc::Exception(file, line, what) { }
48};
49
51 class PacketFilterChangeDenied : public Exception {
52public:
53 PacketFilterChangeDenied(const char* file, size_t line, const char* what) :
54 isc::Exception(file, line, what) { }
55};
56
58 class SignalInterruptOnSelect : public Exception {
59public:
60 SignalInterruptOnSelect(const char* file, size_t line, const char* what) :
61 isc::Exception(file, line, what) { }
62};
63
66 class SocketConfigError : public Exception {
67public:
68 SocketConfigError(const char* file, size_t line, const char* what) :
69 isc::Exception(file, line, what) { }
70};
71
74 class SocketReadError : public Exception {
75public:
76 SocketReadError(const char* file, size_t line, const char* what) :
77 isc::Exception(file, line, what) { }
78};
79
82 class SocketWriteError : public Exception {
83public:
84 SocketWriteError(const char* file, size_t line, const char* what) :
85 isc::Exception(file, line, what) { }
86};
87
89 class IfaceNotFound : public Exception {
90public:
91 IfaceNotFound(const char* file, size_t line, const char* what) :
92 isc::Exception(file, line, what) { }
93};
94
96 class SocketNotFound : public Exception {
97public:
98 SocketNotFound(const char* file, size_t line, const char* what) :
99 isc::Exception(file, line, what) { }
100};
101
104 class SocketFDError : public Exception {
105public:
106 SocketFDError(const char* file, size_t line, const char* what) :
107 isc::Exception(file, line, what) { }
108};
109
111 class ReceiveTerminate : public Exception {
112public:
113 ReceiveTerminate(const char* file, size_t line, const char* what) :
114 isc::Exception(file, line, what) { }
115};
116
136 class Iface : public isc::data::CfgToElement, public boost::noncopyable {
137public:
138
140 static const unsigned int MAX_MAC_LEN = 20;
141
143 typedef util::Optional<asiolink::IOAddress> Address;
144
146 typedef std::list<Address> AddressCollection;
147
157 typedef boost::multi_index_container<
158 // Container comprises elements of SocketInfo type.
159 SocketInfo,
160 // Here we start enumerating various indexes.
161 boost::multi_index::indexed_by<
162 // Sequenced index #0 in insertion order.
163 boost::multi_index::sequenced<>,
164 // Sequenced index #1 in Least Recently Used order.
165 boost::multi_index::sequenced<>
166 >
167 > SocketCollection;
168
170 typedef SocketCollection::nth_index<1>::type SocketLruIndex;
171
173 typedef SocketLruIndex::iterator SocketLruIterator;
174
176 using ErrorBuffer = std::vector<std::string>;
177
185 Iface(const std::string& name, unsigned int ifindex);
186
188 ~Iface() = default;
189
191 void closeSockets();
192
212 void closeSockets(const uint16_t family);
213
217 std::string getFullName() const;
218
222 std::string getPlainMac() const;
223
228 void setMac(const uint8_t* mac, size_t macLen);
229
233 size_t getMacLen() const {
234 return (mac_len_);
235 }
236
241 const uint8_t* getMac() const {
242 return (mac_);
243 }
244
252 void setFlags(uint64_t flags);
253
257 unsigned int getIndex() const {
258 return (ifindex_);
259 }
260
264 std::string getName() const {
265 return (name_);
266 }
267
271 void setHWType(uint16_t type ) {
272 hardware_type_ = type;
273 }
274
278 uint16_t getHWType() const {
279 return (hardware_type_);
280 }
281
300 const AddressCollection& getAddresses() const {
301 return (addrs_);
302 }
303
313 bool getAddress4(isc::asiolink::IOAddress& address) const;
314
319 bool hasAddress(const isc::asiolink::IOAddress& address) const;
320
327 void addAddress(const isc::asiolink::IOAddress& addr);
328
340 void setActive(const isc::asiolink::IOAddress& address, const bool active);
341
350 void setActive(const bool active);
351
353 unsigned int countActive4() const;
354
364 bool delAddress(const isc::asiolink::IOAddress& addr);
365
369 void addSocket(const SocketInfo& sock) {
370 sockets_.push_back(sock);
371 }
372
380 bool delSocket(uint16_t sockfd);
381
395 const SocketCollection& getSockets() const {
396 return (sockets_);
397 }
398
402 SocketCollection& getSocketsRef() {
403 return (sockets_);
404 }
405
410 void clearUnicasts() {
411 unicasts_.clear();
412 }
413
418 void addUnicast(const isc::asiolink::IOAddress& addr);
419
423 const AddressCollection& getUnicasts() const {
424 return (unicasts_);
425 }
426
436 uint8_t* getReadBuffer() {
437 if (read_buffer_.empty()) {
438 return (0);
439 }
440 return (&read_buffer_[0]);
441 }
442
444 size_t getReadBufferSize() const {
445 return (read_buffer_.size());
446 }
447
451 void resizeReadBuffer(const size_t new_size) {
452 read_buffer_.resize(new_size);
453 }
454
458 void addError(std::string const& message);
459
461 void clearErrors();
462
466 ErrorBuffer const& getErrors() const;
467
477 virtual isc::data::ElementPtr toElement() const;
478
479protected:
481 SocketCollection sockets_;
482
484 std::string name_;
485
487 unsigned int ifindex_;
488
490 AddressCollection addrs_;
491
493 AddressCollection unicasts_;
494
496 uint8_t mac_[MAX_MAC_LEN];
497
499 size_t mac_len_;
500
502 uint16_t hardware_type_;
503
504public:
507
509 bool flag_loopback_;
510
512 bool flag_up_;
513
516 bool flag_running_;
517
519 bool flag_multicast_;
520
522 bool flag_broadcast_;
523
528 uint64_t flags_;
529
532 bool inactive4_;
533
536 bool inactive6_;
537
538private:
539
543 std::vector<uint8_t> read_buffer_;
544
551 ErrorBuffer errors_;
552};
553
555 typedef boost::shared_ptr<Iface> IfacePtr;
556
558 class IfaceCollection {
559public:
560
570 typedef boost::multi_index_container<
571 // Container comprises elements of IfacePtr type.
572 IfacePtr,
573 // Here we start enumerating various indexes.
574 boost::multi_index::indexed_by<
575 // Sequenced index allows accessing elements in the same way
576 // as elements in std::list. Sequenced is the index #0.
577 boost::multi_index::sequenced<>,
578 // Start definition of index #1.
579 boost::multi_index::hashed_unique<
580 // Use the interface index as the key.
581 boost::multi_index::const_mem_fun<
582 Iface, unsigned int, &Iface::getIndex
583 >
584 >,
585 // Start definition of index #2.
586 boost::multi_index::hashed_unique<
587 // Use the interface name as the key.
588 boost::multi_index::const_mem_fun<
589 Iface, std::string, &Iface::getName
590 >
591 >,
592 // Start definition of index #3.
593 // Sequence in Least Recently Used order.
594 boost::multi_index::sequenced<>
595 >
596 > IfaceContainer;
597
601 IfaceContainer::const_iterator begin() const {
602 return (ifaces_container_.begin());
603 }
604
608 IfaceContainer::const_iterator end() const {
609 return (ifaces_container_.end());
610 }
611
613 typedef IfaceContainer::nth_index<3>::type LruIndex;
614
618 LruIndex& getLru() {
619 return (ifaces_container_.get<3>());
620 }
621
623 typedef LruIndex::iterator LruIterator;
624
628 bool empty() const {
629 return (ifaces_container_.empty());
630 }
631
635 size_t size() const {
636 return (ifaces_container_.size());
637 }
638
640 void clear() {
641 cache_.reset();
642 ifaces_container_.clear();
643 }
644
650 void push_back(const IfacePtr& iface) {
651 ifaces_container_.push_back(iface);
652 }
653
658 IfacePtr getIface(const unsigned int ifindex);
659
664 IfacePtr getIface(const std::string& ifname);
665
666private:
672 IfacePtr getIfaceInternal(const unsigned int ifindex, const bool need_lock);
673
681 IfacePtr getIfaceInternal(const std::string& ifname, const bool need_lock);
682
685 std::mutex mutex_;
686
696 IfacePtr cache_;
697
699 IfaceContainer ifaces_container_;
700};
701
706typedef boost::multi_index_container<
708 asiolink::IOAddress,
709 // Here we start enumerating the only index.
710 boost::multi_index::indexed_by<
711 // Start definition of index #0.
712 boost::multi_index::hashed_unique<
713 // Use the address in its network order integer form as the key.
714 boost::multi_index::const_mem_fun<
715 asiolink::IOAddress, uint32_t, &asiolink::IOAddress::toUint32
716 >
717 >
718 >
719> BoundAddresses;
720
722class IfaceMgr;
723
725 typedef boost::shared_ptr<IfaceMgr> IfaceMgrPtr;
726
731typedef
732std::function<void(const std::string& errmsg)> IfaceMgrErrorMsgCallback;
733
740 class IfaceMgr : public boost::noncopyable {
741public:
745 typedef std::function<void (int fd)> SocketCallback;
746
754 typedef std::function<bool (bool)> DetectCallback;
755
757 struct SocketCallbackInfo {
759 int socket_;
760
762 SocketCallback callback_;
763
766 bool unusable_;
767
771 SocketCallbackInfo(int socket)
772 : socket_(socket), callback_(0), unusable_(false) {
773 }
774 };
775
780 typedef boost::multi_index_container<
781 // Container comprises elements of SocketCallbackInfo type.
782 SocketCallbackInfo,
783 // Here we start enumerating various indexes.
784 boost::multi_index::indexed_by<
785 // Sequenced index allows accessing elements in the same way
786 // as elements in std::list. Sequenced is the index #0.
787 boost::multi_index::sequenced<>,
788 // Use the file descriptor as the key for index #1.
789 boost::multi_index::hashed_unique<
790 boost::multi_index::member<
791 SocketCallbackInfo, int, &SocketCallbackInfo::socket_
792 >
793 >
794 >
795 > SocketCallbackInfoContainer;
796
798 typedef SocketCallbackInfoContainer::iterator SocketCallbackInfoIterator;
799
807 static const uint32_t RCVBUFSIZE = 1500;
808
813 static IfaceMgr& instance();
814
825 static const IfaceMgrPtr& instancePtr();
826
830 virtual ~IfaceMgr();
831
833 void initializeFDEventHandler();
834
844 void setTestMode(const bool test_mode) {
845 test_mode_ = test_mode;
846 }
847
851 bool isTestMode() const {
852 return (test_mode_);
853 }
854
859 bool getCheckThreadId() const {
860 return (check_thread_id_);
861 }
862
868 void setCheckThreadId(const bool check) {
869 check_thread_id_ = check;
870 }
871
875 bool isMainThread() const {
876 return (std::this_thread::get_id() == id_);
877 }
878
884 void setAllowLoopBack(const bool allow_loopback) {
885 allow_loopback_ = allow_loopback;
886 }
887
896 bool isDirectResponseSupported() const;
897
904 virtual bool isSocketReceivedTimeSupported() const;
905
913 IfacePtr getIface(const unsigned int ifindex);
914
921 IfacePtr getIface(const std::string& ifname);
922
933 IfacePtr getIface(const PktPtr& pkt);
934
942 const IfaceCollection& getIfaces() {
943 return (ifaces_);
944 }
945
952 void clearIfaces();
953
958 void setDetectCallback(const DetectCallback& cb) {
959 detect_callback_ = cb;
960 }
961
970 bool checkDetectIfaces(bool update_only);
971
979 void detectIfaces(bool update_only = false);
980
982 void clearUnicasts();
983
985 void clearBoundAddresses();
986
988 void collectBoundAddresses();
989
1003 uint16_t getSocket(const isc::dhcp::Pkt6Ptr& pkt);
1004
1018 SocketInfo getSocket(const isc::dhcp::Pkt4Ptr& pkt);
1019
1023 void printIfaces(std::ostream& out = std::cout);
1024
1036 bool send(const Pkt6Ptr& pkt);
1037
1049 bool send(const Pkt4Ptr& pkt);
1050
1062 Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1063
1075 Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1076
1095 int openSocket(const std::string& ifname,
1096 const isc::asiolink::IOAddress& addr,
1097 const uint16_t port,
1098 const bool receive_bcast = false,
1099 const bool send_bcast = false);
1100
1118 int openSocketFromIface(const std::string& ifname,
1119 const uint16_t port,
1120 const uint8_t family);
1121
1136 int openSocketFromAddress(const isc::asiolink::IOAddress& addr,
1137 const uint16_t port);
1138
1153 int openSocketFromRemoteAddress(const isc::asiolink::IOAddress& remote_addr,
1154 const uint16_t port);
1155
1202 bool openSockets6(const uint16_t port = DHCP6_SERVER_PORT,
1203 IfaceMgrErrorMsgCallback error_handler = 0,
1204 const bool skip_opened = false);
1205
1275 bool openSockets4(const uint16_t port = DHCP4_SERVER_PORT,
1276 const bool use_bcast = true,
1277 IfaceMgrErrorMsgCallback error_handler = 0,
1278 const bool skip_opened = false);
1279
1286 void closeSockets();
1287
1291 uint16_t countIfaces() {
1292 return (ifaces_.size());
1293 }
1294
1313 void addExternalSocket(int socketfd, SocketCallback callback);
1314
1318 bool isExternalSocket(int fd);
1319
1324 bool isExternalSocketUnusable(int fd);
1325
1332 void deleteExternalSocket(int socketfd);
1333
1340 void deleteAllExternalSockets();
1341
1345 std::list<int> getAllExternalSockets();
1346
1362 void setPacketFilter(const PktFilterPtr& packet_filter);
1363
1384 void setPacketFilter(const PktFilter6Ptr& packet_filter);
1385
1402 void setMatchingPacketFilter(const bool direct_response_desired = false);
1403
1410 void addInterface(const IfacePtr& iface);
1411
1418 bool hasOpenSocket(const uint16_t family) const;
1419
1437 bool hasOpenSocket(const isc::asiolink::IOAddress& addr, bool unicast = false) const;
1438
1442 PacketQueueMgr4Ptr getPacketQueueMgr4() {
1443 return (packet_queue_mgr4_);
1444 }
1445
1452 PacketQueue4Ptr getPacketQueue4() {
1453 return (packet_queue_mgr4_->getPacketQueue());
1454 }
1455
1459 PacketQueueMgr6Ptr getPacketQueueMgr6() {
1460 return (packet_queue_mgr6_);
1461 }
1462
1469 PacketQueue6Ptr getPacketQueue6() {
1470 return (packet_queue_mgr6_->getPacketQueue());
1471 }
1472
1483 void startDHCPReceiver(const uint16_t family);
1484
1492 void stopDHCPReceiver(bool clear_queue = true);
1493
1496 bool isDHCPReceiverRunning() const {
1497 return (dhcp_receiver_ != 0 && dhcp_receiver_->isRunning());
1498 }
1499
1513 bool configureDHCPPacketQueue(const uint16_t family,
1514 data::ConstElementPtr queue_control);
1515
1517 void setFamily(uint16_t family) {
1518 family_ = family == AF_INET ? AF_INET : AF_INET6;
1519 }
1520
1522 uint16_t getFamily() const {
1523 return (family_);
1524 }
1525
1529 isc::data::ElementPtr ifacesToElement() const;
1530
1531 // don't use private, we need derived classes in tests
1532protected:
1533
1538 IfaceMgr();
1539
1553 int openSocket4(Iface& iface, const isc::asiolink::IOAddress& addr,
1554 const uint16_t port, const bool receive_bcast = false,
1555 const bool send_bcast = false);
1556
1577 Pkt4Ptr receive4Direct(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1578
1599 Pkt4Ptr receive4Indirect(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1600
1615 int openSocket6(Iface& iface, const isc::asiolink::IOAddress& addr,
1616 uint16_t port, const bool join_multicast);
1617
1638 Pkt6Ptr receive6Direct(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1639
1660 Pkt6Ptr receive6Indirect(uint32_t timeout_sec, uint32_t timeout_usec = 0);
1661
1663 std::thread::id id_;
1664
1666 IfaceCollection ifaces_;
1667
1669 BoundAddresses bound_address_;
1670
1671 // TODO: Also keep this interface on Iface once interface detection
1672 // is implemented. We may need it e.g. to close all sockets on
1673 // specific interface
1674 //int recvsock_; // TODO: should be fd_set eventually, but we have only
1675 //int sendsock_; // 2 sockets for now. Will do for until next release
1676
1677 // We can't use the same socket, as receiving socket
1678 // is bound to multicast address. And we all know what happens
1679 // to people who try to use multicast as source address.
1680
1681private:
1696 isc::asiolink::IOAddress
1697 getLocalAddress(const isc::asiolink::IOAddress& remote_addr,
1698 const uint16_t port);
1699
1719 bool openMulticastSocket(Iface& iface,
1720 const isc::asiolink::IOAddress& addr,
1721 const uint16_t port,
1722 IfaceMgrErrorMsgCallback error_handler = 0);
1723
1733 void receiveDHCP4Packets();
1734
1738 void scanReceiveDHCP4Packets();
1739
1750 void receiveDHCP4Packet(Iface& iface, const SocketInfo& socket_info);
1751
1761 void receiveDHCP6Packets();
1762
1766 void scanReceiveDHCP6Packets();
1767
1777 void receiveDHCP6Packet(const SocketInfo& socket_info);
1778
1782 void deleteExternalSocketInternal(int socketfd);
1783
1790 void handleClosedExternalSocket(SocketCallbackInfoIterator it);
1791
1793 void handleClosedExternalSockets();
1794
1799 void handleIfaceSocketError(const IfacePtr& iface, const SocketInfo& s);
1800
1809 PktFilterPtr packet_filter_;
1810
1815 PktFilter6Ptr packet_filter6_;
1816
1818 SocketCallbackInfoContainer callbacks_;
1819
1821 std::mutex callbacks_mutex_;
1822
1824 bool test_mode_;
1825
1827 std::atomic<bool> check_thread_id_;
1828
1834 DetectCallback detect_callback_;
1835
1837 bool allow_loopback_;
1838
1840 PacketQueueMgr4Ptr packet_queue_mgr4_;
1841
1843 PacketQueueMgr6Ptr packet_queue_mgr6_;
1844
1846 isc::util::WatchedThreadPtr dhcp_receiver_;
1847
1849 std::mutex receiver_mutex_;
1850
1852 util::FDEventHandlerPtr fd_event_handler_;
1853
1855 util::FDEventHandlerPtr receiver_fd_event_handler_;
1856
1858 uint16_t family_;
1859};
1860
1867 class ReceiverCriticalSection : public boost::noncopyable {
1868public:
1869
1874 ReceiverCriticalSection()
1875 : is_running_(IfaceMgr::instance().isDHCPReceiverRunning()) {
1876 if (is_running_) {
1877 IfaceMgr::instance().stopDHCPReceiver(false);
1878 }
1879 }
1880
1885 ~ReceiverCriticalSection() {
1886 if (is_running_ && !IfaceMgr::instance().isDHCPReceiverRunning()) {
1887 auto family = IfaceMgr::instance().getFamily();
1888 IfaceMgr::instance().startDHCPReceiver(family);
1889 }
1890 }
1891
1892private:
1894 bool is_running_;
1895};
1896
1897} // namespace isc::dhcp
1898} // namespace isc
1899
1900#endif // IFACE_MGR_H
isc::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
Definition exceptions/exceptions.cc:17
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition exceptions/exceptions.cc:32
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:53
isc::asiolink::IOAddress::toUint32
uint32_t toUint32() const
Converts IPv4 address to uint32_t.
Definition io_address.cc:121
isc::dhcp::IfaceCollection
Collection of pointers to network interfaces.
Definition iface_mgr.h:558
isc::dhcp::IfaceCollection::getIface
IfacePtr getIface(const unsigned int ifindex)
Lookup by interface index.
Definition iface_mgr.cc:870
isc::dhcp::IfaceCollection::end
IfaceContainer::const_iterator end() const
End iterator.
Definition iface_mgr.h:608
isc::dhcp::IfaceCollection::clear
void clear()
Clear the collection.
Definition iface_mgr.h:640
isc::dhcp::IfaceCollection::begin
IfaceContainer::const_iterator begin() const
Begin iterator.
Definition iface_mgr.h:601
isc::dhcp::IfaceCollection::getLru
LruIndex & getLru()
LRU index.
Definition iface_mgr.h:618
isc::dhcp::IfaceCollection::LruIndex
IfaceContainer::nth_index< 3 >::type LruIndex
Type of LRU index.
Definition iface_mgr.h:613
isc::dhcp::IfaceCollection::size
size_t size() const
Return the number of interfaces.
Definition iface_mgr.h:635
isc::dhcp::IfaceCollection::push_back
void push_back(const IfacePtr &iface)
Adds an interface to the collection.
Definition iface_mgr.h:650
isc::dhcp::IfaceCollection::empty
bool empty() const
Empty predicate.
Definition iface_mgr.h:628
isc::dhcp::IfaceCollection::IfaceContainer
boost::multi_index_container< IfacePtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, unsigned int, &Iface::getIndex > >, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, std::string, &Iface::getName > >, boost::multi_index::sequenced<> > > IfaceContainer
Multi index container for network interfaces.
Definition iface_mgr.h:596
isc::dhcp::IfaceCollection::LruIterator
LruIndex::iterator LruIterator
Type of LRU iterator.
Definition iface_mgr.h:623
isc::dhcp::IfaceDetectError::IfaceDetectError
IfaceDetectError(const char *file, size_t line, const char *what)
Definition iface_mgr.h:46
isc::dhcp::IfaceMgr
Handles network interfaces, transmission and reception.
Definition iface_mgr.h:740
isc::dhcp::IfaceMgr::clearIfaces
void clearIfaces()
Removes detected interfaces.
Definition iface_mgr.cc:959
isc::dhcp::IfaceMgr::getIfaces
const IfaceCollection & getIfaces()
Returns container with all interfaces.
Definition iface_mgr.h:942
isc::dhcp::IfaceMgr::isExternalSocket
bool isExternalSocket(int fd)
Checks if socket's file description is registered.
Definition iface_mgr.cc:422
isc::dhcp::IfaceMgr::SocketCallbackInfoContainer
boost::multi_index_container< SocketCallbackInfo, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_unique< boost::multi_index::member< SocketCallbackInfo, int, &SocketCallbackInfo::socket_ > > > > SocketCallbackInfoContainer
Defines storage container for callbacks for external sockets.
Definition iface_mgr.h:795
isc::dhcp::IfaceMgr::deleteExternalSocket
void deleteExternalSocket(int socketfd)
Deletes external socket.
Definition iface_mgr.cc:398
isc::dhcp::IfaceMgr::receive6Indirect
Pkt6Ptr receive6Indirect(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv6 packets indirectly or data from external sockets.
Definition iface_mgr.cc:1700
isc::dhcp::IfaceMgr::getPacketQueueMgr6
PacketQueueMgr6Ptr getPacketQueueMgr6()
Fetches the DHCPv6 packet queue manager.
Definition iface_mgr.h:1459
isc::dhcp::IfaceMgr::openSockets4
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:555
isc::dhcp::IfaceMgr::stopDHCPReceiver
void stopDHCPReceiver(bool clear_queue=true)
Stops the DHCP packet receiver.
Definition iface_mgr.cc:325
isc::dhcp::IfaceMgr::SocketCallback
std::function< void(int fd)> SocketCallback
Defines callback used when data is received over external sockets.
Definition iface_mgr.h:745
isc::dhcp::IfaceMgr::openSocket
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:1034
isc::dhcp::IfaceMgr::openSocketFromAddress
int openSocketFromAddress(const isc::asiolink::IOAddress &addr, const uint16_t port)
Opens UDP/IP socket and binds to address specified.
Definition iface_mgr.cc:1100
isc::dhcp::IfaceMgr::printIfaces
void printIfaces(std::ostream &out=std::cout)
Debugging method that prints out all available interfaces.
Definition iface_mgr.cc:846
isc::dhcp::IfaceMgr::countIfaces
uint16_t countIfaces()
Returns number of detected interfaces.
Definition iface_mgr.h:1291
isc::dhcp::IfaceMgr::getIface
IfacePtr getIface(const unsigned int ifindex)
Returns interface specified interface index.
Definition iface_mgr.cc:937
isc::dhcp::IfaceMgr::openSocket4
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:1197
isc::dhcp::IfaceMgr::openSockets6
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:685
isc::dhcp::IfaceMgr::bound_address_
BoundAddresses bound_address_
Unordered set of IPv4 bound addresses.
Definition iface_mgr.h:1669
isc::dhcp::IfaceMgr::setPacketFilter
void setPacketFilter(const PktFilterPtr &packet_filter)
Set packet filter object to handle sending and receiving DHCPv4 messages.
Definition iface_mgr.cc:463
isc::dhcp::IfaceMgr::openSocketFromIface
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:1059
isc::dhcp::IfaceMgr::receive6
Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets or data from external sockets.
Definition iface_mgr.cc:1530
isc::dhcp::IfaceMgr::detectIfaces
void detectIfaces(bool update_only=false)
Detects network interfaces.
isc::dhcp::IfaceMgr::setDetectCallback
void setDetectCallback(const DetectCallback &cb)
Set a callback to perform operations before executing specific system calls.
Definition iface_mgr.h:958
isc::dhcp::IfaceMgr::ifaces_
IfaceCollection ifaces_
List of available interfaces.
Definition iface_mgr.h:1666
isc::dhcp::IfaceMgr::startDHCPReceiver
void startDHCPReceiver(const uint16_t family)
Starts DHCP packet receiver.
Definition iface_mgr.cc:800
isc::dhcp::IfaceMgr::isMainThread
bool isMainThread() const
Check if called from the main thread.
Definition iface_mgr.h:875
isc::dhcp::IfaceMgr::getPacketQueueMgr4
PacketQueueMgr4Ptr getPacketQueueMgr4()
Fetches the DHCPv4 packet queue manager.
Definition iface_mgr.h:1442
isc::dhcp::IfaceMgr::setCheckThreadId
void setCheckThreadId(const bool check)
Set the flag which indicates if thread ID is checked when performing operations with external sockets...
Definition iface_mgr.h:868
isc::dhcp::IfaceMgr::setFamily
void setFamily(uint16_t family)
Sets address family (AF_INET or AF_INET6).
Definition iface_mgr.h:1517
isc::dhcp::IfaceMgr::clearUnicasts
void clearUnicasts()
Clears unicast addresses on all interfaces.
Definition iface_mgr.cc:1028
isc::dhcp::IfaceMgr::isSocketReceivedTimeSupported
virtual bool isSocketReceivedTimeSupported() const
Check if the socket received time is supported.
Definition iface_mgr.cc:362
isc::dhcp::IfaceMgr::instance
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:52
isc::dhcp::IfaceMgr::initializeFDEventHandler
void initializeFDEventHandler()
Initialize the FD event handler;.
Definition iface_mgr.cc:213
isc::dhcp::IfaceMgr::isDHCPReceiverRunning
bool isDHCPReceiverRunning() const
Returns true if there is a receiver exists and its thread is currently running.
Definition iface_mgr.h:1496
isc::dhcp::IfaceMgr::hasOpenSocket
bool hasOpenSocket(const uint16_t family) const
Checks if there is at least one socket of the specified family open.
Definition iface_mgr.cc:505
isc::dhcp::IfaceMgr::~IfaceMgr
virtual ~IfaceMgr()
Destructor.
Definition iface_mgr.cc:343
isc::dhcp::IfaceMgr::collectBoundAddresses
void collectBoundAddresses()
Collect the addresses all sockets are bound to.
Definition iface_mgr.cc:1013
isc::dhcp::IfaceMgr::ifacesToElement
isc::data::ElementPtr ifacesToElement() const
Unparses detected interface list.
Definition iface_mgr.cc:348
isc::dhcp::IfaceMgr::openSocket6
int openSocket6(Iface &iface, const isc::asiolink::IOAddress &addr, uint16_t port, const bool join_multicast)
Opens IPv6 socket.
isc::dhcp::IfaceMgr::isTestMode
bool isTestMode() const
Checks if the IfaceMgr is in the test mode.
Definition iface_mgr.h:851
isc::dhcp::IfaceMgr::getFamily
uint16_t getFamily() const
Returns address family.
Definition iface_mgr.h:1522
isc::dhcp::IfaceMgr::getCheckThreadId
bool getCheckThreadId() const
Get the flag which indicates if thread ID is checked when performing operations with external sockets...
Definition iface_mgr.h:859
isc::dhcp::IfaceMgr::configureDHCPPacketQueue
bool configureDHCPPacketQueue(const uint16_t family, data::ConstElementPtr queue_control)
Configures DHCP packet queue.
Definition iface_mgr.cc:2248
isc::dhcp::IfaceMgr::openSocketFromRemoteAddress
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:1123
isc::dhcp::IfaceMgr::getAllExternalSockets
std::list< int > getAllExternalSockets()
Get the list of external sockets.
Definition iface_mgr.cc:453
isc::dhcp::IfaceMgr::receive6Direct
Pkt6Ptr receive6Direct(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv6 packets directly or data from external sockets.
Definition iface_mgr.cc:1539
isc::dhcp::IfaceMgr::checkDetectIfaces
bool checkDetectIfaces(bool update_only)
Check if the specific system calls used to detect interfaces should be executed.
Definition iface_mgr.cc:2299
isc::dhcp::IfaceMgr::SocketCallbackInfoIterator
SocketCallbackInfoContainer::iterator SocketCallbackInfoIterator
SocketCallbackInfo iterator type.
Definition iface_mgr.h:798
isc::dhcp::IfaceMgr::isDirectResponseSupported
bool isDirectResponseSupported() const
Check if packet be sent directly to the client having no address.
Definition iface_mgr.cc:357
isc::dhcp::IfaceMgr::clearBoundAddresses
void clearBoundAddresses()
Clears the addresses all sockets are bound to.
Definition iface_mgr.cc:964
isc::dhcp::IfaceMgr::addExternalSocket
void addExternalSocket(int socketfd, SocketCallback callback)
Adds external socket and a callback.
Definition iface_mgr.cc:367
isc::dhcp::IfaceMgr::addInterface
void addInterface(const IfacePtr &iface)
Adds an interface to list of known interfaces.
Definition iface_mgr.cc:833
isc::dhcp::IfaceMgr::IfaceMgr
IfaceMgr()
Protected constructor.
Definition iface_mgr.cc:181
isc::dhcp::IfaceMgr::send
bool send(const Pkt6Ptr &pkt)
Sends an IPv6 packet.
Definition iface_mgr.cc:1208
isc::dhcp::IfaceMgr::receive4Indirect
Pkt4Ptr receive4Indirect(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets indirectly or data from external sockets.
Definition iface_mgr.cc:1241
isc::dhcp::IfaceMgr::closeSockets
void closeSockets()
Closes all open sockets.
Definition iface_mgr.cc:313
isc::dhcp::IfaceMgr::getPacketQueue6
PacketQueue6Ptr getPacketQueue6()
Fetches the DHCPv6 receiver packet queue.
Definition iface_mgr.h:1469
isc::dhcp::IfaceMgr::isExternalSocketUnusable
bool isExternalSocketUnusable(int fd)
Checks if socket's file description is registered.
Definition iface_mgr.cc:430
isc::dhcp::IfaceMgr::instancePtr
static const IfaceMgrPtr & instancePtr()
Returns pointer to the sole instance of the interface manager.
Definition iface_mgr.cc:57
isc::dhcp::IfaceMgr::RCVBUFSIZE
static const uint32_t RCVBUFSIZE
Packet reception buffer size.
Definition iface_mgr.h:807
isc::dhcp::IfaceMgr::deleteAllExternalSockets
void deleteAllExternalSockets()
Deletes all external sockets.
Definition iface_mgr.cc:442
isc::dhcp::IfaceMgr::setMatchingPacketFilter
void setMatchingPacketFilter(const bool direct_response_desired=false)
Set Packet Filter object to handle send/receive packets.
isc::dhcp::IfaceMgr::id_
std::thread::id id_
Main thread ID.
Definition iface_mgr.h:1663
isc::dhcp::IfaceMgr::receive4Direct
Pkt4Ptr receive4Direct(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets directly or data from external sockets.
Definition iface_mgr.cc:1369
isc::dhcp::IfaceMgr::setTestMode
void setTestMode(const bool test_mode)
Sets or clears the test mode for IfaceMgr.
Definition iface_mgr.h:844
isc::dhcp::IfaceMgr::getPacketQueue4
PacketQueue4Ptr getPacketQueue4()
Fetches the DHCPv4 receiver packet queue.
Definition iface_mgr.h:1452
isc::dhcp::IfaceMgr::getSocket
uint16_t getSocket(const isc::dhcp::Pkt6Ptr &pkt)
Return most suitable socket for transmitting specified IPv6 packet.
Definition iface_mgr.cc:2159
isc::dhcp::IfaceMgr::setAllowLoopBack
void setAllowLoopBack(const bool allow_loopback)
Allows or disallows the loopback interface.
Definition iface_mgr.h:884
isc::dhcp::IfaceMgr::receive4
Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec=0)
Receive IPv4 packets or data from external sockets.
Definition iface_mgr.cc:1233
isc::dhcp::IfaceMgr::DetectCallback
std::function< bool(bool)> DetectCallback
Defines callback used when detecting interfaces.
Definition iface_mgr.h:754
isc::dhcp::IfaceNotFound::IfaceNotFound
IfaceNotFound(const char *file, size_t line, const char *what)
Definition iface_mgr.h:91
isc::dhcp::Iface
Represents a single network interface.
Definition iface_mgr.h:136
isc::dhcp::Iface::getReadBufferSize
size_t getReadBufferSize() const
Returns the current size of the socket read buffer.
Definition iface_mgr.h:444
isc::dhcp::Iface::getPlainMac
std::string getPlainMac() const
Returns link-layer address a plain text.
Definition iface_mgr.cc:127
isc::dhcp::Iface::getMacLen
size_t getMacLen() const
Returns MAC length.
Definition iface_mgr.h:233
isc::dhcp::Iface::flags_
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:528
isc::dhcp::Iface::inactive4_
bool inactive4_
Indicates that IPv4 sockets should (true) or should not (false) be opened on this interface.
Definition iface_mgr.h:532
isc::dhcp::Iface::mac_len_
size_t mac_len_
Length of link-layer address (usually 6).
Definition iface_mgr.h:499
isc::dhcp::Iface::clearErrors
void clearErrors()
Clears all errors.
Definition iface_mgr.cc:2289
isc::dhcp::Iface::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition iface_mgr.cc:292
isc::dhcp::Iface::addrs_
AddressCollection addrs_
List of assigned addresses.
Definition iface_mgr.h:490
isc::dhcp::Iface::getErrors
ErrorBuffer const & getErrors() const
Get the consistent list of error messages.
Definition iface_mgr.cc:2294
isc::dhcp::Iface::ErrorBuffer
std::vector< std::string > ErrorBuffer
Type definition for a list of error messages.
Definition iface_mgr.h:176
isc::dhcp::Iface::getFullName
std::string getFullName() const
Returns full interface name as "ifname/ifindex" string.
Definition iface_mgr.cc:120
isc::dhcp::Iface::ifindex_
unsigned int ifindex_
Interface index (a value that uniquely identifies an interface).
Definition iface_mgr.h:487
isc::dhcp::Iface::name_
std::string name_
Network interface name.
Definition iface_mgr.h:484
isc::dhcp::Iface::getUnicasts
const AddressCollection & getUnicasts() const
Returns a container of addresses the server should listen on.
Definition iface_mgr.h:423
isc::dhcp::Iface::SocketCollection
boost::multi_index_container< SocketInfo, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::sequenced<> > > SocketCollection
Type that holds a list of socket information.
Definition iface_mgr.h:167
isc::dhcp::Iface::hardware_type_
uint16_t hardware_type_
Hardware type.
Definition iface_mgr.h:502
isc::dhcp::Iface::sockets_
SocketCollection sockets_
Socket used to send data.
Definition iface_mgr.h:481
isc::dhcp::Iface::getAddresses
const AddressCollection & getAddresses() const
Returns all addresses available on an interface.
Definition iface_mgr.h:300
isc::dhcp::Iface::getReadBuffer
uint8_t * getReadBuffer()
Returns the pointer to the buffer used for data reading.
Definition iface_mgr.h:436
isc::dhcp::Iface::flag_multicast_
bool flag_multicast_
Flag specifies if selected interface is multicast capable.
Definition iface_mgr.h:519
isc::dhcp::Iface::setActive
void setActive(const isc::asiolink::IOAddress &address, const bool active)
Activates or deactivates address for the interface.
Definition iface_mgr.cc:262
isc::dhcp::Iface::addError
void addError(std::string const &message)
Add an error to the list of messages.
Definition iface_mgr.cc:2284
isc::dhcp::Iface::SocketLruIterator
SocketLruIndex::iterator SocketLruIterator
SocketInfo LRU iterator type.
Definition iface_mgr.h:173
isc::dhcp::Iface::getName
std::string getName() const
Returns interface name.
Definition iface_mgr.h:264
isc::dhcp::Iface::setFlags
void setFlags(uint64_t flags)
Sets flag_*_ fields based on bitmask value returned by OS.
isc::dhcp::Iface::clearUnicasts
void clearUnicasts()
Removes any unicast addresses.
Definition iface_mgr.h:410
isc::dhcp::Iface::Iface
Iface(const std::string &name, unsigned int ifindex)
Iface constructor.
Definition iface_mgr.cc:62
isc::dhcp::Iface::getHWType
uint16_t getHWType() const
Returns hardware type of the interface.
Definition iface_mgr.h:278
isc::dhcp::Iface::delAddress
bool delAddress(const isc::asiolink::IOAddress &addr)
Deletes an address from an interface.
Definition iface_mgr.cc:154
isc::dhcp::Iface::getIndex
unsigned int getIndex() const
Returns interface index.
Definition iface_mgr.h:257
isc::dhcp::Iface::hasAddress
bool hasAddress(const isc::asiolink::IOAddress &address) const
Check if the interface has the specified address assigned.
Definition iface_mgr.cc:245
isc::dhcp::Iface::SocketLruIndex
SocketCollection::nth_index< 1 >::type SocketLruIndex
SocketInfo LRU index type.
Definition iface_mgr.h:170
isc::dhcp::Iface::setMac
void setMac(const uint8_t *mac, size_t macLen)
Sets MAC address of the interface.
Definition iface_mgr.cc:141
isc::dhcp::Iface::flag_running_
bool flag_running_
Flag specifies if selected interface is running (e.g.
Definition iface_mgr.h:516
isc::dhcp::Iface::~Iface
~Iface()=default
Destructor.
isc::dhcp::Iface::resizeReadBuffer
void resizeReadBuffer(const size_t new_size)
Reallocates the socket read buffer.
Definition iface_mgr.h:451
isc::dhcp::Iface::getSocketsRef
SocketCollection & getSocketsRef()
Returns collection of all sockets added to interface.
Definition iface_mgr.h:402
isc::dhcp::Iface::delSocket
bool delSocket(uint16_t sockfd)
Closes socket.
Definition iface_mgr.cc:164
isc::dhcp::Iface::AddressCollection
std::list< Address > AddressCollection
Type that defines list of addresses.
Definition iface_mgr.h:146
isc::dhcp::Iface::getSockets
const SocketCollection & getSockets() const
Returns collection of all sockets added to interface.
Definition iface_mgr.h:395
isc::dhcp::Iface::inactive6_
bool inactive6_
Indicates that IPv6 sockets should (true) or should not (false) be opened on this interface.
Definition iface_mgr.h:536
isc::dhcp::Iface::MAX_MAC_LEN
static const unsigned int MAX_MAC_LEN
Maximum MAC address length (Infiniband uses 20 bytes).
Definition iface_mgr.h:140
isc::dhcp::Iface::flag_loopback_
bool flag_loopback_
Specifies if selected interface is loopback.
Definition iface_mgr.h:509
isc::dhcp::Iface::addUnicast
void addUnicast(const isc::asiolink::IOAddress &addr)
Adds unicast the server should listen on.
Definition iface_mgr.cc:218
isc::dhcp::Iface::countActive4
unsigned int countActive4() const
Returns a number of activated IPv4 addresses on the interface.
Definition iface_mgr.cc:281
isc::dhcp::Iface::mac_
uint8_t mac_[MAX_MAC_LEN]
Link-layer address.
Definition iface_mgr.h:496
isc::dhcp::Iface::Address
util::Optional< asiolink::IOAddress > Address
Address type.
Definition iface_mgr.h:143
isc::dhcp::Iface::addAddress
void addAddress(const isc::asiolink::IOAddress &addr)
Adds an address to an interface.
Definition iface_mgr.cc:255
isc::dhcp::Iface::closeSockets
void closeSockets()
Closes all open sockets on interface.
Definition iface_mgr.cc:75
isc::dhcp::Iface::addSocket
void addSocket(const SocketInfo &sock)
Adds socket descriptor to an interface.
Definition iface_mgr.h:369
isc::dhcp::Iface::flag_up_
bool flag_up_
Specifies if selected interface is up.
Definition iface_mgr.h:512
isc::dhcp::Iface::flag_broadcast_
bool flag_broadcast_
Flag specifies if selected interface is broadcast capable.
Definition iface_mgr.h:522
isc::dhcp::Iface::setHWType
void setHWType(uint16_t type)
Sets up hardware type of the interface.
Definition iface_mgr.h:271
isc::dhcp::Iface::getMac
const uint8_t * getMac() const
Returns pointer to MAC address.
Definition iface_mgr.h:241
isc::dhcp::Iface::unicasts_
AddressCollection unicasts_
List of unicast addresses the server should listen on.
Definition iface_mgr.h:493
isc::dhcp::Iface::getAddress4
bool getAddress4(isc::asiolink::IOAddress &address) const
Returns IPv4 address assigned to the interface.
Definition iface_mgr.cc:229
isc::dhcp::PacketFilterChangeDenied::PacketFilterChangeDenied
PacketFilterChangeDenied(const char *file, size_t line, const char *what)
Definition iface_mgr.h:53
isc::dhcp::ReceiveTerminate::ReceiveTerminate
ReceiveTerminate(const char *file, size_t line, const char *what)
Definition iface_mgr.h:113
isc::dhcp::ReceiverCriticalSection::ReceiverCriticalSection
ReceiverCriticalSection()
Constructor.
Definition iface_mgr.h:1874
isc::dhcp::ReceiverCriticalSection::~ReceiverCriticalSection
~ReceiverCriticalSection()
Destructor.
Definition iface_mgr.h:1885
isc::dhcp::SignalInterruptOnSelect::SignalInterruptOnSelect
SignalInterruptOnSelect(const char *file, size_t line, const char *what)
Definition iface_mgr.h:60
isc::dhcp::SocketConfigError::SocketConfigError
SocketConfigError(const char *file, size_t line, const char *what)
Definition iface_mgr.h:68
isc::dhcp::SocketFDError::SocketFDError
SocketFDError(const char *file, size_t line, const char *what)
Definition iface_mgr.h:106
isc::dhcp::SocketNotFound::SocketNotFound
SocketNotFound(const char *file, size_t line, const char *what)
Definition iface_mgr.h:98
isc::dhcp::SocketReadError::SocketReadError
SocketReadError(const char *file, size_t line, const char *what)
Definition iface_mgr.h:76
isc::dhcp::SocketWriteError::SocketWriteError
SocketWriteError(const char *file, size_t line, const char *what)
Definition iface_mgr.h:84
isc::util::Optional
A template representing an optional value.
Definition optional.h:37
dhcp4.h
dhcp6.h
fd_event_handler_factory.h
io_address.h
isc::cb
Definition base_config_backend.h:18
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::PktPtr
boost::shared_ptr< isc::dhcp::Pkt > PktPtr
A pointer to either Pkt4 or Pkt6 packet.
Definition pkt.h:999
isc::dhcp::IfaceMgrPtr
boost::shared_ptr< IfaceMgr > IfaceMgrPtr
Type definition for the pointer to the IfaceMgr.
Definition iface_mgr.h:725
isc::dhcp::PacketQueue4Ptr
boost::shared_ptr< PacketQueue< Pkt4Ptr > > PacketQueue4Ptr
Defines pointer to the DHCPv4 queue interface used at the application level.
Definition packet_queue.h:131
isc::dhcp::Pkt4Ptr
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
Definition pkt4.h:556
isc::dhcp::PktFilterPtr
boost::shared_ptr< PktFilter > PktFilterPtr
Pointer to a PktFilter object.
Definition pkt_filter.h:144
isc::dhcp::IfacePtr
boost::shared_ptr< Iface > IfacePtr
Type definition for the pointer to an Iface object.
Definition iface_mgr.h:555
isc::dhcp::BoundAddresses
boost::multi_index_container< asiolink::IOAddress, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< asiolink::IOAddress, uint32_t, &asiolink::IOAddress::toUint32 > > > > BoundAddresses
Type definition for the unordered set of IPv4 bound addresses.
Definition iface_mgr.h:719
isc::dhcp::IfaceMgrErrorMsgCallback
std::function< void(const std::string &errmsg)> IfaceMgrErrorMsgCallback
This type describes the callback function invoked when error occurs in the IfaceMgr.
Definition iface_mgr.h:732
isc::dhcp::PacketQueue6Ptr
boost::shared_ptr< PacketQueue< Pkt6Ptr > > PacketQueue6Ptr
Defines pointer to the DHCPv6 queue interface used at the application level.
Definition packet_queue.h:136
isc::dhcp::Pkt6Ptr
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
Definition pkt6.h:31
isc::dhcp::PktFilter6Ptr
boost::shared_ptr< PktFilter6 > PktFilter6Ptr
Pointer to a PktFilter object.
Definition pkt_filter6.h:136
isc::dhcp::PacketQueueMgr4Ptr
boost::shared_ptr< PacketQueueMgr4 > PacketQueueMgr4Ptr
Defines a shared pointer to PacketQueueMgr4.
Definition packet_queue_mgr4.h:36
isc::dhcp::PacketQueueMgr6Ptr
boost::shared_ptr< PacketQueueMgr6 > PacketQueueMgr6Ptr
Defines a shared pointer to PacketQueueMgr6.
Definition packet_queue_mgr6.h:38
isc::util::file
Definition filesystem.cc:29
isc::util::WatchedThreadPtr
boost::shared_ptr< WatchedThread > WatchedThreadPtr
Defines a pointer to a WatchedThread.
Definition watched_thread.h:140
isc::util::FDEventHandlerPtr
boost::shared_ptr< FDEventHandler > FDEventHandlerPtr
Shared pointer to an FD event handler.
Definition fd_event_handler.h:76
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
optional.h
packet_queue_mgr4.h
packet_queue_mgr6.h
pkt4.h
pkt6.h
pkt_filter6.h
pkt_filter.h
isc::data::CfgToElement
Abstract class for configuration Cfg_* classes.
Definition cfg_to_element.h:29
isc::dhcp::IfaceMgr::SocketCallbackInfo::unusable_
bool unusable_
Indicates if the socket can no longer be used for normal operations.
Definition iface_mgr.h:766
isc::dhcp::IfaceMgr::SocketCallbackInfo::callback_
SocketCallback callback_
A callback that will be called when data arrives over socket_.
Definition iface_mgr.h:762
isc::dhcp::IfaceMgr::SocketCallbackInfo::SocketCallbackInfo
SocketCallbackInfo(int socket)
Constructor.
Definition iface_mgr.h:771
isc::dhcp::IfaceMgr::SocketCallbackInfo::socket_
int socket_
Socket descriptor of the external socket.
Definition iface_mgr.h:759
isc::dhcp::SocketInfo
Holds information about socket.
Definition socket_info.h:18
watch_socket.h
Defines the class, WatchSocket.
watched_thread.h