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

SimpleNetwLayer.h

00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        SimpleNetwLayer.h
00003  *
00004  * author:      Daniel Willkomm
00005  *
00006  * copyright:   (C) 2004 Telecommunication Networks Group (TKN) at
00007  *              Technische Universitaet Berlin, Germany.
00008  *
00009  *              This program is free software; you can redistribute it 
00010  *              and/or modify it under the terms of the GNU General Public 
00011  *              License as published by the Free Software Foundation; either
00012  *              version 2 of the License, or (at your option) any later 
00013  *              version.
00014  *              For further information see file COPYING 
00015  *              in the top level directory
00016  ***************************************************************************
00017  * part of:     framework implementation developed by tkn
00018  * description: network layer: general class for the network layer
00019  *              subclass to create your own network layer
00020  **************************************************************************/
00021 
00022 
00023 #ifndef SIMPLE_NETW_LAYER_H
00024 #define SIMPLE_NETW_LAYER_H
00025 
00026 #include <omnetpp.h>
00027 
00028 #include <BasicLayer.h>
00029 
00030 #include "SimpleArp.h"
00031 #include "NetwPkt_m.h"
00032 #include "SimpleAddress.h"
00033 
00040 class SimpleNetwLayer : public BasicLayer
00041 {
00042 
00043   protected:
00048     int headerLength;
00049     
00051     SimpleArp* arp;
00052     
00054     int myNetwAddr;
00055     
00056 public:
00057     Module_Class_Members(SimpleNetwLayer,BasicLayer,0);
00058 
00060     virtual void initialize(int);
00061     
00062   protected:
00073     
00075     virtual void handleUpperMsg(cMessage* msg);
00076     
00078     virtual void handleLowerMsg(cMessage* msg);
00079 
00081     virtual void handleSelfMsg(cMessage* msg){ delete msg;};
00082 
00084     virtual void handleLowerControl(cMessage* msg) {
00085         EV << "deleting control message from lower layer\n";
00086         delete msg;
00087     }
00088 
00092     virtual cMessage* decapsMsg(NetwPkt*);  
00093 
00095     virtual NetwPkt* encapsMsg(cMessage*);  
00096 };
00097 
00098 #endif

Generated on Fri Jan 12 08:29:32 2007 for Mobility Framework by  doxygen 1.4.4