X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FMPESection.hh;h=7b7879db38471fd6339632de3ac1be30fabe4a07;hb=a58be9dbd48369f2c0469b5c214406d26f1feefa;hp=0bf928b5aa372d4329457e3bf3b0879af83b1c48;hpb=664602bd7e14a365bca130805a1a08a1b347c473;p=senf.git diff --git a/Packets/MPEGDVBBundle/MPESection.hh b/Packets/MPEGDVBBundle/MPESection.hh index 0bf928b..7b7879d 100644 --- a/Packets/MPEGDVBBundle/MPESection.hh +++ b/Packets/MPEGDVBBundle/MPESection.hh @@ -1,9 +1,9 @@ -// $Id:DSMCCSection.hh 327 2007-07-20 10:03:44Z tho $ +// $Id:MPESection.hh 560 2007-12-13 14:39:37Z tho $ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Thorsten Horstmann +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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 @@ -23,8 +23,8 @@ /** \file \brief MPESection public header */ -#ifndef HH_MPESection_ -#define HH_MPESection_ 1 +#ifndef HH_SENF_Packets_MPEGDVBBundle_MPESection_ +#define HH_SENF_Packets_MPEGDVBBundle_MPESection_ 1 // Custom includes #include @@ -36,7 +36,7 @@ namespace senf { - struct Parse_MPERealTimeParameters : public PacketParserBase + struct MPERealTimeParametersParser : public PacketParserBase { # include SENF_FIXED_PARSER() @@ -44,46 +44,47 @@ namespace senf { SENF_PARSER_BITFIELD ( table_boundary, 1, bool ); SENF_PARSER_BITFIELD ( frame_boundary, 1, bool ); SENF_PARSER_BITFIELD ( address, 18, unsigned ); - - SENF_PARSER_FINALIZE( Parse_MPERealTimeParameters ); + + SENF_PARSER_FINALIZE( MPERealTimeParametersParser ); }; - + /** \brief Parse a MPE Section - + Parser implementing the header of a MPE Section - + \see MPESectionType */ - struct Parse_MPESection : public PacketParserBase + class MPESectionParser : public PacketParserBase { + public: # include SENF_FIXED_PARSER() - SENF_PARSER_FIELD( table_id, Parse_UInt8 ); - + SENF_PARSER_FIELD( table_id, UInt8Parser ); + SENF_PARSER_BITFIELD ( section_syntax_indicator, 1, bool ); SENF_PARSER_BITFIELD ( private_indicator, 1, bool ); SENF_PARSER_PRIVATE_BITFIELD( reserved_1, 2, unsigned ); SENF_PARSER_BITFIELD ( section_length, 12, unsigned ); - - SENF_PARSER_FIELD( mac_addr_6, Parse_UInt8 ); - SENF_PARSER_FIELD( mac_addr_5, Parse_UInt8 ); - + + SENF_PARSER_FIELD( mac_addr_6, UInt8Parser ); + SENF_PARSER_FIELD( mac_addr_5, UInt8Parser ); + SENF_PARSER_PRIVATE_BITFIELD( reserved_2, 2, unsigned ); SENF_PARSER_BITFIELD ( payload_scrmbl_ctrl, 2, unsigned ); SENF_PARSER_BITFIELD ( addr_scrmbl_ctrl, 2, unsigned ); SENF_PARSER_BITFIELD ( llc_snap_flag, 1, bool ); SENF_PARSER_BITFIELD ( curr_next_indicator, 1, bool ); - SENF_PARSER_FIELD( section_num, Parse_UInt8 ); - SENF_PARSER_FIELD( last_section_num, Parse_UInt8 ); + SENF_PARSER_FIELD( section_num, UInt8Parser ); + SENF_PARSER_FIELD( last_section_num, UInt8Parser ); + + SENF_PARSER_FIELD( real_time_parameters, MPERealTimeParametersParser ); + + SENF_PARSER_FINALIZE( MPESectionParser ); - SENF_PARSER_FIELD( real_time_parameters, Parse_MPERealTimeParameters ); - - SENF_PARSER_FINALIZE( Parse_MPESection ); - SENF_PARSER_PRIVATE_BITFIELD( ip_datagram_version, 4, unsigned ); - + SENF_PARSER_INIT() { table_id() = 0x3e; section_syntax_indicator() = 1; @@ -94,23 +95,24 @@ namespace senf { addr_scrmbl_ctrl() = 0; curr_next_indicator() = 1; } - - Parse_UInt32 crc() const { return parse( data().size()-4 ); } - -// typedef boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0, false, false> crc32_t; -// boost::uint32_t calcCrc() const; - + + UInt32Parser crc() const { return parse( data().size()-4 ); } + boost::uint32_t calcCrc() const; + friend class MPESectionType; + + private: + typedef boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0, false, false> crc32_t; }; - - + + /** \brief MPE Section - + \par Packet type (typedef): \ref MPESection \par Fields: - \ref Parse_MPESection + \ref MPESectionParser \ingroup protocolbundle_mpegdvb */ @@ -120,18 +122,18 @@ namespace senf { { typedef PacketTypeMixin mixin; typedef ConcretePacket packet; - typedef Parse_MPESection parser; + typedef MPESectionParser parser; using mixin::nextPacketRange; using mixin::init; - + static void dump(packet p, std::ostream & os); static void finalize(packet p); static factory_t nextPacketType(packet p); static PacketParserBase::size_type initSize(); static PacketParserBase::size_type initHeadSize(); }; - + typedef ConcretePacket MPESection; } @@ -142,7 +144,7 @@ namespace senf { //#include "MPESection.cti" #endif - + // Local Variables: // mode: c++ // fill-column: 100