21 #include "ns3/object.h"
22 #include "ns3/assert.h"
23 #include "ns3/simulator.h"
42 .SetGroupName (
"Mesh")
60 uint32_t metric,
Time lifetime, uint32_t seqnum)
62 std::map<Mac48Address, ReactiveRoute>::iterator i =
m_routes.find (destination);
70 i->second.retransmitter = retransmitter;
71 i->second.interface = interface;
72 i->second.metric = metric;
74 i->second.seqnum = seqnum;
78 uint32_t interface,
Time lifetime, uint32_t seqnum)
93 precursor.
address = precursorAddress;
95 std::map<Mac48Address, ReactiveRoute>::iterator i =
m_routes.find (destination);
98 bool should_add =
true;
99 for (
unsigned int j = 0; j < i->second.precursors.size (); j++)
103 if (i->second.precursors[j].address == precursorAddress)
106 i->second.precursors[j].whenExpire = precursor.
whenExpire;
112 i->second.precursors.push_back (precursor);
137 std::map<Mac48Address, ReactiveRoute>::iterator i =
m_routes.find (destination);
146 std::map<Mac48Address, ReactiveRoute>::iterator i =
m_routes.find (destination);
161 std::map<Mac48Address, ReactiveRoute>::iterator i =
m_routes.find (destination);
166 return LookupResult (i->second.retransmitter, i->second.interface, i->second.metric, i->second.seqnum,
174 NS_LOG_DEBUG (
"Proactive route has expired and will be deleted, sorry.");
185 std::vector<HwmpProtocol::FailedDestination>
189 std::vector<HwmpProtocol::FailedDestination> retval;
190 for (std::map<Mac48Address, ReactiveRoute>::iterator i =
m_routes.begin (); i !=
m_routes.end (); i++)
192 if (i->second.retransmitter == peerAddress)
196 dst.
seqnum = i->second.seqnum;
197 retval.push_back (dst);
205 retval.push_back (dst);
214 std::map<Mac48Address, ReactiveRoute>::iterator route =
m_routes.find (destination);
217 for (std::vector<Precursor>::const_iterator i = route->second.precursors.begin ();
218 i != route->second.precursors.end (); i++)
222 retval.push_back (std::make_pair (i->interface, i->address));
235 retransmitter (r), ifIndex (i), metric (m), seqnum (s), lifetime (l)
Simulation virtual time values and global simulation resolution.
ProactiveRoute m_root
Path to proactive tree root MP.
std::vector< Precursor > precursors
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
static const uint32_t MAX_METRIC
Maximum (the best?) path metric.
Route lookup result, return type of LookupXXX methods.
structure of unreachable destination - address and sequence number
#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.
LookupResult LookupReactiveExpired(Mac48Address destination)
Return all reactive paths, including expired.
bool IsValid() const
True for valid route.
void DoDispose()
Destructor implementation.
LookupResult LookupReactive(Mac48Address destination)
Lookup path to destination.
std::vector< std::pair< uint32_t, Mac48Address > > PrecursorList
Path precursor = {MAC, interface ID}.
Routing table for HWMP – 802.11s routing protocol.
std::vector< HwmpProtocol::FailedDestination > GetUnreachableDestinations(Mac48Address peerAddress)
When peer link with a given MAC-address fails - it returns list of unreachable destination addresses...
PrecursorList GetPrecursors(Mac48Address destination)
Route found in reactive mode.
static Mac48Address GetBroadcast(void)
void AddPrecursor(Mac48Address destination, uint32_t precursorInterface, Mac48Address precursorAddress, Time lifetime)
LookupResult LookupProactiveExpired()
Return all proactive paths, including expired.
void AddReactivePath(Mac48Address destination, Mac48Address retransmitter, uint32_t interface, uint32_t metric, Time lifetime, uint32_t seqnum)
static const uint32_t INTERFACE_ANY
Means all interfaces.
bool operator==(const LookupResult &o) const
Compare route lookup results, used by tests.
std::map< Mac48Address, ReactiveRoute > m_routes
List of routes.
static Time Now(void)
Return the current simulation virtual time.
static TypeId GetTypeId()
void DeleteProactivePath()
Mac48Address retransmitter
#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.
LookupResult(Mac48Address r=Mac48Address::GetBroadcast(), uint32_t i=INTERFACE_ANY, uint32_t m=MAX_METRIC, uint32_t s=0, Time l=Seconds(0.0))
void DeleteReactivePath(Mac48Address destination)
void AddProactivePath(uint32_t metric, Mac48Address root, Mac48Address retransmitter, uint32_t interface, Time lifetime, uint32_t seqnum)
A base class which provides memory management and object aggregation.
Mac48Address retransmitter
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
LookupResult LookupProactive()
Find proactive path to tree root. Note that calling this method has side effect of deleting expired p...