4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Philipp Batroff <pug@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief ICMPv6Packet public header */
26 #ifndef HH_SENF_Packets_DefaultBundle_ICMPv6Packet_
27 #define HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ 1
30 #include <senf/Packets/Packets.hh>
32 //#include "ICMPv6Packet.mpp"
33 ///////////////////////////////hh.p////////////////////////////////////////
36 struct ICMPv6PacketParser : public PacketParserBase
38 # include SENF_FIXED_PARSER()
39 SENF_PARSER_FIELD ( type, UInt8Parser );
40 SENF_PARSER_FIELD ( code, UInt8Parser );
41 SENF_PARSER_FIELD ( checksum, UInt16Parser );
43 SENF_PARSER_FINALIZE ( ICMPv6PacketParser );
45 boost::uint16_t calcChecksum() const;
50 typedef boost::uint16_t key_t;
53 /** \brief ICMP Packet for IPv6
55 \par Packet type (typedef):
59 \ref ICMPv6PacketParser
60 \image html ICMPv6Packet.png
62 \par Associated registries:
65 \ingroup protocolbundle_default
67 struct ICMPv6PacketType
68 : public PacketTypeBase,
69 public PacketTypeMixin<ICMPv6PacketType, ICMPTypes>
71 typedef PacketTypeMixin<ICMPv6PacketType, ICMPTypes> mixin;
72 typedef ConcretePacket<ICMPv6PacketType> packet;
73 typedef ICMPv6PacketParser parser;
75 using mixin::nextPacketRange;
76 using mixin::nextPacketType;
78 using mixin::initSize;
80 static void dump(packet p, std::ostream & os);
82 static key_t nextPacketKey(packet p) {
86 static void finalize(packet p) {
87 p->checksum() << p->calcChecksum();
88 p->type() << key(p.next(senf::nothrow));
92 typedef ConcretePacket<ICMPv6PacketType> ICMPv6Packet;
95 ///////////////////////////////hh.e////////////////////////////////////////
96 //#include "IPv4Packet.cci"
97 //#include "IPv4Packet.ct"
98 //#include "IPv4Packet.cti"
105 // c-file-style: "senf"
106 // indent-tabs-mode: nil
107 // ispell-local-dictionary: "american"
108 // compile-command: "scons -u test"
109 // comment-column: 40