Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __INET_MESSAGEHANDLER_H
00019 #define __INET_MESSAGEHANDLER_H
00020
00021 #include "IMessageHandler.h"
00022 #include "HelloHandler.h"
00023 #include "DatabaseDescriptionHandler.h"
00024 #include "LinkStateRequestHandler.h"
00025 #include "LinkStateUpdateHandler.h"
00026 #include "LinkStateAcknowledgementHandler.h"
00027 #include "OSPFTimer_m.h"
00028 #include "IPControlInfo.h"
00029 #include "OSPFInterface.h"
00030
00031
00032 namespace OSPF {
00033
00034 class MessageHandler : public IMessageHandler {
00035 private:
00036 cSimpleModule* ospfModule;
00037
00038 HelloHandler helloHandler;
00039 DatabaseDescriptionHandler ddHandler;
00040 LinkStateRequestHandler lsRequestHandler;
00041 LinkStateUpdateHandler lsUpdateHandler;
00042 LinkStateAcknowledgementHandler lsAckHandler;
00043
00044 public:
00045 MessageHandler (Router* containingRouter, cSimpleModule* containingModule);
00046
00047 void MessageReceived(cMessage* message);
00048 void HandleTimer (OSPFTimer* timer);
00049
00050 void ProcessPacket (OSPFPacket* packet, Interface* unused1 = NULL, Neighbor* unused2 = NULL);
00051
00052 void SendPacket (OSPFPacket* packet, IPv4Address destination, int outputIfIndex, short ttl = 1);
00053 void ClearTimer (OSPFTimer* timer);
00054 void StartTimer (OSPFTimer* timer, simtime_t delay);
00055
00056 void PrintEvent (const char* eventString, const Interface* onInterface = NULL, const Neighbor* forNeighbor = NULL) const;
00057 void PrintHelloPacket (const OSPFHelloPacket* helloPacket, IPv4Address destination, int outputIfIndex) const;
00058 void PrintDatabaseDescriptionPacket (const OSPFDatabaseDescriptionPacket* ddPacket, IPv4Address destination, int outputIfIndex) const;
00059 void PrintLinkStateRequestPacket (const OSPFLinkStateRequestPacket* requestPacket, IPv4Address destination, int outputIfIndex) const;
00060 void PrintLinkStateUpdatePacket (const OSPFLinkStateUpdatePacket* updatePacket, IPv4Address destination, int outputIfIndex) const;
00061 void PrintLinkStateAcknowledgementPacket(const OSPFLinkStateAcknowledgementPacket* ackPacket, IPv4Address destination, int outputIfIndex) const;
00062
00063
00064 bool AuthenticatePacket (OSPFPacket* packet) { return true; }
00065 };
00066
00067 }
00068
00069 #endif // __INET_MESSAGEHANDLER_H
00070