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" 495 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)
Update routing entries with this destination as follows:
Simulation virtual time values and global simulation resolution.
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g.
Smart pointer class similar to boost::intrusive_ptr.
void SetOutputDevice(Ptr< NetDevice > dev)
Set output device.
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup routing table entry with destination address dst.
Time GetBlacklistTimeout() const
Get the blacklist timeout value.
void Clear()
Delete all entries from routing table.
void Print(Ptr< OutputStreamWrapper > stream) const
Print routing table.
bool IsUnidirectional() const
Get the unidirectional flag.
bool Update(RoutingTableEntry &rt)
Update routing table.
Timer m_ackTimer
RREP_ACK timer.
Ipv4Address GetDestination() const
Get destination address function.
void IncrementRreqCnt()
Increment the RREQ count.
Ipv4InterfaceAddress GetInterface() const
Get the Ipv4InterfaceAddress.
RoutingTableEntry(Ptr< NetDevice > dev=0, Ipv4Address dst=Ipv4Address(), bool vSeqNo=false, uint32_t seqNo=0, Ipv4InterfaceAddress iface=Ipv4InterfaceAddress(), uint16_t hops=0, Ipv4Address nextHop=Ipv4Address(), Time lifetime=Simulator::Now())
constructor
bool IsPrecursorListEmpty() const
Check that precursor list is empty.
bool m_validSeqNo
Valid Destination Sequence Number flag.
void SetLifeTime(Time lt)
Set the lifetime.
void GetPrecursors(std::vector< Ipv4Address > &prec) const
Inserts precursors in output parameter prec if they do not yet exist in vector.
Ptr< Ipv4Route > GetRoute() const
Get route function.
uint32_t GetSeqNo() const
Get the sequence number.
bool InsertPrecursor(Ipv4Address id)
Insert precursor in precursor list if it doesn't yet exist in the list.
void SetRreqCnt(uint8_t n)
Set the RREQ count.
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.
void Print(Ptr< OutputStreamWrapper > stream) const
Print packet to trace file.
void SetBlacklistTimeout(Time t)
Set the blacklist timeout.
bool SetEntryState(Ipv4Address dst, RouteFlags state)
Set routing table entry flags.
bool LookupPrecursor(Ipv4Address id)
Lookup precursor by address.
bool GetValidSeqNo() const
Get the valid sequence number.
void SetGateway(Ipv4Address gw)
uint8_t m_reqCount
Number of route requests.
Time m_badLinkLifetime
Deletion time for invalid routes.
Ipv4Address GetNextHop() const
Get next hop address.
bool DeletePrecursor(Ipv4Address id)
Delete precursor.
void SetSeqNo(uint32_t sn)
Set the sequence number.
void SetValidSeqNo(bool s)
Set the valid sequence number.
Ptr< Ipv4Route > m_ipv4Route
Ip route, include.
Ipv4Address GetDestination(void) const
bool m_blackListState
Indicate if this entry is in "blacklist".
std::vector< Ipv4Address > m_precursorList
List of precursors.
void DeleteAllPrecursors()
Delete all precursors.
bool operator==(Ipv4Address const dst) const
Compare destination address.
void GetListOfDestinationWithNextHop(Ipv4Address nextHop, std::map< Ipv4Address, uint32_t > &unreachable)
Lookup routing entries with next hop Address dst and not empty list of precursors.
void SetInterface(Ipv4InterfaceAddress iface)
Set the Ipv4InterfaceAddress.
Ptr< NetDevice > GetOutputDevice(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetFlag(RouteFlags flag)
Set the route flags.
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e.
void SetBadLinkLifetime(Time t)
static Time Now(void)
Return the current simulation virtual time.
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Equivalent in Linux to dst_entry.dev.
Ptr< NetDevice > GetOutputDevice() const
Get output device.
uint8_t GetRreqCnt() const
Get the RREQ count.
The Routing table used by AODV protocol.
Time GetBadLinkLifetime() const
Ipv4InterfaceAddress m_iface
Output interface address.
Ipv4Address GetGateway(void) const
void SetUnidirectional(bool u)
Set the unidirectional flag.
RoutingTable(Time t)
constructor
Time m_lifeTime
Expiration or deletion time of the route Lifetime field in the routing table plays dual role: for an ...
void SetHop(uint16_t hop)
Set the number of hops.
Ipv4 addresses are stored in host order in this class.
a class to store IPv4 address information on an interface
bool AddRoute(RoutingTableEntry &r)
Add routing table entry if it doesn't yet exist in routing table.
void SetRoute(Ptr< Ipv4Route > r)
Set route function.
uint16_t GetHop() const
Get the number of hops.
void SetNextHop(Ipv4Address nextHop)
Set next hop address.
uint32_t m_seqNo
Destination Sequence Number, if m_validSeqNo = true.
uint16_t m_hops
Hop Count (number of hops needed to reach destination)
RouteFlags GetFlag() const
Get the route flags.
Time GetLifeTime() const
Get the lifetime.
bool LookupValidRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup route in VALID state.
bool DeleteRoute(Ipv4Address dst)
Delete routing table entry with destination address dst, if it exists.
void Purge()
Delete all outdated entries and invalidate valid entry if Lifetime is expired.
std::map< Ipv4Address, RoutingTableEntry > m_ipv4AddressEntry
The routing table.
RouteFlags
Route record states.