|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // This program is free software: you can redistribute it and/or modify 00003 // it under the terms of the GNU Lesser General Public License as published by 00004 // the Free Software Foundation, either version 3 of the License, or 00005 // (at your option) any later version. 00006 // 00007 // This program is distributed in the hope that it will be useful, 00008 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 // GNU Lesser General Public License for more details. 00011 // 00012 // You should have received a copy of the GNU Lesser General Public License 00013 // along with this program. If not, see http://www.gnu.org/licenses/. 00014 // 00015 00016 #ifndef ANSAMESSAGEHANDLER6_H_ 00017 #define ANSAMESSAGEHANDLER6_H_ 00018 00019 #include "ansaIMessageHandler6.h" 00020 #include "ansaHelloHandler6.h" 00021 #include "ansaDatabaseDescriptionHandler6.h" 00022 #include "ansaLinkStateRequestHandler6.h" 00023 #include "ansaLinkStateUpdateHandler6.h" 00024 #include "ansaLinkStateAcknowledgementHandler6.h" 00025 00026 #include "ansaOspfInterface6.h" 00027 #include "ansaOspfTimer6_m.h" 00028 00029 00030 namespace AnsaOspf6 { 00031 00032 class MessageHandler : public IMessageHandler { 00033 private: 00034 cSimpleModule* ospfModule; 00035 00036 HelloHandler helloHandler; 00037 DatabaseDescriptionHandler ddHandler; 00038 LinkStateRequestHandler lsRequestHandler; 00039 LinkStateUpdateHandler lsUpdateHandler; 00040 LinkStateAcknowledgementHandler lsAckHandler; 00041 00042 public: 00043 MessageHandler (Router* containingRouter, cSimpleModule* containingModule); 00044 00045 void MessageReceived (cMessage* message); 00046 void HandleTimer (OspfTimer6* timer); 00047 00048 void ProcessPacket (OspfPacket6* packet, Interface* unused1 = NULL, Neighbor* unused2 = NULL); 00049 00050 void SendPacket (OspfPacket6* packet, IPv6Address destination, int outputIfIndex, short hopLimit = 1); 00051 void ClearTimer (OspfTimer6* timer); 00052 void StartTimer (OspfTimer6* timer, simtime_t delay); 00053 00054 void PrintEvent (const char* eventString, const Interface* onInterface = NULL, const Neighbor* forNeighbor = NULL) const; 00055 void PrintHelloPacket (const OspfHelloPacket6* helloPacket, IPv6Address destination, int outputIfIndex) const; 00056 void PrintDatabaseDescriptionPacket (const OspfDatabaseDescriptionPacket6* ddPacket, IPv6Address destination, int outputIfIndex) const; 00057 void PrintLinkStateRequestPacket (const OspfLinkStateRequestPacket6* requestPacket, IPv6Address destination, int outputIfIndex) const; 00058 void PrintLinkStateUpdatePacket (const OspfLinkStateUpdatePacket6* updatePacket, IPv6Address destination, int outputIfIndex) const; 00059 void PrintLinkStateAcknowledgementPacket (const OspfLinkStateAcknowledgementPacket6* ackPacket, IPv6Address destination, int outputIfIndex) const; 00060 }; 00061 00062 } 00063 00064 #endif /* ANSAMESSAGEHANDLER6_H_ */