Public Member Functions | Protected Member Functions

ns3::PbbTlv Class Reference

A packet or message TLV. More...

#include <packetbb.h>

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

List of all members.

Public Member Functions

void SetType (uint8_t type)
 Sets the type of this TLV.
uint8_t GetType (void) const
void SetTypeExt (uint8_t type)
 Sets the type extension of this TLV.
uint8_t GetTypeExt (void) const
bool HasTypeExt (void) const
 Tests whether or not this TLV has a type extension.
void SetValue (Buffer start)
 Sets the value of this message to the specified buffer.
void SetValue (const uint8_t *buffer, uint32_t size)
 Sets the value of this message to a buffer with the specified data.
Buffer GetValue (void) const
bool HasValue (void) const
 Tests whether or not this TLV has a value.
uint32_t GetSerializedSize (void) const
void Serialize (Buffer::Iterator &start) const
 Serializes this TLV into the specified buffer.
void Deserialize (Buffer::Iterator &start)
 Deserializes a TLV from the specified buffer.
void Print (std::ostream &os) const
 Pretty-prints the contents of this TLV.
void Print (std::ostream &os, int level) const
 Pretty-prints the contents of this TLV, with specified indentation.
bool operator== (const PbbTlv &other) const
bool operator!= (const PbbTlv &other) const

Protected Member Functions

void SetIndexStart (uint8_t index)
uint8_t GetIndexStart (void) const
bool HasIndexStart (void) const
void SetIndexStop (uint8_t index)
uint8_t GetIndexStop (void) const
bool HasIndexStop (void) const
void SetMultivalue (bool isMultivalue)
bool IsMultivalue (void) const

Detailed Description

A packet or message TLV.


Member Function Documentation

void ns3::PbbTlv::Deserialize ( Buffer::Iterator start  ) 

Deserializes a TLV from the specified buffer.

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

Users should not need to call this. TLVs will be deserialized by their containing blocks.

uint32_t ns3::PbbTlv::GetSerializedSize ( void   )  const
Returns:
The size (in bytes) needed to serialize this TLV.
uint8_t ns3::PbbTlv::GetType ( void   )  const
Returns:
the type of this TLV.
uint8_t ns3::PbbTlv::GetTypeExt ( void   )  const
Returns:
the type extension for this TLV.

Calling this while HasTypeExt is False is undefined. Make sure you check it first. This will be checked by an assert in debug builds.

Buffer ns3::PbbTlv::GetValue ( void   )  const
Returns:
a Buffer pointing to the value of this TLV.

Calling this while HasValue is False is undefined. Make sure you check it first. This will be checked by an assert in debug builds.

bool ns3::PbbTlv::HasTypeExt ( void   )  const

Tests whether or not this TLV has a type extension.

Returns:
true if this TLV has a type extension, false otherwise.

This should be called before calling GetTypeExt to make sure there actually is one.

bool ns3::PbbTlv::HasValue ( void   )  const

Tests whether or not this TLV has a value.

Returns:
true if this tlv has a TLV, false otherwise.

This should be called before calling GetTypeExt to make sure there actually is one.

void ns3::PbbTlv::Print ( std::ostream &  os,
int  level 
) const

Pretty-prints the contents of this TLV, 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::PbbTlv::Print ( std::ostream &  os  )  const

Pretty-prints the contents of this TLV.

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

Serializes this TLV into the specified buffer.

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

Users should not need to call this. TLVs will be serialized by their containing blocks.

void ns3::PbbTlv::SetType ( uint8_t  type  ) 

Sets the type of this TLV.

Parameters:
type the type value to set.
void ns3::PbbTlv::SetTypeExt ( uint8_t  type  ) 

Sets the type extension of this TLV.

Parameters:
type the type extension value to set.

The type extension is like a sub-type used to further distinguish between TLVs of the same type.

void ns3::PbbTlv::SetValue ( Buffer  start  ) 

Sets the value of this message to the specified buffer.

Parameters:
start a buffer instance.

The buffer is _not_ copied until this TLV is serialized. You should not change the contents of the buffer you pass in to this function.

void ns3::PbbTlv::SetValue ( const uint8_t *  buffer,
uint32_t  size 
)

Sets the value of this message to a buffer with the specified data.

Parameters:
buffer a pointer to data to put in the TLVs buffer.
size the size of the buffer.

The buffer *is copied* into a *new buffer instance*. You can free the data in the buffer provided anytime you wish.


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