This class provides network datagram multiplexing based on the the datagram runtime type or on the type of attached control info.
More...
#include <NetworkDatagramMultiplexer.h>
This class provides network datagram multiplexing based on the the datagram runtime type or on the type of attached control info.
inet::NetworkDatagramMultiplexer::NetworkDatagramMultiplexer |
( |
| ) |
|
|
inline |
virtual inet::NetworkDatagramMultiplexer::~NetworkDatagramMultiplexer |
( |
| ) |
|
|
inlinevirtual |
int inet::NetworkDatagramMultiplexer::getProtocolIndex |
( |
cMessage * |
message | ) |
|
|
protected |
Referenced by handleMessage().
54 cPacket *packet = check_and_cast<cPacket *>(message);
55 cObject *controlInfo = packet->getControlInfo();
60 else if (dynamic_cast<IPv4ControlInfo *>(controlInfo) || dynamic_cast<IPv4Datagram *>(message))
62 #endif // ifdef WITH_IPv4 64 else if (dynamic_cast<IPv6ControlInfo *>(controlInfo) || dynamic_cast<IPv6Datagram *>(message))
66 #endif // ifdef WITH_IPv6 68 else if (dynamic_cast<GenericNetworkProtocolControlInfo *>(controlInfo) || dynamic_cast<GenericDatagram *>(message))
70 #endif // ifdef WITH_GENERIC 72 throw cRuntimeError(
"Unknown control info/packet: '%s' in '%s'", (controlInfo?controlInfo->getClassName():
"<nullptr>"), packet->getClassName());
void inet::NetworkDatagramMultiplexer::handleMessage |
( |
cMessage * |
message | ) |
|
|
overrideprotectedvirtual |
42 cGate *arrivalGate = message->getArrivalGate();
43 const char *arrivalGateName = arrivalGate->getBaseName();
44 if (!strcmp(arrivalGateName,
"upperIn"))
46 else if (!strcmp(arrivalGateName,
"lowerIn"))
47 send(message,
"upperOut");
49 throw cRuntimeError(
"Unknown arrival gate");
int getProtocolIndex(cMessage *message)
Definition: NetworkDatagramMultiplexer.cc:52
The documentation for this class was generated from the following files: