PacketParser Class Reference

#include <PacketParser.h>

Inheritance diagram for PacketParser:

GenericPacketParser RealWorldTestPacketParser List of all members.

Detailed Description

Class that performes parsing of the payload of packets that are send to or received by the tun device.


Public Member Functions

virtual void initialize ()
 Called on initialisation.
virtual void handleMessage (cMessage *msg)
 Is called if the modules receives a message.
virtual char * encapsulatePayload (cMessage *msg, unsigned int *length)=0
 Convert a cMessage to a data block for sending it to the tun device.
virtual cMessage * decapsulatePayload (char *buf, unsigned int length)=0
 Parses a block of data received from the tun device.


Member Function Documentation

virtual void PacketParser::initialize (  )  [inline, virtual]

Called on initialisation.

00040     {}

virtual void PacketParser::handleMessage ( cMessage *  msg  )  [inline, virtual]

Is called if the modules receives a message.

That should never happen

00047     {
00048         opp_error("A PacketParser is not intendet to receive Messages!");
00049     };

virtual char* PacketParser::encapsulatePayload ( cMessage *  msg,
unsigned int *  length 
) [pure virtual]

Convert a cMessage to a data block for sending it to the tun device.

Pure virtual function, has to be implemented by inherited classes.

Parameters:
msg A pointer to the message to be converted
length A pointer to an integer that will hold the length of the data
Returns:
A pointer to the converted data

Implemented in RealWorldTestPacketParser, and GenericPacketParser.

virtual cMessage* PacketParser::decapsulatePayload ( char *  buf,
unsigned int  length 
) [pure virtual]

Parses a block of data received from the tun device.

Pure virtual function, has to be implemented by inherited classes.

Parameters:
buf The data to be parsed
length The length of the data
Returns:
A cMessage containing the parsed data

Implemented in RealWorldTestPacketParser, and GenericPacketParser.


The documentation for this class was generated from the following file:
Generated on Tue Jul 24 16:51:19 2007 for ITM OverSim by  doxygen 1.5.1