|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/aodv-neighbor.h"
22 #include "ns3/aodv-packet.h"
23 #include "ns3/aodv-rqueue.h"
24 #include "ns3/aodv-rtable.h"
25 #include "ns3/ipv4-route.h"
42 virtual void DoRun ();
383 virtual void DoRun ();
569 std::vector<Ipv4Address> prec;
631 std::map<Ipv4Address, uint32_t> unreachable;
634 unreachable.insert (std::make_pair (
Ipv4Address (
"4.3.2.1"), 3));
void SetQueueTimeout(Time t)
Set queue timeout.
Unit test for AODV routing table entry.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void Update(Ipv4Address addr, Time expire)
Update expire time for entry with address addr, if it exists, else add new entry.
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:
Time GetExpireTime() const
Get expire time.
void CheckTimeout3()
Check timeout function 3.
void SetValidSeqNo(bool s)
Set the valid sequence number.
void AddHeader(const Header &header)
Add header to this packet.
SocketErrno
Enumeration of the possible errors returned by a socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void CheckTimeout()
Check timeout function.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
void CheckTimeout2()
Check timeout function 2.
@ AODVTYPE_RREP
AODVTYPE_RREP.
void Unicast(Ptr< Ipv4Route > route, Ptr< const Packet > packet, const Ipv4Header &header)
Unicast test function.
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.
void Handler(Ipv4Address addr)
Handler test function.
bool GetValidSeqNo() const
Get the valid sequence number.
Ipv4 addresses are stored in host order in this class.
Time GetBlacklistTimeout() const
Get the blacklist timeout value.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
RequestQueue q
Request queue.
void SetUnidirectional(bool u)
Set the unidirectional flag.
void SetErrorCallback(ErrorCallback ecb)
Set error callback.
void Error(Ptr< const Packet > p, const Ipv4Header &h, Socket::SocketErrno e)
Error test function.
UnicastForwardCallback GetUnicastForwardCallback() const
Get unicast forward callback.
void SetUnicastForwardCallback(UnicastForwardCallback ucb)
Set unicast forward callback.
void SetRreqCnt(uint8_t n)
Set the RREQ count.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
virtual void DoRun()
Implementation to actually run this TestCase.
Ptr< Ipv4Route > GetRoute() const
Get route function.
Unit test for RequestQueue.
a class to store IPv4 address information on an interface
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e.
void SetExpireTime(Time exp)
Set expire time.
void Error(Ptr< const Packet > p, const Ipv4Header &h, Socket::SocketErrno e)
Error test function.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
@ AODVTYPE_RREQ
AODVTYPE_RREQ.
Time GetLifeTime() const
Get the lifetime.
AODV route request queue.
Ipv4Header GetIpv4Header() const
Get IPv4 header.
virtual void DoRun()
Implementation to actually run this TestCase.
uint16_t GetHop() const
Get the number of hops.
Ptr< const Packet > GetPacket() const
Get packet from entry.
bool SetEntryState(Ipv4Address dst, RouteFlags state)
Set routing table entry flags.
bool IsNeighbor(Ipv4Address addr)
Check that node with address addr is neighbor.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
void SetBlacklistTimeout(Time t)
Set the blacklist timeout.
virtual void DoRun()
Implementation to actually run this TestCase.
uint32_t GetSeqNo() const
Get the sequence number.
bool DeletePrecursor(Ipv4Address id)
Delete precursor.
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
void Unicast(Ptr< Ipv4Route > route, Ptr< const Packet > packet, const Ipv4Header &header)
Unicast test function.
Ptr< NetDevice > GetOutputDevice() const
Get output device.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
bool IsPrecursorListEmpty() const
Check that precursor list is empty.
static void Run(void)
Run the simulation.
ns3::aodv::AodvTestSuite g_aodvTestSuite
the test suite
Unit test for AODV routing table.
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
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.
@ UNIT
This test suite implements a Unit Test.
Time Seconds(double value)
Construct a Time in the indicated unit.
Neighbors * neighbor
The Neighbors.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
void SetHop(uint16_t hop)
Set the number of hops.
uint32_t GetMaxQueueLen() const
Get maximum queue length.
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.
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 Error2(Ptr< const Packet > p, const Ipv4Header &h, Socket::SocketErrno e)
Error2 test function.
ErrorCallback GetErrorCallback() const
Get error callback.
void CheckTimeout1()
Check timeout function 1.
void DeleteAllPrecursors()
Delete all precursors.
void SetCallback(Callback< void, Ipv4Address > cb)
Set link failure callback.
Ipv4Address GetDestination() const
Get destination address function.
bool IsEqual(const CallbackBase &other) const
Equality test.
void SetNextHop(Ipv4Address nextHop)
Set next hop address.
void CheckSizeLimit()
Check size limit function.
void SetLifeTime(Time lt)
Set the lifetime.
void IncrementRreqCnt()
Increment the RREQ count.
void Unicast2(Ptr< Ipv4Route > route, Ptr< const Packet > packet, const Ipv4Header &header)
Unicast 2 testfunction.
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.
virtual void DoRun()
Implementation to actually run this TestCase.
Time GetQueueTimeout() const
Get queue timeout.
void SetFlag(RouteFlags flag)
Set the route flags.
maintain list of active neighbors
Ipv4InterfaceAddress GetInterface() const
Get the Ipv4InterfaceAddress.
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup routing table entry with destination address dst.
void SetIpv4Header(Ipv4Header h)
Set IPv4 header.
Time GetExpireTime(Ipv4Address addr)
Return expire time for neighbor node with address addr, if exists, else return 0.
Unit test for AODV routing table entry.
void SetOutputDevice(Ptr< NetDevice > dev)
Set output device.
virtual void DoRun()
Implementation to actually run this TestCase.