X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FDefaultBundle%2FICMPv6Packet.hh;h=91aea0b60847b942a100d3067c09d79a8fdb79d0;hb=5cb66935d4b2973ea0fe7487b862b9ddc31648f4;hp=bc7d9c2fd3d3bb22fd7956294fc480b0551cfdd1;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Packets/DefaultBundle/ICMPv6Packet.hh b/senf/Packets/DefaultBundle/ICMPv6Packet.hh index bc7d9c2..91aea0b 100644 --- a/senf/Packets/DefaultBundle/ICMPv6Packet.hh +++ b/senf/Packets/DefaultBundle/ICMPv6Packet.hh @@ -27,11 +27,11 @@ #define HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ 1 // Custom includes -#include "../../Packets/Packets.hh" +#include //#include "ICMPv6Packet.mpp" -///////////////////////////////hh.p//////////////////////////////////////// -namespace senf +//-///////////////////////////////////////////////////////////////////////////////////////////////// +namespace senf { struct ICMPv6PacketParser : public PacketParserBase { @@ -39,15 +39,15 @@ namespace senf SENF_PARSER_FIELD ( type, UInt8Parser ); SENF_PARSER_FIELD ( code, UInt8Parser ); SENF_PARSER_FIELD ( checksum, UInt16Parser ); - + SENF_PARSER_FINALIZE ( ICMPv6PacketParser ); - + boost::uint16_t calcChecksum() const; }; - + struct ICMPTypes { // ICMP type registry - typedef boost::uint16_t key_t; + typedef boost::uint8_t key_t; }; /** \brief ICMP Packet for IPv6 @@ -58,41 +58,44 @@ namespace senf \par Fields: \ref ICMPv6PacketParser \image html ICMPv6Packet.png - + \par Associated registries: \ref ICMPTypes \ingroup protocolbundle_default */ - struct ICMPv6PacketType + struct ICMPv6PacketType : public PacketTypeBase, public PacketTypeMixin { typedef PacketTypeMixin mixin; typedef ConcretePacket packet; typedef ICMPv6PacketParser parser; - + using mixin::nextPacketRange; using mixin::nextPacketType; using mixin::init; using mixin::initSize; - + static void dump(packet p, std::ostream & os); - - static key_t nextPacketKey(packet p) { + + static key_t nextPacketKey(packet p) { return p->type(); } - + static void finalize(packet p) { - p->checksum() << p->calcChecksum(); p->type() << key(p.next(senf::nothrow)); + p->checksum() << p->calcChecksum(); } }; - + + /** \brief ICMPv6 packet typedef + \ingroup protocolbundle_default + */ typedef ConcretePacket ICMPv6Packet; } -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// //#include "IPv4Packet.cci" //#include "IPv4Packet.ct" //#include "IPv4Packet.cti"