00001 // 00002 // (C) 2005 Vojtech Janota 00003 // 00004 // This library is free software, you can redistribute it 00005 // and/or modify 00006 // it under the terms of the GNU Lesser General Public License 00007 // as published by the Free Software Foundation; 00008 // either version 2 of the License, or any later version. 00009 // The library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 // See the GNU Lesser General Public License for more details. 00013 // 00014 00015 #ifndef __INET_LINKSTATEROUTING_H 00016 #define __INET_LINKSTATEROUTING_H 00017 00018 #include <omnetpp.h> 00019 #include "NotificationBoard.h" 00020 #include "LinkStatePacket_m.h" 00021 #include "IntServ.h" 00022 00023 00024 #define TED_TRAFFIC 1 00025 00026 class TED; 00027 class IRoutingTable; 00028 class IInterfaceTable; 00029 class InterfaceEntry; 00030 class NotificationBoard; 00031 00032 00056 class LinkStateRouting : public cSimpleModule, public INotifiable 00057 { 00058 protected: 00059 TED *tedmod; 00060 cMessage *announceMsg; 00061 IPAddress routerId; 00062 00063 IPAddressVector peerIfAddrs; // addresses of interfaces towards neighbouring routers 00064 00065 public: 00066 LinkStateRouting(); 00067 virtual ~LinkStateRouting(); 00068 00069 protected: 00070 virtual void initialize(int stage); 00071 virtual int numInitStages() const {return 5;} 00072 virtual void handleMessage(cMessage *msg); 00073 00074 virtual void processLINK_STATE_MESSAGE(LinkStateMsg* msg, IPAddress sender); 00075 00076 // INotifiable method 00077 virtual void receiveChangeNotification(int category, const cPolymorphic *details); 00078 00079 virtual void sendToPeers(const std::vector<TELinkStateInfo>& list, bool req, IPAddress exceptPeer); 00080 virtual void sendToPeer(IPAddress peer, const std::vector<TELinkStateInfo> & list, bool req); 00081 virtual void sendToIP(LinkStateMsg *msg, IPAddress destAddr); 00082 00083 }; 00084 00085 #endif 00086 00087