4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief IPv6Extensions public header */
26 #ifndef HH_SENF_Packets_DefaultBundle_IPv6Extensions_
27 #define HH_SENF_Packets_DefaultBundle_IPv6Extensions_ 1
30 #include "IPv6Packet.hh"
32 //#include "IPv6Extensions.mpp"
33 ///////////////////////////////hh.p////////////////////////////////////////
37 /** \brief Parse in IPv6 fragment extension header
39 Parser implementing the IPv6 fragment extension. The fields implemented are:
41 \see IPv6ExtensionType_Fragment \n
42 <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
44 struct IPv6PacketParserExtension_Fragment : public PacketParserBase
46 # include SENF_FIXED_PARSER()
48 SENF_PARSER_FIELD( nextHeader , UInt8Parser );
49 SENF_PARSER_FIELD( reserved1 , UInt8Parser );
51 SENF_PARSER_BITFIELD( fragmentOffset, 13, unsigned );
52 SENF_PARSER_BITFIELD( reserved2, 2, unsigned );
53 SENF_PARSER_BITFIELD( moreFragments, 1, bool );
55 SENF_PARSER_FIELD( id , UInt32Parser );
57 SENF_PARSER_FINALIZE(IPv6PacketParserExtension_Fragment);
60 /** \brief IPv6 fragment extension
62 \par Packet type (typedef):
63 \ref IPv6Extension_Fragment
66 \ref IPv6PacketParserExtension_Fragment
68 \par Associated registries:
72 Set \a nextHeader from type of next packet if found in \ref IpTypes
74 \ingroup protocolbundle_default
76 struct IPv6ExtensionType_Fragment
77 : public PacketTypeBase,
78 public PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes>
81 typedef PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes> mixin;
82 typedef ConcretePacket<IPv6ExtensionType_Fragment> packet;
83 typedef IPv6PacketParserExtension_Fragment parser;
85 using mixin::nextPacketRange;
86 using mixin::nextPacketType;
87 using mixin::initSize;
90 static key_t nextPacketKey(packet p)
91 { return p->nextHeader(); }
93 static void dump(packet p, std::ostream & os);
95 static void finalize(packet p)
96 { p->nextHeader() << key(p.next(nothrow)); }
99 /** \brief IPv6 fragment extension packet typedef */
100 typedef ConcretePacket<IPv6ExtensionType_Fragment> IPv6Extension_Fragment;
103 ///////////////////////////////hh.e////////////////////////////////////////
105 #ifndef SENF_PACKETS_DECL_ONLY
106 //#include "IPv6Extensions.cci"
107 //#include "IPv6Extensions.ct"
108 //#include "IPv6Extensions.cti"
115 // c-file-style: "senf"
116 // indent-tabs-mode: nil
117 // ispell-local-dictionary: "american"
118 // compile-command: "scons -u test"
119 // comment-column: 40