Kea 2.7.5
isc::dhcp::SocketInfo Struct Reference

Holds information about socket. More...

#include <socket_info.h>

+ Inheritance diagram for isc::dhcp::SocketInfo:

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.
 

Detailed Description

Holds information about socket.

Definition at line 19 of file socket_info.h.

Constructor & Destructor Documentation

◆ SocketInfo()

isc::dhcp::SocketInfo::SocketInfo ( const isc::asiolink::IOAddress & addr,
const uint16_t port,
const int sockfd,
const int fallbackfd = -1 )
inline

SocketInfo constructor.

Parameters
addrAn address the socket is bound to.
portA port the socket is bound to.
sockfdSocket descriptor.
fallbackfdA descriptor of the fallback socket.

Definition at line 58 of file socket_info.h.

Member Data Documentation

◆ addr_

◆ fallbackfd_

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.

◆ family_

uint16_t isc::dhcp::SocketInfo::family_

socket port

Definition at line 23 of file socket_info.h.

◆ port_

uint16_t isc::dhcp::SocketInfo::port_

bound address

Definition at line 22 of file socket_info.h.

◆ sockfd_

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().


The documentation for this struct was generated from the following file: