diff --git a/Examples/DVBdec/MPEdec.cc b/Examples/DVBdec/MPEdec.cc new file mode 100644 index 0000000000000000000000000000000000000000..ee8f8beb2777a388e9736b88d137c627841b904c --- /dev/null +++ b/Examples/DVBdec/MPEdec.cc @@ -0,0 +1,145 @@ +// $Id: Sniffer.cc 296 2007-07-10 20:39:34Z g0dil $ +// +// Copyright (C) 2006 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund <stefan.bund@fokus.fraunhofer.de> +// +// 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 +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +// Definition of non-inline non-template functions + +#include <string> +#include <iostream> +#include <iomanip> +#include <sys/ioctl.h> +#include <linux/sockios.h> +#include <linux/dvb/dmx.h> + +#include "Scheduler/Scheduler.hh" +#include "Packets/DefaultBundle/EthernetPacket.hh" +#include "Packets/MPEG_DVBBundle/DatagramSection.hh" +#include "Utils/membind.hh" +#include "Socket/DVBDemuxHandles.hh" +#include "Packets/ParseInt.hh" +#include "Packets/Packet.hh" +#include "Packets/PacketData.hh" + +#define PID 500 + +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +namespace { + + static const unsigned BLOCK_SIZE = 16; + + template <class Iterator> + void hexdump(Iterator i, Iterator const & i_end, std::ostream& stream) + { + unsigned offset (0); + std::string ascii; + for (; i != i_end; ++i, ++offset) { + switch (offset % BLOCK_SIZE) { + case 0: + if (!ascii.empty()) { + stream << " " << ascii << "\n"; + ascii = ""; + } + stream << " " + << std::hex << std::setw(4) << std::setfill('0') + << offset << ' '; + break; + case BLOCK_SIZE/2: + stream << " "; + ascii += ' '; + break; + } + stream << ' ' << std::hex << std::setw(2) << std::setfill('0') + << unsigned(*i); + ascii += (*i >= ' ' && *i < 126) ? *i : '.'; + } + if (!ascii.empty()) { + for (; (offset % BLOCK_SIZE) != 0; ++offset) { + if ((offset % BLOCK_SIZE) == BLOCK_SIZE/2) + stream << " "; + stream << " "; + } + stream << " " << ascii << "\n"; + } + stream << std::dec; + } +} + + +class MySniffer +{ + senf::DVBDemuxSectionHandle handle; + +public: + MySniffer() + { + struct dmx_sct_filter_params sec_filter; + memset(&sec_filter, 0, sizeof (struct dmx_sct_filter_params)); + sec_filter.pid = PID; + sec_filter.filter.filter[0] = 62; + sec_filter.filter.mask[0] = 0xff; + sec_filter.flags = DMX_IMMEDIATE_START; + sec_filter.flags |= DMX_CHECK_CRC; + + handle.protocol().setSectionFilter( &sec_filter ); + + senf::Scheduler::instance().add( + handle, senf::membind(&MySniffer::dumpSection, this)); + } + +private: + void dumpSection(senf::FileHandle /* ignored */, senf::Scheduler::EventId event) + { + std::string data (handle.read()); + senf::DatagramSection section (senf::DatagramSection::create(data)); + section.dump(std::cout); + senf::PacketData & datagramData (section.last().data()); + hexdump(datagramData.begin(), datagramData.end(), std::cout); + } +}; + +int main(int argc, char const * argv[]) +{ + try { + MySniffer sniffer; + senf::Scheduler::instance().process(); + } + catch (std::exception const & ex) { + std::cerr << senf::prettyName(typeid(ex)) << ": " << ex.what() << "\n"; + } + return 0; +} + + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: diff --git a/Examples/DVBdec/SConscript b/Examples/DVBdec/SConscript new file mode 100644 index 0000000000000000000000000000000000000000..5f69e844206a179636ad306f83c0e1f030c133eb --- /dev/null +++ b/Examples/DVBdec/SConscript @@ -0,0 +1,12 @@ +Import('env') +import SENFSCons + +########################################################################### + +SENFSCons.Binary(env, 'uledec', 'ULEdec.cc', + LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ], + OBJECTS = [ '#/Packets/MPEG_DVBBundle/MPEG_DVBBundle.o' ]); + +SENFSCons.Binary(env, 'mpedec', 'MPEdec.cc', + LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ], + OBJECTS = [ '#/Packets/MPEG_DVBBundle/MPEG_DVBBundle.o' ]); diff --git a/Examples/DVBdec/ULEdec.cc b/Examples/DVBdec/ULEdec.cc new file mode 100644 index 0000000000000000000000000000000000000000..1cc4eecb891245833a97b80be24567761c589a58 --- /dev/null +++ b/Examples/DVBdec/ULEdec.cc @@ -0,0 +1,147 @@ +// $Id: Sniffer.cc 296 2007-07-10 20:39:34Z g0dil $ +// +// Copyright (C) 2006 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund <stefan.bund@fokus.fraunhofer.de> +// +// 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 +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +// Definition of non-inline non-template functions + +#include <string> +#include <iostream> +#include <iomanip> +#include <sys/ioctl.h> +#include <linux/sockios.h> +#include <linux/dvb/dmx.h> + +#include "Scheduler/Scheduler.hh" +#include "Packets/DefaultBundle/EthernetPacket.hh" +#include "Packets/MPEG_DVBBundle/DatagramSection.hh" +#include "Utils/membind.hh" +#include "Socket/DVBDemuxHandles.hh" +#include "Packets/ParseInt.hh" +#include "Packets/Packet.hh" +#include "Packets/PacketData.hh" + +#define PID 271 + +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +namespace { + + static const unsigned BLOCK_SIZE = 16; + + template <class Iterator> + void hexdump(Iterator i, Iterator const & i_end, std::ostream& stream) + { + unsigned offset (0); + std::string ascii; + for (; i != i_end; ++i, ++offset) { + switch (offset % BLOCK_SIZE) { + case 0: + if (!ascii.empty()) { + stream << " " << ascii << "\n"; + ascii = ""; + } + stream << " " + << std::hex << std::setw(4) << std::setfill('0') + << offset << ' '; + break; + case BLOCK_SIZE/2: + stream << " "; + ascii += ' '; + break; + } + stream << ' ' << std::hex << std::setw(2) << std::setfill('0') + << unsigned(*i); + ascii += (*i >= ' ' && *i < 126) ? *i : '.'; + } + if (!ascii.empty()) { + for (; (offset % BLOCK_SIZE) != 0; ++offset) { + if ((offset % BLOCK_SIZE) == BLOCK_SIZE/2) + stream << " "; + stream << " "; + } + stream << " " << ascii << "\n"; + } + stream << std::dec; + } +} + + +class MySniffer +{ + senf::DVBDemuxPESHandle demuxHandle; + senf::DVBDvrHandle dvrHandle; + +public: + MySniffer() + { + struct dmx_pes_filter_params pes_filter; + memset(&pes_filter, 0, sizeof (struct dmx_pes_filter_params)); + pes_filter.pid = PID; + pes_filter.input = DMX_IN_FRONTEND; + pes_filter.output = DMX_OUT_TS_TAP; + pes_filter.pes_type = DMX_PES_OTHER; + pes_filter.flags = DMX_IMMEDIATE_START; + + demuxHandle.protocol().setPESFilter( &pes_filter ); + + senf::Scheduler::instance().add( + dvrHandle, senf::membind(&MySniffer::dumpSection, this)); + } + +private: + void dumpSection(senf::FileHandle /* ignored */, senf::Scheduler::EventId event) + { + std::string data (dvrHandle.read()); + std::cout << data.length() << "\n"; + //senf::DatagramSection section (senf::DatagramSection::create(data)); + //section.dump(std::cout); + //senf::PacketData & datagramData (section.last().data()); + //hexdump(datagramData.begin(), datagramData.end(), std::cout); + } +}; + +int main(int argc, char const * argv[]) +{ + try { + MySniffer sniffer; + senf::Scheduler::instance().process(); + } + catch (std::exception const & ex) { + std::cerr << senf::prettyName(typeid(ex)) << ": " << ex.what() << "\n"; + } + return 0; +} + + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: diff --git a/Examples/DVBdec/mpedec b/Examples/DVBdec/mpedec new file mode 100755 index 0000000000000000000000000000000000000000..3e1ac337aa3adb982caa75850725b6eb03e40d6a Binary files /dev/null and b/Examples/DVBdec/mpedec differ diff --git a/Examples/DVBdec/uledec b/Examples/DVBdec/uledec new file mode 100755 index 0000000000000000000000000000000000000000..0978ba210108aa0d40a0b38ceb7b95213d251dd9 Binary files /dev/null and b/Examples/DVBdec/uledec differ diff --git a/Examples/Sniffer/Sniffer.cc b/Examples/Sniffer/Sniffer.cc index fc9c674c594d8a4b51807bd9be6c2cc374b6fd60..a3234e8c9e7c22123b4e7e9ee6d438e79cff77ce 100644 --- a/Examples/Sniffer/Sniffer.cc +++ b/Examples/Sniffer/Sniffer.cc @@ -84,7 +84,7 @@ int loop_main (int argc, char const * argv[]) { try { senf::PacketSocketHandle sock; - sock.bind(senf::LLSocketAddress("eth0")); + sock.bind(senf::LLSocketAddress("eth1")); // sock.protocol().promisc("eth0",senf::PacketProtocol::Promiscuous); while (true) { // forever @@ -136,7 +136,7 @@ private: int scheduler_main(int argc, char const * argv[]) { try { - Sniffer sniffer ("eth0"); + Sniffer sniffer ("eth1"); sniffer.run(); } catch (std::exception const & ex) { diff --git a/Socket/DVBSectionHandle.cc b/Socket/DVBDemuxHandles.cc similarity index 52% rename from Socket/DVBSectionHandle.cc rename to Socket/DVBDemuxHandles.cc index ad938a7cc33decafcd325737b71d4b4fb358a8ba..d449a628ba81a7f91a1404085f1fd143c7490447 100644 --- a/Socket/DVBSectionHandle.cc +++ b/Socket/DVBDemuxHandles.cc @@ -1,4 +1,4 @@ -// $Id$ +// $Id: DVBSectionHandle.cc 321 2007-07-19 09:00:23Z tho $ // // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) @@ -24,8 +24,8 @@ \brief xxx */ -#include "DVBSectionHandle.hh" -//#include "DVBSectionHandle.ih" +#include "DVBDemuxHandles.hh" +//#include "DVBDemuxHandles.ih" // Custom includes #include <sys/types.h> @@ -39,14 +39,14 @@ #include "Utils/Exception.hh" -//#include "DVBSectionHandle.mpp" +//#include "DVBDemuxHandles.mpp" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::DVBSectionProtocol +// senf::DVBDemuxHandles -prefix_ void senf::DVBSectionProtocol::init_client() +prefix_ void senf::DVBDemuxSectionProtocol::init_client() const { int fd = open("/dev/dvb/adapter0/demux0", O_RDONLY | O_NONBLOCK); @@ -55,45 +55,81 @@ prefix_ void senf::DVBSectionProtocol::init_client() body().fd(fd); } -prefix_ unsigned senf::DVBSectionProtocol::available() +prefix_ unsigned senf::DVBDemuxSectionProtocol::available() const { return 4096; } -prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBSectionProtocol::clone() +prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDemuxSectionProtocol::clone() const { - return std::auto_ptr<SocketProtocol>(new DVBSectionProtocol()); + return std::auto_ptr<SocketProtocol>(new DVBDemuxSectionProtocol()); } +prefix_ void senf::DVBDemuxSectionProtocol::setSectionFilter(struct dmx_sct_filter_params *filter) + const +{ + if (::ioctl(body().fd(), DMX_SET_FILTER, filter) < 0) + throw SystemException(errno); +} -prefix_ void senf::DVBSectionProtocol::setSectionFilter( - unsigned short pid, - unsigned char table_id) +// ---------------------------------------------------------------- + +prefix_ void senf::DVBDemuxPESProtocol::init_client() const { - struct dmx_sct_filter_params sec_filter; - memset(&sec_filter, 0, sizeof (struct dmx_sct_filter_params)); - sec_filter.pid = pid; - sec_filter.filter.filter[0] = table_id; - sec_filter.filter.mask[0] = 0xff; - sec_filter.flags = DMX_IMMEDIATE_START; - sec_filter.flags |= DMX_CHECK_CRC; - setSectionFilter( &sec_filter ); + int fd = open("/dev/dvb/adapter0/demux0", O_RDONLY | O_NONBLOCK); + if (fd < 0) + throw SystemException(errno); + body().fd(fd); } +prefix_ unsigned senf::DVBDemuxPESProtocol::available() + const +{ + return 4096; //??? +} -prefix_ void senf::DVBSectionProtocol::setSectionFilter(struct dmx_sct_filter_params *filter) +prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDemuxPESProtocol::clone() const { - if (::ioctl(body().fd(), DMX_SET_FILTER, filter) < 0) + return std::auto_ptr<SocketProtocol>(new DVBDemuxPESProtocol()); +} + +prefix_ void senf::DVBDemuxPESProtocol::setPESFilter(struct dmx_pes_filter_params *filter) + const +{ + if (::ioctl(body().fd(), DMX_SET_PES_FILTER, filter) < 0) throw SystemException(errno); } +// ---------------------------------------------------------------- + +prefix_ void senf::DVBDvrProtocol::init_client() + const +{ + int fd = open("/dev/dvb/adapter0/dvr0", O_RDONLY | O_NONBLOCK); + if (fd < 0) + throw SystemException(errno); + body().fd(fd); +} + +prefix_ unsigned senf::DVBDvrProtocol::available() + const +{ + return 188; +} + +prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDvrProtocol::clone() + const +{ + return std::auto_ptr<SocketProtocol>(new DVBDvrProtocol()); +} + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ -//#include "DVBSectionHandle.mpp" +//#include "DVBDemuxHandles.mpp" // Local Variables: diff --git a/Socket/DVBDemuxHandles.hh b/Socket/DVBDemuxHandles.hh new file mode 100644 index 0000000000000000000000000000000000000000..40665e5a46f8bad3a49ea4f1d36d3fbd6ed76b82 --- /dev/null +++ b/Socket/DVBDemuxHandles.hh @@ -0,0 +1,174 @@ +// $Id: DVBDemuxSectionHandle.hh 321 2007-07-19 09:00:23Z tho $ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund <stefan.bund@fokus.fraunhofer.de> +// +// 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 +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief DVBHandles + */ + +#ifndef HH_DVBDemuxHandles_ +#define HH_DVBDemuxHandles_ 1 + +// Custom includes +#include "BSDSocketProtocol.hh" +#include "FramingPolicy.hh" +#include "CommunicationPolicy.hh" +#include "ReadWritePolicy.hh" +#include "BufferingPolicy.hh" +#include "ProtocolClientSocketHandle.hh" +#include "DVBDemuxProtocol.hh" + +//#include "DVBDemuxHandles.mpp" +///////////////////////////////hh.p//////////////////////////////////////// + +namespace senf { + + /// \addtogroup concrete_protocol_group + /// @{ + + typedef MakeSocketPolicy< + NoAddressingPolicy, + DatagramFramingPolicy, + UnconnectedCommunicationPolicy, + ReadablePolicy, + NotWriteablePolicy, + SocketBufferingPolicy + >::policy DVBDemux_Policy; ///< Socket Policy for xxxx + + /** \brief xxx + */ + class DVBDemuxSectionProtocol + : public ConcreteSocketProtocol<DVBDemux_Policy>, + public DVBDemuxProtocol + { + public: + /////////////////////////////////////////////////////////////////////////// + // internal interface + + ///\name Constructors + ///@{ + + void init_client() const; ///< xxx + /**< \note This member is implicitly called from the + ProtocolClientSocketHandle::ProtocolClientSocketHandle() + constructor */ + + ///@} + ///\name Abstract Interface Implementation + + unsigned available() const; + + std::auto_ptr<SocketProtocol> clone() const; + + ///@} + + void setSectionFilter(struct dmx_sct_filter_params *filter) const; + }; + + typedef ProtocolClientSocketHandle<DVBDemuxSectionProtocol> DVBDemuxSectionHandle; + + // ---------------------------------------------------------------- + + /** \brief xxx + */ + class DVBDemuxPESProtocol + : public ConcreteSocketProtocol<DVBDemux_Policy>, + public DVBDemuxProtocol + { + public: + /////////////////////////////////////////////////////////////////////////// + // internal interface + + ///\name Constructors + ///@{ + + void init_client() const; ///< xxx + /**< \note This member is implicitly called from the + ProtocolClientSocketHandle::ProtocolClientSocketHandle() + constructor */ + + ///@} + ///\name Abstract Interface Implementation + + unsigned available() const; + + std::auto_ptr<SocketProtocol> clone() const; + + ///@} + + void setPESFilter(struct dmx_pes_filter_params *filter) const; + }; + + typedef ProtocolClientSocketHandle<DVBDemuxPESProtocol> DVBDemuxPESHandle; + + + // ---------------------------------------------------------------- + + + /** \brief xxx + */ + class DVBDvrProtocol + : public ConcreteSocketProtocol<DVBDemux_Policy>, + public DVBDemuxProtocol + { + public: + /////////////////////////////////////////////////////////////////////////// + // internal interface + + ///\name Constructors + ///@{ + + void init_client() const; ///< xxx + /**< \note This member is implicitly called from the + ProtocolClientSocketHandle::ProtocolClientSocketHandle() + constructor */ + + ///@} + ///\name Abstract Interface Implementation + + unsigned available() const; + + std::auto_ptr<SocketProtocol> clone() const; + + ///@} + + }; + + typedef ProtocolClientSocketHandle<DVBDvrProtocol> DVBDvrHandle; + +} + +///////////////////////////////hh.e//////////////////////////////////////// +//#include "DVBDemuxHandles.cci" +//#include "DVBDemuxHandles.ct" +//#include "DVBDemuxHandles.cti" +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: diff --git a/Socket/DVBProtocol.cc b/Socket/DVBDemuxProtocol.cc similarity index 81% rename from Socket/DVBProtocol.cc rename to Socket/DVBDemuxProtocol.cc index 65a3045d22d413e88aced158fe8639ee99996e57..f1f0ef112a58dca148da37f6c8adbc0e821c4411 100644 --- a/Socket/DVBProtocol.cc +++ b/Socket/DVBDemuxProtocol.cc @@ -1,4 +1,4 @@ -// $Id$ +// $Id: DVBProtocol.cc 321 2007-07-19 09:00:23Z tho $ // // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) @@ -24,8 +24,8 @@ \brief xxx */ -#include "DVBProtocol.hh" -//#include "DVBProtocol.ih" +#include "DVBDemuxProtocol.hh" +//#include "DVBDemuxProtocol.ih" // Custom includes #include <sys/socket.h> @@ -35,34 +35,34 @@ #include <linux/sockios.h> #include "SocketHandle.hh" -//#include "DVBProtocol.mpp" +//#include "DVBDemuxProtocol.mpp" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void senf::DVBProtocol::setBufferSize(unsigned long size) +prefix_ void senf::DVBDemuxProtocol::setBufferSize(unsigned long size) const { if (::ioctl(body().fd(), DMX_SET_BUFFER_SIZE, size) < 0) throw SystemException(errno); } -prefix_ void senf::DVBProtocol::startFiltering() +prefix_ void senf::DVBDemuxProtocol::startFiltering() const { if (::ioctl(body().fd(), DMX_START) < 0) throw SystemException(errno); } -prefix_ void senf::DVBProtocol::stopFiltering() +prefix_ void senf::DVBDemuxProtocol::stopFiltering() const { if (::ioctl(body().fd(), DMX_STOP) < 0) throw SystemException(errno); } -prefix_ bool senf::DVBProtocol::eof() +prefix_ bool senf::DVBDemuxProtocol::eof() const { return false; @@ -70,7 +70,7 @@ prefix_ bool senf::DVBProtocol::eof() ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ -//#include "DVBProtocol.mpp" +//#include "DVBDemuxProtocol.mpp" // Local Variables: diff --git a/Socket/DVBProtocol.hh b/Socket/DVBDemuxProtocol.hh similarity index 88% rename from Socket/DVBProtocol.hh rename to Socket/DVBDemuxProtocol.hh index 747d5d4c294d6bd1506f38484a0e7178f2ef7290..8281cc8f15e36c45aa9f0191e7427f7a3f34a584 100644 --- a/Socket/DVBProtocol.hh +++ b/Socket/DVBDemuxProtocol.hh @@ -1,4 +1,4 @@ -// $Id$ +// $Id: DVBProtocol.hh 321 2007-07-19 09:00:23Z tho $ // // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) @@ -24,8 +24,8 @@ \brief DVBProtocol public header */ -#ifndef HH_DVBProtocol_ -#define HH_DVBProtocol_ 1 +#ifndef HH_DVBDemuxProtocol_ +#define HH_DVBDemuxProtocol_ 1 #include <linux/dvb/dmx.h> @@ -43,7 +43,7 @@ namespace senf { /** xxx */ - class DVBProtocol + class DVBDemuxProtocol : public virtual SocketProtocol { public: @@ -66,9 +66,9 @@ namespace senf { } ///////////////////////////////hh.e//////////////////////////////////////// -//#include "DVBProtocol.cci" -//#include "DVBProtocol.ct" -//#include "DVBProtocol.cti" +//#include "DVBDemuxProtocol.cci" +//#include "DVBDemuxProtocol.ct" +//#include "DVBDemuxProtocol.cti" #endif diff --git a/Socket/DVBSectionHandle.hh b/Socket/DVBSectionHandle.hh deleted file mode 100644 index dd9a280efdd04885ee74b486346c69aec82e00bd..0000000000000000000000000000000000000000 --- a/Socket/DVBSectionHandle.hh +++ /dev/null @@ -1,110 +0,0 @@ -// $Id$ -// -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund <stefan.bund@fokus.fraunhofer.de> -// -// 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 -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -/** \file - \brief DVBSectionHandle - */ - -#ifndef HH_DVBSectionHandle_ -#define HH_DVBSectionHandle_ 1 - -// Custom includes -#include "BSDSocketProtocol.hh" -#include "FramingPolicy.hh" -#include "CommunicationPolicy.hh" -#include "ReadWritePolicy.hh" -#include "BufferingPolicy.hh" -#include "ProtocolClientSocketHandle.hh" -#include "DVBProtocol.hh" - -//#include "DVBSocketHandle.mpp" -///////////////////////////////hh.p//////////////////////////////////////// - -namespace senf { - - /// \addtogroup concrete_protocol_group - /// @{ - - typedef MakeSocketPolicy< - NoAddressingPolicy, - DatagramFramingPolicy, - UnconnectedCommunicationPolicy, - ReadablePolicy, - NotWriteablePolicy, - SocketBufferingPolicy - >::policy DVBSection_Policy; ///< Socket Policy for DVBSection - - /** \brief xxx - */ - class DVBSectionProtocol - : public ConcreteSocketProtocol<DVBSection_Policy>, - public DVBProtocol - { - public: - /////////////////////////////////////////////////////////////////////////// - // internal interface - - ///\name Constructors - ///@{ - - void init_client() const; ///< xxx - /**< \note This member is implicitly called from the - ProtocolClientSocketHandle::ProtocolClientSocketHandle() - constructor */ - - ///@} - ///\name Abstract Interface Implementation - - unsigned available() const; - - std::auto_ptr<SocketProtocol> clone() const; - - ///@} - - void setSectionFilter(unsigned short pid, unsigned char table_id) const; - - private: - void setSectionFilter(struct dmx_sct_filter_params *filter) const; - - }; - - typedef ProtocolClientSocketHandle<DVBSectionProtocol> DVBSectionHandle; - - -} - -///////////////////////////////hh.e//////////////////////////////////////// -//#include "DVBSectionHandle.cci" -//#include "DVBSectionHandle.ct" -//#include "DVBSectionHandle.cti" -#endif - - -// Local Variables: -// mode: c++ -// fill-column: 100 -// c-file-style: "senf" -// indent-tabs-mode: nil -// ispell-local-dictionary: "american" -// compile-command: "scons -u test" -// comment-column: 40 -// End: