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/PacketParser.hh"
35 //#include "DSMCCSection.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
40 /** \brief Parse a DSMCC Section
42 Parser implementing the header of a DSMCC Section
46 struct Parse_DSMCCSection : public PacketParserBase
48 typedef Parse_UInt8 Parse_table_id;
49 typedef Parse_Flag < 0 > Parse_ssi; // section_syntax_indicator
50 typedef Parse_Flag < 1 > Parse_pi; // private_indicator
51 typedef Parse_UIntField < 2, 4 > Parse_reserved_1;
52 typedef Parse_UIntField < 4, 16 > Parse_sec_length;
53 typedef Parse_UIntField < 0, 2 > Parse_reserved_2;
54 typedef Parse_UIntField < 2, 7 > Parse_version_num;
55 typedef Parse_Flag < 7 > Parse_curr_next_indicator;
59 SENF_PACKET_PARSER_INIT(Parse_DSMCCSection);
61 SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS(
62 ((Field ) ( table_id, Parse_table_id ))
63 ((OverlayField) ( ssi, Parse_ssi ))
64 ((OverlayField) ( pi, Parse_pi ))
65 ((OverlayField) ( reserved_1, Parse_reserved_1 ))
66 ((Field ) ( sec_length, Parse_sec_length ))
67 ((Field ) ( tabel_id_extension, Parse_UInt16 ))
68 ((OverlayField) ( reserved_2, Parse_reserved_2 ))
69 ((OverlayField) ( version_num, Parse_version_num ))
70 ((Field ) ( curr_next_indicator, Parse_curr_next_indicator ))
71 ((Field ) ( sec_num, Parse_UInt8 ))
72 ((Field ) ( last_sec_num, Parse_UInt8 ))
77 Parse_table_id table_id() const;
78 Parse_ssi ssi() const;
80 Parse_reserved_1 reserved_1() const;
81 Parse_sec_length sec_length const;
82 Parse_UInt16 tabel_id_extension() const;
83 Parse_reserved_2 reserved_2() const;
84 Parse_version_num version_num() const;
85 Parse_curr_next_indicator curr_next_indicator() const;
86 Parse_UInt8 sec_num() const;
87 Parse_UInt8 last_sec_num() const;
91 Parse_UInt32 crc() const { return parse<Parse_UInt32>( data().size()-4 ); }
94 /** \brief DSMCC Section
96 \par Packet type (typedef):
100 \ref Parse_DSMCCSection
102 \ingroup protocolbundle_mpegdvb
104 struct DSMCCSectionType
105 : public PacketTypeBase,
106 public PacketTypeMixin<DSMCCSectionType>
108 typedef PacketTypeMixin<DSMCCSectionType> mixin;
109 typedef ConcretePacket<DSMCCSectionType> packet;
110 typedef Parse_DSMCCSection parser;
112 using mixin::nextPacketRange;
113 // using mixin::nextPacketType;
116 static void dump(packet p, std::ostream & os);
118 static PacketParserBase::size_type initSize();
119 static PacketParserBase::size_type initHeadSize();
122 typedef DSMCCSectionType::packet DSMCCSection;
126 ///////////////////////////////hh.e////////////////////////////////////////
127 //#include "DSMCCSection.cci"
128 //#include "DSMCCSection.ct"
129 //#include "DSMCCSection.cti"
136 // c-file-style: "senf"
137 // indent-tabs-mode: nil
138 // ispell-local-dictionary: "american"
139 // compile-command: "scons -u test"
140 // comment-column: 40