Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __INET_SIMPLECLASSIFIER_H
00016 #define __INET_SIMPLECLASSIFIER_H
00017
00018 #include <omnetpp.h>
00019 #include <vector>
00020 #include <string>
00021 #include "ConstType.h"
00022 #include "IPAddress.h"
00023 #include "IPDatagram.h"
00024 #include "IScriptable.h"
00025 #include "IRSVPClassifier.h"
00026 #include "LIBTable.h"
00027 #include "IntServ.h"
00028
00029 class RSVP;
00030
00034 class INET_API SimpleClassifier: public cSimpleModule, public IScriptable, public IRSVPClassifier
00035 {
00036 public:
00037 struct FECEntry
00038 {
00039 int id;
00040
00041 IPAddress src;
00042 IPAddress dest;
00043
00044 SessionObj_t session;
00045 SenderTemplateObj_t sender;
00046
00047 int inLabel;
00048 };
00049
00050 protected:
00051 IPAddress routerId;
00052 int maxLabel;
00053
00054 std::vector<FECEntry> bindings;
00055 LIBTable *lt;
00056 RSVP *rsvp;
00057
00058 public:
00059 SimpleClassifier() {}
00060
00061 protected:
00062 virtual void initialize(int stage);
00063 virtual int numInitStages() const {return 5;}
00064 virtual void handleMessage(cMessage *msg);
00065
00066
00067 virtual void processCommand(const cXMLElement& node);
00068
00069
00070 virtual bool lookupLabel(IPDatagram *ipdatagram, LabelOpVector& outLabel, std::string& outInterface, int& color);
00071 virtual void bind(const SessionObj_t& session, const SenderTemplateObj_t& sender, int inLabel);
00072
00073 protected:
00074 virtual void readTableFromXML(const cXMLElement *fectable);
00075 virtual void readItemFromXML(const cXMLElement *fec);
00076 std::vector<FECEntry>::iterator findFEC(int fecid);
00077 };
00078
00079 #endif
00080