Public Types | Public Member Functions | Protected Member Functions

ns3::PbbAddressBlock Class Reference

An Address Block and its associated Address TLV Blocks. More...

#include <packetbb.h>

Inheritance diagram for ns3::PbbAddressBlock:
Inheritance graph
[legend]
Collaboration diagram for ns3::PbbAddressBlock:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::list< Address >
::iterator 
AddressIterator
typedef std::list< Address >
::const_iterator 
ConstAddressIterator
typedef std::list< uint8_t >
::iterator 
PrefixIterator
typedef std::list< uint8_t >
::const_iterator 
ConstPrefixIterator
typedef
PbbAddressTlvBlock::Iterator 
TlvIterator
typedef
PbbAddressTlvBlock::ConstIterator 
ConstTlvIterator

Public Member Functions

AddressIterator AddressBegin (void)
ConstAddressIterator AddressBegin (void) const
AddressIterator AddressEnd (void)
ConstAddressIterator AddressEnd (void) const
int AddressSize (void) const
bool AddressEmpty (void) const
Address AddressFront (void) const
Address AddressBack (void) const
void AddressPushFront (Address address)
 Prepends an address to the front of this block.
void AddressPopFront (void)
 Removes an address from the front of this block.
void AddressPushBack (Address address)
 Appends an address to the back of this block.
void AddressPopBack (void)
 Removes an address from the back of this block.
AddressIterator AddressInsert (AddressIterator position, const Address value)
 Inserts an address at the specified position in this block.
AddressIterator AddressErase (AddressIterator position)
 Removes the address at the specified position.
AddressIterator AddressErase (AddressIterator first, AddressIterator last)
 Removes all addresses from [first, last) (includes first, not includes last).
void AddressClear (void)
 Removes all addresses from this block.
PrefixIterator PrefixBegin (void)
ConstPrefixIterator PrefixBegin (void) const
PrefixIterator PrefixEnd (void)
ConstPrefixIterator PrefixEnd (void) const
int PrefixSize (void) const
bool PrefixEmpty (void) const
uint8_t PrefixFront (void) const
uint8_t PrefixBack (void) const
void PrefixPushFront (uint8_t prefix)
 Prepends a prefix to the front of this block.
void PrefixPopFront (void)
 Removes a prefix from the front of this block.
void PrefixPushBack (uint8_t prefix)
 Appends a prefix to the back of this block.
void PrefixPopBack (void)
 Removes a prefix from the back of this block.
PrefixIterator PrefixInsert (PrefixIterator position, const uint8_t value)
 Inserts a prefix at the specified position in this block.
PrefixIterator PrefixErase (PrefixIterator position)
 Removes the prefix at the specified position.
PrefixIterator PrefixErase (PrefixIterator first, PrefixIterator last)
 Removes all prefixes from [first, last) (includes first, not includes last).
void PrefixClear (void)
 Removes all prefixes from this block.
TlvIterator TlvBegin (void)
ConstTlvIterator TlvBegin (void) const
TlvIterator TlvEnd (void)
ConstTlvIterator TlvEnd (void) const
int TlvSize (void) const
bool TlvEmpty (void) const
Ptr< PbbAddressTlvTlvFront (void)
const Ptr< PbbAddressTlvTlvFront (void) const
Ptr< PbbAddressTlvTlvBack (void)
const Ptr< PbbAddressTlvTlvBack (void) const
void TlvPushFront (Ptr< PbbAddressTlv > address)
 Prepends an address TLV to the front of this message.
void TlvPopFront (void)
 Removes an address TLV from the front of this message.
void TlvPushBack (Ptr< PbbAddressTlv > address)
 Appends an address TLV to the back of this message.
void TlvPopBack (void)
 Removes an address TLV from the back of this message.
TlvIterator TlvInsert (TlvIterator position, const Ptr< PbbTlv > value)
 Inserts an address TLV at the specified position in this block.
TlvIterator TlvErase (TlvIterator position)
 Removes the address TLV at the specified position.
TlvIterator TlvErase (TlvIterator first, TlvIterator last)
 Removes all address TLVs from [first, last) (includes first, not includes last).
void TlvClear (void)
 Removes all address TLVs from this block.
uint32_t GetSerializedSize (void) const
void Serialize (Buffer::Iterator &start) const
 Serializes this address block into the specified buffer.
void Deserialize (Buffer::Iterator &start)
 Deserializes an address block from the specified buffer.
void Print (std::ostream &os) const
 Pretty-prints the contents of this address block.
void Print (std::ostream &os, int level) const
 Pretty-prints the contents of this address block, with specified indentation.
