Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

olsr::net::IPv6Address Class Reference

IPv6 address class. More...

#include <ipv6.hh>

List of all members.

Public Types

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

Public Member Functions

 IPv6Address ()
 IPv6Address (const sockaddr_t &s)
 IPv6Address (const addr_t &a)
 IPv6Address (const u_int8_t *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 (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 &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

in6_addr olsr::net::IPv6Address::addr_t
 

System address type.

sockaddr_in6 olsr::net::IPv6Address::sockaddr_t
 

System socket type.

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


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
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

  • s Reference to sockaddr_t instance

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

Low-level constructor

  • a Reference to addr_t instance

olsr::net::IPv6Address::IPv6Address const u_int8_t *  bytes,
unsigned  len
[inline]
 

Low-level constructor

  • bytes Pointer to buffer containing address
  • len Length of the buffer

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

User-level constructor

  • s String containing human-readable address


Member Function Documentation

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

Raw data accessor

Returns:
Pointer to the raw buffer

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

Dumping method

  • p Pointer to destination raw buffer

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

Hashing method

Returns:
Hashed address

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

Link-local predicate

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

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

Low-level structure accessor

  • port Port number
    Returns:
    Instance of sockaddr_t

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

User-level netmask constructor

  • prefix Length of prefix in bits

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

Prefix computation routine

  • nm Netmask address
    Returns:
    Length of the prefix

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

Network address computation routine

  • a Address of a node
  • prefix Length of prefix
    Returns:
    Address of the node's network

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

Difference comparison method

  • rhs RHS operand
    Returns:
    true if addresses are different

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

Less-than comparison method

  • rhs RHS operand
    Returns:
    true if instance's address is lower than RHS's

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

Equality comparison method

  • rhs RHS operand
    Returns:
    true if both addresses are equal

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

Resolving routine

  • s String containing human-readable address
    Returns:
    Address corresponding to the string

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

Scope setting routine

  • sin Instance of sockaddr_t
  • index Index of scope to be set

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

Utility "to string" converter

Returns:
String containing human-readable address


Member Data Documentation

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

Address data.

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

Static INADDR6_ANY address.


The documentation for this class was generated from the following file:
Generated on Thu Jul 28 21:21:50 2005 for Qolyester daemon by  doxygen 1.4.1