|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <IPAddr.h>

Public Member Functions | |
| constexpr | IP4Addr ()=default |
| Default constructor - ANY address. | |
| IP4Addr (self_type const &that)=default | |
| Copy constructor. | |
| constexpr | IP4Addr (in_addr_t addr) |
| IP4Addr (sockaddr_in const *s) | |
Construct from sockaddr_in. | |
| IP4Addr (string_view const &text) | |
| self_type & | operator= (self_type const &that)=default |
| Self assignment. | |
| self_type & | operator= (in_addr_t ip) |
| Assign from IPv4 raw address. | |
| self_type & | operator= (sockaddr_in const *sa) |
| Set to the address in addr. | |
| self_type & | operator++ () |
| Increment address. | |
| self_type & | operator-- () |
| Decrement address. | |
| uint8_t | operator[] (unsigned idx) const |
| self_type & | operator&= (IPMask const &mask) |
| Apply mask to address, leaving the network portion. | |
| self_type & | operator|= (IPMask const &mask) |
| Apply mask to address, creating the broadcast address. | |
| sockaddr * | copy_to (sockaddr *sa) const |
| sockaddr_in * | copy_to (sockaddr_in *sin) const |
| in_addr_t | network_order () const |
| in_addr_t | host_order () const |
| bool | load (string_view const &text) |
| int | cmp (self_type const &that) const |
| Standard ternary compare. | |
| constexpr sa_family_t | family () const |
| bool | is_any () const |
| bool | is_multicast () const |
| bool | is_loopback () const |
| bool | is_link_local () const |
| bool | is_private () const |
| self_type & | operator<<= (unsigned n) |
| self_type & | operator>>= (unsigned n) |
| self_type & | operator&= (self_type const &that) |
| self_type & | operator|= (self_type const &that) |
Static Public Member Functions | |
| static constexpr in_addr_t | reorder (in_addr_t src) |
Static Public Attributes | |
| static constexpr size_t | SIZE = sizeof(in_addr_t) |
| Size of IPv4 address in bytes. | |
| static constexpr size_t | WIDTH = std::numeric_limits<unsigned char>::digits * SIZE |
| static const self_type | MIN {INADDR_ANY} |
| Minimum value. | |
| static const self_type | MAX {INADDR_BROADCAST} |
| Maximum value. | |
| static constexpr sa_family_t | AF_value = AF_INET |
| Address family type. | |
Protected Types | |
| using | bytes = std::array<uint8_t, 4> |
| Access by bytes. | |
Protected Attributes | |
| in_addr_t | _addr = INADDR_ANY |
| Address in host order. | |
Friends | |
| class | IP4Range |
| bool | operator== (self_type const &lhs, self_type const &rhs) |
| Equality. | |
| bool | operator!= (self_type const &lhs, self_type const &rhs) |
| bool | operator< (self_type const &lhs, self_type const &rhs) |
| bool | operator<= (self_type const &lhs, self_type const &rhs) |
|
protected |
|
inlineexplicitconstexpr |
|
explicit |
Construct from sockaddr_in.
Definition at line 342 of file swoc_ip.cc.
|
inline |
|
inline |
|
inline |
| sockaddr_in * swoc::IP4Addr::copy_to | ( | sockaddr_in * | sin | ) | const |
Update socket address with this address.
| sin | IPv4 socket address. |
Definition at line 351 of file swoc_ip.cc.
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool swoc::IP4Addr::load | ( | std::string_view const & | text | ) |
Parse IPv4 address.
| text | Text to parse. |
true if text is a valid IPv4 address, false otherwise.Whitespace is trimmed from @text before parsing. If the parse fails this is set to INADDR_ANY.
Definition at line 299 of file swoc_ip.cc.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| auto swoc::IP4Addr::operator= | ( | sockaddr_in const * | sa | ) |
Set to the address in addr.
Definition at line 345 of file swoc_ip.cc.
|
inline |
|
inline |
|
inline |
|
staticconstexpr |
|
protected |
|
staticconstexpr |
|
static |
|
static |
|
staticconstexpr |
|
staticconstexpr |