21#ifndef GF_SOCKET_ADDRESS_H
22#define GF_SOCKET_ADDRESS_H
30#include <sys/socket.h>
36#ifndef DOXYGEN_SHOULD_SKIP_THIS
108#ifndef DOXYGEN_SHOULD_SKIP_THIS
130 return reinterpret_cast<const sockaddr*
>(&storage);
137#ifndef DOXYGEN_SHOULD_SKIP_THIS
A socket address.
Definition: SocketAddress.h:78
const sockaddr * asSockAddr() const
Get the storage as a sockaddr address.
Definition: SocketAddress.h:129
SocketAddress(sockaddr *a_storage, StorageLengthType a_length)
Constructor with a raw sockaddr and a length.
implementation-defined StorageLengthType
The type to handle the storage length.
Definition: SocketAddress.h:118
StorageLengthType length
The length of the address.
Definition: SocketAddress.h:134
SocketAddress()=default
Default constructor.
std::string getService(SocketAddressFormat format=SocketAddressFormat::Unrestricted) const
Get the service associated to the address.
std::string getHostname(SocketAddressFormat format=SocketAddressFormat::Unrestricted) const
Get the hostname associated to the address.
SocketFamily getFamily() const
Get the family of the socket address.
sockaddr_storage storage
The storage for the address.
Definition: SocketAddress.h:133
SocketFamily
A socket family.
Definition: SocketAddress.h:50
SocketAddressFormat
A socket address format.
Definition: SocketAddress.h:62
@ IPv4
IPv4 (Internet Protocol version 4)
@ Unspec
Unspecified (either IPv4 or IPv6)
@ IPv6
IPv6 (Internet Protocol version 6)
@ Numeric
Use a numeric form for the address.
@ Unrestricted
Allow name resolution for the address.
The namespace for gf classes.