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