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" 
   49   static TypeId tid = 
TypeId (
"ns3::flame::FlameTag").
SetParent<
Tag> ().AddConstructor<FlameTag> ().SetGroupName (
"Mesh");
 
   70   for (
int j = 0; j < 6; j++)
 
   75   for (
int j = 0; j < 6; j++)
 
   86   for (
int j = 0; j < 6; j++)
 
   91   for (
int j = 0; j < 6; j++)
 
  111   static TypeId tid = 
TypeId (
"ns3::flame::FlameProtocol")
 
  113     .SetGroupName (
"Mesh")
 
  115     .AddAttribute ( 
"BroadcastInterval",
 
  116                     "How often we must send broadcast packets",
 
  122     .AddAttribute ( 
"MaxCost",
 
  123                     "Cost threshold after which packet will be dropped",
 
  127                     MakeUintegerChecker<uint8_t> (3)
 
  152   if (sourceIface == 
m_mp->GetIfIndex ())
 
  158           NS_FATAL_ERROR (
"FLAME tag is not supposed to be received from upper layers");
 
  207           flameHdr.AddCost (1);
 
  248           flameHdr.AddCost (1);
 
  271       NS_FATAL_ERROR (
"FLAME tag must exist when packet is coming to protocol");
 
  289   protocolType = flameHdr.GetProtocol ();
 
  296   std::vector<Ptr<NetDevice> > 
interfaces = mp->GetInterfaces ();
 
  297   for (std::vector<
Ptr<NetDevice> >::const_iterator i = interfaces.begin (); i != interfaces.end (); i++)
 
  313       mac->SetBeaconGeneration (
false);
 
  314       mac->InstallPlugin (flameMac);
 
  316   mp->SetRoutingProtocol (
this);
 
  318   mp->AggregateObject (
this);
 
  351   txUnicast (0), txBroadcast (0), txBytes (0), droppedTtl (0), totalDropped (0)
 
  358   "txUnicast=\"" << txUnicast << 
"\" " 
  359   "txBroadcast=\"" << txBroadcast << 
"\" " 
  360   "txBytes=\"" << txBytes << 
"\" " 
  361   "droppedTtl=\"" << droppedTtl << 
"\" " 
  362   "totalDropped=\"" << totalDropped << 
"\"/>" << std::endl;
 
  368   "address=\"" << 
m_address << 
"\"" << std::endl <<
 
  370   "maxCost=\"" << (uint16_t) 
m_maxCost << 
"\">" << std::endl;
 
  374       plugin->second->Report (os);
 
  376   os << 
"</Flame>" << std::endl;
 
  384       plugin->second->ResetStats ();
 
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer. 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
void Print(std::ostream &os) const 
uint32_t GetSerializedSize() const 
bool RemoveRoutingStuff(uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType)
Cleanup flame headers! 
void AddPath(const Mac48Address destination, const Mac48Address retransmitter, const uint32_t interface, const uint8_t cost, const uint16_t seqnum)
Add path. 
void Print(std::ostream &os) const 
void AddPacketTag(const Tag &tag) const 
Add a packet tag. 
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
uint32_t GetSize(void) const 
Returns the the size in bytes of the packet (including the zero-filled initial payload). 
#define NS_FATAL_ERROR(msg)
Fatal error handling. 
TAG_BUFFER_INLINE uint8_t ReadU8(void)
uint8_t m_maxCost
Max Cost value (or TTL, because cost is actually hopcount) 
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. 
bool HandleDataFrame(uint16_t seqno, Mac48Address source, const FlameHeader flameHdr, Mac48Address receiver, uint32_t fromIface)
Handles a packet: adds a routing information and drops packets by TTL or Seqno. 
double GetSeconds(void) const 
Get an approximation of the time stored in this instance in the indicated unit. 
void CopyTo(uint8_t buffer[6]) const 
bool PeekPacketTag(Tag &tag) const 
Search a matching tag and call Tag::Deserialize if it is found. 
Ptr< FlameRtable > m_rtable
Routing table: 
static TypeId GetTypeId()
Ptr< MeshPointDevice > m_mp
Host mesh point. 
void Serialize(TagBuffer i) const 
AttributeValue implementation for Time. 
FlamePluginMap m_interfaces
Hold an unsigned integer type. 
Mac48Address retransmitter
Hold together all Wifi-related objects. 
static Mac48Address GetBroadcast(void)
Mac48Address GetAddress()
static Mac48Address ConvertFrom(const Address &address)
Ptr< Packet > Copy(void) const 
performs a COW copy of the packet. 
tag a set of bytes in a packet 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
Route lookup result, return type of LookupXXX methods. 
bool Install(Ptr< MeshPointDevice >)
Install FLAME on given mesh point. 
bool RequestRoute(uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< const Packet > packet, uint16_t protocolType, RouteReplyCallback routeReply)
Route request, inherited from MeshL2RoutingProtocol. 
void Deserialize(TagBuffer i)
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void CopyFrom(const uint8_t buffer[6])
static Time Now(void)
Return the current simulation virtual time. 
Interface for L2 mesh routing protocol and mesh point communication. 
void DoDispose()
Destructor implementation. 
static const uint32_t INTERFACE_ANY
Means all interfaces. 
bool RemovePacketTag(Tag &tag)
Remove a packet tag. 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
Time Seconds(double value)
Construct a Time in the indicated unit. 
void Report(std::ostream &) const 
Statistics. 
TypeId GetInstanceTypeId() const 
Get the most derived TypeId for this Object. 
Mac48Address receiver
Receiver of the packet: 
Ptr< T > CreateObject(void)
Create an object by type, with varying number of constructor parameters. 
static TypeId GetTypeId()
uint16_t m_myLastSeqno
Sequence number: 
static const uint16_t FLAME_PROTOCOL
LLC protocol number reserved by flame. 
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface. 
TypeId SetParent(TypeId tid)
LookupResult Lookup(Mac48Address destination)
Lookup path to destination. 
Basic MAC of mesh point Wi-Fi interface. 
void AddHeader(const Header &header)
Add header to this packet. 
Transmitter and receiver addresses. 
Mac48Address transmitter
transmitter for incoming: