34 #include <sys/types.h>
36 #include "ns3/ipv4-route.h"
37 #include "ns3/timer.h"
38 #include "ns3/net-device.h"
39 #include "ns3/output-stream-wrapper.h"
66 uint16_t channelNo = 1);
118 void SetSeqNo (uint32_t sn) {
m_seqNo = sn; }
119 uint32_t GetSeqNo ()
const {
return m_seqNo; }
120 void SetHop (uint16_t hop) {
m_hops = hop; }
121 uint16_t GetHop ()
const {
return m_hops; }
122 void SetChannel (uint16_t channel) {
m_channel = channel; }
123 uint16_t GetChannel ()
const {
return m_channel; }
128 void SetRreqCnt (uint8_t n) {
m_reqCount = n; }
129 uint8_t GetRreqCnt ()
const {
return m_reqCount; }
241 void Clear () { m_ipv4AddressEntry.clear (); }
254 std::map<Ipv4Address, RoutingTableEntry> m_ipv4AddressEntry;
258 void Purge (std::map<Ipv4Address, RoutingTableEntry> &table)
const;
Time m_blackListTimeout
Time for which the node is put into the blacklist.
void InvalidateRoutesWithDst(std::map< Ipv4Address, uint32_t > const &unreachable)
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
smart pointer class similar to boost::intrusive_ptr
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
void Clear()
Delete all entries from routing table.
uint16_t m_channel
Channel number for route's destination.
bool Update(RoutingTableEntry &rt)
Update routing table.
Timer m_ackTimer
RREP_ACK timer.
bool m_validSeqNo
Valid Destination Sequence Number flag.
void GetPrecursors(std::vector< Ipv4Address > &prec) const
Ptr< NetDevice > GetOutputDevice(void) const
bool InsertPrecursor(Ipv4Address id)
void Print(Ptr< OutputStreamWrapper > stream) const
Print routing table.
bool IsPrecursorListEmpty() const
RouteFlags m_flag
Routing flags: valid, invalid or in search.
Time m_routeRequestTimout
When I can send another request.
void DeleteAllRoutesFromInterface(Ipv4InterfaceAddress iface)
Delete all route from interface with address iface.
bool SetEntryState(Ipv4Address dst, RouteFlags state)
Set routing table entry flags.
bool LookupPrecursor(Ipv4Address id)
void SetGateway(Ipv4Address gw)
uint8_t m_reqCount
Number of route requests.
Time m_badLinkLifetime
Deletion time for invalid routes.
bool DeletePrecursor(Ipv4Address id)
Delete precursor.
Ptr< Ipv4Route > m_ipv4Route
bool m_blackListState
Indicate if this entry is in "blacklist".
std::vector< Ipv4Address > m_precursorList
List of precursors.
void DeleteAllPrecursors()
Delete all precursors.
Ipv4Address GetGateway(void) const
void GetListOfDestinationWithNextHop(Ipv4Address nextHop, std::map< Ipv4Address, uint32_t > &unreachable)
Lookup routing entries with next hop Address dst and not empty list of precursors.
RoutingTableEntry(Ptr< NetDevice > dev=0, Ipv4Address dst=Ipv4Address(), bool vSeqNo=false, uint32_t m_seqNo=0, Ipv4InterfaceAddress iface=Ipv4InterfaceAddress(), uint16_t hops=0, Ipv4Address nextHop=Ipv4Address(), Time lifetime=Simulator::Now(), uint16_t channelNo=1)
c-to
bool operator==(Ipv4Address const dst) const
Compare destination address.
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e. disable it)
void SetOutputDevice(Ptr< NetDevice > outputDevice)
The Routing table used by AODV protocol.
Ipv4InterfaceAddress m_iface
Output interface address.
RoutingTable(Time t)
c-tor
Time m_lifeTime
Expiration or deletion time of the route Lifetime field in the routing table plays dual role – for an...
Ipv4Address GetDestination(void) const
Ipv4 addresses are stored in host order in this class.
a class to store IPv4 address information on an interface
bool AddRoute(RoutingTableEntry &r)
uint32_t m_seqNo
Destination Sequence Number, if m_validSeqNo = true.
uint16_t m_hops
Hop Count (number of hops needed to reach destination)
bool LookupValidRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup route in VALID state.
bool DeleteRoute(Ipv4Address dst)
void Purge()
Delete all outdated entries and invalidate valid entry if Lifetime is expired.
RouteFlags
Route record states.