Packets/DefaultBundle: fixed names of IPv6 Extension Header classes
tho [Wed, 23 Sep 2009 11:06:35 +0000 (11:06 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1431 270642c3-0616-0410-b53a-bc976706d245

senf/Packets/DefaultBundle/IPv6ExtOptionType.cc
senf/Packets/DefaultBundle/IPv6ExtOptionType.ct
senf/Packets/DefaultBundle/IPv6ExtOptionType.hh
senf/Packets/DefaultBundle/IPv6Extensions.cc
senf/Packets/DefaultBundle/IPv6Extensions.hh
senf/Packets/DefaultBundle/IPv6Extensions.test.cc
senf/Packets/DefaultBundle/ListOptionTypeParser.test.cc

index cde5f4e..96e10e4 100644 (file)
@@ -1,6 +1,6 @@
 // $Id: IPv6ExtOptionType.cc 869 2008-06-09 13:57:27Z pug $
 //
-// Copyright (C) 2007
+// Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Philipp.Batroff@fokus.fraunhofer.de
@@ -27,7 +27,7 @@
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-prefix_  senf::PacketInterpreterBase::range senf::GenericOptTypeTLVParser::value() const {
+prefix_  senf::PacketInterpreterBase::range senf::IPv6GenericOptionTLVParser::value() const {
     senf::PacketData::iterator begin (boost::next(i(), 2 ));
     return PacketInterpreterBase::range(begin, boost::next( begin, optionLength()) );
 }
index 6cb4c62..95dc085 100644 (file)
@@ -1,6 +1,6 @@
 // $Id: IPv6ExtOptionType.ct 869 2008-06-09 13:57:27Z pug $
 //
-// Copyright (C) 2007
+// Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Philipp.Batroff@fokus.fraunhofer.de
@@ -31,7 +31,7 @@
 ///////////////////////////////ct.p////////////////////////////////////////
 
 template <class ForwardReadableRange>
-prefix_ void senf::GenericOptTypeTLVParser::value(ForwardReadableRange const &range)
+prefix_ void senf::IPv6GenericOptionTLVParser::value(ForwardReadableRange const &range)
 {
     unsigned int rangeSize = boost::size(range);
     safe_data_iterator si( data(),  boost::next(i(), 2 + optionLength() ) );
@@ -50,7 +50,7 @@ prefix_ void senf::GenericOptTypeTLVParser::value(ForwardReadableRange const &ra
 }
 
 template <class ForwardReadableRange>
-prefix_ void senf::GenericOptTypeTLVParser::setPayload(ForwardReadableRange const &range)
+prefix_ void senf::IPv6GenericOptionTLVParser::setPayload(ForwardReadableRange const &range)
 {
     unsigned int rangeSize = boost::size(range);
     if ( rangeSize != optionLength() )
@@ -62,7 +62,7 @@ prefix_ void senf::GenericOptTypeTLVParser::setPayload(ForwardReadableRange cons
 
 
 template <class Parser>
-prefix_ Parser& senf::GenericOptTypeTLVParser::init()
+prefix_ Parser& senf::IPv6GenericOptionTLVParser::init()
 {
     size_type oldSize ( bytes() );
     safe_data_iterator j( data(), i() );
index 0811d11..27be018 100644 (file)
@@ -33,7 +33,7 @@
 ///////////////////////////////hh.p////////////////////////////////////////
 namespace senf {
 
-    class OptTypeTLVParser : public PacketParserBase
+    class IPv6OptionTLVParser : public PacketParserBase
     {
     public:
 #       include SENF_PARSER()
@@ -41,15 +41,15 @@ namespace senf {
         SENF_PARSER_BITFIELD (changeFlag, 1, unsigned);
         SENF_PARSER_BITFIELD (optionType, 5, unsigned);
         SENF_PARSER_FIELD (optionLength, UInt8Parser);
-        SENF_PARSER_FINALIZE (OptTypeTLVParser);
+        SENF_PARSER_FINALIZE (IPv6OptionTLVParser);
     };
 
-    struct GenericOptTypeTLVParser : public OptTypeTLVParser
+    struct IPv6GenericOptionTLVParser : public IPv6OptionTLVParser
     {
 #       include SENF_PARSER()
-        SENF_PARSER_INHERIT ( OptTypeTLVParser );
+        SENF_PARSER_INHERIT ( IPv6OptionTLVParser );
         SENF_PARSER_SKIP ( optionLength(), 0 );
-        SENF_PARSER_FINALIZE ( GenericOptTypeTLVParser );
+        SENF_PARSER_FINALIZE ( IPv6GenericOptionTLVParser );
 
         senf::PacketInterpreterBase::range value() const;
 
@@ -66,7 +66,6 @@ namespace senf {
 
         template<class ForwardReadableRange>
         void setPayload(ForwardReadableRange const &range);
-
     };
 
 }
index b786f71..270a307 100644 (file)
@@ -5,6 +5,7 @@
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 //     Philipp Batroff <philipp.batroff@fokus.fraunhofer.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
 // the Free Software Foundation; either version 2 of the License, or
 ///////////////////////////////cc.p////////////////////////////////////////
 
 namespace {
-    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Fragment>
-        registerIPv6FragmentType (44);
-    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Routing>
-        registerIPv6RoutingType (43);
-    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6HopByHop>
-        registerIPv6HopByHopType (0u);
-    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Destination>
-        registerIPv6DestinationType (60u);
+    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6FragmentPacket>
+        registerIPv6FragmentPacketType (44);
+    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6RoutingPacket>
+        registerIPv6RoutingPacketType (43);
+    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6HopByHopOptionsPacket>
+        registerIPv6HopByHopOptionsPacketType (0u);
+    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6DestinationOptionsPacket>
+        registerIPv6DestinationOptionsPacketType (60u);
 }
 
-prefix_ void senf::IPv6FragmentType::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6FragmentPacketType::dump(packet p, std::ostream & os)
 {
     os << "Internet protocol Version 6 fragment extension:\n"
        <<     "  next header             : " << unsigned(p->nextHeader()) << "\n"
@@ -52,39 +53,40 @@ prefix_ void senf::IPv6FragmentType::dump(packet p, std::ostream & os)
        <<     "  id                      : " << std::hex << unsigned(p->id()) << "\n";
 }
 
-prefix_ void senf::IPv6RoutingType::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6RoutingPacketType::dump(packet p, std::ostream & os)
 {
     os << "Internet protocol Version 6 routing extension:\n"
        <<     "  next header             : " << unsigned (p->nextHeader()) << "\n"
        <<     "  header length           : " << unsigned (p->headerLength()) << "\n"
        <<     "  routing type            : " << unsigned (p->routingType()) << "\n"
-       <<     "  segments left           : " << unsigned (p->segmentsLeft()) << "\n";
-    IPv6Routing::Parser::hopAddresses_t::container hopAddresses (p->hopAddresses());
-    os <<     "  further Hop Addresses   : \n";
-        if ( p->segmentsLeft() != 0 ){
-            for (IPv6Routing::Parser::hopAddresses_t::container::iterator i (hopAddresses.begin()); i != hopAddresses.end(); ++i)
-                os << *i << "\n";
-        }
+       <<     "  segments left           : " << unsigned (p->segmentsLeft()) << "\n"
+       <<     "  further Hop Addresses   : \n";
+    typedef IPv6RoutingPacket::Parser::hopAddresses_t::container addrContainer_t;
+    addrContainer_t hopAddresses (p->hopAddresses());
+    if ( p->segmentsLeft() != 0 )
+        for (addrContainer_t::iterator i (hopAddresses.begin()); i != hopAddresses.end(); ++i)
+            os << *i << "\n";
 }
 
-prefix_ void senf::IPv6HopByHopType::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6HopByHopOptionsPacketType::dump(packet p, std::ostream & os)
 {
     os << "Internet protocol Version 6 Hop-By-Hop extension:\n"
        <<     "  next header             : " << unsigned (p->nextHeader()) << "\n"
        <<     "  header length           : " << unsigned (p->headerLength()) << "\n";
-       os << "  OptionTypes:\n";
-       IPv6HopByHop::Parser::options_t::container options (p->options());
-       IPv6HopByHop::Parser::options_t::container::iterator optIter(options.begin());
-       for(;optIter != options.end(); ++optIter){
-           os << "    AltAction             : " << (unsigned) optIter->altAction()
-             << "\n    ChangeFlag            : " << (unsigned) optIter->changeFlag()
-             << "\n    Option Type           : " << (unsigned) optIter->optionType()
-             << "\n    OptionLength          : " << (unsigned)  optIter->optionLength() <<"\n";
-           senf::hexdump(boost::begin(optIter->value()) , boost::end(optIter->value()), os );
-       }
+    os <<     "  OptionTypes:\n";
+    typedef IPv6HopByHopOptionsPacket::Parser::options_t::container optContainer_t;
+    optContainer_t options (p->options());
+    optContainer_t::iterator optIter(options.begin());
+    for(; optIter != options.end(); ++optIter) {
+        os << "    AltAction             : " << (unsigned) optIter->altAction()
+           << "\n    ChangeFlag            : " << (unsigned) optIter->changeFlag()
+           << "\n    Option Type           : " << (unsigned) optIter->optionType()
+           << "\n    OptionLength          : " << (unsigned)  optIter->optionLength() <<"\n";
+        senf::hexdump(boost::begin(optIter->value()) , boost::end(optIter->value()), os );
+    }
 }
 
-prefix_ void senf::IPv6DestinationType::dump(packet p, std::ostream & os)
+prefix_ void senf::IPv6DestinationOptionsPacketType::dump(packet p, std::ostream & os)
 {
     os << "Internet protocol Version 6 Destination Options extension:\n"
        <<     "  next header             : " << unsigned (p->nextHeader()) << "\n"
index b08ca4b..7d1aab6 100644 (file)
@@ -5,6 +5,7 @@
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 //     Philipp Batroff <philipp.batroff@fokus.fraunhofer.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
 // the Free Software Foundation; either version 2 of the License, or
@@ -63,10 +64,10 @@ namespace senf {
     /** \brief IPv6 fragment extension
 
         \par Packet type (typedef):
-            \ref IPv6Extension_Fragment
+            \ref IPv6FragmentPacket
 
         \par Fields:
-            \ref IPv6PacketParserExtension_Fragment
+            \ref IPv6FragmentPacketParser
         
         \par Associated registries:
             \ref IpTypes
@@ -76,15 +77,15 @@ namespace senf {
 
         \ingroup protocolbundle_default
      */
-    struct IPv6FragmentType
+    struct IPv6FragmentPacketType
         : public PacketTypeBase,
-          public PacketTypeMixin<IPv6FragmentType, IpTypes>
+          public PacketTypeMixin<IPv6FragmentPacketType, IpTypes>
     {
 #ifndef DOXYGEN
-        typedef PacketTypeMixin<IPv6FragmentType, IpTypes> mixin;
+        typedef PacketTypeMixin<IPv6FragmentPacketType, IpTypes> mixin;
 #endif
         /** \brief IPv6 fragment extension packet typedef */
-        typedef ConcretePacket<IPv6FragmentType> packet;
+        typedef ConcretePacket<IPv6FragmentPacketType> packet;
         /** \brief typedef to the parser of IPv6 fragment extension packet */
         typedef IPv6FragmentPacketParser parser;
 
@@ -96,7 +97,7 @@ namespace senf {
         static key_t nextPacketKey(packet p) 
             { return p->nextHeader(); }
         
-        /** \brief Dump given IPv6Extension_Fragment in readable form to given output stream */
+        /** \brief Dump given IPv6FragmentPacket in readable form to given output stream */
         static void dump(packet p, std::ostream & os); 
 
         static void finalize(packet p) { 
@@ -104,52 +105,50 @@ namespace senf {
     };
 
     /** \brief IPv6 fragment extension packet typedef */
-    typedef ConcretePacket<IPv6FragmentType> IPv6Fragment;
+    typedef ConcretePacket<IPv6FragmentPacketType> IPv6FragmentPacket;
 
 // =====================================================================================================
 
     /** \brief Parse in IPv6 routing extension header
 
-        Parser implementing the IPv6 routing Header extension. The fields implemented are:
+        Parser implementing the IPv6 routing Header extension (type 0 only).
+        The fields implemented are:
         \image html IPv6Extensions_Routing.png
 
         \see IPv6ExtensionType_Routing \n
-        <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+            <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
      */
-
-//Routing Header Extension (type 0 only)
     struct IPv6PRoutingPacketParser : public PacketParserBase
     {
-/*
-The Type 0 Routing header has the following format: (RFC 2460)
-
-    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    |  Next Header  |  Hdr Ext Len  | Routing Type=0| Segments Left |
-    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    |                            Reserved                           |
-    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    |                                                               |
-    +                                                               +
-    |                                                               |
-    +                           Address[1]                          +
-    |                                                               |
-    +                                                               +
-    |                                                               |
-    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    .                               .                               .
-    .                               .                               .
-    .                               .                               .
-    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    |                                                               |
-    +                                                               +
-    |                                                               |
-    +                           Address[n]                          +
-    |                                                               |
-    +                                                               +
-    |                                                               |
-    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-*/
+        /*
+        The Type 0 Routing header has the following format: (RFC 2460)
+
+        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+        |  Next Header  |  Hdr Ext Len  | Routing Type=0| Segments Left |
+        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+        |                            Reserved                           |
+        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+        |                                                               |
+        +                                                               +
+        |                                                               |
+        +                           Address[1]                          +
+        |                                                               |
+        +                                                               +
+        |                                                               |
+        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+        .                               .                               .
+        .                               .                               .
+        .                               .                               .
+        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+        |                                                               |
+        +                                                               +
+        |                                                               |
+        +                           Address[n]                          +
+        |                                                               |
+        +                                                               +
+        |                                                               |
+        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+        */
 #       include SENF_PARSER()
         
         SENF_PARSER_FIELD ( nextHeader, UInt8Parser      );
@@ -171,29 +170,28 @@ The Type 0 Routing header has the following format: (RFC 2460)
     /** \brief IPv6 routing extension
 
         \par Packet type (typedef):
-    \ref IPv6Extension_Routing
+            \ref IPv6RoutingPacket
 
         \par Fields:
-    \ref IPv6PacketParserExtension_Routing
+            \ref IPv6PRoutingPacketParser
         
         \par Associated registries:
-    \ref IpTypes
+            \ref IpTypes
         
         \par Finalize action:
-    Set \a nextHeader from type of next packet if found in \ref IpTypes
+            Set \a nextHeader from type of next packet if found in \ref IpTypes
 
-    \ingroup protocolbundle_default
-         */
-    
-    struct IPv6RoutingType
+        \ingroup protocolbundle_default
+     */
+    struct IPv6RoutingPacketType
     :   public PacketTypeBase,
-        public PacketTypeMixin<IPv6RoutingType, IpTypes>
+        public PacketTypeMixin<IPv6RoutingPacketType, IpTypes>
     {
 #ifndef DOXYGEN
-        typedef PacketTypeMixin<IPv6RoutingType, IpTypes> mixin;
+        typedef PacketTypeMixin<IPv6RoutingPacketType, IpTypes> mixin;
 #endif
         /** \brief IPv6 routing extension packet typedef */
-        typedef ConcretePacket<IPv6RoutingType> packet;
+        typedef ConcretePacket<IPv6RoutingPacketType> packet;
         /** \brief typedef to the parser of IPv6 routing extension packet */
         typedef IPv6PRoutingPacketParser parser;
         
@@ -204,7 +202,7 @@ The Type 0 Routing header has the following format: (RFC 2460)
         
         static key_t nextPacketKey(packet p) 
             { return p->nextHeader(); }
-        /** \brief Dump given IPv6Extension_Routing in readable form to given output stream */
+        /** \brief Dump given IPv6RoutingPacket in readable form to given output stream */
         static void dump(packet p, std::ostream & os); 
         
         static void finalize(packet p) { 
@@ -212,7 +210,7 @@ The Type 0 Routing header has the following format: (RFC 2460)
     };
     
     /** \brief IPv6 routing extension packet typedef */
-    typedef ConcretePacket<IPv6RoutingType> IPv6Routing;
+    typedef ConcretePacket<IPv6RoutingPacketType> IPv6RoutingPacket;
 
     
 // =====================================================================================================
@@ -220,56 +218,54 @@ The Type 0 Routing header has the following format: (RFC 2460)
     /** \brief Parse in IPv6 Hop-By-Hop extension header
 
         Parser implementing the IPv6 routing Header extension. The fields implemented are:
-    \image html IPv6Extensions_HopByHop.png
+        \image html IPv6Extensions_HopByHop.png
 
-    \see IPv6ExtensionType_HopByHop \n
-    <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+        \see IPv6ExtensionType_HopByHop \n
+            <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
     */
-
-// Hop-By-Hop Extension Header
-
-    struct IPv6HopByHopPacketParser : public PacketParserBase {
+    struct IPv6HopByHopOptionsPacketParser : public PacketParserBase {
 #       include SENF_PARSER()
+      
         SENF_PARSER_FIELD ( nextHeader, UInt8Parser   );
         SENF_PARSER_FIELD ( headerLength, UInt8Parser );
 
         typedef detail::FixedAuxParserPolicy<UInt8Parser, 1u> ListOptionTypeAuxPolicy;
-        typedef detail::ListOptionTypeParser_Policy<GenericOptTypeTLVParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
+        typedef detail::ListOptionTypeParser_Policy<
+            IPv6GenericOptionTLVParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
         typedef ListParser<ListOptionTypePolicy> ListOptionTypeParser;
 
         SENF_PARSER_FIELD  ( options, ListOptionTypeParser);
 
-        SENF_PARSER_FINALIZE ( IPv6HopByHopPacketParser );
+        SENF_PARSER_FINALIZE ( IPv6HopByHopOptionsPacketParser );
     };
     
     /** \brief IPv6 Hop-By-Hop extension
 
         \par Packet type (typedef):
-    \ref IPv6Extension_HopByHop
+            \ref IPv6HopByHopOptionsPacket
 
         \par Fields:
-    \ref IPv6PacketParserExtension_HopByHop
+            \ref IPv6HopByHopOptionsPacketParser
         
         \par Associated registries:
-    \ref IpTypes
+            \ref IpTypes
         
         \par Finalize action:
-    Set \a nextHeader from type of next packet if found in \ref IpTypes
+            Set \a nextHeader from type of next packet if found in \ref IpTypes
 
-    \ingroup protocolbundle_default
+        \ingroup protocolbundle_default
     */
-    
-    struct IPv6HopByHopType
+    struct IPv6HopByHopOptionsPacketType
     :   public PacketTypeBase,
-        public PacketTypeMixin<IPv6HopByHopType, IpTypes>
+        public PacketTypeMixin<IPv6HopByHopOptionsPacketType, IpTypes>
     {
 #ifndef DOXYGEN
-        typedef PacketTypeMixin<IPv6HopByHopType, IpTypes> mixin;
+        typedef PacketTypeMixin<IPv6HopByHopOptionsPacketType, IpTypes> mixin;
 #endif
         /** \brief IPv6 Hop-By-Hop extension packet typedef */
-        typedef ConcretePacket<IPv6HopByHopType> packet;
+        typedef ConcretePacket<IPv6HopByHopOptionsPacketType> packet;
         /** \brief typedef to the parser of IPv6 Hop-By-Hop extension packet */
-        typedef IPv6HopByHopPacketParser parser;
+        typedef IPv6HopByHopOptionsPacketParser parser;
         
         using mixin::nextPacketRange;
         using mixin::nextPacketType;
@@ -278,7 +274,8 @@ The Type 0 Routing header has the following format: (RFC 2460)
         
         static key_t nextPacketKey(packet p) 
         { return p->nextHeader(); }
-        /** \brief Dump given IPv6Extension_HopByHop in readable form to given output stream */
+        
+        /** \brief Dump given IPv6HopByHopOptionsPacket in readable form to given output stream */
         static void dump(packet p, std::ostream & os); 
         
         static void finalize(packet p) { 
@@ -286,58 +283,55 @@ The Type 0 Routing header has the following format: (RFC 2460)
     };
     
     /** \brief IPv6 routing Hop-By-Hop packet typedef */
-    typedef ConcretePacket<IPv6HopByHopType> IPv6HopByHop;
+    typedef ConcretePacket<IPv6HopByHopOptionsPacketType> IPv6HopByHopOptionsPacket;
     
 // =====================================================================================================
     
     /** \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
-    <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
-     */
-    
-    // Destination Options skeleton without TLV-Options
-
-    struct IPv6DestinationPacketParser : public PacketParserBase {
+        Parser implementing the IPv6 Destination Options Header extension. 
+        The fields implemented are:
+        \image html IPv6Extensions_Destination.png
 
+        \see IPv6ExtensionType_Destination \n
+            <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+     */    
+    struct IPv6DestinationOptionsPacketParser : public PacketParserBase 
+    {
 #       include SENF_PARSER()
         SENF_PARSER_FIELD ( nextHeader, UInt8Parser   );
         SENF_PARSER_FIELD ( headerLength, UInt8Parser );
         
-        SENF_PARSER_FINALIZE ( IPv6DestinationPacketParser );
+        SENF_PARSER_FINALIZE ( IPv6DestinationOptionsPacketParser );
     };
     
     /** \brief IPv6 Destination Options extension
 
         \par Packet type (typedef):
-    \ref IPv6Extension_Destination
+            \ref IPv6DestinationOptionsPacket
 
         \par Fields:
-    \ref IPv6PacketParserExtension_Destination
+            \ref IPv6DestinationOptionsPacketParser
         
         \par Associated registries:
-    \ref IpTypes
+            \ref IpTypes
         
         \par Finalize action:
-    Set \a nextHeader from type of next packet if found in \ref IpTypes
+            Set \a nextHeader from type of next packet if found in \ref IpTypes
 
-    \ingroup protocolbundle_default
-         */
-    
-    struct IPv6DestinationType
+        \ingroup protocolbundle_default
+     */
+    struct IPv6DestinationOptionsPacketType
     :   public PacketTypeBase,
-        public PacketTypeMixin<IPv6DestinationType, IpTypes>
+        public PacketTypeMixin<IPv6DestinationOptionsPacketType, IpTypes>
     {
 #ifndef DOXYGEN
-        typedef PacketTypeMixin<IPv6DestinationType, IpTypes> mixin;
+        typedef PacketTypeMixin<IPv6DestinationOptionsPacketType, IpTypes> mixin;
 #endif
         /** \brief IPv6 Destination Options extension packet typedef */
-        typedef ConcretePacket<IPv6DestinationType> packet;
+        typedef ConcretePacket<IPv6DestinationOptionsPacketType> packet;
         /** \brief typedef to the parser of IPv6 Destination Options extension packet */
-        typedef IPv6DestinationPacketParser parser;
+        typedef IPv6DestinationOptionsPacketParser parser;
         
         using mixin::nextPacketRange;
         using mixin::nextPacketType;
@@ -346,7 +340,7 @@ The Type 0 Routing header has the following format: (RFC 2460)
         
         static key_t nextPacketKey(packet p) 
         { return p->nextHeader(); }
-        /** \brief Dump given IPv6Extension_Destination in readable form to given output stream */
+        /** \brief Dump given IPv6DestinationOptionsPacket in readable form to given output stream */
         static void dump(packet p, std::ostream & os); 
         
         static void finalize(packet p) { 
@@ -354,10 +348,10 @@ The Type 0 Routing header has the following format: (RFC 2460)
     };
     
     /** \brief IPv6 routing Destination Options packet typedef */
-    typedef ConcretePacket<IPv6DestinationType> IPv6Destination;
-
+    typedef ConcretePacket<IPv6DestinationOptionsPacketType> IPv6DestinationOptionsPacket;
     
-} //namespace senf
+}
+
 ///////////////////////////////hh.e////////////////////////////////////////
 //#include "IPv6Extensions.cci"
 //#include "IPv6Extensions.ct"
index 9451b44..380b696 100644 (file)
@@ -5,6 +5,7 @@
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 //     Philipp Batroff <philipp.batroff@fokus.fraunhofer.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
 // the Free Software Foundation; either version 2 of the License, or
@@ -80,9 +81,9 @@ BOOST_AUTO_UNIT_TEST(ipv6Extensions_fragment)
     std::ostringstream oss (std::ostringstream::out);
     SENF_CHECK_NO_THROW( pFragment_packet.dump( oss));
 
-    BOOST_CHECK( pFragment_packet.next().is<senf::IPv6Fragment>() );
+    BOOST_CHECK( pFragment_packet.next().is<senf::IPv6FragmentPacket>() );
 
-    senf::IPv6Fragment fFragment_packet (pFragment_packet.next().as<senf::IPv6Fragment>());
+    senf::IPv6FragmentPacket fFragment_packet (pFragment_packet.next().as<senf::IPv6FragmentPacket>());
 
     BOOST_CHECK_EQUAL( fFragment_packet->nextHeader(), 17u );
     BOOST_CHECK_EQUAL( fFragment_packet->fragmentOffset(), 160u );
@@ -141,9 +142,9 @@ BOOST_AUTO_UNIT_TEST(ipv6Extensions_routing)
     std::ostringstream oss (std::ostringstream::out);
     SENF_CHECK_NO_THROW( pRouting_packet.dump( oss));
 
-    BOOST_REQUIRE( pRouting_packet.next().is<senf::IPv6Routing>() );
+    BOOST_REQUIRE( pRouting_packet.next().is<senf::IPv6RoutingPacket>() );
 
-    senf::IPv6Routing pRouting_extension (pRouting_packet.next().as<senf::IPv6Routing>());
+    senf::IPv6RoutingPacket pRouting_extension (pRouting_packet.next().as<senf::IPv6RoutingPacket>());
 
     BOOST_CHECK_EQUAL( pRouting_extension->nextHeader(), 58u );
     BOOST_CHECK_EQUAL( pRouting_extension->headerLength(), 0x00 );
@@ -197,13 +198,14 @@ BOOST_AUTO_UNIT_TEST(ipv6Extensions_hopByHop_parse)
     std::ostringstream oss (std::ostringstream::out);
     SENF_CHECK_NO_THROW( pHop_packet.dump( oss ));
 
-    BOOST_REQUIRE( pHop_packet.next().is<senf::IPv6HopByHop>() );
-    senf::IPv6HopByHop pHop_extension (pHop_packet.next().as<senf::IPv6HopByHop>());
+    BOOST_REQUIRE( pHop_packet.next().is<senf::IPv6HopByHopOptionsPacket>() );
+    senf::IPv6HopByHopOptionsPacket pHop_extension (
+            pHop_packet.next().as<senf::IPv6HopByHopOptionsPacket>());
     BOOST_CHECK_EQUAL( pHop_extension->nextHeader(), 58u );
     BOOST_CHECK_EQUAL( pHop_extension->headerLength(), 0x00 );
 
-    senf::IPv6HopByHop::Parser::options_t::container optC(pHop_extension->options() );
-    senf::IPv6HopByHop::Parser::options_t::container::iterator listIter (optC.begin());
+    senf::IPv6HopByHopOptionsPacket::Parser::options_t::container optC(pHop_extension->options() );
+    senf::IPv6HopByHopOptionsPacket::Parser::options_t::container::iterator listIter (optC.begin());
 
     BOOST_CHECK_EQUAL( listIter->altAction(), 0u);
     BOOST_CHECK_EQUAL( listIter->changeFlag(), 0u);
@@ -259,14 +261,14 @@ BOOST_AUTO_UNIT_TEST(ipv6Extensions_hopByHop_create)
     ip->hopLimit() = 1u;
     ip->source() = senf::INet6Address::from_string("fe80::219:b9ff:feeb:b226");
     ip->destination() = senf::INet6Address::from_string("ff02::16");
-    senf::IPv6HopByHop pext (senf::IPv6HopByHop::createAfter(ip) );
+    senf::IPv6HopByHopOptionsPacket pext (senf::IPv6HopByHopOptionsPacket::createAfter(ip) );
     pext->nextHeader() = 58u;
     pext->headerLength() = 0u;
     {
-        senf::IPv6HopByHop::Parser::options_t::container optC(pext->options() );
+        senf::IPv6HopByHopOptionsPacket::Parser::options_t::container optC(pext->options() );
         
         optC.push_back_space();
-        senf::GenericOptTypeTLVParser opt = optC.back().init<senf::GenericOptTypeTLVParser>();
+        senf::IPv6GenericOptionTLVParser opt = optC.back().init<senf::IPv6GenericOptionTLVParser>();
         opt.altAction() = 0u;
         opt.changeFlag() = 0u;
         opt.optionType() = 5u;
@@ -274,7 +276,7 @@ BOOST_AUTO_UNIT_TEST(ipv6Extensions_hopByHop_create)
         opt.setPayload(val);
         
         optC.push_back_space();
-        opt = optC.back().init<senf::GenericOptTypeTLVParser>();
+        opt = optC.back().init<senf::IPv6GenericOptionTLVParser>();
         opt.altAction() = 0u;
         opt.changeFlag() = 0u;
         opt.optionType() = 2u;
index d1ab97a..c0802d8 100644 (file)
@@ -41,7 +41,8 @@ namespace {
 
         SENF_PARSER_FIELD( size, senf::UInt8Parser );
         typedef senf::detail::FixedAuxParserPolicy<senf::UInt8Parser, 1u> ListOptionTypeAuxPolicy;
-        typedef senf::detail::ListOptionTypeParser_Policy<senf::GenericOptTypeTLVParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
+        typedef senf::detail::ListOptionTypeParser_Policy<
+            senf::IPv6GenericOptionTLVParser, ListOptionTypeAuxPolicy> ListOptionTypePolicy;
         typedef senf::ListParser<ListOptionTypePolicy> ListOptionTypeParser;
         SENF_PARSER_FIELD ( list, ListOptionTypeParser);