#include <TunLoopbackApp.h>
inet::TunLoopbackApp::TunLoopbackApp |
( |
| ) |
|
unsigned int packetsSent
Definition: TunLoopbackApp.h:28
unsigned int packetsReceived
Definition: TunLoopbackApp.h:29
inet::TunLoopbackApp::~TunLoopbackApp |
( |
| ) |
|
|
virtual |
void inet::TunLoopbackApp::finish |
( |
| ) |
|
|
overrideprotected |
unsigned int packetsSent
Definition: TunLoopbackApp.h:28
unsigned int packetsReceived
Definition: TunLoopbackApp.h:29
void inet::TunLoopbackApp::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotected |
53 if (message->getArrivalGate()->isName(
"tunIn")) {
54 EV_INFO <<
"Message " << message->getName() <<
" arrived from tun. " <<
packetsReceived + 1 <<
" packets received so far\n";
56 INetworkDatagram *networkDatagram = check_and_cast<INetworkDatagram *>(message);
57 ITransportPacket *transportPacket = check_and_cast<ITransportPacket *>(check_and_cast<cPacket *>(message)->getEncapsulatedPacket());
58 transportPacket->setDestinationPort(transportPacket->getSourcePort());
59 transportPacket->setSourcePort(transportPacket->getDestinationPort());
60 networkDatagram->setSourceAddress(networkDatagram->getDestinationAddress());
61 networkDatagram->setDestinationAddress(networkDatagram->getSourceAddress());
62 send(message,
"tunOut");
66 throw cRuntimeError(
"Unknown message");
unsigned int packetsSent
Definition: TunLoopbackApp.h:28
unsigned int packetsReceived
Definition: TunLoopbackApp.h:29
void inet::TunLoopbackApp::initialize |
( |
int |
stage | ) |
|
|
overrideprotected |
44 cSimpleModule::initialize(stage);
unsigned int packetsSent
Definition: TunLoopbackApp.h:28
unsigned int packetsReceived
Definition: TunLoopbackApp.h:29
Local initializations.
Definition: InitStages.h:35
unsigned int inet::TunLoopbackApp::packetsReceived |
|
protected |
unsigned int inet::TunLoopbackApp::packetsSent |
|
protected |
simsignal_t inet::TunLoopbackApp::rcvdPkSignal = registerSignal("rcvdPk") |
|
staticprotected |
simsignal_t inet::TunLoopbackApp::sentPkSignal = registerSignal("sentPk") |
|
staticprotected |
The documentation for this class was generated from the following files: