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/PacketType.hh"
29 #include "Packets/ParseInt.hh"
30 #include "Packets/PacketRegistry.hh"
31 #include "Packets/PacketParser.hh"
32 #include "Packets/ParseArray.hh"
33 #include "IpV4Packet.hh"
35 //#include "IpV6Packet.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
40 ///\addtogroup protocolbundle_default
44 struct Parse_IpV6 : public PacketParserBase
46 SENF_PACKET_PARSER_NO_INIT(Parse_IpV6);
48 ///////////////////////////////////////////////////////////////////////////
50 typedef Parse_UIntField < 0, 4 > Parse_Version;
51 typedef Parse_UIntField < 4, 12 > Parse_Class;
52 typedef Parse_UIntField < 12, 32 > Parse_FlowLabel;
53 typedef Parse_UInt8 Parse_8bit;
54 typedef Parse_UInt16 Parse_16bit;
56 typedef Parse_Array < 16, Parse_8bit > Parse_Addr;
58 SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS(
59 ((OverlayField)( version, Parse_Version ))
60 ((OverlayField)( trafficClass, Parse_Class ))
61 ((Field )( flowLabel, Parse_FlowLabel ))
62 ((Field )( length, Parse_16bit ))
63 ((Field )( nextHeader, Parse_8bit ))
64 ((Field )( hopLimit, Parse_8bit ))
65 ((Field )( source, Parse_Addr ))
66 ((Field )( destination, Parse_Addr )) );
74 : public PacketTypeBase,
75 public PacketTypeMixin<IpV6PacketType, IpTypes>
77 typedef PacketTypeMixin<IpV6PacketType, IpTypes> mixin;
78 typedef ConcretePacket<IpV6PacketType> packet;
79 typedef Parse_IpV6 parser;
81 using mixin::nextPacketRange;
82 using mixin::nextPacketType;
83 using mixin::initSize;
86 static registry_key_t nextPacketKey(packet p)
87 { return p->nextHeader(); }
89 static void dump(packet p, std::ostream & os);
92 typedef IpV6PacketType::packet IpV6Packet;
97 ///////////////////////////////hh.e////////////////////////////////////////
98 //#include "IpV6Packet.cci"
99 //#include "IpV6Packet.ct"
100 //#include "IpV6Packet.cti"
107 // c-file-style: "senf"
108 // indent-tabs-mode: nil
109 // ispell-local-dictionary: "american"
110 // compile-command: "scons -u test"
111 // comment-column: 40