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////////////////////////////////////////
36 template <class Iterator=nil, class IPacket=nil>
37 struct Parse_IpV6Extension_Fragment
38 : public ParserBase<Iterator,IPacket>
40 template <class I, class P=nil>
41 struct rebind { typedef Parse_IpV6Extension_Fragment<I,P> parser; };
42 typedef Iterator byte_iterator;
44 Parse_IpV6Extension_Fragment() {}
45 Parse_IpV6Extension_Fragment(Iterator const & i) : ParserBase<Iterator,IPacket>(i) {}
47 static unsigned bytes() { return 8; }
49 ///////////////////////////////////////////////////////////////////////////
51 typedef Parse_UInt8 < Iterator > Parse_8bit;
52 typedef Parse_UIntField < 0, 13, Iterator > Parse_Offset;
53 typedef Parse_UIntField < 13, 15, Iterator > Parse_Reserved;
54 typedef Parse_Flag < 15, Iterator > Parse_More;
55 typedef Parse_UInt32 < Iterator > Parse_32bit;
57 Parse_8bit nextHeader() const { return Parse_8bit (this->i() ); }
58 Parse_8bit reserved1() const { return Parse_8bit (this->i() + 1 ); }
59 Parse_Offset fragmentOffset() const { return Parse_Offset (this->i() + 2 ); }
60 Parse_Reserved reserved2() const { return Parse_Reserved (this->i() + 2 ); }
61 Parse_More moreFragments() const { return Parse_More (this->i() + 2 ); }
62 Parse_32bit id() const { return Parse_32bit (this->i() + 4 ); }
65 class IpV6Extension_Fragment
67 public Parse_IpV6Extension_Fragment<Packet::iterator, IpV6Extension_Fragment>,
68 public PacketRegistryMixin<IpTypes, IpV6Extension_Fragment>
70 using PacketRegistryMixin<IpTypes,IpV6Extension_Fragment>::registerInterpreter;
72 ///////////////////////////////////////////////////////////////////////////
75 typedef ptr_t<IpV6Extension_Fragment>::ptr ptr;
77 ///////////////////////////////////////////////////////////////////////////
81 IpV6Extension_Fragment(Arg const & arg);
83 virtual void v_nextInterpreter() const;
84 virtual void v_finalize();
85 virtual void v_dump(std::ostream & os) const;
91 ///////////////////////////////hh.e////////////////////////////////////////
92 //#include "IpV6Extensions.cci"
93 #include "IpV6Extensions.ct"
94 //#include "IpV6Extensions.cti"
101 // c-file-style: "senf"
102 // indent-tabs-mode: nil
103 // ispell-local-dictionary: "american"