olsr::net::IPv6Address Class Reference

IPv6 address class. More...

#include <ipv6.hh>

List of all members.

Public Types

enum  { address_size = sizeof (addr_t), proto = PF_INET6, family = AF_INET6, header_length = 48 }
typedef sockaddr_in6 sockaddr_t
 System socket type.
typedef in6_addr addr_t
 System address type.

Public Member Functions

 IPv6Address ()
 IPv6Address (const sockaddr_t &s)
 IPv6Address (const addr_t &a)
 IPv6Address (const void *bytes, unsigned len)
 IPv6Address (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 &sin, unsigned index)
static const This network (const This &a, unsigned prefix)
static unsigned netmask_to_prefix (const This &nm)
static const This resolve (const std::string &s)

Static Public Attributes

static const This addr_any
 Static INADDR6_ANY address.

Private Types

typedef IPv6Address This

Private Attributes

in6_addr _addr
 Address data.


Detailed Description

IPv6 address class.


Member Typedef Documentation

typedef IPv6Address olsr::net::IPv6Address::This [private]

sockaddr_in6 olsr::net::IPv6Address::sockaddr_t

System socket type.

in6_addr olsr::net::IPv6Address::addr_t

System address type.


Member Enumeration Documentation

anonymous enum

Enumerator:
address_size  Address size in bytes.
proto  Protocol index.
family  Family index.
header_length  Length of IP header.


Constructor & Destructor Documentation

olsr::net::IPv6Address::IPv6Address (  )  [inline]

Default constructor

olsr::net::IPv6Address::IPv6Address ( const sockaddr_t s  )  [inline]

Low-level constructor

olsr::net::IPv6Address::IPv6Address ( const addr_t a  )  [inline]

Low-level constructor

olsr::net::IPv6Address::IPv6Address ( const void *  bytes,
unsigned  len 
) [inline]

Low-level constructor

olsr::net::IPv6Address::IPv6Address ( const std::string &  s  )  [inline]

User-level constructor


Member Function Documentation

static This olsr::net::IPv6Address::netmask ( unsigned  prefix  )  [inline, static]

User-level netmask constructor

const unsigned char* olsr::net::IPv6Address::bytes (  )  const [inline]

Raw data accessor

Returns:
Pointer to the raw buffer

const std::string olsr::net::IPv6Address::to_string (  )  const [inline]

Utility "to string" converter

Returns:
String containing human-readable address

const sockaddr_t olsr::net::IPv6Address::make_sockaddr ( u_int16_t  port  )  const [inline]

Low-level structure accessor

void olsr::net::IPv6Address::dump ( void *  p  )  const [inline]

Dumping method

bool olsr::net::IPv6Address::is_linklocal (  )  const [inline]

Link-local predicate

Returns:
true if the address is link-local, false otherwise

static void olsr::net::IPv6Address::set_scope_index ( sockaddr_t sin,
unsigned  index 
) [inline, static]

Scope setting routine

static const This olsr::net::IPv6Address::network ( const This a,
unsigned  prefix 
) [inline, static]

Network address computation routine

static unsigned olsr::net::IPv6Address::netmask_to_prefix ( const This nm  )  [inline, static]

Prefix computation routine

static const This olsr::net::IPv6Address::resolve ( const std::string &  s  )  [inline, static]

Resolving routine

bool olsr::net::IPv6Address::operator< ( const This rhs  )  const [inline]

Less-than comparison method

bool olsr::net::IPv6Address::operator== ( const This rhs  )  const [inline]

Equality comparison method

bool olsr::net::IPv6Address::operator!= ( const This rhs  )  const [inline]

Difference comparison method

unsigned long olsr::net::IPv6Address::hash (  )  const [inline]

Hashing method

Returns:
Hashed address


Member Data Documentation

const IPv6Address olsr::net::IPv6Address::addr_any [static]

Static INADDR6_ANY address.

in6_addr olsr::net::IPv6Address::_addr [private]

Address data.


The documentation for this class was generated from the following file:
Generated on Mon Sep 10 17:02:13 2007 for Qolyester daemon by  doxygen 1.5.1