diff -r 8776c223c36c src/helper/csma-helper.cc --- a/src/helper/csma-helper.cc Wed Oct 28 12:29:58 2009 +0300 +++ b/src/helper/csma-helper.cc Tue Nov 17 16:32:24 2009 +0100 @@ -28,6 +28,7 @@ #include "ns3/names.h" #include "ns3/pcap-writer.h" #include "ns3/ascii-writer.h" +#include "ns3/node-list.h" #include namespace ns3 { @@ -76,7 +77,26 @@ return; } oss.str (""); - oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; + std::string nodename=Names::FindName (NodeList::GetNode(nodeid)); + std::string devicename=Names::FindName (NodeList::GetNode(nodeid)->GetDevice(deviceid)); + oss << filename << "-"; + if (nodename != "") + { + oss << nodename << "-"; + } + else + { + oss << nodeid << "-"; + } + if (devicename != "") + { + oss << devicename; + } + else + { + oss << deviceid; + } + oss << ".pcap"; Ptr pcap = CreateObject (); pcap->Open (oss.str ()); pcap->WriteEthernetHeader (); diff -r 8776c223c36c src/helper/point-to-point-helper.cc --- a/src/helper/point-to-point-helper.cc Wed Oct 28 12:29:58 2009 +0300 +++ b/src/helper/point-to-point-helper.cc Tue Nov 17 16:32:24 2009 +0100 @@ -27,6 +27,7 @@ #include "ns3/names.h" #include "ns3/pcap-writer.h" #include "ns3/ascii-writer.h" +#include "ns3/node-list.h" namespace ns3 { @@ -75,7 +76,26 @@ return; } oss.str (""); - oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; + std::string nodename=Names::FindName (NodeList::GetNode(nodeid)); + std::string devicename=Names::FindName (NodeList::GetNode(nodeid)->GetDevice(deviceid)); + oss << filename << "-"; + if (nodename != "") + { + oss << nodename << "-"; + } + else + { + oss << nodeid << "-"; + } + if (devicename != "") + { + oss << devicename; + } + else + { + oss << deviceid; + } + oss << ".pcap"; Ptr pcap = CreateObject (); pcap->Open (oss.str ()); pcap->WritePppHeader ();