00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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