bug 280: trace helpers too inclusive

This commit is contained in:
Mathieu Lacage
2008-10-24 13:22:16 +02:00
parent c164d111bd
commit 3ec1d2f640
3 changed files with 21 additions and 0 deletions

View File

@@ -78,6 +78,13 @@ void
CsmaHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid)
{
std::ostringstream oss;
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/";
Config::MatchContainer matches = Config::LookupMatches (oss.str ());
if (matches.GetN () == 0)
{
return;
}
oss.str ("");
oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
Ptr<PcapWriter> pcap = Create<PcapWriter> ();
pcap->Open (oss.str ());

View File

@@ -78,6 +78,13 @@ void
PointToPointHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid)
{
std::ostringstream oss;
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/";
Config::MatchContainer matches = Config::LookupMatches (oss.str ());
if (matches.GetN () == 0)
{
return;
}
oss.str ("");
oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
Ptr<PcapWriter> pcap = Create<PcapWriter> ();
pcap->Open (oss.str ());

View File

@@ -149,6 +149,13 @@ void
WifiHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid)
{
std::ostringstream oss;
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/";
Config::MatchContainer matches = Config::LookupMatches (oss.str ());
if (matches.GetN () == 0)
{
return;
}
oss.str ("");
oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
Ptr<PcapWriter> pcap = Create<PcapWriter> ();
pcap->Open (oss.str ());