21#include "ns3/data-rate.h"
22#include "ns3/internet-stack-helper.h"
23#include "ns3/ipv6-address-helper.h"
24#include "ns3/ipv6-route.h"
25#include "ns3/ipv6-routing-helper.h"
26#include "ns3/ipv6-routing-protocol.h"
27#include "ns3/radvd-helper.h"
28#include "ns3/simple-net-device-helper.h"
29#include "ns3/simple-net-device.h"
52 void DoRun()
override;
100 m_addresses.push_back(ipv6->GetAddress(ipv6->GetInterfaceForDevice(n0Dev), 1).GetAddress());
103 m_addresses.push_back(ipv6->GetAddress(ipv6->GetInterfaceForDevice(r0Dev), 1).GetAddress());
106 m_addresses.push_back(ipv6->GetAddress(ipv6->GetInterfaceForDevice(r1Dev), 1).GetAddress());
109 m_addresses.push_back(ipv6->GetAddress(ipv6->GetInterfaceForDevice(n1Dev), 1).GetAddress());
127 route = ipv6->GetRoutingProtocol()->RouteOutput(p, ipHdr, n0Dev, sockerr);
134 route = ipv6->GetRoutingProtocol()->RouteOutput(p, ipHdr, r0Dev, sockerr);
141 route = ipv6->GetRoutingProtocol()->RouteOutput(p, ipHdr, r1Dev, sockerr);
148 route = ipv6->GetRoutingProtocol()->RouteOutput(p, ipHdr, n1Dev, sockerr);
213 prefix->SetOnLinkFlag(
false);
247 <<
"2001:1::200:ff:fe00:1");
252 <<
"2001:1::200:ff:fe00:2");
257 <<
"2001:2::200:ff:fe00:3");
262 <<
"2001:2::200:ff:fe00:4");
271 m_routes[0]->GetGateway() <<
" instead of "
272 <<
"fe80::200:ff:fe00:2");
284 m_routes[2]->GetGateway() <<
" instead of "
293 m_routes[3]->GetGateway() <<
" instead of "
void CheckRouting(Ptr< NetDevice > n0Dev, Ptr< NetDevice > r0Dev, Ptr< NetDevice > r1Dev, Ptr< NetDevice > n1Dev)
Checks the routing between the selected NetDevices.
std::vector< Ipv6Address > m_addresses
Addresses on the nodes.
std::vector< Socket::SocketErrno > m_routingResults
Routing call return values.
void DoRun() override
Implementation to actually run this TestCase.
void CheckAddresses(Ptr< NetDevice > n0Dev, Ptr< NetDevice > r0Dev, Ptr< NetDevice > r1Dev, Ptr< NetDevice > n1Dev)
Checks the addresses on the selected NetDevices.
~RadvdTestCase() override
std::vector< Ptr< Ipv6Route > > m_routes
Routing call results.
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
Class for representing data rates.
AttributeValue implementation for DataRate.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Helper class to auto-assign global IPv6 unicast addresses.
Ipv6InterfaceContainer AssignWithoutAddress(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer but do not assign any IPv6 addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv6InterfaceContainer AssignWithoutOnLink(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses, but do not set the on-link property ...
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Describes an IPv6 address.
Keep track of a set of IPv6 interfaces.
void SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
uint32_t GetInterfaceIndex(uint32_t i) const
Get the interface index for the specified node index.
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
IPv6 layer implementation.
Describes an IPv6 prefix.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
Radvd application helper.
void AddAnnouncedPrefix(uint32_t interface, Ipv6Address prefix, uint32_t prefixLength)
Add a new prefix to be announced through an interface.
ApplicationContainer Install(Ptr< Node > node)
Install the application in a Node.
Ptr< RadvdInterface > GetRadvdInterface(uint32_t interface)
Get the low-level RadvdInterface specification for an interface.
RadvdPrefixList GetPrefixes() const
Get list of prefixes advertised for this interface.
build a set of SimpleNetDevice objects
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
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.
AttributeValue implementation for 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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
static RadvdTestSuite radvdTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.