48 const char *file = par(
"pcapFile");
56 cStringTokenizer signalTokenizer(par(
"sendingSignalNames"));
58 while (signalTokenizer.hasMoreTokens())
59 signalList[registerSignal(signalTokenizer.nextToken())] =
true;
63 cStringTokenizer signalTokenizer(par(
"receivingSignalNames"));
65 while (signalTokenizer.hasMoreTokens())
66 signalList[registerSignal(signalTokenizer.nextToken())] =
false;
69 const char *moduleNames = par(
"moduleNamePatterns");
70 cStringTokenizer moduleTokenizer(moduleNames);
72 while (moduleTokenizer.hasMoreTokens()) {
74 std::string mname(moduleTokenizer.nextToken());
75 bool isAllIndex = (mname.length() > 3) && mname.rfind(
"[*]") == mname.length() - 3;
78 mname.replace(mname.length() - 3, 3,
"");
80 for (cModule::SubmoduleIterator i(getParentModule()); !i.end(); i++) {
82 if (0 == strcmp(isAllIndex ? submod->getName() : submod->getFullName(), mname.c_str())) {
86 if (!submod->isSubscribed(elem.first,
this)) {
87 submod->subscribe(elem.first,
this);
88 EV <<
"PcapRecorder " << getFullPath() <<
" subscribed to " 89 << submod->getFullPath() <<
":" << getSignalName(elem.first) << endl;
96 EV <<
"The module " << mname << (isAllIndex ?
"[*]" :
"")
97 <<
" not found for PcapRecorder " << getFullPath() << endl;
void openPcap(const char *filename, unsigned int snaplen)
Opens a PCAP file with the given file name.
Definition: PcapDump.cc:75
void setOutStream(std::ostream &o)
Sets the output stream.
Definition: PacketDump.h:62
void setVerbose(bool verb)
Enable/disable verbose output.
Definition: PacketDump.h:72
void setFlushParameter(bool doFlush)
Force flushing of pcap dump.
Definition: PcapDump.h:83
unsigned int snaplen
Definition: PcapRecorder.h:41
#define EVSTREAM
Definition: Compat.h:36
PacketDump packetDumper
Definition: PcapRecorder.h:39
PcapDump pcapDumper
Definition: PcapRecorder.h:40
bool dumpBadFrames
Definition: PcapRecorder.h:42
SignalList signalList
Definition: PcapRecorder.h:38