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

System socket type.

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

References _addr.

Referenced by resolve().

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 void *  bytes,
unsigned  len 
) [inline]

Low-level constructor

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

References _addr, and address_size.

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

User-level constructor

  • s String containing human-readable address


Member Function Documentation

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

User-level netmask constructor

  • prefix Length of prefix in bits

Referenced by olsr::concept_check::address_check::address_check().

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

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

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

References _addr.

Referenced by olsr::concept_check::address_check::address_check(), olsr::sys::Socket::bind(), olsr::sys::Socket::connect(), and olsr::sys::Socket::sendto_bcast().

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

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

Link-local predicate

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

References _addr.

Referenced by olsr::concept_check::address_check::address_check(), olsr::sys::RealInterfaceInfo::get_addr(), olsr::sys::RealInterfaceInfo::get_bcast(), and olsr::net::RealInterface::RealInterface().

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

Referenced by olsr::concept_check::address_check::address_check().

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

References _addr.

Referenced by olsr::concept_check::address_check::address_check(), and olsr::utl::parse_args().

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

Prefix computation routine

  • nm Netmask address
    Returns:
    Length of the prefix

References _addr.

Referenced by olsr::concept_check::address_check::address_check(), and olsr::msg::HNAMessage::parse().

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

References IPv6Address().

Referenced by olsr::concept_check::address_check::address_check().

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

References _addr.

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

Equality comparison method

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

References _addr.

Referenced by operator!=().

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

Difference comparison method

  • rhs RHS operand
    Returns:
    true if addresses are different

References operator==().

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

Hashing method

Returns:
Hashed address

References _addr.

Referenced by olsr::concept_check::address_check::address_check(), and hash< olsr::address_t >::operator()().


Member Data Documentation

Static INADDR6_ANY address.

Referenced by olsr::concept_check::address_check::address_check().

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


The documentation for this class was generated from the following file:

Generated on Thu Feb 12 20:45:38 2009 for Qolyester daemon by  doxygen 1.5.6