26 #include "ns3/ipv6-address.h" 
   27 #include "ns3/ipv6-packet-info-tag.h" 
   29 #include "ns3/abort.h" 
   30 #include "ns3/attribute.h" 
   31 #include "ns3/simple-net-device.h" 
   32 #include "ns3/object-factory.h" 
   33 #include "ns3/socket-factory.h" 
   34 #include "ns3/udp-socket-factory.h" 
   35 #include "ns3/udp-socket.h" 
   36 #include "ns3/ipv6-l3-protocol.h" 
   37 #include "ns3/ipv6-raw-socket-factory.h" 
   38 #include "ns3/ipv6-interface.h" 
   39 #include "ns3/icmpv6-l4-protocol.h" 
   40 #include "ns3/ipv6-static-routing.h" 
   41 #include "ns3/ipv6-list-routing.h" 
   42 #include "ns3/inet6-socket-address.h" 
   43 #include "ns3/simulator.h" 
   44 #include "ns3/uinteger.h" 
   45 #include "ns3/boolean.h" 
   47 #include "ns3/traffic-control-layer.h" 
   48 #include "ns3/internet-stack-helper.h" 
   49 #include "ns3/simple-net-device-helper.h" 
   89   virtual void DoRun (
void);
 
  100   void DoSendData (
Ptr<Socket> socket, std::string to);
 
  104   : 
TestCase (
"Ipv6PacketInfoTagTest")
 
  111   uint32_t availableData;
 
  128   if (DynamicCast<UdpSocket> (socket) != 0)
 
  136       socket->
SendTo (Create<Packet> (123), 0, realTo);
 
  156   internet.Install (node0);
 
  169   node1->AddDevice (device2);
 
  170   internet.Install (node1);
 
  186   socket->SetAttribute (
"Protocol", 
UintegerValue (Ipv6Header::IPV6_ICMPV6));
 
  187   socket->Bind (local);
 
  188   socket->SetRecvPktInfo (
true);
 
  192   Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), 
Seconds (0),
 
  198   std::stringstream dst;
 
  200   Simulator::ScheduleWithContext (socket2->GetNode ()->GetId (), 
Seconds (0),
 
  205 #ifdef UDP6_SUPPORTED 
  210   socket->Bind (local);
 
  211   socket->SetRecvPktInfo (
true);
 
  215   Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), 
Seconds (0),
 
  221   Simulator::ScheduleWithContext (socket2->GetNode ()->GetId (), 
Seconds (0),
 
  225 #endif  // UDP6_SUPPORTED 
  227   Simulator::Destroy ();
 
  245   : 
TestSuite (
"ipv6-packet-info-tag", UNIT)
 
AttributeValue implementation for Boolean. 
 
virtual void SetMetric(uint32_t interface, uint16_t metric)=0
Set metric on specified Ipv6 interface. 
 
Ptr< T > GetObject(void) const 
Get a pointer to the requested aggregated Object. 
 
Access to the IPv6 forwarding table, interfaces, and configuration. 
 
Ptr< NetDevice > Get(uint32_t i) const 
Get the Ptr stored in this container at a given index. 
 
IPv6 address associated with an interface. 
 
aggregate IP/TCP/UDP functionality to existing Nodes. 
 
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not. 
 
uint32_t GetSize(void) const 
Returns the the size in bytes of the packet (including the zero-filled initial payload). 
 
virtual Ptr< Socket > CreateSocket(void)=0
 
virtual void DoRun(void)
Implementation to actually run this TestCase. 
 
Object to create transport layer instances that provide a socket API to applications. 
 
a polymophic address class 
 
void RxCb(Ptr< Socket > socket)
Receive callback. 
 
Ipv6Address GetAddress() const 
Get the IPv6 address. 
 
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite. 
 
Hold an unsigned integer type. 
 
void SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install. 
 
#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. 
 
holds a vector of ns3::NetDevice pointers 
 
static Ipv6PacketInfoTagTestSuite g_packetinfotagTests
Static variable for test initialization. 
 
An implementation of the ICMPv6 protocol. 
 
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
keep track of a set of node pointers. 
 
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket. 
 
IPv6 PacketInfoTag TestSuite. 
 
virtual uint32_t AddInterface(Ptr< NetDevice > device)=0
Add a NetDevice interface. 
 
Describes an IPv6 address. 
 
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node. 
 
bool RemovePacketTag(Tag &tag)
Remove a packet tag. 
 
Time Seconds(double value)
Construct a Time in the indicated unit. 
 
void DoSendData(Ptr< Socket > socket, std::string to)
Send data. 
 
Describes an IPv6 prefix. 
 
virtual bool AddAddress(uint32_t interface, Ipv6InterfaceAddress address)=0
Add an address on the specified IPv6 interface. 
 
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer. 
 
This class implements a tag that carries socket ancillary data to the socket interface. 
 
build a set of SimpleNetDevice objects 
 
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful. 
 
Ipv6PacketInfoTagTestSuite()
 
virtual void SetUp(uint32_t interface)=0
Set the interface into the "up" state. 
 
virtual uint32_t GetRxAvailable(void) const =0
Return number of bytes which can be returned from one or multiple calls to Recv.