1 // $Id:DSMCCSection.hh 327 2007-07-20 10:03:44Z tho $
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@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 \brief DSMCCSection public header */
26 #ifndef HH_DSMCCSection_
27 #define HH_DSMCCSection_ 1
31 #include "Packets/PacketType.hh"
32 #include "Packets/ParseInt.hh"
33 #include "Packets/PacketRegistry.hh"
34 #include "Packets/PacketParser.hh"
36 //#include "DSMCCSection.mpp"
37 ///////////////////////////////hh.p////////////////////////////////////////
41 ///\addtogroup protocolbundle_mpegdvb
44 struct Parse_DSMCCSection : public PacketParserBase
46 SENF_PACKET_PARSER_INIT(Parse_DSMCCSection);
48 ///////////////////////////////////////////////////////////////////////////
50 typedef Parse_UInt8 Parse_table_id;
51 typedef Parse_Flag < 0 > Parse_ssi; // section_syntax_indicator
52 typedef Parse_Flag < 1 > Parse_pi; // private_indicator
53 typedef Parse_UIntField < 2, 4 > Parse_reserved_1;
54 typedef Parse_UIntField < 4, 16 > Parse_sec_length;
55 typedef Parse_UIntField < 0, 2 > Parse_reserved_2;
56 typedef Parse_UIntField < 2, 7 > Parse_version_num;
57 typedef Parse_Flag < 7 > Parse_curr_next_indicator;
59 SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS(
60 ((Field ) ( table_id, Parse_table_id ))
61 ((OverlayField) ( ssi, Parse_ssi ))
62 ((OverlayField) ( pi, Parse_pi ))
63 ((OverlayField) ( reserved_1, Parse_reserved_1 ))
64 ((Field ) ( sec_length, Parse_sec_length ))
65 ((Field ) ( tabel_id_extension, Parse_UInt16 ))
66 ((OverlayField) ( reserved_2, Parse_reserved_2 ))
67 ((OverlayField) ( version_num, Parse_version_num ))
68 ((Field ) ( curr_next_indicator, Parse_curr_next_indicator ))
69 ((Field ) ( sec_num, Parse_UInt8 ))
70 ((Field ) ( last_sec_num, Parse_UInt8 ))
73 Parse_UInt32 crc() const { return parse<Parse_UInt32>( data().size()-4 ); }
76 struct DSMCCSectionType
77 : public PacketTypeBase,
78 public PacketTypeMixin<DSMCCSectionType>
80 typedef PacketTypeMixin<DSMCCSectionType> mixin;
81 typedef ConcretePacket<DSMCCSectionType> packet;
82 typedef Parse_DSMCCSection parser;
84 using mixin::nextPacketRange;
85 // using mixin::nextPacketType;
88 static void dump(packet p, std::ostream & os);
90 static PacketParserBase::size_type initSize();
91 static PacketParserBase::size_type initHeadSize();
94 typedef DSMCCSectionType::packet DSMCCSection;
100 ///////////////////////////////hh.e////////////////////////////////////////
101 //#include "DSMCCSection.cci"
102 //#include "DSMCCSection.ct"
103 //#include "DSMCCSection.cti"
110 // c-file-style: "senf"
111 // indent-tabs-mode: nil
112 // ispell-local-dictionary: "american"
113 // compile-command: "scons -u test"
114 // comment-column: 40