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"
252 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 destinations 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)
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup routing table entry with destination address dst.
void Clear()
Delete all entries from routing table.
bool Update(RoutingTableEntry &rt)
Update routing table.
Timer m_ackTimer
RREP_ACK timer.
bool m_validSeqNo
Valid Destination Sequence Number flag.
Ptr< NetDevice > GetOutputDevice() const
void GetPrecursors(std::vector< Ipv4Address > &prec) const
Inserts precursors in vector prec if they does not yet exist in vector.
void SetLifeTime(Time lt)
void SetBalcklistTimeout(Time t)
Ptr< NetDevice > GetOutputDevice(void) const
bool InsertPrecursor(Ipv4Address id)
Insert precursor in precursor list if it doesn't yet exist in the list.
void Print(Ptr< OutputStreamWrapper > stream) const
Print routing table.
void SetRreqCnt(uint8_t n)
bool IsPrecursorListEmpty() const
Check that precursor list empty.
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)
Lookup precursor by address.
Ipv4Address GetNextHop() const
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.
void SetSeqNo(uint32_t sn)
void SetValidSeqNo(bool s)
Ptr< Ipv4Route > m_ipv4Route
Ip route, include.
Time GetBlacklistTimeout() const
bool m_blackListState
Indicate if this entry is in "blacklist".
std::vector< Ipv4Address > m_precursorList
List of precursors.
Ipv4InterfaceAddress GetInterface() const
Time GetBadLinkLifetime() const
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.
void SetInterface(Ipv4InterfaceAddress iface)
bool operator==(Ipv4Address const dst) const
Compare destination address.
void SetFlag(RouteFlags flag)
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e. disable it)
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.
The Routing table used by AODV protocol.
Ipv4InterfaceAddress m_iface
Output interface address.
void SetUnidirectional(bool u)
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
void SetHop(uint16_t hop)
Ipv4 addresses are stored in host order in this class.
a class to store IPv4 address information on an interface
uint32_t GetSeqNo() const
bool AddRoute(RoutingTableEntry &r)
Add routing table entry if it doesn't yet exist in routing table.
void SetRoute(Ptr< Ipv4Route > r)
void SetNextHop(Ipv4Address nextHop)
uint32_t m_seqNo
Destination Sequence Number, if m_validSeqNo = true.
uint16_t m_hops
Hop Count (number of hops needed to reach destination)
Ptr< Ipv4Route > GetRoute() const
bool LookupValidRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup route in VALID state.
bool IsUnidirectional() const
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
RouteFlags GetFlag() const
Ipv4Address GetDestination() const
uint8_t GetRreqCnt() const
void Print(Ptr< OutputStreamWrapper > stream) const
RouteFlags
Route record states.
bool GetValidSeqNo() const
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())
c-to