|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // (C) 2005 Vojtech Janota 00003 // (C) 2003 Xuan Thang Nguyen 00004 // 00005 // This library is free software, you can redistribute it 00006 // and/or modify 00007 // it under the terms of the GNU Lesser General Public License 00008 // as published by the Free Software Foundation; 00009 // either version 2 of the License, or any later version. 00010 // The library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 // See the GNU Lesser General Public License for more details. 00014 // 00015 00016 #ifndef __INET_MPLSMODULE_H 00017 #define __INET_MPLSMODULE_H 00018 00019 #include <vector> 00020 #include <omnetpp.h> 00021 00022 #include "MPLSPacket.h" 00023 #include "IPDatagram.h" 00024 #include "ConstType.h" 00025 00026 #include "LIBTable.h" 00027 #include "IInterfaceTable.h" 00028 00029 #include "IClassifier.h" 00030 00031 00035 class INET_API MPLS : public cSimpleModule 00036 { 00037 protected: 00038 simtime_t delay1; 00039 00040 //no longer used, see comment in intialize 00041 //std::vector<bool> labelIf; 00042 00043 LIBTable *lt; 00044 IInterfaceTable *ift; 00045 IClassifier *pct; 00046 00047 protected: 00048 virtual void initialize(int stage); 00049 virtual int numInitStages() const {return 5;} 00050 virtual void handleMessage(cMessage *msg); 00051 00052 protected: 00053 virtual void processPacketFromL3(cMessage *msg); 00054 virtual void processPacketFromL2(cMessage *msg); 00055 virtual void processMPLSPacketFromL2(MPLSPacket *mplsPacket); 00056 00057 virtual bool tryLabelAndForwardIPDatagram(IPDatagram *ipdatagram); 00058 virtual void labelAndForwardIPDatagram(IPDatagram *ipdatagram); 00059 00060 virtual void sendToL2(cMessage *msg, int gateIndex); 00061 virtual void doStackOps(MPLSPacket *mplsPacket, const LabelOpVector& outLabel); 00062 }; 00063 00064 #endif 00065