20 #include "ns3/assert.h"
21 #include "ns3/simulator.h"
38 TypeId (
"ns3::flame::FlameRtable")
40 .AddAttribute (
"Lifetime",
41 "The lifetime of the routing enrty",
42 TimeValue (Seconds (120)), MakeTimeAccessor (
50 m_lifetime (Seconds (120))
63 const uint32_t interface,
const uint8_t cost,
const uint16_t seqnum)
65 std::map<Mac48Address, Route>::iterator i =
m_routes.find (destination);
77 i->second.seqnum = seqnum;
79 i->second.retransmitter = retransmitter;
80 i->second.interface = interface;
81 i->second.cost = cost;
87 std::map<Mac48Address, Route>::iterator i =
m_routes.find (destination);
98 return LookupResult (i->second.retransmitter, i->second.interface, i->second.cost, i->second.seqnum);
static const uint32_t MAX_COST
Maximum (the best?) path cost.
void AddPath(const Mac48Address destination, const Mac48Address retransmitter, const uint32_t interface, const uint8_t cost, const uint16_t seqnum)
Add path.
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Mac48Address retransmitter
std::map< Mac48Address, Route > m_routes
List of routes.
hold objects of type ns3::Time
Mac48Address retransmitter
static Mac48Address GetBroadcast(void)
Time m_lifetime
Lifetime parameter.
Route lookup result, return type of LookupXXX methods.
static Time Now(void)
Return the "current simulation time".
bool operator==(const LookupResult &o) const
Compare route lookup results, used by tests.
static TypeId GetTypeId()
static const uint32_t INTERFACE_ANY
Means all interfaces.
NS_LOG_COMPONENT_DEFINE("FlameProtocolMac")
bool IsValid() const
True for valid route.
#define NS_LOG_DEBUG(msg)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
a base class which provides memory management and object aggregation
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
LookupResult Lookup(Mac48Address destination)
Lookup path to destination.