2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
4 // Stefan Bund <g0dil@berlios.de>
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 \brief IpV6Extensions public header */
24 #ifndef HH_IpV6Extensions_
25 #define HH_IpV6Extensions_ 1
28 #include "IpV6Packet.hh"
30 //#include "IpV6Extensions.mpp"
31 ///////////////////////////////hh.p////////////////////////////////////////
35 /** \brief Parse in IpV6 fragment extension header
37 Parser implementing the IpV6 fragment extension. The fields implemented are:
39 \see IpV6ExtensionType_Fragment \n
40 <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
42 struct Parse_IpV6Extension_Fragment : public PacketParserBase
44 # include SENF_FIXED_PARSER()
46 SENF_PARSER_FIELD( nextHeader , Parse_UInt8 );
47 SENF_PARSER_FIELD( reserved1 , Parse_UInt8 );
49 SENF_PARSER_BITFIELD( fragmentOffset, 13, unsigned );
50 SENF_PARSER_BITFIELD( reserved2, 2, unsigned );
51 SENF_PARSER_BITFIELD( moreFragments, 1, bool );
53 SENF_PARSER_FIELD( id , Parse_UInt32 );
55 SENF_PARSER_FINALIZE(Parse_IpV6Extension_Fragment);
58 /** \brief IpV6 fragment extension
60 \par Packet type (typedef):
61 \ref IpV6Extension_Fragment
64 \ref Parse_IpV6Extension_Fragment
66 \par Associated registries:
70 Set \a nextHeader from type of next packet if found in \ref IpTypes
72 \ingroup protocolbundle_default
74 struct IpV6ExtensionType_Fragment
75 : public PacketTypeBase,
76 public PacketTypeMixin<IpV6ExtensionType_Fragment, IpTypes>
78 typedef PacketTypeMixin<IpV6ExtensionType_Fragment, IpTypes> mixin;
79 typedef ConcretePacket<IpV6ExtensionType_Fragment> packet;
80 typedef Parse_IpV6Extension_Fragment parser;
82 using mixin::nextPacketRange;
83 using mixin::nextPacketType;
84 using mixin::initSize;
87 static registry_key_t nextPacketKey(packet p)
88 { return p->nextHeader(); }
90 static void dump(packet p, std::ostream & os);
92 static void finalize(packet p)
93 { p->nextHeader() << key(p.next()); }
96 /** \brief IpV6 fragment extension packet typedef */
97 typedef IpV6ExtensionType_Fragment::packet IpV6Extension_Fragment;
100 ///////////////////////////////hh.e////////////////////////////////////////
102 #ifndef SENF_PACKETS_DECL_ONLY
103 //#include "IpV6Extensions.cci"
104 //#include "IpV6Extensions.ct"
105 //#include "IpV6Extensions.cti"
112 // c-file-style: "senf"
113 // indent-tabs-mode: nil
114 // ispell-local-dictionary: "american"
115 // compile-command: "scons -u test"
116 // comment-column: 40