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"
253 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:
keep track of time values and allow control of 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)
RREP_ACK timer.
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.
void IncrementRreqCnt()
RREP_ACK timer.
bool m_validSeqNo
Valid Destination Sequence Number flag.
Ptr< NetDevice > GetOutputDevice() const
RREP_ACK timer.
void GetPrecursors(std::vector< Ipv4Address > &prec) const
Inserts precursors in vector prec if they does not yet exist in vector.
void SetLifeTime(Time lt)
RREP_ACK timer.
void SetBalcklistTimeout(Time t)
RREP_ACK timer.
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.
Time GetLifeTime() const
RREP_ACK timer.
void SetRreqCnt(uint8_t n)
RREP_ACK timer.
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
RREP_ACK timer.
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)
RREP_ACK timer.
void SetValidSeqNo(bool s)
RREP_ACK timer.
Ptr< Ipv4Route > m_ipv4Route
Ip route, include.
Time GetBlacklistTimeout() const
RREP_ACK timer.
bool m_blackListState
Indicate if this entry is in "blacklist".
std::vector< Ipv4Address > m_precursorList
List of precursors.
Ipv4InterfaceAddress GetInterface() const
RREP_ACK timer.
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)
RREP_ACK timer.
bool operator==(Ipv4Address const dst) const
Compare destination address.
void SetFlag(RouteFlags flag)
RREP_ACK timer.
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e. disable it)
uint16_t GetHop() const
RREP_ACK timer.
void SetBadLinkLifetime(Time t)
static Time Now(void)
Return the "current simulation 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)
RREP_ACK timer.
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 a...
Ipv4Address GetDestination(void) const
void SetHop(uint16_t hop)
RREP_ACK timer.
Ipv4 addresses are stored in host order in this class.
a class to store IPv4 address information on an interface
uint32_t GetSeqNo() const
RREP_ACK timer.
bool AddRoute(RoutingTableEntry &r)
Add routing table entry if it doesn't yet exist in routing table.
void SetRoute(Ptr< Ipv4Route > r)
RREP_ACK timer.
void SetNextHop(Ipv4Address nextHop)
RREP_ACK timer.
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
RREP_ACK timer.
bool LookupValidRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup route in VALID state.
bool IsUnidirectional() const
RREP_ACK timer.
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
RREP_ACK timer.
Ipv4Address GetDestination() const
RREP_ACK timer.
uint8_t GetRreqCnt() const
RREP_ACK timer.
void Print(Ptr< OutputStreamWrapper > stream) const
RouteFlags
Route record states.
bool GetValidSeqNo() const
RREP_ACK timer.
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