|
fastcgi++
A C++ FastCGI/Web API
|
Efficiently stores IPv6 addresses. More...
#include <fastcgi++/http.hpp>
Public Member Functions | |
| Address | operator= (const unsigned char *data) |
| Assign the IPv6 address from a data array. More... | |
| Address | operator= (const Address &address) |
| Address (const Address &address) | |
| Address () | |
| Initializes an all zero address. More... | |
| Address (const unsigned char *data) | |
| Construct the IPv6 address from a data array. More... | |
| template<class charT > | |
| void | assign (const charT *start, const charT *end) |
| Assign the IP address from a string of characters. More... | |
| 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. More... | |
| Address | operator& (const Address &x) const |
| Address & | operator&= (const Address &x) |
| void | zero () |
| Set all bits to zero in IP address. More... | |
Public Attributes | |
| std::array< unsigned char, size > | m_data |
| Data representation of the IPv6 address. More... | |
Static Public Attributes | |
| static const size_t | size =16 |
| This is the data length of the IPv6 address. More... | |
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 |
|
inline |
|
inlineexplicit |
| void Fastcgipp::Http::Address::assign | ( | const charT * | start, |
| const charT * | 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 |
| charT | Character type. |
Definition at line 798 of file http.cpp.
References Fastcgipp::Http::atoi(), Fastcgipp::Http::SessionId::m_data, and WARNING_LOG.
| Fastcgipp::Http::Address::operator bool | ( | ) | const |
Returns false if the ip address is zeroed. True otherwise.
Definition at line 1255 of file http.cpp.
References Fastcgipp::Http::SessionId::m_data.
| Fastcgipp::Http::Address Fastcgipp::Http::Address::operator& | ( | const Address & | x | ) | const |
| Fastcgipp::Http::Address & Fastcgipp::Http::Address::operator&= | ( | const Address & | x | ) |
Definition at line 772 of file http.cpp.
References m_data, and Fastcgipp::Http::SessionId::m_data.
|
inline |
Definition at line 200 of file http.hpp.
References m_data, and Fastcgipp::Http::File< charT >::size.
|
inline |
|
inline |
|
inline |
Set all bits to zero in IP address.
Definition at line 213 of file http.hpp.
References Fastcgipp::Http::operator<<(), and Fastcgipp::Http::operator>>().
| std::array<unsigned char, size> Fastcgipp::Http::Address::m_data |
Data representation of the IPv6 address.
Definition at line 134 of file http.hpp.
Referenced by Address(), operator&=(), operator<(), Fastcgipp::Http::operator<<(), operator=(), and operator==().
|
static |
This is the data length of the IPv6 address.
Definition at line 131 of file http.hpp.
Referenced by Fastcgipp::Http::operator<<(), and Fastcgipp::Http::operator>>().
1.8.11