Kea 2.7.5
|
Holds information about socket. More...
#include <socket_info.h>
Public Member Functions | |
SocketInfo (const isc::asiolink::IOAddress &addr, const uint16_t port, const int sockfd, const int fallbackfd=-1) | |
SocketInfo constructor. | |
Public Attributes | |
isc::asiolink::IOAddress | addr_ |
int | fallbackfd_ |
Fallback socket descriptor. | |
uint16_t | family_ |
socket port | |
uint16_t | port_ |
bound address | |
int | sockfd_ |
IPv4 or IPv6. | |
Holds information about socket.
Definition at line 19 of file socket_info.h.
|
inline |
SocketInfo constructor.
addr | An address the socket is bound to. |
port | A port the socket is bound to. |
sockfd | Socket descriptor. |
fallbackfd | A descriptor of the fallback socket. |
Definition at line 58 of file socket_info.h.
isc::asiolink::IOAddress isc::dhcp::SocketInfo::addr_ |
Definition at line 21 of file socket_info.h.
Referenced by isc::perfdhcp::PerfSocket::initSocketData(), isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().
int isc::dhcp::SocketInfo::fallbackfd_ |
Fallback socket descriptor.
This socket descriptor holds the handle to the fallback socket. The fallback socket is created when there is a need for the regular datagram socket to be bound to an IP address and port, besides primary socket (sockfd_) which is actually used to receive and process the DHCP messages. The fallback socket (if exists) is always associated with the primary socket. In particular, the need for the fallback socket arises when raw socket is a primary one. When primary socket is open, it is bound to an interface not the address and port. The implications include the possibility that the other process (e.g. the other instance of DHCP server) will bind to the same address and port through which the raw socket receives the DHCP messages. Another implication is that the kernel, being unaware of the DHCP server operating through the raw socket, will respond with the ICMP "Destination port unreachable" messages when DHCP messages are only received through the raw socket. In order to workaround the issues mentioned here, the fallback socket should be opened so as/ the kernel is aware that the certain address and port is in use.
The fallback description is supposed to be set to a negative value if the fallback socket is closed (not open).
Definition at line 50 of file socket_info.h.
uint16_t isc::dhcp::SocketInfo::family_ |
socket port
Definition at line 23 of file socket_info.h.
uint16_t isc::dhcp::SocketInfo::port_ |
bound address
Definition at line 22 of file socket_info.h.
int isc::dhcp::SocketInfo::sockfd_ |
IPv4 or IPv6.
Socket descriptor (a.k.a. primary socket).
Definition at line 26 of file socket_info.h.
Referenced by isc::perfdhcp::PerfSocket::PerfSocket(), isc::perfdhcp::PerfSocket::~PerfSocket(), and isc::perfdhcp::PerfSocket::initSocketData().