| Kea 3.0.2-git

isc::perfdhcp::BasePerfSocket Class Referenceabstract

Socket wrapper structure. More...

`#include <perf_socket.h>`

Inheritance diagram for isc::perfdhcp::BasePerfSocket:
[legend]

## Public Member Functions
| BasePerfSocket ()
| Default constructor of BasePerfSocket.
virtual | ~BasePerfSocket ()=default
| Destructor of the socket wrapper class.
virtual dhcp::IfacePtr | getIface ()=0
| See description of this method in PerfSocket class below.
virtual dhcp::Pkt4Ptr | receive4 (uint32_t timeout_sec, uint32_t timeout_usec)=0
| See description of this method in PerfSocket class below.
virtual dhcp::Pkt6Ptr | receive6 (uint32_t timeout_sec, uint32_t timeout_usec)=0
| See description of this method in PerfSocket class below.
virtual bool | send (const dhcp::Pkt4Ptr &pkt)=0
| See description of this method in PerfSocket class below.
virtual bool | send (const dhcp::Pkt6Ptr &pkt)=0
| See description of this method in PerfSocket class below.
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.

## Public Attributes
unsigned int | ifindex_
| Interface index.
Public Attributes inherited from isc::dhcp::SocketInfo
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

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 isc::dhcp::SocketInfo::SocketInfo(), and ifindex_.

Here is the call graph for this function:

## ◆ ~BasePerfSocket()

virtual isc::perfdhcp::BasePerfSocket::~BasePerfSocket | ( |  | ) |
| virtual default

Destructor of the socket wrapper class.

## 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.

## ◆ 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.

## ◆ 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.

## ◆ send() [1/2]

virtual bool isc::perfdhcp::BasePerfSocket::send | ( | const dhcp::Pkt4Ptr & | pkt | ) |
| pure virtual

See description of this method in PerfSocket class below.

Implemented in isc::perfdhcp::PerfSocket.

## ◆ 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_

unsigned int isc::perfdhcp::BasePerfSocket::ifindex_

Interface index.

Definition at line 29 of file perf_socket.h.

Referenced by BasePerfSocket(), isc::perfdhcp::PerfSocket::~PerfSocket(), isc::perfdhcp::PerfSocket::getIface(), and isc::perfdhcp::PerfSocket::initSocketData().

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

- perf_socket.h