+// $Id$
+//
// Copyright (C) 2008
// Fraunhofer Institute for Open Communication Systems (FOKUS)
// Competence Center NETwork research (NET), St. Augustin, GERMANY
-// Philipp Batroff <Philipp.Batroff@fokus.fraunhofer.de>
+// Philipp Batroff <pug@berlios.de>
//
// 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
// 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<ICMPV6PacketType, ICMPTypes>
+ 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<ICMPv6PacketType, ICMPTypes>
{
- typedef senf::PacketTypeMixin<ICMPV6PacketType, ICMPTypes> mixin;
- typedef senf::ConcretePacket<ICMPV6PacketType> packet;
- typedef ICMPV6PacketParser parser;
+ typedef PacketTypeMixin<ICMPv6PacketType, ICMPTypes> mixin;
+ typedef ConcretePacket<ICMPv6PacketType> packet;
+ typedef ICMPv6PacketParser parser;
using mixin::nextPacketRange;
using mixin::nextPacketType;
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<ICMPv6PacketType> ICMPv6Packet;
}
+
+///////////////////////////////hh.e////////////////////////////////////////
+#endif
+#ifndef SENF_PACKETS_DECL_ONLY
+//#include "IPv4Packet.cci"
+//#include "IPv4Packet.ct"
+//#include "IPv4Packet.cti"
#endif
+
+\f
+// 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:
+