Multicast Routing Modelling In OMNeT++
MulticastRoutingTable.h
Go to the documentation of this file.
00001 
00008 #ifndef __MULTICASTROUTINGTABLE_H
00009 #define __MULTICASTROUTINGTABLE_H
00010 
00011 #include <omnetpp.h>
00012 #include "MulticastIPRoute.h"
00013 #include "IPAddress.h"
00014 #include "NotificationBoard.h"
00015 #include "AnsaInterfaceTableAccess.h"
00016 #include "AnsaInterfaceTable.h"
00017 
00021 typedef std::vector<MulticastIPRoute *> RouteVector;
00022 
00029 class INET_API MulticastRoutingTable: public cSimpleModule
00030 {
00031         protected:
00032                 RouteVector multicastRoutes;                                            
00033                 std::vector<std::string> showMRoute;                            
00034                 IInterfaceTable *ift;                                                           
00036         protected:
00037             virtual bool routeMatches(const MulticastIPRoute *entry,
00038                     const IPAddress& source, const IPAddress& group,
00039                     const IPAddress& RP, int intId, const IPAddress& nextHop) const;
00040             virtual void updateDisplayString();
00041 
00042 
00043         public:
00044                 // print multicast routing table
00045                 void generateShowIPMroute();
00046                 virtual void printRoutingTable() const;
00047 
00048                 // Returns routes for a multicast address.
00049                 virtual std::vector<MulticastIPRoute*> getRouteFor(IPAddress group);
00050                 virtual MulticastIPRoute *getRouteFor(IPAddress group, IPAddress source);
00051                 virtual std::vector<MulticastIPRoute*> getRoutesForSource(IPAddress source);
00052 
00053                 // for manipulation with the table
00054                 virtual int getNumRoutes() const;
00055                 virtual MulticastIPRoute *getRoute(int k) const;
00056                 virtual const MulticastIPRoute *findRoute(const IPAddress& source, const IPAddress& group,
00057                                 const IPAddress& RP, int intId, const IPAddress& nextHop) const;
00058 
00059                 // the most important !!!
00060                 virtual void addRoute(const MulticastIPRoute *entry);
00061                 virtual bool deleteRoute(const MulticastIPRoute *entry);
00062 
00063         public:
00064             MulticastRoutingTable(){};
00065             virtual ~MulticastRoutingTable();
00066 
00067         protected:
00068             virtual int numInitStages() const  {return 4;}
00069             virtual void initialize(int stage);
00070             virtual void handleMessage(cMessage *);
00071 };
00072 
00073 
00074 #endif /* MULTICASTROUTINGTABLE_H_ */