Public Types |
| enum | { AF = AF_INET6
} |
| | Constant for address family.
|
| enum | { IPV = 6
} |
| | Constant for IP protocol version.
|
|
typedef struct in6_addr | InAddrType |
|
typedef struct sockaddr_in6 | SockAddrType |
Public Member Functions |
| | IPv6 () |
| | Default constructor.
|
| | IPv6 (const uint8_t *from_uint8) |
| | Constructor from a (uint8_t *) memory pointer.
|
| | IPv6 (const uint32_t *from_uint32) |
| | Constructor from a (uint32_t *) memory pointer.
|
| | IPv6 (const in6_addr &from_in6_addr) |
| | Constructor from in6_addr structure.
|
| | IPv6 (const sockaddr &sa) throw (InvalidFamily) |
| | Constructor from sockaddr structure.
|
| | IPv6 (const sockaddr_storage &ss) throw (InvalidFamily) |
| | Constructor from sockaddr_storage structure.
|
| | IPv6 (const sockaddr_in6 &sin6) throw (InvalidFamily) |
| | Constructor from sockaddr_in6 structure.
|
| | IPv6 (const char *from_cstring) throw (InvalidString) |
| | Constructor from a string.
|
| size_t | copy_out (uint8_t *to_uint8) const |
| | Copy the IPv6 raw address to specified memory location.
|
| size_t | copy_out (in6_addr &to_in6_addr) const |
| | Copy the IPv6 raw address to an in6_addr structure.
|
| size_t | copy_out (sockaddr &to_sockaddr) const |
| | Copy the IPv6 raw address to a sockaddr structure.
|
| size_t | copy_out (sockaddr_storage &to_sockaddr_storage) const |
| | Copy the IPv6 raw address to a sockaddr_storage structure.
|
| size_t | copy_out (sockaddr_in6 &to_sockaddr_in6) const |
| | Copy the IPv6 raw address to a sockaddr_in6 structure.
|
| size_t | copy_in (const uint8_t *from_uint8) |
| | Copy a raw IPv6 address from specificed memory location into IPv6 structure.
|
| size_t | copy_in (const in6_addr &from_in6_addr) |
| | Copy a raw IPv6 address from a in6_addr structure into IPv6 structure.
|
| size_t | copy_in (const sockaddr &from_sockaddr) throw (InvalidFamily) |
| | Copy a raw IPv6 address from a sockaddr structure into IPv6 structure.
|
| size_t | copy_in (const sockaddr_storage &from_sockaddr_storage) throw (InvalidFamily) |
| | Copy a raw IPv6 address from a sockaddr_storage structure into IPv6 structure.
|
| size_t | copy_in (const sockaddr_in6 &from_sockaddr_in6) throw (InvalidFamily) |
| | Copy a raw address from sockaddr_in6 structure into IPv6 structure.
|
| IPv6 | operator~ () const |
| | Bitwise-Negation Operator.
|
| IPv6 | operator| (const IPv6 &other) const |
| | OR Operator.
|
| IPv6 | operator& (const IPv6 &other) const |
| | AND Operator.
|
| IPv6 | operator^ (const IPv6 &other) const |
| | XOR Operator.
|
| IPv6 | operator<< (uint32_t left_shift) const |
| | Operator <<.
|
| IPv6 | operator>> (uint32_t right_shift) const |
| | Operator >>
|
| bool | operator< (const IPv6 &other) const |
| | Less-Than Operator.
|
| bool | operator== (const IPv6 &other) const |
| | Equality Operator.
|
| bool | operator!= (const IPv6 &other) const |
| | Not-Equal Operator.
|
| bool | operator== (const IPv6Range &rhs) const |
| | Equality Operator for IPv6 against IPv6Range operand.
|
| bool | operator!= (const IPv6Range &rhs) const |
| | Non-equality Operator for IPv6 against IPv6Range operand.
|
| bool | operator< (const IPv6Range &rhs) const |
| | Less-than comparison for IPv6 against IPv6Range operand.
|
| bool | operator<= (const IPv6Range &rhs) const |
| | Less-than or equal comparison for IPv6 against IPv6Range.
|
| bool | operator> (const IPv6Range &rhs) const |
| | Greater-than comparison for IPv6 against IPv6Range operand.
|
| bool | operator>= (const IPv6Range &rhs) const |
| | Greater-than or equal comparison for IPv6 against IPv6Range.
|
| IPv6 & | operator-- () |
| | Decrement Operator.
|
| IPv6 & | operator++ () |
| | Increment Operator.
|
| string | str () const |
| | Convert this address from binary form to presentation format.
|
| bool | is_zero () const |
| | Test if this address is numerically zero.
|
| bool | is_unicast () const |
| | Test if this address is a valid unicast address.
|
| bool | is_multicast () const |
| | Test if this address is a valid multicast address.
|
| bool | is_linklocal_unicast () const |
| | Test if this address is a valid link-local unicast address.
|
| bool | is_interfacelocal_multicast () const |
| | Test if this address is a valid interface-local multicast address.
|
| bool | is_nodelocal_multicast () const |
| | Test if this address is a valid node-local multicast address.
|
| bool | is_linklocal_multicast () const |
| | Test if this address is a valid link-local multicast address.
|
| bool | is_loopback () const |
| | Test if this address is the loopback address.
|
| IPv6 | mask_by_prefix_len (uint32_t prefix_len) const throw (InvalidNetmaskLength) |
| | Make an IPv6 address prefix.
|
| uint32_t | mask_len () const |
| | Get the mask length.
|
| const uint32_t * | addr () const |
| | Get the uint32_t raw value of this address.
|
| void | set_addr (const uint8_t *from_uint8) |
| | Set the address value.
|
| uint32_t | bits (uint32_t lsb, uint32_t len) const |
| | Extract bits from an address.
|
| uint32_t | bit_count () const |
| | Count the number of bits that are set in this address.
|
| uint32_t | leading_zero_count () const |
| | Count the number of leading zeroes in this address.
|
Static Public Member Functions |
| static size_t | addr_bytelen () |
| | Get the address octet-size.
|
| static uint32_t | addr_bitlen () |
| | Get the address bit-length.
|
| static uint32_t | ip_multicast_base_address_mask_len () |
| | Get the mask length for the multicast base address.
|
| static const IPv6 & | make_prefix (uint32_t mask_len) throw (InvalidNetmaskLength) |
| | Make an IPv6 mask prefix.
|
| static int | af () |
| | Get the address family.
|
| static uint32_t | ip_version () |
| | Get the IP protocol version.
|
| static const string & | ip_version_str () |
| | Get the human-readable string with the IP protocol version.
|
|
static const IPv6 & | ZERO (int af=AF_INET6) |
| | Pre-defined IPv6 address constants.
|
|
static const IPv6 & | ANY (int af=AF_INET6) |
|
static const IPv6 & | ALL_ONES (int af=AF_INET6) |
|
static const IPv6 & | LOOPBACK (int af=AF_INET6) |
|
static const IPv6 & | MULTICAST_BASE (int af=AF_INET6) |
|
static const IPv6 & | MULTICAST_ALL_SYSTEMS (int af=AF_INET6) |
|
static const IPv6 & | MULTICAST_ALL_ROUTERS (int af=AF_INET6) |
|
static const IPv6 & | DVMRP_ROUTERS (int af=AF_INET6) |
|
static const IPv6 & | OSPFIGP_ROUTERS (int af=AF_INET6) |
|
static const IPv6 & | OSPFIGP_DESIGNATED_ROUTERS (int af=AF_INET6) |
|
static const IPv6 & | RIP2_ROUTERS (int af=AF_INET6) |
|
static const IPv6 & | PIM_ROUTERS (int af=AF_INET6) |
|
static const IPv6 & | SSM_ROUTERS (int af=AF_INET6) |
Static Public Attributes |
|
static const uint32_t | ADDR_BITLEN = 128 |
| | Number of bits in address as a constant.
|
|
static const uint32_t | ADDR_BYTELEN = ADDR_BITLEN / 8 |
| | Number of bytes in address as a constant.
|
Private Attributes |
|
uint32_t | _addr [4] |
IPv6 address class.
The IPv6 address class is a trivial class for handling IPv6 addresses and for performing operations on them such as printing and masking.