|
libtins 4.5
|
#include <ipv6_address.h>
Public Types | |
| typedef uint8_t * | iterator |
| typedef const uint8_t * | const_iterator |
Public Member Functions | |
| IPv6Address () | |
| Default constructor. Initializes this IPv6 address to "::". | |
| IPv6Address (const char *addr) | |
| Constructor from a text representation char*. | |
| IPv6Address (const std::string &addr) | |
| Constructor from a text representation std::string. | |
| IPv6Address (const_iterator ptr) | |
| Constructor from a buffer. | |
| std::string | to_string () const |
| Retrieve the string representation of this address. | |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| bool | operator== (const IPv6Address &rhs) const |
| Compares this address for equality. | |
| bool | operator!= (const IPv6Address &rhs) const |
| Compares this address for inequality. | |
| bool | operator< (const IPv6Address &rhs) const |
| Compares this address for less-than inequality. | |
| bool | operator<= (const IPv6Address &rhs) const |
| Compares this address for less-than equality. | |
| bool | operator> (const IPv6Address &rhs) const |
| Compares this address for greater-than inequality. | |
| bool | operator>= (const IPv6Address &rhs) const |
| Compares this address for greater-than equality. | |
| template<typename OutputIterator> | |
| OutputIterator | copy (OutputIterator iter) const |
| Helper function which copies the address into an output iterator. | |
| bool | is_loopback () const |
| Returns true if this is a loopback IPv6 address. | |
| bool | is_multicast () const |
| Returns true if this is a multicast IPv6 address. | |
| bool | is_local_unicast () const |
| Return true if this is a Link-Local unicast IPv6 address. | |
| size_t | size () const |
| Returns the size of an IPv6 Address. | |
| IPv6Address | operator& (const IPv6Address &rhs) const |
| IPv6Address | operator| (const IPv6Address &rhs) const |
| IPv6Address | operator~ () const |
Static Public Member Functions | |
| static IPv6Address | from_prefix_length (uint32_t prefix_length) |
| Constructs an IPv6 address from a prefix length. | |
Static Public Attributes | |
| static const size_t | address_size = 16 |
Friends | |
| TINS_API friend std::ostream & | operator<< (std::ostream &os, const IPv6Address &addr) |
| Writes this address in hex-notation to a std::ostream. | |
Represents an IPv6 address.
| typedef const uint8_t* Tins::IPv6Address::const_iterator |
The const iterator type.
| typedef uint8_t* Tins::IPv6Address::iterator |
The iterator type.
| Tins::IPv6Address::IPv6Address | ( | const char * | addr | ) |
Constructor from a text representation char*.
| addr | The text representation from which to construct this object. |
| Tins::IPv6Address::IPv6Address | ( | const std::string & | addr | ) |
Constructor from a text representation std::string.
| addr | The text representation from which to construct this object. |
Constructor from a buffer.
The ptr parameter must be at least address_size bytes long.
| ptr | The buffer from which to construct this object. |
|
inline |
Returns an iterator to the beginning of this address.
|
inline |
Returns a const iterator to the beginning of this address.
|
inline |
Helper function which copies the address into an output iterator.
This is the same as:
std::copy(begin(), end(), iter);
But since some PDUs return a IPv6Address by value, this function can be used to avoid temporaries.
| iter | The output iterator in which to store this address. |
|
inline |
Returns an iterator to the one-past-the-end element of this address.
|
inline |
Returns a const iterator to the one-past-the-end element of this address.
|
static |
Constructs an IPv6 address from a prefix length.
| prefix_length | The length of the prefix |
| bool Tins::IPv6Address::is_local_unicast | ( | ) | const |
Return true if this is a Link-Local unicast IPv6 address.
This method returns true if this address is in the address range fe80::/10, false otherwise
| bool Tins::IPv6Address::is_loopback | ( | ) | const |
Returns true if this is a loopback IPv6 address.
This method returns true if this address is the ::1/128 address, false otherwise.
| bool Tins::IPv6Address::is_multicast | ( | ) | const |
Returns true if this is a multicast IPv6 address.
This method returns true if this address is in the address range ff00::/8, false otherwise.
|
inline |
Compares this address for inequality.
| rhs | The address to be compared to. |
| IPv6Address Tins::IPv6Address::operator& | ( | const IPv6Address & | rhs | ) | const |
Applies a mask to an address
|
inline |
Compares this address for less-than inequality.
| rhs | The address to be compared to. |
|
inline |
Compares this address for less-than equality.
| rhs | The address to be compared to. |
|
inline |
Compares this address for equality.
| rhs | The address to be compared to. |
|
inline |
Compares this address for greater-than inequality.
| rhs | The address to be compared to. |
|
inline |
Compares this address for greater-than equality.
| rhs | The address to be compared to. |
| IPv6Address Tins::IPv6Address::operator| | ( | const IPv6Address & | rhs | ) | const |
or a mask to an address
| IPv6Address Tins::IPv6Address::operator~ | ( | ) | const |
not operator (invert)
|
inline |
Returns the size of an IPv6 Address.
This returns the value of IPv6Address::address_size
| string Tins::IPv6Address::to_string | ( | ) | const |
Retrieve the string representation of this address.
|
friend |
Writes this address in hex-notation to a std::ostream.
| os | The stream in which to write the address. |
| addr | The parameter to be written. |