#include <ipv4.hh>
Public Types | |
typedef sockaddr_in | sockaddr_t |
System socket type. | |
typedef in_addr | addr_t |
System address type. | |
enum | { address_size = sizeof (addr_t), proto = PF_INET, family = AF_INET, header_length = 28 } |
Public Member Functions | |
IPv4Address () | |
IPv4Address (const sockaddr_t &s) | |
IPv4Address (const addr_t &a) | |
IPv4Address (const u_int8_t *bytes, unsigned len) | |
IPv4Address (const std::string &s) | |
const unsigned char * | bytes () const |
const std::string | to_string () const |
const sockaddr_t | make_sockaddr (u_int16_t port) const |
void | dump (u_int8_t *p) const |
bool | is_linklocal () const |
bool | operator< (const This &rhs) const |
bool | operator== (const This &rhs) const |
bool | operator!= (const This &rhs) const |
unsigned long | hash () const |
Static Public Member Functions | |
static This | netmask (unsigned prefix) |
static void | set_scope_index (sockaddr_t &, unsigned) |
static unsigned | netmask_to_prefix (const This &nm) |
static const This | network (const This &a, unsigned prefix) |
static const This | resolve (const std::string &s) |
Static Public Attributes | |
static const This | addr_any |
Static INADDR_ANY address. | |
Private Types | |
typedef IPv4Address | This |
Private Attributes | |
::in_addr | _addr |
Address data. |
|
System address type.
|
|
System socket type.
|
|
|
|
|
|
Default constructor |
|
Low-level constructor
|
|
Low-level constructor
|
|
Low-level constructor
|
|
User-level constructor
|
|
Raw data accessor
|
|
Dumping method
|
|
Hashing method
|
|
Link-local predicate
|
|
Low-level structure accessor
|
|
User-level netmask constructor
|
|
Prefix computation routine
|
|
Network address computation routine
|
|
Difference comparison method
|
|
Less-than comparison method
|
|
Equality comparison method
|
|
Resolving routine
|
|
Scope setting routine (does nothing) |
|
Utility "to string" converter
|
|
Address data.
|
|
Static INADDR_ANY address.
|