22 #include "ns3/data-rate.h"
23 #include "ns3/simple-net-device.h"
24 #include "ns3/simple-net-device-helper.h"
25 #include "ns3/internet-stack-helper.h"
26 #include "ns3/ipv6-address-helper.h"
27 #include "ns3/ipv6-routing-protocol.h"
28 #include "ns3/ipv6-routing-helper.h"
29 #include "ns3/ipv6-route.h"
30 #include "ns3/radvd-helper.h"
54 virtual void DoRun (
void);
93 m_addresses.push_back (ipv6->GetAddress (ipv6->GetInterfaceForDevice (n0Dev), 1).GetAddress ());
96 m_addresses.push_back (ipv6->GetAddress (ipv6->GetInterfaceForDevice (r0Dev), 1).GetAddress ());
99 m_addresses.push_back (ipv6->GetAddress (ipv6->GetInterfaceForDevice (r1Dev), 1).GetAddress ());
102 m_addresses.push_back (ipv6->GetAddress (ipv6->GetInterfaceForDevice (n1Dev), 1).GetAddress ());
117 route = ipv6->GetRoutingProtocol ()->RouteOutput (p, ipHdr, n0Dev, sockerr);
124 route = ipv6->GetRoutingProtocol ()->RouteOutput (p, ipHdr, r0Dev, sockerr);
131 route = ipv6->GetRoutingProtocol ()->RouteOutput (p, ipHdr, r1Dev, sockerr);
138 route = ipv6->GetRoutingProtocol ()->RouteOutput (p, ipHdr, n1Dev, sockerr);
216 Simulator::Stop (
Seconds (10.0));
222 m_addresses[0] <<
" instead of " <<
"2001:1::200:ff:fe00:1");
225 m_addresses[1] <<
" instead of " <<
"2001:1::200:ff:fe00:2");
228 m_addresses[2] <<
" instead of " <<
"2001:2::200:ff:fe00:3");
231 m_addresses[3] <<
" instead of " <<
"2001:2::200:ff:fe00:4");
238 m_routes[0]->GetGateway () <<
" instead of " <<
"fe80::200:ff:fe00:2");
247 m_routes[2]->GetGateway () <<
" instead of " <<
"::");
253 m_routes[3]->GetGateway () <<
" instead of " <<
"::");
256 Simulator::Destroy ();
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 CheckAddresses(Ptr< NetDevice > n0Dev, Ptr< NetDevice > r0Dev, Ptr< NetDevice > r1Dev, Ptr< NetDevice > n1Dev)
Checks the addresses on the selected NetDevices.
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::vector< Ptr< Ipv6Route > > m_routes
Routing call results.
holds a vector of ns3::Application pointers.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
void Stop(Time stop)
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.
virtual Ptr< Node > GetNode(void) const =0
keep track of a set of node pointers.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
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.
void SetOnLinkFlag(bool onLinkFlag)
Set on-link flag.
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...
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.