|
66 |
} |
66 |
} |
67 |
|
67 |
|
68 |
void |
68 |
void |
69 |
EmuHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) |
69 |
EmuHelper::EnablePcapExplicit (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) |
70 |
{ |
70 |
{ |
71 |
NS_LOG_FUNCTION (filename << nodeid << deviceid << promiscuous); |
71 |
NS_LOG_FUNCTION (filename << nodeid << deviceid << promiscuous); |
72 |
std::ostringstream oss; |
72 |
std::ostringstream oss; |
73 |
oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; |
|
|
74 |
Ptr<PcapWriter> pcap = CreateObject<PcapWriter> (); |
73 |
Ptr<PcapWriter> pcap = CreateObject<PcapWriter> (); |
75 |
pcap->Open (oss.str ()); |
74 |
pcap->Open (filename); |
76 |
pcap->WriteEthernetHeader (); |
75 |
pcap->WriteEthernetHeader (); |
77 |
|
76 |
|
78 |
oss.str (""); |
|
|
79 |
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; |
77 |
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; |
80 |
if (promiscuous) |
78 |
if (promiscuous) |
81 |
{ |
79 |
{ |
|
89 |
} |
87 |
} |
90 |
|
88 |
|
91 |
void |
89 |
void |
|
|
90 |
EmuHelper::EnablePcapExplicit (std::string filename, Ptr<NetDevice> nd, bool promiscuous) |
91 |
{ |
92 |
NS_LOG_FUNCTION (filename << &nd << promiscuous); |
93 |
EnablePcapExplicit (filename, nd->GetNode ()->GetId (), nd->GetIfIndex (), promiscuous); |
94 |
} |
95 |
|
96 |
void |
97 |
EmuHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) |
98 |
{ |
99 |
NS_LOG_FUNCTION (filename << nodeid << deviceid << promiscuous); |
100 |
std::ostringstream oss; |
101 |
oss.str (""); |
102 |
oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; |
103 |
EnablePcapExplicit(oss.str (), nodeid, deviceid, promiscuous); |
104 |
} |
105 |
|
106 |
void |
92 |
EmuHelper::EnablePcap (std::string filename, Ptr<NetDevice> nd, bool promiscuous) |
107 |
EmuHelper::EnablePcap (std::string filename, Ptr<NetDevice> nd, bool promiscuous) |
93 |
{ |
108 |
{ |
94 |
NS_LOG_FUNCTION (filename << &nd << promiscuous); |
109 |
NS_LOG_FUNCTION (filename << &nd << promiscuous); |