ns3::Ipv6Prefix Class Reference

Describes an IPv6 prefix. It is just a bitmask like Ipv4Mask. More...

#include <ipv6-address.h>

List of all members.

Public Member Functions

 Ipv6Prefix ()
 Default constructor.
 Ipv6Prefix (uint8_t prefix[16])
 Constructs an Ipv6Prefix by using the input 16 bytes.
 Ipv6Prefix (char const *prefix)
 Constructs an Ipv6Prefix by using the input string.
 Ipv6Prefix (uint8_t prefix)
 Constructs an Ipv6Prefix by using the input number of bits.
 Ipv6Prefix (Ipv6Prefix const &prefix)
 Copy constructor.
 Ipv6Prefix (Ipv6Prefix const *prefix)
 Copy constructor.
 ~Ipv6Prefix ()
 Destructor.
bool IsMatch (Ipv6Address a, Ipv6Address b) const
 If the Address match the type.
void GetBytes (uint8_t buf[16]) const
 Get the bytes corresponding to the prefix.
bool IsEqual (const Ipv6Prefix &other) const
 Comparison operation between two Ipv6Prefix.
void Print (std::ostream &os) const
 Print this address to the given output stream.

Static Public Member Functions

static Ipv6Prefix GetLoopback ()
 Get the loopback prefix ( /128).
static Ipv6Prefix GetZero ()
 Get the zero prefix ( /0).

Private Attributes

uint8_t m_prefix [16]
 The prefix representation.

Detailed Description

Describes an IPv6 prefix. It is just a bitmask like Ipv4Mask.

See also:
Ipv6Address

Definition at line 291 of file ipv6-address.h.


Constructor & Destructor Documentation

ns3::Ipv6Prefix::Ipv6Prefix (  ) 

Default constructor.

Definition at line 523 of file ipv6-address.cc.

References m_prefix.

ns3::Ipv6Prefix::Ipv6Prefix ( uint8_t  prefix[16]  ) 

Constructs an Ipv6Prefix by using the input 16 bytes.

Parameters:
prefix the 128-bit prefix

Definition at line 533 of file ipv6-address.cc.

References m_prefix.

ns3::Ipv6Prefix::Ipv6Prefix ( char const *  prefix  ) 

Constructs an Ipv6Prefix by using the input string.

Parameters:
prefix the 128-bit prefix

Definition at line 528 of file ipv6-address.cc.

References ns3::AsciiToIpv6Host(), and m_prefix.

ns3::Ipv6Prefix::Ipv6Prefix ( uint8_t  prefix  ) 

Constructs an Ipv6Prefix by using the input number of bits.

Parameters:
prefix number of bits of the prefix (0 - 128)
Note:
A valid number of bits is between 0 and 128).

Definition at line 538 of file ipv6-address.cc.

References m_prefix, and NS_ASSERT.

ns3::Ipv6Prefix::Ipv6Prefix ( Ipv6Prefix const &  prefix  ) 

Copy constructor.

Parameters:
prefix Ipv6Prefix object

Definition at line 568 of file ipv6-address.cc.

References m_prefix.

ns3::Ipv6Prefix::Ipv6Prefix ( Ipv6Prefix const *  prefix  ) 

Copy constructor.

Parameters:
prefix Ipv6Prefix pointer

Definition at line 573 of file ipv6-address.cc.

References m_prefix.

ns3::Ipv6Prefix::~Ipv6Prefix (  ) 

Destructor.

Definition at line 578 of file ipv6-address.cc.


Member Function Documentation

void ns3::Ipv6Prefix::GetBytes ( uint8_t  buf[16]  )  const

Get the bytes corresponding to the prefix.

Parameters:
buf buffer to store the data

Definition at line 635 of file ipv6-address.cc.

References m_prefix.

Ipv6Prefix ns3::Ipv6Prefix::GetLoopback ( void   )  [static]

Get the loopback prefix ( /128).

Returns:
a Ipv6Prefix corresponding to loopback prefix

Definition at line 623 of file ipv6-address.cc.

Ipv6Prefix ns3::Ipv6Prefix::GetZero ( void   )  [static]

Get the zero prefix ( /0).

Returns:
an Ipv6Prefix

Definition at line 629 of file ipv6-address.cc.

bool ns3::Ipv6Prefix::IsEqual ( const Ipv6Prefix other  )  const

Comparison operation between two Ipv6Prefix.

Parameters:
other the IPv6 prefix to which to compare this prefix
Returns:
true if the prefixes are equal, false otherwise

Definition at line 640 of file ipv6-address.cc.

References m_prefix.

bool ns3::Ipv6Prefix::IsMatch ( Ipv6Address  a,
Ipv6Address  b 
) const

If the Address match the type.

Parameters:
a a first address
b a second address
Returns:
true if the type match, false otherwise

Definition at line 583 of file ipv6-address.cc.

References ns3::Ipv6Address::GetBytes(), and m_prefix.

void ns3::Ipv6Prefix::Print ( std::ostream &  os  )  const

Print this address to the given output stream.

The print format is in the typicall "2001:660:4701::1".

Parameters:
os the output stream to which this Ipv6Address is printed

Definition at line 603 of file ipv6-address.cc.

References m_prefix.


Member Data Documentation

uint8_t ns3::Ipv6Prefix::m_prefix[16] [private]

The prefix representation.

Definition at line 380 of file ipv6-address.h.

Referenced by GetBytes(), Ipv6Prefix(), IsEqual(), IsMatch(), and Print().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:12:03 2009 for NS-3 by  doxygen 1.6.3