OverSim
TunOutDevice Class Reference

TunOutDevice is a pseudo interface that allows communcation with the real world through the TunOutScheduler. More...

#include <TunOutDevice.h>

Inheritance diagram for TunOutDevice:
RealworldDevice RealworldConnector

Protected Member Functions

virtual char * encapsulate (cPacket *msg, unsigned int *length, sockaddr **addr, socklen_t *addrlen)
 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)
 Parses data received from the (realworld) network and converts it into a cMessage.
- Protected Member Functions inherited from RealworldDevice
InterfaceEntry * registerInterface ()
 Register the interface in the interface table of the parent.
- Protected Member Functions inherited from RealworldConnector
virtual void transmitToNetwork (cPacket *msg)
 Send a message to the (realworld) network.
virtual void updateDisplayString ()
virtual bool isApp ()
 If the Connector connects to an application, this method has to be overwritten to return "true".

Additional Inherited Members

- Public Member Functions inherited from RealworldDevice
virtual int numInitStages () const
virtual void initialize (int stage)
 Initialization of the module.
- Protected Attributes inherited from RealworldDevice
InterfaceEntry * interfaceEntry

Detailed Description

TunOutDevice is a pseudo interface that allows communcation with the real world through the TunOutScheduler.

WARNING: This does ONLY work with the combination IPv4|UDP|OverlayMessage

Definition at line 36 of file TunOutDevice.h.

Member Function Documentation

cPacket * TunOutDevice::decapsulate ( char *  buf,
uint32_t  length,
sockaddr *  addr,
socklen_t  addrlen 
)
protectedvirtual

Parses data received from the (realworld) network and converts it into a cMessage.

Parameters
bufA pointer to the data to be parsed
lengthThe lenght of the buffer in bytes
addrIgnored (deleted)
addrlenIgnored
Returns
The parsed message

Implements RealworldConnector.

Definition at line 257 of file TunOutDevice.cc.

{
throw cRuntimeError("TunOutDevice::decapsulate(): Not supported on Windows/Mac OS yet");
}
char * TunOutDevice::encapsulate ( cPacket *  msg,
unsigned int *  length,
sockaddr **  addr,
socklen_t *  addrlen 
)
protectedvirtual

Converts an IP datagram to a data block for sending it to the (realworld) network.

Parameters
msgA pointer to the message to be converted
lengthA pointer to an int that will hold the length of the converted data
addrIgnored (set to 0)
addrlenIgnored (set to 0)
Returns
A pointer to the converted data

Implements RealworldConnector.

Definition at line 265 of file TunOutDevice.cc.

{
throw cRuntimeError("TunOutDevice::encapsulate(): Not supported on Windows/Mac OS yet");
}

The documentation for this class was generated from the following files: