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 IpV6Packet public header */
24 #ifndef HH_IpV6Packet_
25 #define HH_IpV6Packet_ 1
28 #include "Packets/Packets.hh"
29 #include "IpV4Packet.hh"
31 //#include "IpV6Packet.mpp"
32 ///////////////////////////////hh.p////////////////////////////////////////
36 ///\addtogroup protocolbundle_default
40 struct Parse_IpV6 : public PacketParserBase
42 SENF_PACKET_PARSER_NO_INIT(Parse_IpV6);
44 ///////////////////////////////////////////////////////////////////////////
46 typedef Parse_UIntField < 0, 4 > Parse_Version;
47 typedef Parse_UIntField < 4, 12 > Parse_Class;
48 typedef Parse_UIntField < 12, 32 > Parse_FlowLabel;
49 typedef Parse_UInt8 Parse_8bit;
50 typedef Parse_UInt16 Parse_16bit;
52 typedef Parse_Array < 16, Parse_8bit > Parse_Addr;
54 SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS(
55 ((OverlayField)( version, Parse_Version ))
56 ((OverlayField)( trafficClass, Parse_Class ))
57 ((Field )( flowLabel, Parse_FlowLabel ))
58 ((Field )( length, Parse_16bit ))
59 ((Field )( nextHeader, Parse_8bit ))
60 ((Field )( hopLimit, Parse_8bit ))
61 ((Field )( source, Parse_Addr ))
62 ((Field )( destination, Parse_Addr )) );
70 : public PacketTypeBase,
71 public PacketTypeMixin<IpV6PacketType, IpTypes>
73 typedef PacketTypeMixin<IpV6PacketType, IpTypes> mixin;
74 typedef ConcretePacket<IpV6PacketType> packet;
75 typedef Parse_IpV6 parser;
77 using mixin::nextPacketRange;
78 using mixin::nextPacketType;
79 using mixin::initSize;
82 static registry_key_t nextPacketKey(packet p)
83 { return p->nextHeader(); }
85 static void dump(packet p, std::ostream & os);
88 typedef IpV6PacketType::packet IpV6Packet;
93 ///////////////////////////////hh.e////////////////////////////////////////
95 #ifndef SENF_PACKETS_DECL_ONLY
96 //#include "IpV6Packet.cci"
97 //#include "IpV6Packet.ct"
98 //#include "IpV6Packet.cti"
105 // c-file-style: "senf"
106 // indent-tabs-mode: nil
107 // ispell-local-dictionary: "american"
108 // compile-command: "scons -u test"
109 // comment-column: 40