INET Framework for OMNeT++/OMNEST
ansaOspfRouting6.h
Go to the documentation of this file.
00001 //
00002 // Marek Cerny, 2MSK
00003 // FIT VUT 2011
00004 //
00005 //
00006 // This program is free software: you can redistribute it and/or modify
00007 // it under the terms of the GNU Lesser General Public License as published by
00008 // the Free Software Foundation, either version 3 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU Lesser General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU Lesser General Public License
00017 // along with this program.  If not, see http://www.gnu.org/licenses/.
00018 // 
00019 
00020 #ifndef __ANSAINET_ANSAOSPFROUTING6_H_
00021 #define __ANSAINET_ANSAOSPFROUTING6_H_
00022 
00023 #include <omnetpp.h>
00024 
00025 #include "AnsaInterfaceTable.h"
00026 #include "AnsaInterfaceTableAccess.h"
00027 
00028 #include "NotificationBoard.h"
00029 #include "IPv6ControlInfo.h"
00030 #include "IPAddress.h"
00031 
00032 #include "xmlParser.h"
00033 
00034 #include "ansaOspfCommon6.h"
00035 #include "ansaOspfRouter6.h"
00036 #include "ansaOspfPacket6_m.h"
00037 
00038 
00039 class AnsaOspfRouting6 : public cSimpleModule, protected INotifiable {
00040 
00041    private:
00042       AnsaInterfaceTable*  ift;
00043       bool                 ospfEnabled;
00044 
00045       std::map<AnsaOspf6::ProcessID, AnsaOspf6::Router *>   routers;
00046       std::vector<AnsaOspf6::Router *>                      iface2Routers;
00047       std::map<std::string, std::string>                    interfaces;
00048 
00049    protected:
00050       NotificationBoard *nb;
00051 
00052    public:
00053       AnsaOspfRouting6();
00054       virtual ~AnsaOspfRouting6(void);
00055 
00056    private:
00057       void loadOspfRouting(cXMLElement *process);
00058       void loadInterfaceConfig(cXMLElement *iface);
00059       void addWatches(void);
00060       AnsaOspf6::Router * getOspfRouter(int interfaceId);
00061 
00062    protected:
00063       virtual int numInitStages() const {return 5;}
00064       virtual void initialize(int stage);
00065       virtual void handleMessage(cMessage *msg);
00066       virtual void receiveChangeNotification(int category, const cPolymorphic *details);
00067 };
00068 
00069 #endif