![]() |
Kea
1.5.0
|
Socket wrapper structure. More...
#include <test_control.h>
Inheritance diagram for isc::perfdhcp::TestControl::TestControlSocket:Public Member Functions | |
| TestControlSocket (const int socket) | |
| Constructor of socket wrapper class. More... | |
| ~TestControlSocket () | |
| Destructor of the socket wrapper class. 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... | |
| bool | valid_ |
| Is socket valid. 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... | |
Socket wrapper structure.
This is the wrapper that holds descriptor of the socket used to run DHCP test. The wrapped socket is closed in the destructor. This prevents resource leaks when when function that created the socket ends (normally or when exception occurs). This structure extends parent structure with new field ifindex_ that holds interface index where socket is bound to.
Definition at line 160 of file test_control.h.
| isc::perfdhcp::TestControl::TestControlSocket::TestControlSocket | ( | const int | socket | ) |
Constructor of socket wrapper class.
This constructor uses provided socket descriptor to find the name of the interface where socket has been bound to. If provided socket descriptor is invalid then valid_ field is set to false;
| socket | socket descriptor. |
Definition at line 103 of file test_control.cc.
References valid_.
| isc::perfdhcp::TestControl::TestControlSocket::~TestControlSocket | ( | ) |
Destructor of the socket wrapper class.
Destructor closes wrapped socket.
Definition at line 113 of file test_control.cc.
| uint16_t isc::perfdhcp::TestControl::TestControlSocket::ifindex_ |
Interface index.
Definition at line 162 of file test_control.h.
Referenced by isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().
| bool isc::perfdhcp::TestControl::TestControlSocket::valid_ |
Is socket valid.
It will not be valid if the provided socket descriptor does not point to valid socket.
Definition at line 165 of file test_control.h.
Referenced by isc::perfdhcp::TestControl::run(), and TestControlSocket().