4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Thorsten Horstmann <tho@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 LLC/SNAP public header */
26 #ifndef HH_SENF_Packets_DefaultBundle_LlcSnapPacket_
27 #define HH_SENF_Packets_DefaultBundle_LlcSnapPacket_ 1
30 #include "EthernetPacket.hh"
32 //#include "LlcSnapPacket.mpp"
33 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37 /** \brief Parse a LLC/SNAP header
39 \image html LlcSnapPacket.png
42 struct LlcSnapPacketParser : public PacketParserBase
44 # include SENF_FIXED_PARSER()
46 SENF_PARSER_FIELD( dsap, UInt8Parser );
47 SENF_PARSER_FIELD( ssap, UInt8Parser );
48 SENF_PARSER_FIELD( ctrl, UInt8Parser );
50 SENF_PARSER_FIELD( protocolId, UInt24Parser );
51 SENF_PARSER_FIELD( type_length, UInt16Parser );
53 SENF_PARSER_FINALIZE(LlcSnapPacketParser);
59 protocolId() = 0x000000;
63 /** \brief LLC/SNAP header
67 \par Packet type (typedef):
68 \ref LlcSnapPacketType
71 \ref LlcSnapPacketParser
73 \par Associated registries:
79 \ingroup protocolbundle_default
81 struct LlcSnapPacketType
82 : public PacketTypeBase,
83 public PacketTypeMixin<LlcSnapPacketType, EtherTypes>
86 typedef PacketTypeMixin<LlcSnapPacketType, EtherTypes> mixin;
88 typedef ConcretePacket<LlcSnapPacketType> packet; ///< LLC/SNAP packet typedef
89 typedef LlcSnapPacketParser parser; ///< typedef to the parser of LLC/SNAP packet
91 using mixin::nextPacketRange;
92 using mixin::initSize;
95 static factory_t nextPacketType(packet p);
96 /** \brief Dump given LlcSnapPacket in readable form to given output stream */
97 static void dump(packet p, std::ostream & os);
98 static void finalize(packet p);
101 /** \brief LLC/SNAP packet typedef
102 \ingroup protocolbundle_default
104 typedef ConcretePacket<LlcSnapPacketType> LlcSnapPacket;
108 //-/////////////////////////////////////////////////////////////////////////////////////////////////
109 //#include "LlcSnapPacket.cci"
110 //#include "LlcSnapPacket.ct"
111 //#include "LlcSnapPacket.cti"
118 // c-file-style: "senf"
119 // indent-tabs-mode: nil
120 // ispell-local-dictionary: "american"
121 // compile-command: "scons -u test"
122 // comment-column: 40