X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FDefaultBundle%2FICMPv6Packet.hh;h=91aea0b60847b942a100d3067c09d79a8fdb79d0;hb=57daeae6f2e924ce3f16f9677c3474f531cba9e5;hp=0c8586b03a312436033b7916fcff144548bb66ab;hpb=26610f603ebdd465307b9621f532c1fe19fd5571;p=senf.git diff --git a/senf/Packets/DefaultBundle/ICMPv6Packet.hh b/senf/Packets/DefaultBundle/ICMPv6Packet.hh index 0c8586b..91aea0b 100644 --- a/senf/Packets/DefaultBundle/ICMPv6Packet.hh +++ b/senf/Packets/DefaultBundle/ICMPv6Packet.hh @@ -30,8 +30,8 @@ #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"