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:
40 \image html IPv6Extensions_Fragment.png
42 \see IPv6ExtensionType_Fragment \n
43 <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
45 struct IPv6PacketParserExtension_Fragment : public PacketParserBase
47 # include SENF_FIXED_PARSER()
49 SENF_PARSER_FIELD ( nextHeader , UInt8Parser );
50 SENF_PARSER_PRIVATE_FIELD ( reserved1 , UInt8Parser );
52 SENF_PARSER_BITFIELD ( fragmentOffset , 13, unsigned );
53 SENF_PARSER_PRIVATE_BITFIELD ( reserved2 , 2, unsigned );
54 SENF_PARSER_BITFIELD ( moreFragments , 1, bool );
56 SENF_PARSER_FIELD ( id , UInt32Parser );
58 SENF_PARSER_FINALIZE(IPv6PacketParserExtension_Fragment);
61 /** \brief IPv6 fragment extension
63 \par Packet type (typedef):
64 \ref IPv6Extension_Fragment
67 \ref IPv6PacketParserExtension_Fragment
69 \par Associated registries:
73 Set \a nextHeader from type of next packet if found in \ref IpTypes
75 \ingroup protocolbundle_default
77 struct IPv6ExtensionType_Fragment
78 : public PacketTypeBase,
79 public PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes>
82 typedef PacketTypeMixin<IPv6ExtensionType_Fragment, IpTypes> mixin;
84 /** \brief IPv6 fragment extension packet typedef */
85 typedef ConcretePacket<IPv6ExtensionType_Fragment> packet;
86 /** \brief typedef to the parser of IPv6 fragment extension packet */
87 typedef IPv6PacketParserExtension_Fragment parser;
89 using mixin::nextPacketRange;
90 using mixin::nextPacketType;
91 using mixin::initSize;
94 static key_t nextPacketKey(packet p)
95 { return p->nextHeader(); }
97 /** \brief Dump given IPv6Extension_Fragment in readable form to given output stream */
98 static void dump(packet p, std::ostream & os);
100 static void finalize(packet p) {
101 p->nextHeader() << key(p.next(nothrow)); }
104 /** \brief IPv6 fragment extension packet typedef */
105 typedef ConcretePacket<IPv6ExtensionType_Fragment> IPv6Extension_Fragment;
108 ///////////////////////////////hh.e////////////////////////////////////////
110 #ifndef SENF_PACKETS_DECL_ONLY
111 //#include "IPv6Extensions.cci"
112 //#include "IPv6Extensions.ct"
113 //#include "IPv6Extensions.cti"
120 // c-file-style: "senf"
121 // indent-tabs-mode: nil
122 // ispell-local-dictionary: "american"
123 // compile-command: "scons -u test"
124 // comment-column: 40