added documentation stub for the MPEG/DVB Bundle
[senf.git] / Packets / MPEGDVBBundle / DSMCCSection.hh
1 // $Id:DSMCCSection.hh 327 2007-07-20 10:03:44Z tho $
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 //     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
7 //
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.
12 //
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.
17 //
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.
22
23 #ifndef HH_DSMCCSection_
24 #define HH_DSMCCSection_ 1
25
26 // Custom includes
27 #include <algorithm>
28 #include "Packets/PacketType.hh"
29 #include "Packets/ParseInt.hh"
30 #include "Packets/PacketRegistry.hh"
31 #include "Packets/PacketParser.hh"
32
33 //#include "DSMCCSection.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
35
36 namespace senf {
37
38     ///\addtogroup protocolbundle_mpegdvb
39     ///@{
40
41     struct Parse_DSMCCSection : public PacketParserBase
42     {
43         SENF_PACKET_PARSER_INIT(Parse_DSMCCSection);
44
45         ///////////////////////////////////////////////////////////////////////////
46
47         typedef Parse_UInt8               Parse_table_id;
48         typedef Parse_Flag      <     0 > Parse_ssi;  // section_syntax_indicator
49         typedef Parse_Flag      <     1 > Parse_pi;   // private_indicator
50         typedef Parse_UIntField < 2,  4 > Parse_reserved_1;
51         typedef Parse_UIntField < 4, 16 > Parse_sec_length;
52         typedef Parse_UIntField < 0,  2 > Parse_reserved_2;
53         typedef Parse_UIntField < 2,  7 > Parse_version_num;
54         typedef Parse_Flag      <     7 > Parse_curr_next_indicator;
55                 
56         SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS(
57             ((Field       ) ( table_id,            Parse_table_id            )) 
58             ((OverlayField) ( ssi,                 Parse_ssi                 ))
59             ((OverlayField) ( pi,                  Parse_pi                  ))
60             ((OverlayField) ( reserved_1,          Parse_reserved_1          ))
61             ((Field       ) ( sec_length,          Parse_sec_length          ))
62             ((Field       ) ( tabel_id_extension,  Parse_UInt16              ))
63             ((OverlayField) ( reserved_2,          Parse_reserved_2          ))
64             ((OverlayField) ( version_num,         Parse_version_num         ))
65             ((Field       ) ( curr_next_indicator, Parse_curr_next_indicator ))
66             ((Field       ) ( sec_num,             Parse_UInt8               ))
67             ((Field       ) ( last_sec_num,        Parse_UInt8               ))
68         );
69         
70         Parse_UInt32 crc() const { return parse<Parse_UInt32>( data().size()-4 ); }
71     };
72
73     struct DSMCCSectionType
74         : public PacketTypeBase,
75           public PacketTypeMixin<DSMCCSectionType>
76     {
77         typedef PacketTypeMixin<DSMCCSectionType> mixin;
78         typedef ConcretePacket<DSMCCSectionType> packet;
79         typedef Parse_DSMCCSection parser;
80
81         using mixin::nextPacketRange;
82 //          using mixin::nextPacketType;
83         using mixin::init;
84         
85         static void dump(packet p, std::ostream & os);
86         
87         static PacketParserBase::size_type initSize();
88         static PacketParserBase::size_type initHeadSize();
89     };
90         
91     typedef DSMCCSectionType::packet DSMCCSection;
92     
93     ///@}
94 }
95
96
97 ///////////////////////////////hh.e////////////////////////////////////////
98 //#include "DSMCCSection.cci"
99 //#include "DSMCCSection.ct"
100 //#include "DSMCCSection.cti"
101 #endif
102
103 \f
104 // Local Variables:
105 // mode: c++
106 // fill-column: 100
107 // c-file-style: "senf"
108 // indent-tabs-mode: nil
109 // ispell-local-dictionary: "american"
110 // compile-command: "scons -u test"
111 // comment-column: 40
112 // End: