fixed small documentation bug
[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 /** \file
24     \brief DSMCCSection public header */
25
26 #ifndef HH_DSMCCSection_
27 #define HH_DSMCCSection_ 1
28
29 // Custom includes
30 #include <algorithm>
31 #include "Packets/PacketType.hh"
32 #include "Packets/ParseInt.hh"
33 #include "Packets/PacketRegistry.hh"
34 #include "Packets/PacketParser.hh"
35
36 //#include "DSMCCSection.mpp"
37 ///////////////////////////////hh.p////////////////////////////////////////
38
39 namespace senf {
40
41     ///\addtogroup protocolbundle_mpegdvb
42     ///@{
43
44     struct Parse_DSMCCSection : public PacketParserBase
45     {
46         SENF_PACKET_PARSER_INIT(Parse_DSMCCSection);
47
48         ///////////////////////////////////////////////////////////////////////////
49
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;
58                 
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               ))
71         );
72         
73         Parse_UInt32 crc() const { return parse<Parse_UInt32>( data().size()-4 ); }
74     };
75
76     struct DSMCCSectionType
77         : public PacketTypeBase,
78           public PacketTypeMixin<DSMCCSectionType>
79     {
80         typedef PacketTypeMixin<DSMCCSectionType> mixin;
81         typedef ConcretePacket<DSMCCSectionType> packet;
82         typedef Parse_DSMCCSection parser;
83
84         using mixin::nextPacketRange;
85 //          using mixin::nextPacketType;
86         using mixin::init;
87         
88         static void dump(packet p, std::ostream & os);
89         
90         static PacketParserBase::size_type initSize();
91         static PacketParserBase::size_type initHeadSize();
92     };
93         
94     typedef DSMCCSectionType::packet DSMCCSection;
95     
96     ///@}
97 }
98
99
100 ///////////////////////////////hh.e////////////////////////////////////////
101 //#include "DSMCCSection.cci"
102 //#include "DSMCCSection.ct"
103 //#include "DSMCCSection.cti"
104 #endif
105
106 \f
107 // Local Variables:
108 // mode: c++
109 // fill-column: 100
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
115 // End: