Kea: socket_info.h Source File

| Kea 3.2.0-git

socket_info.h
Go to the documentation of this file.
1// Copyright (C) 2018-2026 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef DHCP_SOCKET_INFO_H
8#define DHCP_SOCKET_INFO_H
9
10#include <asiolink/io_address.h>
11
12#include <cstdint>
13
14namespace isc {
15namespace dhcp {
16
18 struct SocketInfo {
19
21 isc::asiolink::IOAddress addr_;
22
24 uint16_t port_;
25
27 uint16_t family_;
28
30 int sockfd_;
31
54 int fallbackfd_;
55
62 SocketInfo(const isc::asiolink::IOAddress& addr, const uint16_t port,
63 const int sockfd, const int fallbackfd = -1)
64 : addr_(addr), port_(port), family_(addr.getFamily()),
65 sockfd_(sockfd), fallbackfd_(fallbackfd) { }
66};
67
68} // namespace dhcp
69} // namespace isc
70
71#endif // DHCP_SOCKET_INFO_H
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:53
io_address.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
isc::dhcp::SocketInfo::sockfd_
int sockfd_
Socket descriptor (a.k.a. primary socket).
Definition socket_info.h:30
isc::dhcp::SocketInfo::fallbackfd_
int fallbackfd_
Fallback socket descriptor.
Definition socket_info.h:54
isc::dhcp::SocketInfo::addr_
isc::asiolink::IOAddress addr_
Bound address.
Definition socket_info.h:21
isc::dhcp::SocketInfo::family_
uint16_t family_
Family IPv4 or IPv6.
Definition socket_info.h:27
isc::dhcp::SocketInfo::SocketInfo
SocketInfo(const isc::asiolink::IOAddress &addr, const uint16_t port, const int sockfd, const int fallbackfd=-1)
SocketInfo constructor.
Definition socket_info.h:62
isc::dhcp::SocketInfo::port_
uint16_t port_
Socket port.
Definition socket_info.h:24