19 #include "ns3/ipv6-list-routing.h"
20 #include "ns3/ipv6-route.h"
21 #include "ns3/ipv6-routing-protocol.h"
168 void DoRun()
override;
172 :
TestCase(
"Check negative priorities")
183 lr->AddRoutingProtocol(aRouting, -10);
184 lr->AddRoutingProtocol(bRouting, -5);
186 uint32_t
num = lr->GetNRoutingProtocols();
202 void DoRun()
override;
206 :
TestCase(
"Check positive priorities")
218 lr->AddRoutingProtocol(aRouting, 10);
219 lr->AddRoutingProtocol(bRouting, 5);
222 uint32_t
num = lr->GetNRoutingProtocols();
248 static Ipv6ListRoutingTestSuite
IPv6 dummy routing class (A)
Ptr< Ipv6Route > RouteOutput(Ptr< Packet > p, const Ipv6Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
Query routing cache for an existing route, for an outbound packet.
bool RouteInput(Ptr< const Packet > p, const Ipv6Header &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 PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit) const override
Print the Routing Table entries.
void NotifyAddAddress(uint32_t interface, Ipv6InterfaceAddress address) override
Notify when specified interface add an address.
void NotifyRemoveAddress(uint32_t interface, Ipv6InterfaceAddress address) override
Notify when specified interface add an address.
void NotifyInterfaceUp(uint32_t interface) override
Notify when specified interface goes UP.
void NotifyInterfaceDown(uint32_t interface) override
Notify when specified interface goes DOWN.
void NotifyRemoveRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) override
Notify route removing.
void SetIpv6(Ptr< Ipv6 > ipv6) override
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
void NotifyAddRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero()) override
Notify a new route.
Describes an IPv6 address.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
IPv6 dummy routing class (B)
void NotifyAddAddress(uint32_t interface, Ipv6InterfaceAddress address) override
Notify when specified interface add an address.
Ptr< Ipv6Route > RouteOutput(Ptr< Packet > p, const Ipv6Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
Query routing cache for an existing route, for an outbound packet.
void NotifyAddRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero()) override
Notify a new route.
void NotifyRemoveAddress(uint32_t interface, Ipv6InterfaceAddress address) override
Notify when specified interface add an address.
void NotifyInterfaceUp(uint32_t interface) override
Notify when specified interface goes UP.
bool RouteInput(Ptr< const Packet > p, const Ipv6Header &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 PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit) const override
Print the Routing Table entries.
void NotifyRemoveRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) override
Notify route removing.
void NotifyInterfaceDown(uint32_t interface) override
Notify when specified interface goes DOWN.
void SetIpv6(Ptr< Ipv6 > ipv6) override
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
IPv6 address associated with an interface.
IPv6 ListRouting negative test.
void DoRun() override
Implementation to actually run this TestCase.
Ipv6ListRoutingNegativeTestCase()
IPv6 ListRouting positive test.
void DoRun() override
Implementation to actually run this TestCase.
Ipv6ListRoutingPositiveTestCase()
IPv6 ListRouting TestSuite.
Ipv6ListRoutingTestSuite()
Describes an IPv6 prefix.
Abstract base class for IPv6 routing protocols.
Smart pointer class similar to boost::intrusive_ptr.
SocketErrno
Enumeration of the possible errors returned by a socket.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
Unit
The unit to use to interpret a number representing time.
#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 Ipv6ListRoutingTestSuite g_ipv6ListRoutingTestSuite
Static variable for test initialization.