dodo
0.0.1
A C++ library to create containerized Linux services
|
Socket parameters - the family (domain), socket type and protocol triplet. More...
#include <socketparams.hpp>
Public Types | |
enum | AddressFamily { afLOCAL = AF_LOCAL, afINET = AF_INET, afINET6 = AF_INET6, afIPX = AF_IPX, afNETLINK = AF_NETLINK, afX25 = AF_X25, afAX25 = AF_AX25, afATMPVC = AF_ATMPVC, afAPPLETALK = AF_APPLETALK, afPACKET = AF_PACKET, afALG = AF_ALG, afUNSPEC = AF_UNSPEC } |
Addres family type. More... | |
enum | ProtocolNumber { pnHOPOPT = 0, pnICMP = IPPROTO_ICMP, pnICMPV6 = IPPROTO_ICMPV6, pnIGMP = 2, pnGGP = 3, pnIPv4 = 4, pnST = 5, pnTCP = 6, pnCBT = 7, pnEGP = 8, pnIGP = 9, pnBBN_RCC_MON = 10, pnNVP_II = 11, pnPUP = 12, pnARGUS = 13, pnEMCON = 14, pnXNET = 15, pnCHAOS = 16, pnUDP = 17, pnMUX = 18, pnDCN_MEAS = 19, pnHMP = 20, pnPRM = 21, pnXNS_IDP = 22, pnTRUNK_1 = 23, pnTRUNK_2 = 24, pnLEAF_1 = 25, pnLEAF_2 = 26, pnRDP = 27, pnIRTP = 28, pnISO_TP4 = 29, pnNETBLT = 30, pnMFE_NSP = 31, pnMERIT_INP = 32, pnDCCP = 33, pn3PC = 34, pnIDPR = 35, pnXTP = 36, pnDDP = 37, pnIDPR_CMTP = 38 } |
IANA Protocol number. More... | |
enum | SocketType { stSTREAM = SOCK_STREAM, stDGRAM = SOCK_DGRAM, stSEQPACKET = SOCK_SEQPACKET, stRAW = SOCK_RAW, stRDM = SOCK_RDM, stPACKET = SOCK_PACKET } |
Socket Type type. More... | |
Public Member Functions | |
SocketParams () | |
Default constructor to AF_INET6, SOCK_STREAM, protocol pnHOPOPT. More... | |
SocketParams (AddressFamily family) | |
Constructor only sets the AddressFamily. More... | |
SocketParams (AddressFamily family, SocketType sockettype) | |
Constructor sets the AddressFamily and SocketType. More... | |
SocketParams (AddressFamily family, SocketType sockettype, ProtocolNumber protocol) | |
Constructor sets the AddressFamily, SocketType and ProtocolNumber. More... | |
std::string | asString () const |
Return the parameters as a string. More... | |
AddressFamily | getAddressFamily () const |
Get the AddressFamily. More... | |
ProtocolNumber | getProtocol () const |
Get the ProtocolNumber. More... | |
SocketType | getSocketType () const |
Get the SocketType. More... | |
void | setAddressFamily (AddressFamily family) |
Set the AddressFamily. More... | |
void | setProtocol (ProtocolNumber protocol) |
Set the ProtocolNumber. More... | |
void | setSocketType (SocketType sockettype) |
Set the SocketType. More... | |
Static Public Member Functions | |
static std::string | familyString (AddressFamily family) |
Return the AddressFamily name as a string. More... | |
static std::string | protocolString (ProtocolNumber protocol) |
Return the ProtocolNumber name as a string. More... | |
static std::string | socketTypeString (SocketType sockettype) |
Return the SocketType name as a string. More... | |
Private Attributes | |
AddressFamily | family_ |
The address family. More... | |
ProtocolNumber | protocol_ |
The protocol. More... | |
SocketType | sockettype_ |
The socket type. More... | |
Socket parameters - the family (domain), socket type and protocol triplet.
Definition at line 35 of file socketparams.hpp.
Addres family type.
Definition at line 41 of file socketparams.hpp.
IANA Protocol number.
https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
Definition at line 73 of file socketparams.hpp.
Socket Type type.
Definition at line 59 of file socketparams.hpp.
|
inline |
Default constructor to AF_INET6, SOCK_STREAM, protocol pnHOPOPT.
Definition at line 119 of file socketparams.hpp.
|
inline |
Constructor only sets the AddressFamily.
family | The AddressFamily. |
Definition at line 125 of file socketparams.hpp.
|
inline |
Constructor sets the AddressFamily and SocketType.
family | The AddressFamily. |
sockettype | The SocketType. |
Definition at line 132 of file socketparams.hpp.
|
inline |
Constructor sets the AddressFamily, SocketType and ProtocolNumber.
family | The AddressFamily. |
sockettype | The SocketType. |
protocol | The ProtocolNumber. |
Definition at line 141 of file socketparams.hpp.
|
inline |
Return the parameters as a string.
Definition at line 184 of file socketparams.hpp.
References family_, familyString(), protocol_, protocolString(), sockettype_, and socketTypeString().
Referenced by dodo::network::AddrInfoItem::asString().
|
inlinestatic |
Return the AddressFamily name as a string.
family | The AddressFamily to convert. |
Definition at line 198 of file socketparams.hpp.
Referenced by asString().
|
inline |
Get the AddressFamily.
Definition at line 148 of file socketparams.hpp.
References family_.
Referenced by dodo::network::BaseSocket::BaseSocket(), and dodo::network::Address::getHostAddrInfo().
|
inline |
Get the ProtocolNumber.
Definition at line 160 of file socketparams.hpp.
References protocol_.
Referenced by dodo::network::BaseSocket::BaseSocket(), and dodo::network::Address::getHostAddrInfo().
|
inline |
Get the SocketType.
Definition at line 154 of file socketparams.hpp.
References sockettype_.
Referenced by dodo::network::BaseSocket::BaseSocket(), and dodo::network::Address::getHostAddrInfo().
|
inlinestatic |
Return the ProtocolNumber name as a string.
protocol | The ProtocolNumber to convert. |
Definition at line 243 of file socketparams.hpp.
Referenced by asString().
|
inline |
Set the AddressFamily.
family | The AddressFamily. |
Definition at line 166 of file socketparams.hpp.
References family_.
Referenced by dodo::network::Address::getHostAddrInfo().
|
inline |
Set the ProtocolNumber.
protocol | The ProtocolNumber. |
Definition at line 178 of file socketparams.hpp.
References protocol_.
Referenced by dodo::network::Address::getHostAddrInfo().
|
inline |
Set the SocketType.
sockettype | The SocketType. |
Definition at line 172 of file socketparams.hpp.
References sockettype_.
Referenced by dodo::network::Address::getHostAddrInfo().
|
inlinestatic |
Return the SocketType name as a string.
sockettype | The SocketType to convert. |
Definition at line 223 of file socketparams.hpp.
Referenced by asString().
|
private |
The address family.
Definition at line 270 of file socketparams.hpp.
Referenced by asString(), getAddressFamily(), and setAddressFamily().
|
private |
The protocol.
Definition at line 286 of file socketparams.hpp.
Referenced by asString(), getProtocol(), and setProtocol().
|
private |
The socket type.
Definition at line 281 of file socketparams.hpp.
Referenced by asString(), getSocketType(), and setSocketType().