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