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"
36 virtual void DoRun ();
112 uint32_t bytes = p->RemoveHeader (h2);
159 uint32_t bytes = p->RemoveHeader (h2);
205 uint32_t bytes = p->RemoveHeader (h2);
251 uint32_t bytes = p->RemoveHeader (h2);
273 QueueEntry entry (packet, h, ucb, ecb, Seconds (1));
299 virtual void DoRun ();
324 QueueEntry e1 (packet, h, ucb, ecb, Seconds (1));
336 QueueEntry e2 (packet, h, ucb, ecb, Seconds (1));
340 QueueEntry e3 (packet2, h, ucb, ecb, Seconds (1));
349 QueueEntry e4 (packet4, h, ucb, ecb, Seconds (20));
374 QueueEntry e1 (packet, header, ucb, ecb, Seconds (1));
455 std::vector<Ipv4Address> prec;
501 iface, 15,
Ipv4Address (
"1.1.1.1"), Seconds (-10));
510 std::map<Ipv4Address, uint32_t> unreachable;
513 unreachable.insert (std::make_pair (
Ipv4Address (
"4.3.2.1"), 3));
UnicastForwardCallback GetUnicastForwardCallback() const
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
maintain list of active neighbors
void InvalidateRoutesWithDst(std::map< Ipv4Address, uint32_t > const &unreachable)
Update routing entries with this destinations as follows:
Unit test for AODV routing table entry.
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g.
void SetOutputDevice(Ptr< NetDevice > dev)
RREP_ACK timer.
AODV route request queue.
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup routing table entry with destination address dst.
Ipv4Header GetIpv4Header() const
virtual void DoRun()
Implementation to actually run this TestCase.
void Unicast2(Ptr< Ipv4Route > route, Ptr< const Packet > packet, const Ipv4Header &header)
bool Update(RoutingTableEntry &rt)
Update routing table.
void IncrementRreqCnt()
RREP_ACK timer.
void Error(Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno)
void SetMaxQueueLen(uint32_t len)
static void Run(void)
Run the simulation until one of:
void SetUnicastForwardCallback(UnicastForwardCallback ucb)
Ptr< NetDevice > GetOutputDevice() const
RREP_ACK timer.
void Error2(Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno)
void GetPrecursors(std::vector< Ipv4Address > &prec) const
Inserts precursors in vector prec if they does not yet exist in vector.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
virtual void DoRun()
Implementation to actually run this TestCase.
void SetExpireTime(Time exp)
void SetLifeTime(Time lt)
RREP_ACK timer.
void SetBalcklistTimeout(Time t)
RREP_ACK timer.
SocketErrno
Enumeration of the possible errors returned by a socket.
ns3::aodv::AodvTestSuite g_aodvTestSuite
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
Unit test for RequestQueue.
bool InsertPrecursor(Ipv4Address id)
Insert precursor in precursor list if it doesn't yet exist in the list.
Time GetLifeTime() const
RREP_ACK timer.
void SetRreqCnt(uint8_t n)
RREP_ACK timer.
bool IsPrecursorListEmpty() const
Check that precursor list empty.
virtual void DoRun()
Implementation to actually run this TestCase.
void Error(Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno)
void SetErrorCallback(ErrorCallback ecb)
Time GetQueueTimeout() const
bool SetEntryState(Ipv4Address dst, RouteFlags state)
Set routing table entry flags.
bool LookupPrecursor(Ipv4Address id)
Lookup precursor by address.
void SetIpv4Header(Ipv4Header h)
Ipv4Address GetNextHop() const
RREP_ACK timer.
virtual void DoRun()
Implementation to actually run this TestCase.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
bool DeletePrecursor(Ipv4Address id)
Delete precursor.
bool IsNeighbor(Ipv4Address addr)
Check that node with address addr is neighbor.
void SetValidSeqNo(bool s)
RREP_ACK timer.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Time GetBlacklistTimeout() const
RREP_ACK timer.
uint32_t GetMaxQueueLen() const
Ptr< const Packet > GetPacket() const
Ipv4InterfaceAddress GetInterface() const
RREP_ACK timer.
Time GetBadLinkLifetime() const
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
void DeleteAllPrecursors()
Delete all precursors.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
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.
Unit test for AODV routing table.
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.
bool IsEqual(const CallbackBase &other) const
Equality test.
ErrorCallback GetErrorCallback() const
uint32_t GetSize()
Number of entries.
void SetBadLinkLifetime(Time t)
void Update(Ipv4Address addr, Time expire)
Update expire time for entry with address addr, if it exists, else add new entry. ...
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void Unicast(Ptr< Ipv4Route > route, Ptr< const Packet > packet, const Ipv4Header &header)
The Routing table used by AODV protocol.
Time GetExpireTime() const
void SetUnidirectional(bool u)
RREP_ACK timer.
Time GetExpireTime(Ipv4Address addr)
Return expire time for neighbor node with address addr, if exists, else return 0. ...
void Unicast(Ptr< Ipv4Route > route, Ptr< const Packet > packet, const Ipv4Header &header)
void SetHop(uint16_t hop)
RREP_ACK timer.
Ipv4 addresses are stored in host order in this class.
virtual void DoRun()
Implementation to actually run this TestCase.
a class to store IPv4 address information on an interface
uint32_t GetSeqNo() const
RREP_ACK timer.
void SetQueueTimeout(Time t)
bool AddRoute(RoutingTableEntry &r)
Add routing table entry if it doesn't yet exist in routing table.
void Handler(Ipv4Address addr)
void SetCallback(Callback< void, Ipv4Address > cb)
void SetNextHop(Ipv4Address nextHop)
RREP_ACK timer.
Ptr< Ipv4Route > GetRoute() const
RREP_ACK timer.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
Unit test for AODV routing table entry.
This test suite implements a Unit Test.
bool IsUnidirectional() const
RREP_ACK timer.
bool DeleteRoute(Ipv4Address dst)
Delete routing table entry with destination address dst, if it exists.
RouteFlags GetFlag() const
RREP_ACK timer.
Ipv4Address GetDestination() const
RREP_ACK timer.
uint8_t GetRreqCnt() const
RREP_ACK timer.
void AddHeader(const Header &header)
Add header to this packet.
bool GetValidSeqNo() const
RREP_ACK timer.