|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/socket-factory.h"
25 #include "ns3/tcp-socket-factory.h"
26 #include "ns3/simulator.h"
27 #include "ns3/simple-channel.h"
28 #include "ns3/simple-net-device.h"
29 #include "ns3/config.h"
30 #include "ns3/ipv4-static-routing.h"
31 #include "ns3/ipv4-list-routing.h"
32 #include "ns3/ipv6-static-routing.h"
33 #include "ns3/ipv6-list-routing.h"
35 #include "ns3/inet-socket-address.h"
36 #include "ns3/inet6-socket-address.h"
37 #include "ns3/uinteger.h"
40 #include "ns3/arp-l3-protocol.h"
41 #include "ns3/ipv4-l3-protocol.h"
42 #include "ns3/ipv6-l3-protocol.h"
43 #include "ns3/icmpv4-l4-protocol.h"
44 #include "ns3/icmpv6-l4-protocol.h"
45 #include "ns3/udp-l4-protocol.h"
46 #include "ns3/tcp-l4-protocol.h"
47 #include "ns3/traffic-control-layer.h"
66 virtual void DoRun (
void);
67 virtual void DoTeardown (
void);
231 receivedAddr1 = addr;
238 receivedAddr2 = addr;
245 receivedAddr3 = addr;
252 receivedAddr4 = addr;
271 uint16_t port1 = 5000;
272 uint16_t port2 = 5001;
273 uint16_t port3 = 5002;
274 uint16_t port4 = 5003;
334 Simulator::Destroy ();
void ServerHandleConnectionCreated4(Ptr< Socket > s, const Address &addr)
Handle connection created (4).
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< Socket > server1
Server socket (1).
IPv6 address associated with an interface.
Ptr< Socket > source2
Sending socket (2).
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual void AddRoutingProtocol(Ptr< Ipv4RoutingProtocol > routingProtocol, int16_t priority)
Register a new routing protocol to be used in this IPv4 stack.
static Ipv6DualStackTestSuite g_ipv6DualStackTestSuite
Static variable for test initialization.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Address receivedAddr2
Received address (2).
virtual void RegisterOptions()
Register the IPv6 Options.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual uint32_t AddInterface(Ptr< NetDevice > device)=0
Add a NetDevice interface.
Ptr< Socket > source3
Sending socket (3).
Ptr< Socket > source1
Sending socket (1).
virtual void SetUp(uint32_t interface)=0
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
void SetRoutingProtocol(Ptr< Ipv4RoutingProtocol > routingProtocol)
Register a new routing protocol to be used by this Ipv4 stack.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Address receivedAddr3
Received address (3).
void SetAcceptCallback(Callback< bool, Ptr< Socket >, const Address & > connectionRequest, Callback< void, Ptr< Socket >, const Address & > newConnectionCreated)
Accept connection requests from remote hosts.
void SetUpSim()
Setup the test.
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
API to create TCP socket instances.
virtual bool AddAddress(uint32_t interface, Ipv6InterfaceAddress address, bool addOnLinkRoute=true)=0
Add an address on the specified IPv6 interface.
void ServerHandleConnectionCreated1(Ptr< Socket > s, const Address &addr)
Handle connection created (1).
virtual void SetAddress(Address address)
Set the address of this interface.
virtual void RegisterExtensions()
Register the IPv6 Extensions.
Callback< R, Ts... > MakeNullCallback(void)
void SetRoutingProtocol(Ptr< Ipv6RoutingProtocol > routingProtocol)
Set routing protocol for this stack.
Address receivedAddr4
Received address (4).
Access to the IPv4 forwarding table, interfaces, and configuration.
virtual uint32_t AddInterface(Ptr< NetDevice > device)=0
Ptr< Socket > server2
Server socket (2).
a polymophic address class
a class to store IPv4 address information on an interface
static Mac48Address ConvertFrom(const Address &address)
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
virtual void SetUp(uint32_t interface)=0
Set the interface into the "up" state.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
virtual void AddRoutingProtocol(Ptr< Ipv6RoutingProtocol > routingProtocol, int16_t priority)
Register a new routing protocol to be used in this IPv4 stack.
Ptr< Node > CreateDualStackNode()
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
virtual Ptr< Socket > CreateSocket(void)=0
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< SimpleNetDevice > AddSimpleNetDevice(Ptr< Node > node, Ipv4Address v4Addr, Ipv4Mask v4Mask, Ipv6Address v6Addr, Ipv6Prefix v6Prefix)
virtual int Listen(void)=0
Listen for incoming connections.
void ServerHandleConnectionCreated3(Ptr< Socket > s, const Address &addr)
Handle connection created (3).
Ptr< Socket > server3
Server socket (3).
Ptr< Socket > server4
Server socket (4).
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
@ UNIT
This test suite implements a Unit Test.
bool IsInvalid(void) const
void SetTrafficControl(Ptr< TrafficControlLayer > tc)
Set the TrafficControlLayer.
a class to represent an Ipv4 address mask
IPv6 dual stack TestSuite.
Access to the IPv6 forwarding table, interfaces, and configuration.
Ptr< Socket > source4
Sending socket (4).
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
virtual void DoRun(void)
Implementation to actually run this TestCase.
Describes an IPv6 prefix.
void ServerHandleConnectionCreated2(Ptr< Socket > s, const Address &addr)
Handle connection created (2).
virtual bool AddAddress(uint32_t interface, Ipv4InterfaceAddress address)=0
Address receivedAddr1
Received address (1).