4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Philipp Batroff <pug@berlios.de>
29 \brief ICMPv6Packet public header */
31 #ifndef HH_SENF_Packets_DefaultBundle_ICMPv6Packet_
32 #define HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ 1
35 #include <senf/Packets/Packets.hh>
37 //#include "ICMPv6Packet.mpp"
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41 struct ICMPv6PacketParser : public PacketParserBase
43 # include SENF_FIXED_PARSER()
44 SENF_PARSER_FIELD ( type, UInt8Parser );
45 SENF_PARSER_FIELD ( code, UInt8Parser );
46 SENF_PARSER_FIELD ( checksum, UInt16Parser );
48 SENF_PARSER_FINALIZE ( ICMPv6PacketParser );
50 boost::uint16_t calcChecksum() const;
55 typedef boost::uint8_t key_t;
58 /** \brief ICMP Packet for IPv6
60 \par Packet type (typedef):
64 \ref ICMPv6PacketParser
65 \image html ICMPv6Packet.png
67 \par Associated registries:
70 \ingroup protocolbundle_default
72 struct ICMPv6PacketType
73 : public PacketTypeBase,
74 public PacketTypeMixin<ICMPv6PacketType, ICMPTypes>
76 typedef PacketTypeMixin<ICMPv6PacketType, ICMPTypes> mixin;
77 typedef ConcretePacket<ICMPv6PacketType> packet;
78 typedef ICMPv6PacketParser parser;
80 using mixin::nextPacketRange;
81 using mixin::nextPacketType;
83 using mixin::initSize;
85 static void dump(packet p, std::ostream & os);
87 static key_t nextPacketKey(packet p) {
91 static void finalize(packet p) {
92 p->type() << key(p.next(senf::nothrow));
93 p->checksum() << p->calcChecksum();
97 /** \brief ICMPv6 packet typedef
98 \ingroup protocolbundle_default
100 typedef ConcretePacket<ICMPv6PacketType> ICMPv6Packet;
103 //-/////////////////////////////////////////////////////////////////////////////////////////////////
104 //#include "IPv4Packet.cci"
105 //#include "IPv4Packet.ct"
106 //#include "IPv4Packet.cti"
113 // c-file-style: "senf"
114 // indent-tabs-mode: nil
115 // ispell-local-dictionary: "american"
116 // compile-command: "scons -u test"
117 // comment-column: 40