A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::UanHeaderCommon Class Reference

#include <uan-header-common.h>

+ Inheritance diagram for ns3::UanHeaderCommon:
+ Collaboration diagram for ns3::UanHeaderCommon:

Public Member Functions

 UanHeaderCommon ()
 UanHeaderCommon (const UanAddress src, const UanAddress dest, uint8_t type)
 Create UanHeaderCommon object with given source and destination address and header type.
virtual ~UanHeaderCommon ()
virtual uint32_t Deserialize (Buffer::Iterator start)
UanAddress GetDest (void) const
virtual TypeId GetInstanceTypeId (void) const
virtual uint32_t GetSerializedSize (void) const
UanAddress GetSrc (void) const
uint8_t GetType (void) const
virtual void Print (std::ostream &os) const
virtual void Serialize (Buffer::Iterator start) const
void SetDest (UanAddress dest)
void SetSrc (UanAddress src)
void SetType (uint8_t type)
- Public Member Functions inherited from ns3::Header
virtual ~Header ()

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::UanHeaderCommon.

Private Attributes

UanAddress m_dest
UanAddress m_src
uint8_t m_type

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
virtual void NotifyConstructionCompleted (void)

Detailed Description

Header includes 1 byte src address, 1 byte dest address, and a 1 byte type field.

Definition at line 37 of file uan-header-common.h.

Constructor & Destructor Documentation

ns3::UanHeaderCommon::UanHeaderCommon ( )

Definition at line 28 of file uan-header-common.cc.

ns3::UanHeaderCommon::UanHeaderCommon ( const UanAddress  src,
const UanAddress  dest,
uint8_t  type 
)

Create UanHeaderCommon object with given source and destination address and header type.

Parameters
srcSource address defined in header
destDestination address defined in header
typeHeader type

Definition at line 32 of file uan-header-common.cc.

ns3::UanHeaderCommon::~UanHeaderCommon ( )
virtual

Definition at line 56 of file uan-header-common.cc.

Member Function Documentation

uint32_t ns3::UanHeaderCommon::Deserialize ( Buffer::Iterator  start)
virtual
Parameters
startan iterator which points to where the header should written.
Returns
the number of bytes read.

This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.

Implements ns3::Header.

Definition at line 111 of file uan-header-common.cc.

References ns3::Buffer::Iterator::GetDistanceFrom(), m_dest, m_src, m_type, ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().

+ Here is the call graph for this function:

UanAddress ns3::UanHeaderCommon::GetDest ( void  ) const
TypeId ns3::UanHeaderCommon::GetInstanceTypeId ( void  ) const
virtual
Returns
the TypeId associated to the most-derived type of this instance.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Implements ns3::ObjectBase.

Definition at line 52 of file uan-header-common.cc.

References GetTypeId().

+ Here is the call graph for this function:

uint32_t ns3::UanHeaderCommon::GetSerializedSize ( void  ) const
virtual
Returns
the expected size of the header.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.

Implements ns3::Header.

Definition at line 97 of file uan-header-common.cc.

Referenced by ns3::UanMacRcGw::ComputeExpS(), ns3::AcousticModemEnergyTestCase::DoRun(), ns3::UanMacRc::ReceiveOkFromPhy(), ns3::Reservation::Reservation(), and ns3::UanMacRcGw::UanMacRcGw().

+ Here is the caller graph for this function:

UanAddress ns3::UanHeaderCommon::GetSrc ( void  ) const
Returns
UanAddress in source field

Definition at line 84 of file uan-header-common.cc.

References m_src.

Referenced by ns3::UanPhyCalcSinrDual::CalcSinrDb(), ns3::UanMacCw::PhyRxPacketGood(), ns3::UanMacRc::ReceiveOkFromPhy(), ns3::UanMacRcGw::ReceivePacket(), and ns3::UanMacAloha::RxPacketGood().

+ Here is the caller graph for this function:

uint8_t ns3::UanHeaderCommon::GetType ( void  ) const
Returns
value of type field

Definition at line 89 of file uan-header-common.cc.

References m_type.

Referenced by ns3::UanPhyCalcSinrDual::CalcSinrDb(), ns3::UanMacRc::IsPhy1Ok(), ns3::UanMacRc::ReceiveOkFromPhy(), ns3::UanMacRcGw::ReceivePacket(), ns3::UanMacRcGw::SendPacket(), and ns3::UanMacRc::SendPacket().

+ Here is the caller graph for this function:

TypeId ns3::UanHeaderCommon::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::UanHeaderCommon.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Header.

Definition at line 42 of file uan-header-common.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanHeaderCommon::Print ( std::ostream &  os) const
virtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a trailer as ascii data to a c++ output stream. Although the trailer is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5

Implements ns3::Header.

Definition at line 123 of file uan-header-common.cc.

References m_dest, m_src, and m_type.

void ns3::UanHeaderCommon::Serialize ( Buffer::Iterator  start) const
virtual
Parameters
startan iterator which points to where the header should be written.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.

Implements ns3::Header.

Definition at line 103 of file uan-header-common.cc.

References ns3::UanAddress::GetAsInt(), m_dest, m_src, m_type, and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

void ns3::UanHeaderCommon::SetDest ( UanAddress  dest)
Parameters
destAddress of destination node

Definition at line 62 of file uan-header-common.cc.

References m_dest.

Referenced by ns3::UanMacRcGw::EndCycle(), ns3::UanMacAloha::Enqueue(), ns3::UanMacCw::Enqueue(), ns3::UanMacRc::ScheduleData(), and ns3::UanMacRcGw::StartCycle().

+ Here is the caller graph for this function:

void ns3::UanHeaderCommon::SetSrc ( UanAddress  src)
Parameters
srcAddress of packet source node

Definition at line 67 of file uan-header-common.cc.

References m_src.

Referenced by ns3::UanMacRcGw::EndCycle(), ns3::UanMacAloha::Enqueue(), ns3::UanMacCw::Enqueue(), ns3::UanMacRc::ScheduleData(), and ns3::UanMacRcGw::StartCycle().

+ Here is the caller graph for this function:

void ns3::UanHeaderCommon::SetType ( uint8_t  type)
Parameters
typeValue to set 1 byte type field to. Value has protocol specific meaning

Definition at line 73 of file uan-header-common.cc.

References m_type.

Referenced by ns3::UanMacRcGw::EndCycle(), ns3::UanMacAloha::Enqueue(), ns3::UanMacCw::Enqueue(), ns3::UanMacRc::ScheduleData(), and ns3::UanMacRcGw::StartCycle().

+ Here is the caller graph for this function:

Member Data Documentation

UanAddress ns3::UanHeaderCommon::m_dest
private

Definition at line 87 of file uan-header-common.h.

Referenced by Deserialize(), GetDest(), Print(), Serialize(), and SetDest().

UanAddress ns3::UanHeaderCommon::m_src
private

Definition at line 88 of file uan-header-common.h.

Referenced by Deserialize(), GetSrc(), Print(), Serialize(), and SetSrc().

uint8_t ns3::UanHeaderCommon::m_type
private

Definition at line 89 of file uan-header-common.h.

Referenced by Deserialize(), GetType(), Print(), Serialize(), and SetType().


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