ICMPv6.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2005 Andras Varga
00003 // Copyright (C) 2005 Wei Yang, Ng
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 __ICMPv6_H__
00021 #define __ICMPv6_H__
00022 
00023 #include <omnetpp.h>
00024 #include "RoutingTable6Access.h"
00025 #include "IPv6Datagram.h"
00026 #include "ICMPv6Message_m.h"
00027 #include "IPv6ControlInfo.h"
00028 
00029 
00033 class INET_API ICMPv6 : public cSimpleModule
00034 {
00035   public:
00049     virtual void sendErrorMessage(IPv6Datagram *datagram, ICMPv6Type type, int code);
00050 
00058     virtual void sendErrorMessage(cPacket *transportPacket, IPv6ControlInfo *ctrl, ICMPv6Type type, int code);
00059 
00060   protected:
00061     // internal helper functions
00062     virtual void sendToIP(ICMPv6Message *msg, const IPv6Address& dest);
00063     virtual void sendToIP(ICMPv6Message *msg); // FIXME check if really needed
00064 
00065     virtual ICMPv6Message *createDestUnreachableMsg(int code);
00066     virtual ICMPv6Message *createPacketTooBigMsg(int mtu);
00067     virtual ICMPv6Message *createTimeExceededMsg(int code);
00068     virtual ICMPv6Message *createParamProblemMsg(int code);//TODO:Section 3.4 describes a pointer. What is it?
00069 
00070   protected:
00074     virtual void initialize();
00075 
00080     virtual void handleMessage(cMessage *msg);
00081     virtual void processICMPv6Message(ICMPv6Message *);
00082 
00086     virtual void processEchoRequest(ICMPv6EchoRequestMsg *);
00087 
00091     virtual void processEchoReply(ICMPv6EchoReplyMsg *);
00092 
00097     virtual void sendEchoRequest(cPacket *);
00098 
00102     virtual bool validateDatagramPromptingError(IPv6Datagram *datagram);
00103 
00104     virtual void errorOut(ICMPv6Message *);
00105 };
00106 
00107 
00108 #endif
00109 
00110