Dumps every packet using the PcapDump class and the PacketDump class.
More...
#include <TCPDump.h>
Dumps every packet using the PcapDump class and the PacketDump class.
inet::TCPDump::TCPDump |
( |
| ) |
|
|
inline |
inet::TCPDump::~TCPDump |
( |
| ) |
|
void inet::TCPDump::finish |
( |
| ) |
|
|
overridevirtual |
void closePcap()
Closes the output file if it is open.
Definition: PcapDump.cc:171
PcapDump pcapDump
Definition: TCPDump.h:38
PacketDump tcpdump
Definition: TCPDump.h:39
void dump(const char *label, const char *msg)
Writes the given text on the output stream.
Definition: PacketDump.cc:355
void inet::TCPDump::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overridevirtual |
55 if (msg->isPacket()) {
56 bool l2r = msg->arrivedOn(
"hlIn");
64 const simtime_t stime = simTime();
65 IPv4Datagram *ipPacket = check_and_cast<IPv4Datagram *>(msg);
68 #endif // ifdef WITH_IPv4 76 int32 index = msg->getArrivalGate()->getIndex();
79 if (msg->getArrivalGate()->isName(
"ifIn"))
80 id = findGate(
"hlOut", index);
82 id = findGate(
"ifOut", index);
void writeFrame(simtime_t time, const IPv4Datagram *ipPacket)
Records the given packet into the output file if it is open, and throws an exception otherwise...
Definition: PcapDump.cc:101
PcapDump pcapDump
Definition: TCPDump.h:38
void dumpPacket(bool l2r, cPacket *packet)
Dumps info about the given packet.
Definition: PacketDump.cc:366
int32_t int32
Definition: Compat.h:31
bool dumpBadFrames
Definition: TCPDump.h:41
PacketDump tcpdump
Definition: TCPDump.h:39
#define PK(msg)
Definition: INETDefs.h:92
uint16_t id
Definition: TCP_NSC.cc:85
bool dropBadFrames
Definition: TCPDump.h:42
bool isOpen() const
Returns true if the pcap file is currently open.
Definition: PcapDump.h:66
void inet::TCPDump::initialize |
( |
| ) |
|
|
overridevirtual |
40 const char *file = this->par(
"dumpFile");
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
unsigned int snaplen
Definition: TCPDump.h:40
PcapDump pcapDump
Definition: TCPDump.h:38
bool dumpBadFrames
Definition: TCPDump.h:41
PacketDump tcpdump
Definition: TCPDump.h:39
#define EVSTREAM
Definition: Compat.h:36
bool dropBadFrames
Definition: TCPDump.h:42
bool inet::TCPDump::dropBadFrames = false |
|
protected |
bool inet::TCPDump::dumpBadFrames = false |
|
protected |
unsigned int inet::TCPDump::snaplen = 0 |
|
protected |
The documentation for this class was generated from the following files: