25 #include "ns3/llc-snap-header.h"
27 #include "ns3/simulator.h"
28 #include "ns3/packet.h"
29 #include "ns3/mesh-point-device.h"
30 #include "ns3/wifi-net-device.h"
31 #include "ns3/mesh-point-device.h"
32 #include "ns3/mesh-wifi-interface-mac.h"
68 for (
int j = 0; j < 6; j++)
73 for (
int j = 0; j < 6; j++)
84 for (
int j = 0; j < 6; j++)
89 for (
int j = 0; j < 6; j++)
109 static TypeId tid =
TypeId (
"ns3::flame::FlameProtocol")
111 .AddConstructor<FlameProtocol> ()
112 .AddAttribute (
"BroadcastInterval",
113 "How often we must send broadcast packets",
119 .AddAttribute (
"MaxCost",
120 "Cost threshold after which packet will be dropped",
122 MakeUintegerAccessor (
124 MakeUintegerChecker<uint8_t> (3)
130 m_address (
Mac48Address ()), m_broadcastInterval (Seconds (5)), m_lastBroadcast (Seconds (0)),
155 NS_FATAL_ERROR (
"FLAME tag is not supposed to be received from upper layers");
204 flameHdr.AddCost (1);
245 flameHdr.AddCost (1);
268 NS_FATAL_ERROR (
"FLAME tag must exist when packet is coming to protocol");
286 protocolType = flameHdr.GetProtocol ();
294 for (std::vector<
Ptr<NetDevice> >::const_iterator i = interfaces.begin (); i != interfaces.end (); i++)
348 txUnicast (0), txBroadcast (0), txBytes (0), droppedTtl (0), totalDropped (0)
355 "txUnicast=\"" << txUnicast <<
"\" "
356 "txBroadcast=\"" << txBroadcast <<
"\" "
357 "txBytes=\"" << txBytes <<
"\" "
358 "droppedTtl=\"" << droppedTtl <<
"\" "
359 "totalDropped=\"" << totalDropped <<
"\"/>" << std::endl;
365 "address=\"" <<
m_address <<
"\"" << std::endl <<
367 "maxCost=\"" << (uint16_t)
m_maxCost <<
"\">" << std::endl;
371 plugin->second->Report (os);
373 os <<
"</Flame>" << std::endl;
381 plugin->second->ResetStats ();