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 \image html IPv6Extensions_Fragment.png
76 \ingroup protocolbundle_default
78 struct IPv6ExtensionType_Fragment
79 : public PacketTypeBase,
80 public PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes>
83 typedef PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes> mixin;
84 typedef ConcretePacket<IPv6ExtensionType_Fragment> packet;
85 typedef IPv6PacketParserExtension_Fragment parser;
87 using mixin::nextPacketRange;
88 using mixin::nextPacketType;
89 using mixin::initSize;
92 static key_t nextPacketKey(packet p)
93 { return p->nextHeader(); }
95 static void dump(packet p, std::ostream & os);
97 static void finalize(packet p)
98 { p->nextHeader() << key(p.next(nothrow)); }
101 /** \brief IPv6 fragment extension packet typedef */
102 typedef ConcretePacket<IPv6ExtensionType_Fragment> IPv6Extension_Fragment;
105 ///////////////////////////////hh.e////////////////////////////////////////
107 #ifndef SENF_PACKETS_DECL_ONLY
108 //#include "IPv6Extensions.cci"
109 //#include "IPv6Extensions.ct"
110 //#include "IPv6Extensions.cti"
117 // c-file-style: "senf"
118 // indent-tabs-mode: nil
119 // ispell-local-dictionary: "american"
120 // compile-command: "scons -u test"
121 // comment-column: 40