X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FDefaultBundle%2FIPv6Extensions.hh;h=c38fda46276e9d610f7adc68fe5213fcc0454d47;hb=ab7ff164ab5ae711ec09ce2b24228510f1ffdcff;hp=bf41e889a5dba37df0d29549a79d31ac0607468b;hpb=8348a88c43eb04dc2979f3c07b2e6e920f251073;p=senf.git diff --git a/senf/Packets/DefaultBundle/IPv6Extensions.hh b/senf/Packets/DefaultBundle/IPv6Extensions.hh index bf41e88..c38fda4 100644 --- a/senf/Packets/DefaultBundle/IPv6Extensions.hh +++ b/senf/Packets/DefaultBundle/IPv6Extensions.hh @@ -2,25 +2,29 @@ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund -// Philipp Batroff // -// 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 -// (at your option) any later version. +// The contents of this file are subject to the Fraunhofer FOKUS Public License +// Version 1.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// http://senf.berlios.de/license.html // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// The Fraunhofer FOKUS Public License Version 1.0 is based on, +// but modifies the Mozilla Public License Version 1.1. +// See the full license text for the amendments. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the License. +// +// The Original Code is Fraunhofer FOKUS code. +// +// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. +// (registered association), Hansastraße 27 c, 80686 Munich, Germany. +// All Rights Reserved. +// +// Contributor(s): +// Stefan Bund +// Philipp Batroff /** \file \brief IPv6Extensions public header */ @@ -33,12 +37,12 @@ #include "IPv6Packet.hh" //#include "IPv6Extensions.mpp" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { /** \brief Parse in IPv6 fragment extension header - + Parser implementing the IPv6 fragment extension. The fields implemented are: \image html IPv6FragmentPacket.png @@ -66,10 +70,10 @@ namespace senf { \par Fields: \ref IPv6FragmentPacketParser - + \par Associated registries: \ref IpTypes - + \par Finalize action: Set \a nextHeader from type of next packet if found in \ref IpTypes @@ -92,16 +96,16 @@ namespace senf { using mixin::initSize; using mixin::init; - static key_t nextPacketKey(packet p) + static key_t nextPacketKey(packet p) { return p->nextHeader(); } - + /** \brief Dump given IPv6FragmentPacket in readable form to given output stream */ - static void dump(packet p, std::ostream & os); + static void dump(packet p, std::ostream & os); static void finalize(packet p); }; - /** \brief IPv6 fragment extension packet typedef + /** \brief IPv6 fragment extension packet typedef \ingroup protocolbundle_default */ typedef ConcretePacket IPv6FragmentPacket; @@ -128,11 +132,11 @@ namespace senf { | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | - + + + + | | - + Address[1] + + + Address[1] | | - + + + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . @@ -140,32 +144,32 @@ namespace senf { . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | - + + + + | | - + Address[n] + + + Address[n] | | - + + + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ # 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_VECTOR ( hopAddresses, segmentsLeft, INet6AddressParser ); - + SENF_PARSER_FINALIZE ( IPv6RoutingPacketParser ); - + //provisionary, since only type 0 is implemented - SENF_PARSER_INIT() { + SENF_PARSER_INIT() { routingType() = 0u; - reserved() = 0u; + reserved() = 0u; } }; - + /** \brief IPv6 routing extension \par Packet type (typedef): @@ -173,10 +177,10 @@ namespace senf { \par Fields: \ref IPv6RoutingPacketParser - + \par Associated registries: \ref IpTypes - + \par Finalize action: Set \a nextHeader from type of next packet if found in \ref IpTypes @@ -193,29 +197,29 @@ namespace senf { typedef ConcretePacket packet; /** \brief typedef to the parser of IPv6 routing extension packet */ typedef IPv6RoutingPacketParser parser; - + using mixin::nextPacketRange; using mixin::nextPacketType; using mixin::init; using mixin::initSize; - - static key_t nextPacketKey(packet p) + + static key_t nextPacketKey(packet p) { return p->nextHeader(); } - + /** \brief Dump given IPv6RoutingPacket in readable form to given output stream */ - static void dump(packet p, std::ostream & os); - + static void dump(packet p, std::ostream & os); + static void finalize(packet p); }; - + /** \brief IPv6 routing extension packet typedef \ingroup protocolbundle_default */ typedef ConcretePacket IPv6RoutingPacket; - + // ===================================================================================================== - + /** \brief Parse in IPv6 Hop-By-Hop extension header Parser implementing the IPv6 routing Header extension. The fields implemented are: @@ -224,10 +228,10 @@ namespace senf { \see IPv6ExtensionType_HopByHop \n RFC 2460 */ - struct IPv6HopByHopOptionsPacketParser : public PacketParserBase + struct IPv6HopByHopOptionsPacketParser : public PacketParserBase { # include SENF_PARSER() - + SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); SENF_PARSER_FIELD_RO ( headerLength, UInt8Parser ); @@ -240,7 +244,7 @@ namespace senf { SENF_PARSER_FINALIZE ( IPv6HopByHopOptionsPacketParser ); }; - + /** \brief IPv6 Hop-By-Hop extension \par Packet type (typedef): @@ -248,10 +252,10 @@ namespace senf { \par Fields: \ref IPv6HopByHopOptionsPacketParser - + \par Associated registries: \ref IpTypes - + \par Finalize action: Set \a nextHeader from type of next packet if found in \ref IpTypes @@ -268,38 +272,38 @@ namespace senf { typedef ConcretePacket packet; /** \brief typedef to the parser of IPv6 Hop-By-Hop extension packet */ typedef IPv6HopByHopOptionsPacketParser 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 IPv6HopByHopOptionsPacket in readable form to given output stream */ - static void dump(packet p, std::ostream & os); - + static void dump(packet p, std::ostream & os); + static void finalize(packet p); }; - + /** \brief IPv6 routing Hop-By-Hop packet typedef \ingroup protocolbundle_default */ typedef ConcretePacket IPv6HopByHopOptionsPacket; - + // ===================================================================================================== - + /** \brief Parse in IPv6 Destination Options extension header - Parser implementing the IPv6 Destination Options Header extension. + Parser implementing the IPv6 Destination Options Header extension. The fields implemented are: \image html IPv6DestinationOptionsPacket.png \see IPv6ExtensionType_Destination \n RFC 2460 - */ - struct IPv6DestinationOptionsPacketParser : public PacketParserBase + */ + struct IPv6DestinationOptionsPacketParser : public PacketParserBase { # include SENF_PARSER() SENF_PARSER_FIELD ( nextHeader, UInt8Parser ); @@ -313,7 +317,7 @@ namespace senf { SENF_PARSER_FINALIZE ( IPv6DestinationOptionsPacketParser ); }; - + /** \brief IPv6 Destination Options extension \par Packet type (typedef): @@ -321,10 +325,10 @@ namespace senf { \par Fields: \ref IPv6DestinationOptionsPacketParser - + \par Associated registries: \ref IpTypes - + \par Finalize action: Set \a nextHeader from type of next packet if found in \ref IpTypes @@ -341,28 +345,28 @@ namespace senf { typedef ConcretePacket packet; /** \brief typedef to the parser of IPv6 Destination Options extension packet */ typedef IPv6DestinationOptionsPacketParser parser; - + using mixin::nextPacketRange; using mixin::nextPacketType; using mixin::init; using mixin::initSize; - - static key_t nextPacketKey(packet p) + + static key_t nextPacketKey(packet p) { return p->nextHeader(); } /** \brief Dump given IPv6DestinationOptionsPacket in readable form to given output stream */ - static void dump(packet p, std::ostream & os); - + static void dump(packet p, std::ostream & os); + static void finalize(packet p); }; - + /** \brief IPv6 routing Destination Options packet typedef \ingroup protocolbundle_default */ typedef ConcretePacket IPv6DestinationOptionsPacket; - + } -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// //#include "IPv6Extensions.cci" //#include "IPv6Extensions.ct" //#include "IPv6Extensions.cti"