Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

MPEGDVBBundle/TransportPacket.hh

Go to the documentation of this file.
00001 // $Id:TransportPacket.hh 560 2007-12-13 14:39:37Z tho $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Thorsten Horstmann <tho@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #ifndef HH_SENF_Packets_MPEGDVBBundle_TransportPacket_
00027 #define HH_SENF_Packets_MPEGDVBBundle_TransportPacket_ 1
00028 
00029 // Custom includes
00030 #include <senf/Packets/Packets.hh>
00031 
00032 //#include "TransportPacket.mpp"
00033 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00034 
00035 namespace senf {
00036 
00044     struct TransportPacketParser : public PacketParserBase
00045     {
00046 #       include SENF_PARSER()
00047 
00048         SENF_PARSER_FIELD       ( sync_byte,                  UInt8Parser );
00049 
00050         SENF_PARSER_BITFIELD    ( transport_error_indicator,  1, bool     );
00051         SENF_PARSER_BITFIELD_RO ( pusi,                       1, bool     );
00052         SENF_PARSER_BITFIELD    ( transport_priority,         1, bool     );
00053         SENF_PARSER_BITFIELD    ( pid,                       13, unsigned );
00054         SENF_PARSER_BITFIELD    ( transport_scrmbl_ctrl,      2, unsigned );
00055         SENF_PARSER_BITFIELD    ( adaptation_field_ctrl,      2, unsigned );
00056         SENF_PARSER_BITFIELD    ( continuity_counter,         4, unsigned );
00057 
00058         SENF_PARSER_PRIVATE_VARIANT ( pointer_field_, pusi,
00059                 (senf::VoidPacketParser) (UInt8Parser) );
00060 
00061         SENF_PARSER_FINALIZE( TransportPacketParser );
00062 
00063         UInt8Parser pointer_field() const;
00064         void init_fields() const;
00065         void setPUSI(bool pusi) const;
00066 
00067         SENF_PARSER_INIT() {
00068             defaultInit();
00069             init_fields();
00070         }
00071     };
00072 
00117     struct TransportPacketType
00118         : public PacketTypeBase,
00119           public PacketTypeMixin<TransportPacketType>
00120     {
00121 #ifndef DOXYGEN
00122         typedef PacketTypeMixin<TransportPacketType> mixin;
00123 #endif
00124         typedef ConcretePacket<TransportPacketType> packet; 
00125         typedef TransportPacketParser parser; 
00126 
00127         using mixin::nextPacketRange;
00128         using mixin::init;
00129         using mixin::initSize;
00130 
00132         static void dump(packet p, std::ostream & os);
00133         static const byte SYNC_BYTE = 0x47;
00134     };
00135 
00137     typedef ConcretePacket<TransportPacketType> TransportPacket;
00138 }
00139 
00140 
00141 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00142 //#include "TransportPacket.cci"
00143 //#include "TransportPacket.ct"
00144 //#include "TransportPacket.cti"
00145 #endif
00146 
00147 
00148 // Local Variables:
00149 // mode: c++
00150 // fill-column: 100
00151 // c-file-style: "senf"
00152 // indent-tabs-mode: nil
00153 // ispell-local-dictionary: "american"
00154 // compile-command: "scons -u test"
00155 // comment-column: 40
00156 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research