remove Packet Info Tag test dependence on CsmaNetDevice

This commit is contained in:
Tom Henderson
2011-01-28 12:09:55 -08:00
parent 3363c1fcc5
commit ef66a5e048
2 changed files with 8 additions and 11 deletions

View File

@@ -146,8 +146,7 @@ Ipv4PacketInfoTag::Print (std::ostream &os) const
#include "ns3/log.h"
#include "ns3/abort.h"
#include "ns3/attribute.h"
#include "ns3/object-factory.h"
#include "ns3/csma-net-device.h"
#include "ns3/simple-net-device.h"
#include "ns3/object-factory.h"
#include "ns3/socket-factory.h"
#include "ns3/udp-socket-factory.h"
@@ -163,6 +162,7 @@ Ipv4PacketInfoTag::Print (std::ostream &os) const
#include "ns3/udp-l4-protocol.h"
#include "ns3/tcp-l4-protocol.h"
#include "ns3/simulator.h"
#include "ns3/node.h"
namespace ns3 {
@@ -241,8 +241,8 @@ Ipv4PacketInfoTagTest::DoRun (void)
Ptr<Node> node0 = CreateObject<Node> ();
Ptr<Node> node1 = CreateObject<Node> ();
Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> ();
Ptr<CsmaNetDevice> device2 = CreateObject<CsmaNetDevice> ();
Ptr<SimpleNetDevice> device = CreateObject<SimpleNetDevice> ();
Ptr<SimpleNetDevice> device2 = CreateObject<SimpleNetDevice> ();
// For Node 0
node0->AddDevice (device);
@@ -281,7 +281,6 @@ Ipv4PacketInfoTagTest::DoRun (void)
&Ipv4PacketInfoTagTest::DoSendData, this, socket, "127.0.0.1");
Simulator::Run ();
// send from node1 and recved via csma
Ptr<SocketFactory> factory2 = node1->GetObject<SocketFactory> (UdpSocketFactory::GetTypeId ());
Ptr<Socket> socket2 = factory2->CreateSocket ();
Simulator::ScheduleWithContext (socket2->GetNode ()->GetId (), Seconds (0),
@@ -301,7 +300,6 @@ Ipv4PacketInfoTagTest::DoRun (void)
&Ipv4PacketInfoTagTest::DoSendData, this, socket, "127.0.0.1");
Simulator::Run ();
// send from node1 and recved via csma
factory2 = node1->GetObject<SocketFactory> (Ipv4RawSocketFactory::GetTypeId ());
socket2 = factory2->CreateSocket ();
Simulator::ScheduleWithContext (socket2->GetNode ()->GetId (), Seconds (0),

View File

@@ -144,7 +144,7 @@ Ipv6PacketInfoTag::Print (std::ostream &os) const
#include "ns3/log.h"
#include "ns3/abort.h"
#include "ns3/attribute.h"
#include "ns3/csma-net-device.h"
#include "ns3/simple-net-device.h"
#include "ns3/object-factory.h"
#include "ns3/socket-factory.h"
#include "ns3/udp-socket-factory.h"
@@ -159,6 +159,7 @@ Ipv6PacketInfoTag::Print (std::ostream &os) const
#include "ns3/simulator.h"
#include "ns3/uinteger.h"
#include "ns3/boolean.h"
#include "ns3/node.h"
namespace ns3 {
@@ -237,8 +238,8 @@ Ipv6PacketInfoTagTest::DoRun (void)
Ptr<Node> node0 = CreateObject<Node> ();
Ptr<Node> node1 = CreateObject<Node> ();
Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> ();
Ptr<CsmaNetDevice> device2 = CreateObject<CsmaNetDevice> ();
Ptr<SimpleNetDevice> device = CreateObject<SimpleNetDevice> ();
Ptr<SimpleNetDevice> device2 = CreateObject<SimpleNetDevice> ();
// For Node 0
node0->AddDevice (device);
@@ -278,7 +279,6 @@ Ipv6PacketInfoTagTest::DoRun (void)
&Ipv6PacketInfoTagTest::DoSendData, this, socket, "::1");
Simulator::Run ();
// send from node1 and recved via csma
Ptr<SocketFactory> factory2 = node1->GetObject<SocketFactory> (Ipv6RawSocketFactory::GetTypeId ());
Ptr<Socket> socket2 = factory2->CreateSocket ();
std::stringstream dst;
@@ -302,7 +302,6 @@ Ipv6PacketInfoTagTest::DoRun (void)
&Ipv6PacketInfoTagTest::DoSendData, this, socket, "::1");
Simulator::Run ();
// send from node1 and recved via csma
factory2 = node1->GetObject<SocketFactory> (UdpSocketFactory::GetTypeId ());
socket2 = factory2->CreateSocket ();
Simulator::ScheduleWithContext (socket2->GetNode ()->GetId (), Seconds (0),