View | Details | Raw Unified | Return to bug 622
Collapse All | Expand All

(-)a/src/helper/csma-helper.cc (-1 / +21 lines)
 Lines 28-33    Link Here 
28
#include "ns3/names.h"
28
#include "ns3/names.h"
29
#include "ns3/pcap-writer.h"
29
#include "ns3/pcap-writer.h"
30
#include "ns3/ascii-writer.h"
30
#include "ns3/ascii-writer.h"
31
#include "ns3/node-list.h"
31
#include <string>
32
#include <string>
32
33
33
namespace ns3 {
34
namespace ns3 {
 Lines 76-82    Link Here 
76
      return;
77
      return;
77
    }
78
    }
78
  oss.str ("");
79
  oss.str ("");
79
  oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
80
  std::string nodename=Names::FindName (NodeList::GetNode(nodeid));
81
  std::string devicename=Names::FindName (NodeList::GetNode(nodeid)->GetDevice(deviceid));
82
  oss << filename << "-";
83
  if (nodename != "")
84
    {
85
      oss << nodename << "-";
86
    }
87
    else
88
    {
89
      oss << nodeid << "-";
90
    }
91
  if (devicename != "")
92
    {
93
      oss << devicename;
94
    }
95
    else
96
    {
97
      oss << deviceid;
98
    }
99
  oss << ".pcap";
80
  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
100
  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
81
  pcap->Open (oss.str ());
101
  pcap->Open (oss.str ());
82
  pcap->WriteEthernetHeader ();
102
  pcap->WriteEthernetHeader ();
(-)a/src/helper/point-to-point-helper.cc (-1 / +21 lines)
 Lines 27-32    Link Here 
27
#include "ns3/names.h"
27
#include "ns3/names.h"
28
#include "ns3/pcap-writer.h"
28
#include "ns3/pcap-writer.h"
29
#include "ns3/ascii-writer.h"
29
#include "ns3/ascii-writer.h"
30
#include "ns3/node-list.h"
30
31
31
namespace ns3 {
32
namespace ns3 {
32
33
 Lines 75-81    Link Here 
75
      return;
76
      return;
76
    }
77
    }
77
  oss.str ("");
78
  oss.str ("");
78
  oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
79
  std::string nodename=Names::FindName (NodeList::GetNode(nodeid));
80
  std::string devicename=Names::FindName (NodeList::GetNode(nodeid)->GetDevice(deviceid));
81
  oss << filename << "-";
82
  if (nodename != "")
83
    {
84
     oss << nodename << "-";
85
    }
86
  else
87
    {
88
      oss << nodeid << "-";
89
    }
90
  if (devicename != "")
91
    {
92
      oss << devicename;
93
    }
94
  else
95
    {
96
      oss << deviceid;
97
    }
98
  oss << ".pcap";
79
  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
99
  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
80
  pcap->Open (oss.str ());
100
  pcap->Open (oss.str ());
81
  pcap->WritePppHeader ();
101
  pcap->WritePppHeader ();

Return to bug 622