X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FICMPv6Packet.hh;h=032bfa32f1803caaacccaa4dfdcd8121b7a05cc5;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=ad8bb00f6477a0bb417e56174cc331d8d749e245;hpb=ccc827edda90ace7d2f8564660ee26b09a5a23b5;p=senf.git diff --git a/Packets/DefaultBundle/ICMPv6Packet.hh b/Packets/DefaultBundle/ICMPv6Packet.hh index ad8bb00..032bfa3 100644 --- a/Packets/DefaultBundle/ICMPv6Packet.hh +++ b/Packets/DefaultBundle/ICMPv6Packet.hh @@ -1,7 +1,9 @@ +// $Id$ +// // Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Philipp Batroff +// Philipp Batroff // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -18,40 +20,57 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#ifndef HH_ICMPV6Packet -#define HH_ICMPV6Packet +/** \file + \brief ICMPv6Packet public header */ + +#ifndef HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ +#define HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ 1 // Custom includes #include "../../Packets/Packets.hh" -#include "../../Packets/DefaultBundle/IPv6Packet.hh" -namespace senf{ - struct ICMPV6PacketParser : public senf::PacketParserBase +//#include "ICMPv6Packet.mpp" +///////////////////////////////hh.p//////////////////////////////////////// +namespace senf +{ + struct ICMPv6PacketParser : public PacketParserBase { - # include SENF_FIXED_PARSER() - SENF_PARSER_FIELD ( type, senf::UInt8Parser ); - SENF_PARSER_FIELD ( code, senf::UInt8Parser ); - SENF_PARSER_PRIVATE_FIELD ( checksum, senf::UInt16Parser); - - SENF_PARSER_FINALIZE ( ICMPV6PacketParser ); +# include SENF_FIXED_PARSER() + SENF_PARSER_FIELD ( type, UInt8Parser ); + SENF_PARSER_FIELD ( code, UInt8Parser ); + SENF_PARSER_FIELD ( checksum, UInt16Parser ); - void calcChecksum() const; - boost::uint16_t checksumOutput() const - { return this->checksum();} + SENF_PARSER_FINALIZE ( ICMPv6PacketParser ); + + boost::uint16_t calcChecksum() const; }; - struct ICMPTypes { - // ICMP type registry - typedef boost::uint16_t key_t; - }; - - struct ICMPV6PacketType - : public senf::PacketTypeBase, - public senf::PacketTypeMixin + struct ICMPTypes { + // ICMP type registry + typedef boost::uint16_t key_t; + }; + + /** \brief ICMP Packet for IPv6 + + \par Packet type (typedef): + \ref ICMPv6Packet + + \par Fields: + \ref ICMPv6PacketParser + \image html ICMPv6Packet.png + + \par Associated registries: + \ref ICMPTypes + + \ingroup protocolbundle_default + */ + struct ICMPv6PacketType + : public PacketTypeBase, + public PacketTypeMixin { - typedef senf::PacketTypeMixin mixin; - typedef senf::ConcretePacket packet; - typedef ICMPV6PacketParser parser; + typedef PacketTypeMixin mixin; + typedef ConcretePacket packet; + typedef ICMPv6PacketParser parser; using mixin::nextPacketRange; using mixin::nextPacketType; @@ -59,15 +78,36 @@ namespace senf{ using mixin::initSize; static void dump(packet p, std::ostream & os); - static senf::IpTypes::key_t nextPacketKey(packet p) { + + static key_t nextPacketKey(packet p) { return p->type(); } + static void finalize(packet p) { - p->calcChecksum(); + p->checksum() << p->calcChecksum(); p->type() << key(p.next(senf::nothrow)); } }; - typedef ICMPV6PacketType::packet ICMPv6Packet; + typedef ConcretePacket ICMPv6Packet; } + +///////////////////////////////hh.e//////////////////////////////////////// +#endif +#ifndef SENF_PACKETS_DECL_ONLY +//#include "IPv4Packet.cci" +//#include "IPv4Packet.ct" +//#include "IPv4Packet.cti" #endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: +