25 #include "ns3/socket-factory.h"
26 #include "ns3/ipv6-raw-socket-factory.h"
27 #include "ns3/simulator.h"
28 #include "ns3/simple-channel.h"
29 #include "ns3/simple-net-device.h"
30 #include "ns3/drop-tail-queue.h"
31 #include "ns3/socket.h"
35 #include "ns3/inet6-socket-address.h"
36 #include "ns3/boolean.h"
37 #include "ns3/uinteger.h"
39 #include "ns3/ipv6-l3-protocol.h"
40 #include "ns3/icmpv6-l4-protocol.h"
41 #include "ns3/ipv6-list-routing.h"
42 #include "ns3/ipv6-static-routing.h"
46 #include <netinet/in.h>
47 #include <sys/socket.h>
48 #include <sys/types.h>
75 void DoSendData (
Ptr<Socket> socket, std::string to);
79 virtual void DoRun (
void);
90 :
TestCase (
"Ipv6 Raw socket implementation")
106 uint32_t availableData;
111 NS_ASSERT (availableData == m_receivedPacket->GetSize ());
116 uint32_t availableData;
122 NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
151 Ptr<Node> rxNode = CreateObject<Node> ();
155 rxDev1 = CreateObject<SimpleNetDevice> ();
156 rxDev1->
SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
162 ipv6->
SetUp (netdev_idx);
166 rxDev2 = CreateObject<SimpleNetDevice> ();
167 rxDev2->
SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
173 ipv6->
SetUp (netdev_idx);
177 Ptr<Node> txNode = CreateObject<Node> ();
181 txDev1 = CreateObject<SimpleNetDevice> ();
182 txDev1->
SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
188 ipv6->
SetUp (netdev_idx);
192 txDev2 = CreateObject<SimpleNetDevice> ();
193 txDev2->
SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
199 ipv6->
SetUp (netdev_idx);
216 rxSocket->SetAttribute (
"Protocol",
UintegerValue (Ipv6Header::IPV6_ICMPV6));
231 SendData (txSocket,
"2001:db8:0::1");
265 Simulator::Destroy ();