ICMP.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2000 Institut fuer Telematik, Universitaet Karlsruhe
00003 // Copyright (C) 2004 Andras Varga
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with this program; if not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 
00020 #ifndef __INET_ICMP_H
00021 #define __INET_ICMP_H
00022 
00023 //  Cleanup and rewrite: Andras Varga, 2004
00024 
00025 #include "RoutingTableAccess.h"
00026 #include "ICMPMessage.h"
00027 
00028 class IPDatagram;
00029 class IPControlInfo;
00030 
00031 
00035 class INET_API ICMP : public cSimpleModule
00036 {
00037   protected:
00038     RoutingTableAccess routingTableAccess;
00039 
00040     virtual void processICMPMessage(ICMPMessage *);
00041     virtual void errorOut(ICMPMessage *);
00042     virtual void processEchoRequest (ICMPMessage *);
00043     virtual void processEchoReply (ICMPMessage *);
00044     virtual void sendEchoRequest(cPacket *);
00045     virtual void sendToIP(ICMPMessage *, const IPAddress& dest);
00046     virtual void sendToIP(ICMPMessage *msg);
00047 
00048   public:
00053     virtual void sendErrorMessage(IPDatagram *datagram, ICMPType type, ICMPCode code);
00054 
00062     virtual void sendErrorMessage(cPacket *transportPacket, IPControlInfo *ctrl, ICMPType type, ICMPCode code);
00063 
00064   protected:
00065     virtual void handleMessage(cMessage *msg);
00066 
00067 };
00068 
00069 #endif
00070