#include <evo/iosock.h>
TCP/IP socket address.
- Holds either IPv4 or IPv6 address
|
static const uint | MAX_INET4_STRLEN = 22 |
| Max IPv4 string length with port num + terminator. More...
|
|
static const uint | MAX_INET6_STRLEN = 65 |
| Max IPv6 string length with IPv4 tunneling, brackets, zone/scope ID, and port num + terminator. More...
|
|
static const socklen_t | MAX_SIZE = sizeof(sockaddr_in6) |
| Max socket address size used here. More...
|
|
◆ SocketAddressIp() [1/7]
Default constructor sets as empty/invalid.
◆ SocketAddressIp() [2/7]
Copy constructor.
- Parameters
-
src | Source IP address to copy |
◆ SocketAddressIp() [3/7]
Constructor to copy from an IPv4 address.
- Parameters
-
◆ SocketAddressIp() [4/7]
Constructor to copy from an IPv6 address.
- Parameters
-
◆ SocketAddressIp() [5/7]
Constructor for wildcard address.
- Parameters
-
port | Port number |
ip6 | Whether to use IPv6, false for IPv4 |
◆ SocketAddressIp() [6/7]
Constructor to copy from addrinfo structure.
- Parameters
-
ptr | Address info pointer to get IP address |
◆ SocketAddressIp() [7/7]
Constructor to copy IP address from sockaddr structure.
- This is set to null if ptr isn't a valid and supported IP address
- Parameters
-
ptr | Address pointer to get IP address |
◆ check()
static bool check |
( |
struct sockaddr * |
addr | ) |
|
|
inlinestatic |
Check if address struct holds a supported IP address type.
- Parameters
-
addr | Address pointer, NULL for none |
- Returns
- Whether addr is valid and is a supported IP address type
◆ clear()
Clear current address.
- Returns
- This
◆ format()
bool format |
( |
String & |
str | ) |
const |
|
inline |
Format IP address to given string (appended).
- Parameters
-
str | String to format to, unchanged if IP not valid |
- Returns
- Whether successful, false if IP not valid
◆ format_addr()
Format IP address to given string (appended).
- Parameters
-
str | String to format to, unchanged if IP not valid |
address | Address to format |
- Returns
- Whether successful, false if not a valid IP address
◆ parse()
bool parse |
( |
const SubString & |
str, |
|
|
ushort |
port = 0 , |
|
|
int |
family = AF_UNSPEC |
|
) |
| |
|
inline |
◆ set() [1/4]
Set as copy of IP address.
- Parameters
-
src | Source IP address to copy |
- Returns
- This
◆ set() [2/4]
Set as copy of an IPv4 address.
- Parameters
-
- Returns
- This
◆ set() [3/4]
Set as copy of an IPv6 address.
- Parameters
-
- Returns
- This
◆ set() [4/4]
Set to address from addrinfo structure.
- Parameters
-
ptr | Address info pointer to get IP address |
- Returns
- This
◆ set_maxsize()
Set addrlen to max size for socket address.
- Low-level socket functions that store a socket address need to know the max socket address length
- Derived class must implement this and set the proper max size
Reimplemented from SocketAddressBase.
◆ setany4()
Set as wildcard IPv4 address.
- Parameters
-
- Returns
- This
◆ setany6()
Set as wildcard IPv6 address.
- Parameters
-
- Returns
- This
◆ setport()
Set port on current address.
- This is ignored if no address is set
- Parameters
-
- Returns
- This
◆ valid()
Get whether valid.
- Returns
- Whether valid
◆ @1
◆ addr
Generic address structure.
◆ addr_ip4
struct sockaddr_in addr_ip4 |
IPv4 address structure (union with addr)
◆ addr_ip6
struct sockaddr_in6 addr_ip6 |
IPv6 address structure (union with addr)
◆ addrlen
◆ MAX_INET4_STRLEN
const uint MAX_INET4_STRLEN = 22 |
|
static |
Max IPv4 string length with port num + terminator.
◆ MAX_INET6_STRLEN
const uint MAX_INET6_STRLEN = 65 |
|
static |
Max IPv6 string length with IPv4 tunneling, brackets, zone/scope ID, and port num + terminator.
◆ MAX_SIZE
const socklen_t MAX_SIZE = sizeof(sockaddr_in6) |
|
static |
Max socket address size used here.
The documentation for this struct was generated from the following file: