4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Christian Niephaus <cni@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 MPLSPacket public header */
26 #ifndef HH_SENF_Packets_DefaultBundle_MPLSPacket_
27 #define HH_SENF_Packets_DefaultBundle_MPLSPacket_ 1
31 #include "../../Packets/Packets.hh"
33 //#include "MPLSPacket.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
38 /** \brief Parse an MPLS packet
40 Parser implementing an MPLS header.
42 \image html MPLSPacket.png
46 struct MPLSPacketParser : public PacketParserBase
48 # include SENF_FIXED_PARSER()
50 SENF_PARSER_BITFIELD( label, 20, unsigned);
51 SENF_PARSER_BITFIELD( tc, 3, unsigned);
52 SENF_PARSER_BITFIELD_RO( s, 1, bool);
53 SENF_PARSER_FIELD( ttl, UInt8Parser);
55 SENF_PARSER_FINALIZE(MPLSPacketParser);
57 friend class MPLSPacketType;
60 /** \brief MPLS packet
62 \par Packet type (typedef):
69 \ingroup protocolbundle_default
72 : public PacketTypeBase,
73 public PacketTypeMixin<MPLSPacketType>
76 typedef PacketTypeMixin<MPLSPacketType> mixin;
78 typedef ConcretePacket<MPLSPacketType> packet;
79 typedef MPLSPacketParser parser;
81 using mixin::nextPacketRange;
82 using mixin::initSize;
85 static factory_t nextPacketType(packet p);
86 /// Dump given MPLSPacket in readable form to given output stream
87 static void dump(packet p, std::ostream & os);
88 static void finalize(packet p);
91 /** \brief MPLS packet typedef */
92 typedef ConcretePacket<MPLSPacketType> MPLSPacket;
97 ///////////////////////////////hh.e////////////////////////////////////////
99 #ifndef SENF_PACKETS_DECL_ONLY
100 //#include "MPLSPacket.cci"
101 //#include "MPLSPacket.ct"
102 //#include "MPLSPacket.cti"
109 // c-file-style: "senf"
110 // indent-tabs-mode: nil
111 // ispell-local-dictionary: "american"
112 // compile-command: "scons -u test"
113 // comment-column: 40