bool operator== (const PbbAddressBlock &other) const
bool operator!= (const PbbAddressBlock &other) const

Protected Member Functions

virtual uint8_t GetAddressLength (void) const =0
virtual void SerializeAddress (uint8_t *buffer, ConstAddressIterator iter) const =0
virtual Address DeserializeAddress (uint8_t *buffer) const =0
virtual void PrintAddress (std::ostream &os, ConstAddressIterator iter) const =0

Detailed Description

An Address Block and its associated Address TLV Blocks.

This is a pure virtual base class, when creating address blocks, you should instantiate either PbbAddressBlockIpv4 or PbbAddressBlockIpv6.


Member Function Documentation

Address ns3::PbbAddressBlock::AddressBack ( void   )  const
Returns:
the last address in this block.
AddressIterator ns3::PbbAddressBlock::AddressBegin ( void   ) 
Returns:
an iterator to the first address in this block.
ConstAddressIterator ns3::PbbAddressBlock::AddressBegin ( void   )  const
Returns:
a const iterator to the first address in this block.
bool ns3::PbbAddressBlock::AddressEmpty ( void   )  const
Returns:
true if there are no addresses in this block, false otherwise.
ConstAddressIterator ns3::PbbAddressBlock::AddressEnd ( void   )  const
Returns:
a const iterator to the last address in this block.
AddressIterator ns3::PbbAddressBlock::AddressEnd ( void   ) 
Returns:
an iterator to the last address in this block.
AddressIterator ns3::PbbAddressBlock::AddressErase ( AddressIterator  position  ) 

Removes the address at the specified position.

Parameters:
position an Iterator pointing to the address to erase.
Returns:
an iterator pointing to the next address in the block.
AddressIterator ns3::PbbAddressBlock::AddressErase ( AddressIterator  first,
AddressIterator  last 
)

Removes all addresses from [first, last) (includes first, not includes last).

Parameters:
first an Iterator pointing to the first address to erase (inclusive).
last an Iterator pointing to the element past the last address to erase.
Returns:
an iterator pointing to the next address in the block.
Address ns3::PbbAddressBlock::AddressFront ( void   )  const
Returns:
the first address in this block.
AddressIterator ns3::PbbAddressBlock::AddressInsert ( AddressIterator  position,
const Address  value 
)

Inserts an address at the specified position in this block.

Parameters:
position an Iterator pointing to the position in this block to insert the address.
value the address to insert.
Returns:
An iterator pointing to the newly inserted address.
void ns3::PbbAddressBlock::AddressPushBack ( Address  address  ) 

Appends an address to the back of this block.

Parameters:
address the address to append.
void ns3::PbbAddressBlock::AddressPushFront ( Address  address  ) 

Prepends an address to the front of this block.

Parameters:
address the address to prepend.
int ns3::PbbAddressBlock::AddressSize ( void   )  const
Returns:
the number of addresses in this block.
void ns3::PbbAddressBlock::Deserialize ( Buffer::Iterator start  ) 

Deserializes an address block from the specified buffer.

Parameters:
start a reference to the point in a buffer to begin deserializing.

Users should not need to call this. Blocks will be deserialized by their containing packet.

uint32_t ns3::PbbAddressBlock::GetSerializedSize ( void   )  const
Returns:
The size (in bytes) needed to serialize this address block.
uint8_t ns3::PbbAddressBlock::PrefixBack ( void   )  const
Returns:
the last prefix in this block.
PrefixIterator ns3::PbbAddressBlock::PrefixBegin ( void   ) 
Returns:
an iterator to the first prefix in this block.
ConstPrefixIterator ns3::PbbAddressBlock::PrefixBegin ( void   )  const
Returns:
a const iterator to the first prefix in this block.
bool ns3::PbbAddressBlock::PrefixEmpty ( void   )  const
Returns:
true if there are no prefixes in this block, false otherwise.
PrefixIterator ns3::PbbAddressBlock::PrefixEnd ( void   ) 
Returns:
an iterator to the last prefix in this block.
ConstPrefixIterator ns3::PbbAddressBlock::PrefixEnd ( void   )  const
Returns:
a const iterator to the last prefix in this block.
PrefixIterator ns3::PbbAddressBlock::PrefixErase ( PrefixIterator  position  ) 

Removes the prefix at the specified position.

Parameters:
position an Iterator pointing to the prefix to erase.
Returns:
an iterator pointing to the next prefix in the block.
PrefixIterator ns3::PbbAddressBlock::PrefixErase ( PrefixIterator  first,
PrefixIterator  last 
)

Removes all prefixes from [first, last) (includes first, not includes last).

