X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FDSMCCSection.hh;h=e6c2cef9ffd949bf11f585ad95fde912ccaf7b62;hb=ff0f2fabb3dbb76ee9383a98291a1420d2a59a7f;hp=70eeceaf318b2e7e9db8c12fee084dc0830059fd;hpb=f42f550e611b7cb1f0c729c12b09931319a7d41c;p=senf.git diff --git a/Packets/MPEGDVBBundle/DSMCCSection.hh b/Packets/MPEGDVBBundle/DSMCCSection.hh index 70eecea..e6c2cef 100644 --- a/Packets/MPEGDVBBundle/DSMCCSection.hh +++ b/Packets/MPEGDVBBundle/DSMCCSection.hh @@ -3,7 +3,7 @@ // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,56 +20,62 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/** \file + \brief DSMCCSection public header */ + #ifndef HH_DSMCCSection_ #define HH_DSMCCSection_ 1 // Custom includes #include -#include "Packets/PacketType.hh" -#include "Packets/ParseInt.hh" -#include "Packets/PacketRegistry.hh" -#include "Packets/PacketParser.hh" +#include "../../Packets/Packets.hh" //#include "DSMCCSection.mpp" ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - ///\addtogroup protocolbundle_mpegdvb - ///@{ - + /** \brief Parse a DSMCC Section + + Parser implementing the header of a DSMCC Section + + \see DSMCCSectionType + */ struct Parse_DSMCCSection : public PacketParserBase { - SENF_PACKET_PARSER_INIT(Parse_DSMCCSection); - - /////////////////////////////////////////////////////////////////////////// - - typedef Parse_UInt8 Parse_table_id; - typedef Parse_Flag < 0 > Parse_ssi; // section_syntax_indicator - typedef Parse_Flag < 1 > Parse_pi; // private_indicator - typedef Parse_UIntField < 2, 4 > Parse_reserved_1; - typedef Parse_UIntField < 4, 16 > Parse_sec_length; - typedef Parse_UIntField < 0, 2 > Parse_reserved_2; - typedef Parse_UIntField < 2, 7 > Parse_version_num; - typedef Parse_Flag < 7 > Parse_curr_next_indicator; - - SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( - ((Field ) ( table_id, Parse_table_id )) - ((OverlayField) ( ssi, Parse_ssi )) - ((OverlayField) ( pi, Parse_pi )) - ((OverlayField) ( reserved_1, Parse_reserved_1 )) - ((Field ) ( sec_length, Parse_sec_length )) - ((Field ) ( tabel_id_extension, Parse_UInt16 )) - ((OverlayField) ( reserved_2, Parse_reserved_2 )) - ((OverlayField) ( version_num, Parse_version_num )) - ((Field ) ( curr_next_indicator, Parse_curr_next_indicator )) - ((Field ) ( sec_num, Parse_UInt8 )) - ((Field ) ( last_sec_num, Parse_UInt8 )) - ); +# include SENF_FIXED_PARSER() + + SENF_PARSER_FIELD ( table_id , Parse_UInt8 ); + + SENF_PARSER_BITFIELD ( ssi , 1 , bool ); + SENF_PARSER_BITFIELD ( private_indicator , 1 , bool ); + SENF_PARSER_SKIP_BITS( 2 ); + SENF_PARSER_BITFIELD ( sec_length , 12 , unsigned ); + + SENF_PARSER_FIELD ( table_id_extension , Parse_UInt16 ); + SENF_PARSER_SKIP_BITS( 2 ); + SENF_PARSER_BITFIELD ( version_num , 5 , unsigned ); + SENF_PARSER_BITFIELD ( curr_next_indicator , 1 , bool ); + + SENF_PARSER_FIELD ( sec_num , Parse_UInt8 ); + SENF_PARSER_FIELD ( last_sec_num , Parse_UInt8 ); + + SENF_PARSER_FINALIZE( Parse_DSMCCSection ); + Parse_UInt32 crc() const { return parse( data().size()-4 ); } }; + + /** \brief DSMCC Section + + \par Packet type (typedef): + \ref DSMCCSection + + \par Fields: + \ref Parse_DSMCCSection + \ingroup protocolbundle_mpegdvb + */ struct DSMCCSectionType : public PacketTypeBase, public PacketTypeMixin @@ -89,8 +95,6 @@ namespace senf { }; typedef DSMCCSectionType::packet DSMCCSection; - - ///@} }