X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FIPv6Extensions.hh;h=aa2d3314300c50349aba325f5e05d39d1dfab5e3;hb=fd3a0e8ac95d1158e9ea661ddf9187b67c70169f;hp=f768c1b621e79f746189792d0eb3f9306c0f2e17;hpb=a26b7c3df863b1966c5d933d00e23248e7fc9116;p=senf.git diff --git a/Packets/DefaultBundle/IPv6Extensions.hh b/Packets/DefaultBundle/IPv6Extensions.hh index f768c1b..aa2d331 100644 --- a/Packets/DefaultBundle/IPv6Extensions.hh +++ b/Packets/DefaultBundle/IPv6Extensions.hh @@ -150,11 +150,11 @@ The Type 0 Routing header has the following format: (RFC 2460) */ # include SENF_PARSER() - SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); - SENF_PARSER_FIELD ( headerLength, UInt8Parser ); - SENF_PARSER_FIELD ( routingType, UInt8Parser ); //set to Zero for minimal implementation - SENF_PARSER_FIELD_RO ( segmentsLeft, UInt8Parser ); - SENF_PARSER_FIELD ( reserved, UInt32Parser ); //set to zero by RFC + SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); + SENF_PARSER_FIELD ( headerLength, UInt8Parser ); + SENF_PARSER_FIELD ( routingType, UInt8Parser ); //set to Zero for minimal implementation + SENF_PARSER_FIELD_RO ( segmentsLeft, UInt8Parser ); + SENF_PARSER_FIELD ( reserved, UInt32Parser ); //set to zero by RFC SENF_PARSER_VECTOR ( hopAddresses, segmentsLeft, INet6AddressParser ); SENF_PARSER_FINALIZE ( IPv6PacketParserExtension_Routing ); @@ -229,8 +229,8 @@ The Type 0 Routing header has the following format: (RFC 2460) struct IPv6PacketParserExtension_HopByHop : public PacketParserBase { # include SENF_PARSER() - SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); - SENF_PARSER_FIELD ( headerLength, UInt8Parser ); + SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); + SENF_PARSER_FIELD ( headerLength, UInt8Parser ); SENF_PARSER_FINALIZE ( IPv6PacketParserExtension_HopByHop ); }; @@ -281,6 +281,74 @@ The Type 0 Routing header has the following format: (RFC 2460) /** \brief IPv6 routing Hop-By-Hop packet typedef */ typedef ConcretePacket IPv6Extension_HopByHop; +// ===================================================================================================== + + /** \brief Parse in IPv6 Destination Options extension header + + Parser implementing the IPv6 Destination Options Header extension. The fields implemented are: + \image html IPv6Extensions_Destination.png + + \see IPv6ExtensionType_Destination \n + RFC 2460 + */ + + // Destination Options skeleton without TLV-Options + + struct IPv6PacketParserExtension_Destination : public PacketParserBase { +# include SENF_PARSER() + SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); + SENF_PARSER_FIELD ( headerLength, UInt8Parser ); + + SENF_PARSER_FINALIZE ( IPv6PacketParserExtension_Destination ); + }; + + /** \brief IPv6 Destination Options extension + + \par Packet type (typedef): + \ref IPv6Extension_Destination + + \par Fields: + \ref IPv6PacketParserExtension_Destination + + \par Associated registries: + \ref IpTypes + + \par Finalize action: + Set \a nextHeader from type of next packet if found in \ref IpTypes + + \ingroup protocolbundle_default + */ + + struct IPv6ExtensionType_Destination + : public PacketTypeBase, + public PacketTypeMixin + { +#ifndef DOXYGEN + typedef PacketTypeMixin mixin; +#endif + /** \brief IPv6 Destination Options extension packet typedef */ + typedef ConcretePacket packet; + /** \brief typedef to the parser of IPv6 Destination Options extension packet */ + typedef IPv6PacketParserExtension_Destination parser; + + using mixin::nextPacketRange; + using mixin::nextPacketType; + using mixin::init; + using mixin::initSize; + + static key_t nextPacketKey(packet p) + { return p->nextHeader(); } + /** \brief Dump given IPv6Extension_Destination in readable form to given output stream */ + static void dump(packet p, std::ostream & os); + + static void finalize(packet p) { + p->nextHeader() << key(p.next(nothrow)); } + }; + + /** \brief IPv6 routing Destination Options packet typedef */ + typedef ConcretePacket IPv6Extension_Destination; + + } //namespace senf ///////////////////////////////hh.e//////////////////////////////////////// #endif