Interface MAC plugin for FLAME routing protocol. More...
#include "flame-protocol-mac.h"
Classes | |
struct | Statistics |
Statistics structure. More... | |
Public Member Functions | |
FlameProtocolMac (Ptr< FlameProtocol > protocol) | |
Constructor. More... | |
~FlameProtocolMac () | |
int64_t | AssignStreams (int64_t stream) |
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) |
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) |
Set parent of this instance. More... | |
void | UpdateBeacon (MeshWifiBeacon &beacon) const |
Update beacon is empty, because FLAME does not know anything about beacons. More... | |
bool | UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) |
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 (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Private Attributes | |
Ptr< MeshWifiInterfaceMac > | m_parent |
parent More... | |
Ptr< FlameProtocol > | m_protocol |
protocol More... | |
Statistics | m_stats |
statistics More... | |
Interface MAC plugin for FLAME routing protocol.
Definition at line 34 of file flame-protocol-mac.h.
ns3::flame::FlameProtocolMac::FlameProtocolMac | ( | Ptr< FlameProtocol > | protocol | ) |
Constructor.
protocol | flame protocol object |
Definition at line 33 of file flame-protocol-mac.cc.
ns3::flame::FlameProtocolMac::~FlameProtocolMac | ( | ) |
Definition at line 37 of file flame-protocol-mac.cc.
References m_parent, and m_protocol.
|
inlinevirtual |
AssignStreams is empty, because this model doesn't use random variables.
stream |
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 78 of file flame-protocol-mac.h.
uint16_t ns3::flame::FlameProtocolMac::GetChannelId | ( | ) | const |
Get channel ID function.
Definition at line 100 of file flame-protocol-mac.cc.
References m_parent.
|
virtual |
Receive and process a packet; packets are given a FlameTag packet tag.
packet | the packet received |
header | the header |
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 49 of file flame-protocol-mac.cc.
References ns3::Packet::AddPacketTag(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::Mac48Address::GetBroadcast(), ns3::Packet::GetSize(), ns3::WifiMacHeader::IsData(), m_stats, NS_FATAL_ERROR, ns3::Packet::PeekPacketTag(), ns3::flame::FlameTag::receiver, ns3::flame::FlameProtocolMac::Statistics::rxBroadcast, ns3::flame::FlameProtocolMac::Statistics::rxBytes, ns3::flame::FlameProtocolMac::Statistics::rxUnicast, and ns3::flame::FlameTag::transmitter.
void ns3::flame::FlameProtocolMac::Report | ( | std::ostream & | os | ) | const |
Report statistics.
os | the output stream |
Definition at line 120 of file flame-protocol-mac.cc.
References m_parent, m_stats, and ns3::flame::FlameProtocolMac::Statistics::Print().
void ns3::flame::FlameProtocolMac::ResetStats | ( | ) |
Reset statistics function.
Definition at line 129 of file flame-protocol-mac.cc.
References m_stats.
|
virtual |
Set parent of this instance.
parent | pointer to the parent MeshWifiInterfaceMac |
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 43 of file flame-protocol-mac.cc.
References m_parent.
|
inlinevirtual |
Update beacon is empty, because FLAME does not know anything about beacons.
beacon | the beacon |
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 72 of file flame-protocol-mac.h.
|
virtual |
Process an outgoing frame.
Remove the FlameTag and increment stats counters.
packet | the packet received |
header | the header |
from | the MAC address of the sender |
to | the MAC address of the receiver |
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 75 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.
|
private |
parent
Definition at line 97 of file flame-protocol-mac.h.
Referenced by ~FlameProtocolMac(), GetChannelId(), Report(), and SetParent().
|
private |
|
private |
statistics
Definition at line 116 of file flame-protocol-mac.h.
Referenced by Receive(), Report(), ResetStats(), and UpdateOutcomingFrame().