Parameters:
first an Iterator pointing to the first prefix to erase (inclusive).
last an Iterator pointing to the element past the last prefix to erase.
Returns:
an iterator pointing to the next prefix in the block.
uint8_t ns3::PbbAddressBlock::PrefixFront ( void   )  const
Returns:
the first prefix in this block.
PrefixIterator ns3::PbbAddressBlock::PrefixInsert ( PrefixIterator  position,
const uint8_t  value 
)

Inserts a prefix at the specified position in this block.

Parameters:
position an Iterator pointing to the position in this block to insert the prefix.
value the prefix to insert.
Returns:
An iterator pointing to the newly inserted prefix.
void ns3::PbbAddressBlock::PrefixPushBack ( uint8_t  prefix  ) 

Appends a prefix to the back of this block.

Parameters:
prefix the prefix to append.
void ns3::PbbAddressBlock::PrefixPushFront ( uint8_t  prefix  ) 

Prepends a prefix to the front of this block.

Parameters:
prefix the prefix to prepend.
int ns3::PbbAddressBlock::PrefixSize ( void   )  const
Returns:
the number of prefixes in this block.
void ns3::PbbAddressBlock::Print ( std::ostream &  os,
int  level 
) const

Pretty-prints the contents of this address block, with specified indentation.

Parameters:
os a stream object to print to.
level level of indentation.

This probably never needs to be called by users. This is used when recursively printing sub-objects.

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

Pretty-prints the contents of this address block.

Parameters:
os a stream object to print to.
void ns3::PbbAddressBlock::Serialize ( Buffer::Iterator start  )  const

Serializes this address block into the specified buffer.

Parameters:
start a reference to the point in a buffer to begin serializing.

Users should not need to call this. Blocks will be deserialized by their containing packet.

Ptr<PbbAddressTlv> ns3::PbbAddressBlock::TlvBack ( void   ) 
Returns:
a smart pointer to the last address TLV in this message.
const Ptr<PbbAddressTlv> ns3::PbbAddressBlock::TlvBack ( void   )  const
Returns:
a const smart pointer to the last address TLV in this message.
TlvIterator ns3::PbbAddressBlock::TlvBegin ( void   ) 
Returns:
an iterator to the first address TLV in this block.
ConstTlvIterator ns3::PbbAddressBlock::TlvBegin ( void   )  const
Returns:
a const iterator to the first address TLV in this block.
bool ns3::PbbAddressBlock::TlvEmpty ( void   )  const
Returns:
true if there are no address TLVs in this block, false otherwise.
ConstTlvIterator ns3::PbbAddressBlock::TlvEnd ( void   )  const
Returns:
a const iterator to the last address TLV in this block.
TlvIterator ns3::PbbAddressBlock::TlvEnd ( void   ) 
Returns:
an iterator to the last address TLV in this block.
TlvIterator ns3::PbbAddressBlock::TlvErase ( TlvIterator  position  ) 

Removes the address TLV at the specified position.

Parameters:
position an Iterator pointing to the address TLV to erase.
Returns:
an iterator pointing to the next address TLV in the block.
TlvIterator ns3::PbbAddressBlock::TlvErase ( TlvIterator  first,
TlvIterator  last 
)

Removes all address TLVs from [first, last) (includes first, not includes last).

Parameters:
first an Iterator pointing to the first address TLV to erase (inclusive).
last an Iterator pointing to the element past the last address TLV to erase.
Returns:
an iterator pointing to the next address TLV in the message.
Ptr<PbbAddressTlv> ns3::PbbAddressBlock::TlvFront ( void   ) 
Returns:
a smart pointer to the first address TLV in this block.
const Ptr<PbbAddressTlv> ns3::PbbAddressBlock::TlvFront ( void   )  const
Returns:
a const smart pointer to the first address TLV in this message.
TlvIterator ns3::PbbAddressBlock::TlvInsert ( TlvIterator  position,
const Ptr< PbbTlv value 
)

Inserts an address TLV at the specified position in this block.

Parameters:
position an Iterator pointing to the position in this block to insert the address TLV.
value the prefix to insert.
Returns:
An iterator pointing to the newly inserted address TLV.
void ns3::PbbAddressBlock::TlvPushBack ( Ptr< PbbAddressTlv address  ) 

Appends an address TLV to the back of this message.

Parameters:
address a smart pointer to the address TLV to append.
void ns3::PbbAddressBlock::TlvPushFront ( Ptr< PbbAddressTlv address  ) 

Prepends an address TLV to the front of this message.

Parameters:
address a smart pointer to the address TLV to prepend.
int ns3::PbbAddressBlock::TlvSize ( void   )  const
Returns:
the number of address TLVs in this block.

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