1 // $Id:DatagramSection.hh 327 2007-07-20 10:03:44Z tho $
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Thorsten Horstmann <thorsten.horstmann@fokus.fraunhofer.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 \file DatagramSection public header */
26 #ifndef HH_DatagramSection_
27 #define HH_DatagramSection_ 1
31 #include "../../Packets/Packets.hh"
32 #include "DSMCCSection.hh"
35 //#include "DatagramSection.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
40 /** \brief Parse a Datagram Section
42 Parser implementing the Datagram Section.
44 \see DatagramSectionType
46 struct Parse_DatagramSection : public Parse_DSMCCSection
48 # include SENF_FIXED_PARSER()
50 SENF_PARSER_INHERIT( Parse_DSMCCSection );
52 SENF_PARSER_FIELD ( mac_addr_4 , Parse_UInt8 );
53 SENF_PARSER_FIELD ( mac_addr_3 , Parse_UInt8 );
54 SENF_PARSER_FIELD ( mac_addr_2 , Parse_UInt8 );
55 SENF_PARSER_FIELD ( mac_addr_1 , Parse_UInt8 );
57 SENF_PARSER_FINALIZE( Parse_DatagramSection );
59 // Parse table_id_extension as two bytes
60 SENF_PARSER_GOTO( table_id_extension );
61 SENF_PARSER_FIELD ( mac_addr_6 , Parse_UInt8 );
62 SENF_PARSER_FIELD ( mac_addr_5 , Parse_UInt8 );
64 // Divide 5 bit version_num field into several subfields.
65 SENF_PARSER_SKIP_BITS( 2 );
66 SENF_PARSER_BITFIELD ( payload_scrmbl_ctrl , 2, unsigned );
67 SENF_PARSER_BITFIELD ( addr_scrmbl_ctrl , 2, unsigned );
68 SENF_PARSER_BITFIELD ( llc_snap_flag , 1, bool );
71 /** \brief Datagram Section
73 \par Packet type (typedef):
77 \ref Parse_DatagramSection
79 \ingroup protocolbundle_mpegdvb
81 struct DatagramSectionType
82 : public DSMCCSectionType,
83 public PacketTypeMixin<DatagramSectionType>
85 typedef PacketTypeMixin<DatagramSectionType> mixin;
86 typedef ConcretePacket<DatagramSectionType> packet;
87 typedef Parse_DatagramSection parser;
89 using mixin::nextPacketRange;
92 static void dump(packet p, std::ostream & os);
94 static PacketParserBase::size_type initSize();
95 static PacketParserBase::size_type initHeadSize();
98 typedef DatagramSectionType::packet DatagramSection;
102 ///////////////////////////////hh.e////////////////////////////////////////
103 //#include "DatagramSection.cci"
104 //#include "DatagramSection.ct"
105 //#include "DatagramSection.cti"
112 // c-file-style: "senf"
113 // indent-tabs-mode: nil
114 // ispell-local-dictionary: "american"
115 // compile-command: "scons -u test"
116 // comment-column: 40