A Discrete-Event Network Simulator
API
ns3::flame::FlameProtocolMac Class Reference

Interface MAC plugin for FLAME routing protocol. More...

#include "flame-protocol-mac.h"

+ Inheritance diagram for ns3::flame::FlameProtocolMac:
+ Collaboration diagram for ns3::flame::FlameProtocolMac:

Classes

struct  Statistics
 Statistics structure. More...
 

Public Member Functions

 FlameProtocolMac (Ptr< FlameProtocol > protocol)
 Constructor. More...
 
 ~FlameProtocolMac () override
 
int64_t AssignStreams (int64_t stream) override
 AssignStreams is empty, because this model doesn't use random variables. More...
 
uint16_t GetChannelId () const
 Get channel ID function. More...
 
bool Receive (Ptr< Packet > packet, const WifiMacHeader &header) override
 Receive and process a packet; packets are given a FlameTag packet tag. More...
 
void Report (std::ostream &os) const
 Report statistics. More...
 
void ResetStats ()
 Reset statistics function. More...
 
void SetParent (Ptr< MeshWifiInterfaceMac > parent) override
 Set parent of this instance. More...
 
void UpdateBeacon (MeshWifiBeacon &beacon) const override
 Update beacon is empty, because FLAME does not know anything about beacons. More...
 
bool UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) override
 Process an outgoing frame. More...
 
- Public Member Functions inherited from ns3::MeshWifiInterfaceMacPlugin
virtual ~MeshWifiInterfaceMacPlugin ()
 This is for subclasses. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 

Private Attributes

Ptr< MeshWifiInterfaceMacm_parent
 parent More...
 
Ptr< FlameProtocolm_protocol
 protocol More...
 
Statistics m_stats
 statistics More...
 

Detailed Description

Interface MAC plugin for FLAME routing protocol.

Definition at line 36 of file flame-protocol-mac.h.

Constructor & Destructor Documentation

◆ FlameProtocolMac()

ns3::flame::FlameProtocolMac::FlameProtocolMac ( Ptr< FlameProtocol protocol)

Constructor.

Parameters
protocolflame protocol object

Definition at line 36 of file flame-protocol-mac.cc.

◆ ~FlameProtocolMac()

ns3::flame::FlameProtocolMac::~FlameProtocolMac ( )
override

Definition at line 41 of file flame-protocol-mac.cc.

References m_parent, and m_protocol.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::flame::FlameProtocolMac::AssignStreams ( int64_t  stream)
inlineoverridevirtual

AssignStreams is empty, because this model doesn't use random variables.

Parameters
stream
Returns
0 (no streams used)

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 84 of file flame-protocol-mac.h.

◆ GetChannelId()

uint16_t ns3::flame::FlameProtocolMac::GetChannelId ( ) const

Get channel ID function.

Returns
the channel

Definition at line 109 of file flame-protocol-mac.cc.

References m_parent.

◆ Receive()

bool ns3::flame::FlameProtocolMac::Receive ( Ptr< Packet packet,
const WifiMacHeader header 
)
overridevirtual

◆ Report()

void ns3::flame::FlameProtocolMac::Report ( std::ostream &  os) const

Report statistics.

Parameters
osthe output stream

Definition at line 148 of file flame-protocol-mac.cc.

References m_parent, m_stats, and ns3::flame::FlameProtocolMac::Statistics::Print().

+ Here is the call graph for this function:

◆ ResetStats()

void ns3::flame::FlameProtocolMac::ResetStats ( )

Reset statistics function.

Definition at line 157 of file flame-protocol-mac.cc.

References m_stats.

◆ SetParent()

void ns3::flame::FlameProtocolMac::SetParent ( Ptr< MeshWifiInterfaceMac parent)
overridevirtual

Set parent of this instance.

Parameters
parentpointer to the parent MeshWifiInterfaceMac

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 48 of file flame-protocol-mac.cc.

References m_parent.

◆ UpdateBeacon()

void ns3::flame::FlameProtocolMac::UpdateBeacon ( MeshWifiBeacon beacon) const
inlineoverridevirtual

Update beacon is empty, because FLAME does not know anything about beacons.

Parameters
beaconthe beacon

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 77 of file flame-protocol-mac.h.

◆ UpdateOutcomingFrame()

bool ns3::flame::FlameProtocolMac::UpdateOutcomingFrame ( Ptr< Packet packet,
WifiMacHeader header,
Mac48Address  from,
Mac48Address  to 
)
overridevirtual

Process an outgoing frame.

Remove the FlameTag and increment stats counters.

Parameters
packetthe packet received
headerthe header
fromthe MAC address of the sender
tothe MAC address of the receiver
Returns
true if successful

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 81 of file flame-protocol-mac.cc.

References ns3::Mac48Address::GetBroadcast(), ns3::Packet::GetSize(), ns3::WifiMacHeader::IsData(), m_stats, NS_FATAL_ERROR, ns3::flame::FlameTag::receiver, ns3::Packet::RemovePacketTag(), ns3::WifiMacHeader::SetAddr1(), ns3::flame::FlameProtocolMac::Statistics::txBroadcast, ns3::flame::FlameProtocolMac::Statistics::txBytes, and ns3::flame::FlameProtocolMac::Statistics::txUnicast.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_parent

Ptr<MeshWifiInterfaceMac> ns3::flame::FlameProtocolMac::m_parent
private

parent

Definition at line 105 of file flame-protocol-mac.h.

Referenced by ~FlameProtocolMac(), GetChannelId(), Report(), and SetParent().

◆ m_protocol

Ptr<FlameProtocol> ns3::flame::FlameProtocolMac::m_protocol
private

protocol

Definition at line 104 of file flame-protocol-mac.h.

Referenced by ~FlameProtocolMac().

◆ m_stats

Statistics ns3::flame::FlameProtocolMac::m_stats
private

statistics

Definition at line 126 of file flame-protocol-mac.h.

Referenced by Receive(), Report(), ResetStats(), and UpdateOutcomingFrame().


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