20 #include "ns3/assert.h"
21 #include "ns3/simulator.h"
37 TypeId (
"ns3::flame::FlameRtable")
39 .AddAttribute (
"Lifetime",
40 "The lifetime of the routing enrty",
41 TimeValue (Seconds (120)), MakeTimeAccessor (
49 m_lifetime (Seconds (120))
62 const uint32_t interface,
const uint8_t cost,
const uint16_t seqnum)
64 std::map<Mac48Address, Route>::iterator i =
m_routes.find (destination);
76 i->second.seqnum = seqnum;
78 i->second.retransmitter = retransmitter;
79 i->second.interface = interface;
80 i->second.cost = cost;
86 std::map<Mac48Address, Route>::iterator i =
m_routes.find (destination);
97 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)
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.
bool operator==(const LookupResult &o) const
Compare route lookup results, used by tests.
static TypeId GetTypeId()
NS_OBJECT_ENSURE_REGISTERED(FlameHeader)
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. Both limits are inclusive.
a base class which provides memory management and object aggregation
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
LookupResult Lookup(Mac48Address destination)
Lookup path to destination.