Thrill
0.1
|
IPv4 Subclass of SocketAddress for direct initialization from a known IPv4 address, known either in binary format, numerals, or as "ddd.ddd.ddd.ddd" format.
No name lookup or resolution takes place in these functions.
Definition at line 199 of file socket_address.hpp.
#include <socket_address.hpp>
Public Member Functions | |
IPv4Address () | |
Create uninitialized IPv4 address. More... | |
IPv4Address (uint16_t port) | |
Create an IPv4 address and initialize only the port part. More... | |
IPv4Address (uint32_t addr, uint16_t port) | |
Create an IPv4 address object with initialized address and port parts. More... | |
IPv4Address (struct in_addr &addr, uint16_t port) | |
Create an IPv4 address object with initialized address and port parts. More... | |
IPv4Address (struct sockaddr_in &sa) | |
Create an IPv4 address object and copy the given sockaddr_in structure. More... | |
IPv4Address (const char *ipstring, uint16_t port=0) | |
Public Member Functions inherited from SocketAddress | |
SocketAddress () | |
Create empty invalid address object by clearing all bytes. More... | |
SocketAddress (struct sockaddr *sa, socklen_t salen) | |
Create a socket address object with the given sockaddr data. More... | |
SocketAddress (const std::string &hostport) | |
SocketAddress (const char *hostname, const char *servicename) | |
uint16_t | GetPort () const |
Return the currently set port address in host byte-order. More... | |
const char * | GetResolveError () const |
bool | IsIPv4 () const |
Returns true if the enclosed socket address is a IPv4 address. More... | |
bool | IsIPv6 () const |
Returns true if the enclosed socket address is a IPv6 address. More... | |
bool | IsValid () const |
bool | Resolve (const char *hostname, const char *servicename=nullptr) |
void | SetPort (uint16_t port) |
Change the currently set port address. More... | |
struct sockaddr * | sockaddr () |
Return pointer to enclosed address as a generic sockattr struct. More... | |
const struct sockaddr * | sockaddr () const |
Return pointer to enclosed address as a generic sockattr struct. More... | |
struct sockaddr_in * | sockaddr_in () |
Cast the enclosed sockaddr into the sockaddr_in IPv4 structure. More... | |
const struct sockaddr_in * | sockaddr_in () const |
struct sockaddr_in6 * | sockaddr_in6 () |
Cast the enclosed sockaddr into the sockaddr_in6 IPv6 structure. More... | |
const struct sockaddr_in6 * | sockaddr_in6 () const |
socklen_t | socklen () const |
Return total length of enclosed sockaddr structure. More... | |
std::string | ToStringHost () const |
Return the enclosed socket address as a string without the port number. More... | |
std::string | ToStringHostPort () const |
Return the enclosed socket address as a string with the port number. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from SocketAddress | |
static std::vector< SocketAddress > | ResolveAll (const char *hostname, const char *servicename=nullptr) |
static SocketAddress | ResolveOne (const char *hostname, const char *servicename=nullptr) |
static SocketAddress | ResolveWithPort (const char *hostname, const char *defaultservice) |
Protected Attributes inherited from SocketAddress | |
union thrill::net::tcp::SocketAddress::SockAddrUnion | sockaddr_ |
|
inline |
Create uninitialized IPv4 address.
Definition at line 203 of file socket_address.hpp.
References SocketAddress::SockAddrUnion::in, and SocketAddress::sockaddr_.
|
inlineexplicit |
Create an IPv4 address and initialize only the port part.
Definition at line 208 of file socket_address.hpp.
References SocketAddress::SockAddrUnion::in, and SocketAddress::sockaddr_.
|
inline |
Create an IPv4 address object with initialized address and port parts.
Definition at line 215 of file socket_address.hpp.
References SocketAddress::SockAddrUnion::in, and SocketAddress::sockaddr_.
|
inline |
Create an IPv4 address object with initialized address and port parts.
Definition at line 223 of file socket_address.hpp.
References SocketAddress::SockAddrUnion::in, and SocketAddress::sockaddr_.
|
inlineexplicit |
Create an IPv4 address object and copy the given sockaddr_in structure.
Definition at line 231 of file socket_address.hpp.
References SocketAddress::SockAddrUnion::in, and SocketAddress::sockaddr_.
|
explicit |
Create an IPv4 address object and initialize it with the given ip address string, which is given in "ddd.ddd.ddd.ddd" format. You must check with IsValid() if the conversion was successfull.
Definition at line 185 of file socket_address.cpp.
References SocketAddress::sockaddr_in().