Wraps a sockaddr_in or sockaddr_in6 struct instance together with the IP
address network <-> presentation and port number network <-> host conversion
functions.
Aliases the following types and constants from <netinet/in.h>:
Type IPv4 name IPv6 name Alias name
struct sockaddr_in sockaddr_in6 Addr
const int INET_ADDRSTRLEN INET6_ADDRSTRLEN addrstrlen
const sa_family_t AF_INET AF_INET6 family
Uses the following functions from <arpa/inet.h>:
- inet_ntop, inet_pton (IP address network <-> presentation conversion),
- htons, ntohs, htonl (port number network <-> host conversion).
Boost Software License Version 1.0. See LICENSE_BOOST.txt for details.
Alternatively, this file may be distributed under the terms of the Tango
3-Clause BSD License (see LICENSE_BSD.txt for details).
Internet address handling and conversion heper.
Wraps a sockaddr_in or sockaddr_in6 struct instance together with the IP address network <-> presentation and port number network <-> host conversion functions.
Aliases the following types and constants from <netinet/in.h>:
Type IPv4 name IPv6 name Alias name
struct sockaddr_in sockaddr_in6 Addr const int INET_ADDRSTRLEN INET6_ADDRSTRLEN addrstrlen const sa_family_t AF_INET AF_INET6 family
Uses the following functions from <arpa/inet.h>: - inet_ntop, inet_pton (IP address network <-> presentation conversion), - htons, ntohs, htonl (port number network <-> host conversion).
For the whole misery see
http://pubs.opengroup.org/onlinepubs/009604499/basedefs/netinet/in.h.html
http://pubs.opengroup.org/onlinepubs/009604499/functions/inet_ntop.html
http://pubs.opengroup.org/onlinepubs/009604499/functions/ntohs.html
http://www.openisbn.com/isbn/0131411551/
Important note: To reinitialise the address, use clear() (do not assign .init).