Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Packets / DefaultBundle / ICMPv6Packet.hh
1 // $Id$
2 //
3 // Copyright (C) 2008
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Philipp Batroff <pug@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief ICMPv6Packet public header */
25
26 #ifndef HH_SENF_Packets_DefaultBundle_ICMPv6Packet_
27 #define HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ 1
28
29 // Custom includes
30 #include <senf/Packets/Packets.hh>
31
32 //#include "ICMPv6Packet.mpp"
33 //-/////////////////////////////////////////////////////////////////////////////////////////////////
34 namespace senf
35 {
36     struct ICMPv6PacketParser : public PacketParserBase
37     {
38 #       include SENF_FIXED_PARSER()
39         SENF_PARSER_FIELD ( type,     UInt8Parser  );
40         SENF_PARSER_FIELD ( code,     UInt8Parser  );
41         SENF_PARSER_FIELD ( checksum, UInt16Parser );
42
43         SENF_PARSER_FINALIZE ( ICMPv6PacketParser );
44
45         boost::uint16_t calcChecksum() const;
46     };
47
48     struct ICMPTypes {
49         // ICMP type registry
50         typedef boost::uint8_t key_t;
51     };
52
53     /** \brief ICMP Packet for IPv6
54
55         \par Packet type (typedef):
56             \ref ICMPv6Packet
57
58         \par Fields:
59             \ref ICMPv6PacketParser
60             \image html ICMPv6Packet.png
61
62         \par Associated registries:
63             \ref ICMPTypes
64
65         \ingroup protocolbundle_default
66      */
67     struct ICMPv6PacketType
68         : public PacketTypeBase,
69           public PacketTypeMixin<ICMPv6PacketType, ICMPTypes>
70     {
71         typedef PacketTypeMixin<ICMPv6PacketType, ICMPTypes> mixin;
72         typedef ConcretePacket<ICMPv6PacketType> packet;
73         typedef ICMPv6PacketParser parser;
74
75         using mixin::nextPacketRange;
76         using mixin::nextPacketType;
77         using mixin::init;
78         using mixin::initSize;
79
80         static void dump(packet p, std::ostream & os);
81
82         static key_t nextPacketKey(packet p) {
83             return p->type();
84         }
85
86         static void finalize(packet p) {
87             p->type() << key(p.next(senf::nothrow));
88             p->checksum() << p->calcChecksum();
89         }
90     };
91
92     /** \brief ICMPv6 packet typedef
93         \ingroup protocolbundle_default
94      */
95     typedef ConcretePacket<ICMPv6PacketType> ICMPv6Packet;
96 }
97
98 //-/////////////////////////////////////////////////////////////////////////////////////////////////
99 //#include "IPv4Packet.cci"
100 //#include "IPv4Packet.ct"
101 //#include "IPv4Packet.cti"
102 #endif
103
104 \f
105 // Local Variables:
106 // mode: c++
107 // fill-column: 100
108 // c-file-style: "senf"
109 // indent-tabs-mode: nil
110 // ispell-local-dictionary: "american"
111 // compile-command: "scons -u test"
112 // comment-column: 40
113 // End:
114