From 511e11e9be5163612c65bd687fefe20e5af89b47 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 28 Mar 2008 16:58:44 -0700 Subject: [PATCH] configure tracing post-topology construction, not before. --- examples/csma-broadcast.cc | 16 ++-- examples/mixed-global-routing.cc | 14 +-- examples/simple-alternate-routing.cc | 10 +-- examples/simple-error-model.cc | 9 +- examples/tcp-large-transfer.cc | 11 +-- examples/udp-echo.cc | 10 +-- src/helper/csma-helper.cc | 112 ++++++++++++++++-------- src/helper/csma-helper.h | 40 ++------- src/helper/point-to-point-helper.cc | 123 ++++++++++++++++----------- src/helper/point-to-point-helper.h | 40 ++------- 10 files changed, 200 insertions(+), 185 deletions(-) diff --git a/examples/csma-broadcast.cc b/examples/csma-broadcast.cc index fbd91375c..2b00a5a44 100644 --- a/examples/csma-broadcast.cc +++ b/examples/csma-broadcast.cc @@ -85,14 +85,6 @@ main (int argc, char *argv[]) NS_LOG_INFO ("Build Topology."); CsmaHelper csma; - // Also configure some tcpdump traces; each interface will be traced - // The output files will be named - // csma-broadcast.pcap-- - // and can be read by the "tcpdump -tt -r" command - csma.EnablePcap ("csma-broadcast.pcap"); - std::ofstream ascii; - ascii.open ("csma-broadcast.tr"); - csma.EnableAscii (ascii); csma.SetChannelParameter ("BitRate", DataRate(5000000)); csma.SetChannelParameter ("Delay", MilliSeconds(2)); @@ -137,6 +129,14 @@ main (int argc, char *argv[]) sink.Build (c1.Get (1)); + // Also configure some tcpdump traces; each interface will be traced + // The output files will be named + // csma-broadcast.pcap-- + // and can be read by the "tcpdump -tt -r" command + CsmaHelper::EnablePcap ("csma-broadcast.pcap"); + std::ofstream ascii; + ascii.open ("csma-broadcast.tr"); + CsmaHelper::EnableAscii (ascii); NS_LOG_INFO ("Run Simulation."); Simulator::Run (); diff --git a/examples/mixed-global-routing.cc b/examples/mixed-global-routing.cc index 850e87d61..d875da8a8 100644 --- a/examples/mixed-global-routing.cc +++ b/examples/mixed-global-routing.cc @@ -89,9 +89,6 @@ main (int argc, char *argv[]) CommandLine cmd; cmd.Parse (argc, argv); - std::ofstream ascii; - ascii.open ("mixed-global-routing.tr"); - NS_LOG_INFO ("Create nodes."); NodeContainer c; c.Create (7); @@ -106,8 +103,6 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.EnablePcap ("mixed-global-routing.pcap"); - p2p.EnableAscii (ascii); p2p.SetChannelParameter ("BitRate", DataRate (5000000)); p2p.SetChannelParameter ("Delay", MilliSeconds (2)); NetDeviceContainer d0d2 = p2p.Build (n0n2); @@ -120,8 +115,6 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information CsmaHelper csma; - csma.EnablePcap ("mixed-global-routing.pcap"); - csma.EnableAscii (ascii); csma.SetChannelParameter ("BitRate", DataRate (5000000)); csma.SetChannelParameter ("Delay", MilliSeconds (2)); NetDeviceContainer d2345 = csma.Build (n2345); @@ -159,6 +152,13 @@ main (int argc, char *argv[]) apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); + std::ofstream ascii; + ascii.open ("mixed-global-routing.tr"); + PointToPointHelper::EnablePcap ("mixed-global-routing.pcap"); + PointToPointHelper::EnableAscii (ascii); + CsmaHelper::EnablePcap ("mixed-global-routing.pcap"); + CsmaHelper::EnableAscii (ascii); + NS_LOG_INFO ("Run Simulation."); Simulator::Run (); diff --git a/examples/simple-alternate-routing.cc b/examples/simple-alternate-routing.cc index c2f6dcb5f..c843b6944 100644 --- a/examples/simple-alternate-routing.cc +++ b/examples/simple-alternate-routing.cc @@ -103,9 +103,6 @@ main (int argc, char *argv[]) // DefaultValue::Bind ()s at run-time, via command-line arguments cmd.Parse (argc, argv); - std::ofstream ascii; - ascii.open ("simple-alternate-routing.tr"); - // Here, we will explicitly create four nodes. In more sophisticated // topologies, we could configure a node factory. NS_LOG_INFO ("Create nodes."); @@ -119,8 +116,6 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.EnablePcap ("simple-alternate-routing.pcap"); - p2p.EnableAscii (ascii); p2p.SetChannelParameter ("BitRate", DataRate (5000000)); p2p.SetChannelParameter ("Delay", MilliSeconds (2)); NetDeviceContainer d0d2 = p2p.Build (n0n2); @@ -180,6 +175,11 @@ main (int argc, char *argv[]) apps.Start (Seconds (1.1)); apps.Stop (Seconds (10.0)); + std::ofstream ascii; + ascii.open ("simple-alternate-routing.tr"); + PointToPointHelper::EnablePcap ("simple-alternate-routing.pcap"); + PointToPointHelper::EnableAscii (ascii); + NS_LOG_INFO ("Run Simulation."); Simulator::Run (); diff --git a/examples/simple-error-model.cc b/examples/simple-error-model.cc index 52e80594a..ee2fbfdd9 100644 --- a/examples/simple-error-model.cc +++ b/examples/simple-error-model.cc @@ -71,9 +71,6 @@ main (int argc, char *argv[]) CommandLine cmd; cmd.Parse (argc, argv); - std::ofstream ascii; - ascii.open ("simple-error-model.pcap"); - // Here, we will explicitly create four nodes. In more sophisticated // topologies, we could configure a node factory. NS_LOG_INFO ("Create nodes."); @@ -89,8 +86,6 @@ main (int argc, char *argv[]) // We create the channels first without any IP addressing information NS_LOG_INFO ("Create channels."); PointToPointHelper p2p; - p2p.EnablePcap ("simple-error-model.pcap"); - p2p.EnableAscii (ascii); p2p.SetChannelParameter ("BitRate", DataRate (5000000)); p2p.SetChannelParameter ("Delay", MilliSeconds (2)); NetDeviceContainer d0d2 = p2p.Build (n0n2); @@ -166,6 +161,10 @@ main (int argc, char *argv[]) pem->SetList (sampleList); d0d2.Get (1)->SetAttribute ("ReceiveErrorModel", pem); + std::ofstream ascii; + ascii.open ("simple-error-model.tr"); + PointToPointHelper::EnablePcap ("simple-error-model.pcap"); + PointToPointHelper::EnableAscii (ascii); NS_LOG_INFO ("Run Simulation."); Simulator::Run (); diff --git a/examples/tcp-large-transfer.cc b/examples/tcp-large-transfer.cc index 550be0a45..509676b0a 100644 --- a/examples/tcp-large-transfer.cc +++ b/examples/tcp-large-transfer.cc @@ -130,13 +130,8 @@ int main (int argc, char *argv[]) c1.Add (c0.Get (1)); c1.Create (1); - std::ofstream ascii; - ascii.open ("tcp-large-transfer.tr"); - // We create the channels first without any IP addressing information PointToPointHelper p2p; - p2p.EnablePcap ("tcp-large-transfer.pcap"); - p2p.EnableAscii (ascii); p2p.SetChannelParameter ("BitRate", DataRate(10000000)); p2p.SetChannelParameter ("Delay", MilliSeconds(10)); NetDeviceContainer dev0 = p2p.Build (c0); @@ -185,6 +180,12 @@ int main (int argc, char *argv[]) Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink)); + std::ofstream ascii; + ascii.open ("tcp-large-transfer.tr"); + PointToPointHelper::EnablePcap ("tcp-large-transfer.pcap"); + PointToPointHelper::EnableAscii (ascii); + + Simulator::StopAt (Seconds(1000)); Simulator::Run (); Simulator::Destroy (); diff --git a/examples/udp-echo.cc b/examples/udp-echo.cc index 599f8efa9..291ff6574 100644 --- a/examples/udp-echo.cc +++ b/examples/udp-echo.cc @@ -82,16 +82,11 @@ main (int argc, char *argv[]) InternetStackHelper internet; internet.Build (n); - std::ofstream ascii; - ascii.open ("udp-echo.tr"); - NS_LOG_INFO ("Create channels."); // // Explicitly create the channels required by the topology (shown above). // CsmaHelper csma; - csma.EnablePcap ("udp-echo.pcap"); - csma.EnableAscii (ascii); csma.SetChannelParameter ("BitRate", DataRate(5000000)); csma.SetChannelParameter ("Delay", MilliSeconds (2)); NetDeviceContainer d = csma.Build (n); @@ -131,6 +126,11 @@ main (int argc, char *argv[]) apps.Start (Seconds (2.0)); apps.Stop (Seconds (10.0)); + std::ofstream ascii; + ascii.open ("udp-echo.tr"); + CsmaHelper::EnablePcap ("udp-echo.pcap"); + CsmaHelper::EnableAscii (ascii); + // // Now, do the actual simulation. // diff --git a/src/helper/csma-helper.cc b/src/helper/csma-helper.cc index 128fe5549..3698d5321 100644 --- a/src/helper/csma-helper.cc +++ b/src/helper/csma-helper.cc @@ -11,8 +11,6 @@ namespace ns3 { CsmaHelper::CsmaHelper () - : m_pcap (false), - m_ascii (false) { m_queueFactory.SetTypeId ("ns3::DropTailQueue"); m_deviceFactory.SetTypeId ("ns3::CsmaNetDevice"); @@ -46,27 +44,92 @@ CsmaHelper::SetChannelParameter (std::string n1, Attribute v1) } void -CsmaHelper::EnablePcap (std::string filename) +CsmaHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid) { - m_pcap = true; - m_pcapFilename = filename; + std::ostringstream oss; + oss << filename << "-" << nodeid << "-" << deviceid; + Ptr pcap = Create (); + pcap->Open (oss.str ()); + pcap->WriteEthernetHeader (); + oss.str (""); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/Rx"; + Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&CsmaHelper::RxEvent, pcap)); + oss.str (""); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/TxQueue/Enqueue"; + Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&CsmaHelper::EnqueueEvent, pcap)); } void -CsmaHelper::DisablePcap (void) +CsmaHelper::EnablePcap (std::string filename, NetDeviceContainer d) { - m_pcap = false; + for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) + { + Ptr dev = *i; + EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex ()); + } +} +void +CsmaHelper::EnablePcap (std::string filename, NodeContainer n) +{ + NetDeviceContainer devs; + for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) + { + Ptr node = *i; + for (uint32_t j = 0; j < node->GetNDevices (); ++j) + { + devs.Add (node->GetDevice (j)); + } + } + EnablePcap (filename, devs); +} + +void +CsmaHelper::EnablePcap (std::string filename) +{ + EnablePcap (filename, NodeContainer::GetGlobal ()); } void -CsmaHelper::EnableAscii (std::ostream &os) +CsmaHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid) { - m_ascii = true; - m_asciiOs = &os; + Packet::EnableMetadata (); + std::ostringstream oss; + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/Rx"; + Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEvent, &os)); + oss.str (""); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/TxQueue/Enqueue"; + Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEvent, &os)); + oss.str (""); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/TxQueue/Dequeue"; + Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEvent, &os)); } void -CsmaHelper::DisableAscii (void) +CsmaHelper::EnableAscii (std::ostream &os, NetDeviceContainer d) { - m_ascii = false; + for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) + { + Ptr dev = *i; + EnableAscii (os, dev->GetNode ()->GetId (), dev->GetIfIndex ()); + } +} +void +CsmaHelper::EnableAscii (std::ostream &os, NodeContainer n) +{ + NetDeviceContainer devs; + for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) + { + Ptr node = *i; + for (uint32_t j = 0; j < node->GetNDevices (); ++j) + { + devs.Add (node->GetDevice (j)); + } + } + EnableAscii (os, devs); +} + +void +CsmaHelper::EnableAscii (std::ostream &os) +{ + EnableAscii (os, NodeContainer::GetGlobal ()); } @@ -90,31 +153,6 @@ CsmaHelper::Build (const NodeContainer &c, Ptr channel) Ptr queue = m_queueFactory.Create (); device->AddQueue (queue); device->Attach (channel); - if (m_pcap) - { - std::ostringstream oss; - oss << m_pcapFilename << "-" << node->GetId () << "-" << device->GetIfIndex (); - std::string filename = oss.str (); - Ptr pcap = Create (); - pcap->Open (filename); - pcap->WriteEthernetHeader (); - device->TraceConnectWithoutContext ("Rx", MakeBoundCallback (&CsmaHelper::RxEvent, pcap)); - queue->TraceConnectWithoutContext ("Enqueue", MakeBoundCallback (&CsmaHelper::EnqueueEvent, pcap)); - } - if (m_ascii) - { - Packet::EnableMetadata (); - std::ostringstream oss; - oss << "/NodeList/" << node->GetId () << "/DeviceList/" << device->GetIfIndex () << "/Rx"; - Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEvent, m_asciiOs)); - oss.str (""); - oss << "/NodeList/" << node->GetId () << "/DeviceList/" << device->GetIfIndex () << "/TxQueue/Enqueue"; - Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEvent, m_asciiOs)); - oss.str (""); - oss << "/NodeList/" << node->GetId () << "/DeviceList/" << device->GetIfIndex () << "/TxQueue/Dequeue"; - Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEvent, m_asciiOs)); - - } container.Add (device); } return container; diff --git a/src/helper/csma-helper.h b/src/helper/csma-helper.h index 91d1eb676..91db6340d 100644 --- a/src/helper/csma-helper.h +++ b/src/helper/csma-helper.h @@ -60,35 +60,15 @@ public: */ void SetChannelParameter (std::string n1, Attribute v1); - /** - * \param filename file template to dump pcap traces in. - * - * Every ns3::CsmaNetDevice created through subsequent calls - * to CsmaHelper::Build will be configured to dump - * pcap output in a file named filename-nodeid-deviceid. - */ - void EnablePcap (std::string filename); - /** - * Every ns3::CsmaNetDevice created through subsequent calls - * to CsmaHelper::Build will be configured to not dump any pcap - * output. - */ - void DisablePcap (void); + static void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid); + static void EnablePcap (std::string filename, NetDeviceContainer d); + static void EnablePcap (std::string filename, NodeContainer n); + static void EnablePcap (std::string filename); - /** - * \param os an output stream where ascii trace should be sent. - * - * Every ns3::CsmaNetDevice created through subsequent calls - * to CsmaHelper::Build will be configured to dump Rx, EnQueue - * and Dequeue events as ascii data in the specified output stream. - */ - void EnableAscii (std::ostream &os); - /** - * Every ns3::CsmaNetDevice created through subsequent calls - * to CsmaHelper::Build will be configured to not dump any - * ascii output. - */ - void DisableAscii (void); + static void EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid); + static void EnableAscii (std::ostream &os, NetDeviceContainer d); + static void EnableAscii (std::ostream &os, NodeContainer n); + static void EnableAscii (std::ostream &os); /** * \param c a set of nodes @@ -116,10 +96,6 @@ private: ObjectFactory m_queueFactory; ObjectFactory m_deviceFactory; ObjectFactory m_channelFactory; - bool m_pcap; - std::string m_pcapFilename; - bool m_ascii; - std::ostream *m_asciiOs; }; diff --git a/src/helper/point-to-point-helper.cc b/src/helper/point-to-point-helper.cc index 31c846a0c..6e6f7c6b9 100644 --- a/src/helper/point-to-point-helper.cc +++ b/src/helper/point-to-point-helper.cc @@ -43,57 +43,93 @@ PointToPointHelper::SetChannelParameter (std::string n1, Attribute v1) m_channelFactory.Set (n1, v1); } - void -PointToPointHelper::EnablePcap (std::string filename) -{ - m_pcap = true; - m_pcapFilename = filename; -} -void -PointToPointHelper::DisablePcap (void) -{ - m_pcap = false; -} - -void -PointToPointHelper::EnableAscii (std::ostream &os) -{ - m_ascii = true; - m_asciiOs = &os; -} -void -PointToPointHelper::DisableAscii (void) -{ - m_ascii = false; -} - -void -PointToPointHelper::EnablePcap (Ptr node, Ptr device, Ptr queue) +PointToPointHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid) { std::ostringstream oss; - oss << m_pcapFilename << "-" << node->GetId () << "-" << device->GetIfIndex (); - std::string filename = oss.str (); + oss << filename << "-" << nodeid << "-" << deviceid; Ptr pcap = Create (); - pcap->Open (filename); + pcap->Open (oss.str ()); pcap->WriteEthernetHeader (); - device->TraceConnectWithoutContext ("Rx", MakeBoundCallback (&PointToPointHelper::RxEvent, pcap)); - queue->TraceConnectWithoutContext ("Enqueue", MakeBoundCallback (&PointToPointHelper::EnqueueEvent, pcap)); + oss.str (""); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/Rx"; + Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&PointToPointHelper::RxEvent, pcap)); + oss.str (""); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/TxQueue/Enqueue"; + Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&PointToPointHelper::EnqueueEvent, pcap)); +} +void +PointToPointHelper::EnablePcap (std::string filename, NetDeviceContainer d) +{ + for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) + { + Ptr dev = *i; + EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex ()); + } +} +void +PointToPointHelper::EnablePcap (std::string filename, NodeContainer n) +{ + NetDeviceContainer devs; + for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) + { + Ptr node = *i; + for (uint32_t j = 0; j < node->GetNDevices (); ++j) + { + devs.Add (node->GetDevice (j)); + } + } + EnablePcap (filename, devs); } void -PointToPointHelper::EnableAscii (Ptr node, Ptr device) +PointToPointHelper::EnablePcap (std::string filename) +{ + EnablePcap (filename, NodeContainer::GetGlobal ()); +} + +void +PointToPointHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid) { Packet::EnableMetadata (); std::ostringstream oss; - oss << "/NodeList/" << node->GetId () << "/DeviceList/" << device->GetIfIndex () << "/Rx"; - Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEvent, m_asciiOs)); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/Rx"; + Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEvent, &os)); oss.str (""); - oss << "/NodeList/" << node->GetId () << "/DeviceList/" << device->GetIfIndex () << "/TxQueue/Enqueue"; - Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEvent, m_asciiOs)); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/TxQueue/Enqueue"; + Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEvent, &os)); oss.str (""); - oss << "/NodeList/" << node->GetId () << "/DeviceList/" << device->GetIfIndex () << "/TxQueue/Dequeue"; - Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEvent, m_asciiOs)); + oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/TxQueue/Dequeue"; + Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEvent, &os)); +} +void +PointToPointHelper::EnableAscii (std::ostream &os, NetDeviceContainer d) +{ + for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) + { + Ptr dev = *i; + EnableAscii (os, dev->GetNode ()->GetId (), dev->GetIfIndex ()); + } +} +void +PointToPointHelper::EnableAscii (std::ostream &os, NodeContainer n) +{ + NetDeviceContainer devs; + for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) + { + Ptr node = *i; + for (uint32_t j = 0; j < node->GetNDevices (); ++j) + { + devs.Add (node->GetDevice (j)); + } + } + EnableAscii (os, devs); +} + +void +PointToPointHelper::EnableAscii (std::ostream &os) +{ + EnableAscii (os, NodeContainer::GetGlobal ()); } NetDeviceContainer @@ -120,17 +156,6 @@ PointToPointHelper::Build (Ptr a, Ptr b) Ptr channel = m_channelFactory.Create (); devA->Attach (channel); devB->Attach (channel); - if (m_pcap) - { - EnablePcap (a, devA, queueA); - EnablePcap (b, devB, queueB); - } - if (m_ascii) - { - EnableAscii (a, devA); - EnableAscii (b, devB); - } - container.Add (devA); container.Add (devB); diff --git a/src/helper/point-to-point-helper.h b/src/helper/point-to-point-helper.h index 50b6164d8..2315684e6 100644 --- a/src/helper/point-to-point-helper.h +++ b/src/helper/point-to-point-helper.h @@ -59,35 +59,15 @@ public: */ void SetChannelParameter (std::string name, Attribute value); - /** - * \param filename file template to dump pcap traces in. - * - * Every ns3::PointToPointNetDevice created through subsequent calls - * to PointToPointHelper::Build will be configured to dump - * pcap output in a file named filename-nodeid-deviceid. - */ - void EnablePcap (std::string filename); - /** - * Every ns3::PointToPointNetDevice created through subsequent calls - * to PointToPointHelper::Build will be configured to not dump any pcap - * output. - */ - void DisablePcap (void); + static void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid); + static void EnablePcap (std::string filename, NetDeviceContainer d); + static void EnablePcap (std::string filename, NodeContainer n); + static void EnablePcap (std::string filename); - /** - * \param os an output stream where ascii trace should be sent. - * - * Every ns3::PointToPointNetDevice created through subsequent calls - * to PointToPointHelper::Build will be configured to dump Rx, EnQueue - * and Dequeue events as ascii data in the specified output stream. - */ - void EnableAscii (std::ostream &os); - /** - * Every ns3::PointToPointNetDevice created through subsequent calls - * to PointToPointHelper::Build will be configured to not dump any - * ascii output. - */ - void DisableAscii (void); + static void EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid); + static void EnableAscii (std::ostream &os, NetDeviceContainer d); + static void EnableAscii (std::ostream &os, NodeContainer n); + static void EnableAscii (std::ostream &os); /** * \param c a set of nodes @@ -117,10 +97,6 @@ private: ObjectFactory m_queueFactory; ObjectFactory m_channelFactory; ObjectFactory m_deviceFactory; - bool m_pcap; - std::string m_pcapFilename; - bool m_ascii; - std::ostream *m_asciiOs; };