fastcgi++
|
Efficiently stores IPv6 addresses. More...
#include <http.hpp>
Public Member Functions | |
const unsigned char * | data () const |
Retrieve a const pointer to the raw data of the IPv6 address. | |
unsigned char * | data () |
Retrieve a pointer to the raw data of the IPv6 address. | |
Address | operator= (const unsigned char *data_) |
Assign the IPv4 address from a data array. | |
Address | operator= (const Address &address) |
Address (const Address &address) | |
Address () | |
Address (const unsigned char *data_) | |
Construct the IPv6 address from a data array. | |
void | assign (const char *start, const char *end) |
Assign the IP address from a string of characters. | |
bool | operator== (const Address &x) const |
bool | operator> (const Address &x) const |
bool | operator< (const Address &x) const |
bool | operator<= (const Address &x) const |
bool | operator>= (const Address &x) const |
operator bool () const | |
Returns false if the ip address is zeroed. True otherwise. | |
Address | operator& (const Address &x) const |
Address & | operator&= (const Address &x) |
void | zero () |
Set all bits to zero in ip address. |
Static Public Attributes | |
static const size_t | size = 16 |
This is the data length of the IPv6 address. |
Private Attributes | |
unsigned char | m_data [size] |
Data representation of the IPv6 address. |
Efficiently stores IPv6 addresses.
This class stores IPv6 addresses as a 128 bit array. It does this as opposed to storing the string itself to facilitate efficient logging and processing of the address. The class possesses full IO and comparison capabilities as well as allowing bitwise AND operations for netmask calculation. It detects when an IPv4 address is stored outputs it accordingly.
|
inline |
|
inlineexplicit |
void Fastcgipp::Http::Address::assign | ( | const char * | start, |
const char * | end | ||
) |
Assign the IP address from a string of characters.
In order for this to work the string must represent either an IPv4 address in standard textual decimal form (127.0.0.1) or an IPv6 in standard form.
[in] | start | First character of the string |
[in] | end | Last character of the string + 1 |
Definition at line 610 of file http.cpp.
References Fastcgipp::Http::atoi().
|
inline |
|
inline |
Fastcgipp::Http::Address::operator bool | ( | ) | const |
Fastcgipp::Http::Address Fastcgipp::Http::Address::operator& | ( | const Address & | x | ) | const |
Fastcgipp::Http::Address & Fastcgipp::Http::Address::operator&= | ( | const Address & | x | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Data representation of the IPv6 address.
Definition at line 178 of file http.hpp.
Referenced by Address(), data(), operator&=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), and zero().
|
static |
This is the data length of the IPv6 address.
Definition at line 123 of file http.hpp.
Referenced by Address(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), and zero().