Kea  2.3.5-git
isc::perfdhcp::BasePerfSocket Class Referenceabstract

Socket wrapper structure. More...

#include <perf_socket.h>

+ Inheritance diagram for isc::perfdhcp::BasePerfSocket:

Public Member Functions

 BasePerfSocket ()
 Default constructor of BasePerfSocket. More...
 
virtual ~BasePerfSocket ()=default
 Destructor of the socket wrapper class. More...
 
virtual dhcp::IfacePtr getIface ()=0
 See description of this method in PerfSocket class below. More...
 
virtual dhcp::Pkt4Ptr receive4 (uint32_t timeout_sec, uint32_t timeout_usec)=0
 See description of this method in PerfSocket class below. More...
 
virtual dhcp::Pkt6Ptr receive6 (uint32_t timeout_sec, uint32_t timeout_usec)=0
 See description of this method in PerfSocket class below. More...
 
virtual bool send (const dhcp::Pkt4Ptr &pkt)=0
 See description of this method in PerfSocket class below. More...
 
virtual bool send (const dhcp::Pkt6Ptr &pkt)=0
 See description of this method in PerfSocket class below. More...
 
- Public Member Functions inherited from isc::dhcp::SocketInfo
 SocketInfo (const isc::asiolink::IOAddress &addr, const uint16_t port, const int sockfd, const int fallbackfd=-1)
 SocketInfo constructor. More...
 

Public Attributes

uint16_t ifindex_
 Interface index. More...
 
- Public Attributes inherited from isc::dhcp::SocketInfo
isc::asiolink::IOAddress addr_
 
int fallbackfd_
 Fallback socket descriptor. More...
 
uint16_t family_
 socket port More...
 
uint16_t port_
 bound address More...
 
int sockfd_
 IPv4 or IPv6. More...
 

Detailed Description

Socket wrapper structure.

This is a base class that is inherited by PerfSocket and unit tests derived that. This way it allows mocking out socket operations and avoid using real network interfaces.

Definition at line 26 of file perf_socket.h.

Constructor & Destructor Documentation

◆ BasePerfSocket()

isc::perfdhcp::BasePerfSocket::BasePerfSocket ( )
inline

Default constructor of BasePerfSocket.

Definition at line 32 of file perf_socket.h.

References getIface(), receive4(), receive6(), send(), and ~BasePerfSocket().

+ Here is the call graph for this function:

◆ ~BasePerfSocket()

virtual isc::perfdhcp::BasePerfSocket::~BasePerfSocket ( )
virtualdefault

Destructor of the socket wrapper class.

Referenced by BasePerfSocket().

Member Function Documentation

◆ getIface()

virtual dhcp::IfacePtr isc::perfdhcp::BasePerfSocket::getIface ( )
pure virtual

See description of this method in PerfSocket class below.

Implemented in isc::perfdhcp::PerfSocket.

Referenced by BasePerfSocket(), isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().

◆ receive4()

virtual dhcp::Pkt4Ptr isc::perfdhcp::BasePerfSocket::receive4 ( uint32_t  timeout_sec,
uint32_t  timeout_usec 
)
pure virtual

See description of this method in PerfSocket class below.

Implemented in isc::perfdhcp::PerfSocket.

Referenced by BasePerfSocket().

◆ receive6()

virtual dhcp::Pkt6Ptr isc::perfdhcp::BasePerfSocket::receive6 ( uint32_t  timeout_sec,
uint32_t  timeout_usec 
)
pure virtual

See description of this method in PerfSocket class below.

Implemented in isc::perfdhcp::PerfSocket.

Referenced by BasePerfSocket().

◆ send() [1/2]

◆ send() [2/2]

virtual bool isc::perfdhcp::BasePerfSocket::send ( const dhcp::Pkt6Ptr pkt)
pure virtual

See description of this method in PerfSocket class below.

Implemented in isc::perfdhcp::PerfSocket.

Member Data Documentation

◆ ifindex_

uint16_t isc::perfdhcp::BasePerfSocket::ifindex_

Interface index.

Definition at line 29 of file perf_socket.h.

Referenced by isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().


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