Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

SimpleNetwLayer Class Reference
[netwLayer - network layer modules]

Simple class for the network layer. More...

#include <SimpleNetwLayer.h>

Inherits BasicLayer.

Inherited by Flood.

Inheritance diagram for SimpleNetwLayer:

Inheritance graph
[legend]
Collaboration diagram for SimpleNetwLayer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Module_Class_Members (SimpleNetwLayer, BasicLayer, 0)
virtual void initialize (int)
 Initialization of the module and some variables.

Protected Member Functions

virtual cMessage * decapsMsg (NetwPkt *)
 decapsulate higher layer message from NetwPkt
virtual NetwPkt * encapsMsg (cMessage *)
 Encapsulate higher layer packet into an NetwPkt.
Handle Messages
Functions to redefine by the programmer

These are the functions provided to add own functionality to your modules. These functions are called whenever a self message or a data message from the upper or lower layer arrives respectively.

virtual void handleUpperMsg (cMessage *msg)
 Handle messages from upper layer.
virtual void handleLowerMsg (cMessage *msg)
 Handle messages from lower layer.
virtual void handleSelfMsg (cMessage *msg)
 Handle self messages.
virtual void handleLowerControl (cMessage *msg)
 Handle control messages from lower layer.

Protected Attributes

int headerLength
 Length of the NetwPkt header Read from omnetpp.ini.
SimpleArparp
 Pointer to the arp module.
int myNetwAddr
 cached variable of my networ address

Detailed Description

Simple class for the network layer.

Author:
Daniel Willkomm


Member Function Documentation

cMessage * SimpleNetwLayer::decapsMsg NetwPkt *  msg  )  [protected, virtual]
 

decapsulate higher layer message from NetwPkt

Decapsulates the packet from the received Network packet

NetwPkt * SimpleNetwLayer::encapsMsg cMessage *  msg  )  [protected, virtual]
 

Encapsulate higher layer packet into an NetwPkt.

Encapsulates the received ApplPkt into a NetwPkt and set all needed header fields.

void SimpleNetwLayer::handleLowerMsg cMessage *  msg  )  [protected, virtual]
 

Handle messages from lower layer.

Redefine this function if you want to process messages from lower layers before they are forwarded to upper layers

If you want to forward the message to upper layers please use sendUp which will take care of decapsulation and thelike

Implements BasicLayer.

Reimplemented in Flood.

void SimpleNetwLayer::handleUpperMsg cMessage *  msg  )  [protected, virtual]
 

Handle messages from upper layer.

Redefine this function if you want to process messages from upper layers before they are send to lower layers.

For the SimpleNetwLayer we just use the destAddr of the network message as a nextHop

To forward the message to lower layers after processing it please use sendDown. It will take care of anything needed

Implements BasicLayer.

Reimplemented in Flood.


The documentation for this class was generated from the following files:
Generated on Fri Jan 12 08:30:18 2007 for Mobility Framework by  doxygen 1.4.4