8#include "ns3/ipv4-list-routing.h"
9#include "ns3/ipv4-routing-protocol.h"
128 void DoRun()
override;
132 :
TestCase(
"Check negative priorities")
143 lr->AddRoutingProtocol(aRouting, -10);
144 lr->AddRoutingProtocol(bRouting, -5);
146 uint32_t num = lr->GetNRoutingProtocols();
162 void DoRun()
override;
166 :
TestCase(
"Check positive priorities")
178 lr->AddRoutingProtocol(aRouting, 10);
179 lr->AddRoutingProtocol(bRouting, 5);
182 uint32_t num = lr->GetNRoutingProtocols();
208static Ipv4ListRoutingTestSuite
IPv4 dummy routing class (A)
void SetIpv4(Ptr< Ipv4 > ipv4) override
void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address) override
void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit) const override
Print the Routing Table entries.
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb) override
Route an input packet (to be forwarded or locally delivered)
void NotifyInterfaceUp(uint32_t interface) override
void NotifyInterfaceDown(uint32_t interface) override
void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address) override
Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
Query routing cache for an existing route, for an outbound packet.
IPv4 dummy routing class (B)
void SetIpv4(Ptr< Ipv4 > ipv4) override
void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit) const override
Print the Routing Table entries.
void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address) override
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb) override
Route an input packet (to be forwarded or locally delivered)
Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
Query routing cache for an existing route, for an outbound packet.
void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address) override
void NotifyInterfaceDown(uint32_t interface) override
void NotifyInterfaceUp(uint32_t interface) override
a class to store IPv4 address information on an interface
IPv4 ListRouting negative test.
Ipv4ListRoutingNegativeTestCase()
void DoRun() override
Implementation to actually run this TestCase.
IPv4 ListRouting positive test.
Ipv4ListRoutingPositiveTestCase()
void DoRun() override
Implementation to actually run this TestCase.
IPv4 ListRouting TestSuite.
Ipv4ListRoutingTestSuite()
Abstract base class for IPv4 routing protocols.
Smart pointer class similar to boost::intrusive_ptr.
SocketErrno
Enumeration of the possible errors returned by a socket.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
Unit
The unit to use to interpret a number representing time.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Ipv4ListRoutingTestSuite g_ipv4ListRoutingTestSuite
Static variable for test initialization.