OverSim
|
RealworldConnector is a pseudo interface that allows communcation with the real world through the TunOutScheduler. More...
#include <RealworldConnector.h>
Public Member Functions | |
RealworldConnector () | |
virtual | ~RealworldConnector () |
virtual int | numInitStages () const |
virtual void | initialize (int stage) |
Initialization of the module. | |
virtual void | handleMessage (cMessage *msg) |
The "main loop". |
Protected Member Functions | |
virtual void | transmitToNetwork (cPacket *msg) |
Send a message to the (realworld) network. | |
virtual void | updateDisplayString () |
virtual char * | encapsulate (cPacket *msg, unsigned int *length, sockaddr **addr, socklen_t *addrlen)=0 |
Converts an IP datagram to a data block for sending it to the (realworld) network. | |
virtual cPacket * | decapsulate (char *buf, uint32_t length, sockaddr *addr, socklen_t addrlen)=0 |
Parses data received from the (realworld) network and converts it into a cMessage. | |
virtual bool | isApp () |
If the Connector connects to an application, this method has to be overwritten to return "true". |
Protected Attributes | |
int | gateIndexNetwOut |
unsigned int | mtu |
long | numSent |
long | numSendError |
long | numRcvdOK |
long | numRcvError |
cMessage * | packetNotification |
PacketBuffer | packetBuffer |
RealtimeScheduler * | scheduler |
PacketParser * | parser |
RealworldConnector is a pseudo interface that allows communcation with the real world through the TunOutScheduler.
Definition at line 66 of file RealworldConnector.h.
RealworldConnector::RealworldConnector | ( | ) |
Definition at line 30 of file RealworldConnector.cc.
|
virtual |
Definition at line 35 of file RealworldConnector.cc.
|
protectedpure virtual |
Parses data received from the (realworld) network and converts it into a cMessage.
buf | A pointer to the data to be parsed |
length | The lenght of the buffer in bytes |
addr | If needed, the destination address |
addrlen | If needed, the length of the address |
Implemented in TunOutDevice, UdpOutDevice, and RealworldApp.
Referenced by handleMessage().
|
protectedpure virtual |
Converts an IP datagram to a data block for sending it to the (realworld) network.
msg | A pointer to the message to be converted |
length | A pointer to an int that will hold the length of the converted data |
addr | If needed, the destination address |
addrlen | If needed, the length of the address |
Implemented in TunOutDevice, UdpOutDevice, and RealworldApp.
Referenced by transmitToNetwork().
|
virtual |
The "main loop".
Every message that is received or send is handled by this method
Definition at line 82 of file RealworldConnector.cc.
|
virtual |
Initialization of the module.
Registers the device at the scheduler and searches for the appropriate payload-parser Will be called automatically at startup
Reimplemented in RealworldDevice.
Definition at line 40 of file RealworldConnector.cc.
|
inlineprotectedvirtual |
If the Connector connects to an application, this method has to be overwritten to return "true".
Reimplemented in RealworldApp.
Definition at line 124 of file RealworldConnector.h.
Referenced by initialize(), and transmitToNetwork().
|
inlinevirtual |
Reimplemented in RealworldDevice.
Definition at line 130 of file RealworldConnector.h.
|
protectedvirtual |
Send a message to the (realworld) network.
msg | A pointer to the message to be send |
Definition at line 123 of file RealworldConnector.cc.
Referenced by handleMessage().
|
protectedvirtual |
Definition at line 152 of file RealworldConnector.cc.
Referenced by handleMessage(), and initialize().
|
protected |
Definition at line 70 of file RealworldConnector.h.
Referenced by handleMessage(), and initialize().
|
protected |
Definition at line 71 of file RealworldConnector.h.
Referenced by UdpOutDevice::encapsulate(), initialize(), and RealworldDevice::registerInterface().
|
protected |
Definition at line 77 of file RealworldConnector.h.
Referenced by handleMessage(), initialize(), and updateDisplayString().
|
protected |
Definition at line 78 of file RealworldConnector.h.
Referenced by handleMessage(), initialize(), and updateDisplayString().
|
protected |
Definition at line 76 of file RealworldConnector.h.
Referenced by initialize(), transmitToNetwork(), and updateDisplayString().
|
protected |
Definition at line 75 of file RealworldConnector.h.
Referenced by initialize(), transmitToNetwork(), and updateDisplayString().
|
protected |
Definition at line 81 of file RealworldConnector.h.
Referenced by handleMessage(), and initialize().
|
protected |
Definition at line 80 of file RealworldConnector.h.
Referenced by handleMessage(), initialize(), RealworldConnector(), and ~RealworldConnector().
|
protected |
Definition at line 83 of file RealworldConnector.h.
Referenced by RealworldApp::decapsulate(), UdpOutDevice::decapsulate(), RealworldApp::encapsulate(), UdpOutDevice::encapsulate(), and initialize().
|
protected |
Definition at line 82 of file RealworldConnector.h.
Referenced by initialize(), and transmitToNetwork().