DVBDemuxSocketProtocol.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
18 //#include "DVBDemuxSocketProtocol.ih"
19 
20 // Custom includes
21 #include <sys/socket.h>
22 #include <string>
23 #include <sys/ioctl.h>
24 #include <linux/sockios.h>
26 
27 //#include "DVBDemuxSocketProtocol.mpp"
28 #define prefix_
29 //-/////////////////////////////////////////////////////////////////////////////////////////////////
30 
32  const
33 {
34  if (::ioctl(fd(), DMX_SET_BUFFER_SIZE, size) < 0)
36  "Could not set the size of the buffer on DVB adapter. requested size: ")
37  << size << ".";
38 }
39 
41  const
42 {
43  if (::ioctl(fd(), DMX_START) < 0)
44  SENF_THROW_SYSTEM_EXCEPTION("Could not start filtering operation on DVB adapter.");
45 }
46 
48  const
49 {
50  if (::ioctl(fd(), DMX_STOP) < 0)
51  SENF_THROW_SYSTEM_EXCEPTION("Could not stop filtering operation on DVB adapter.");
52 }
53 
55  const
56 {
57  return false;
58 }
59 
60 //-/////////////////////////////////////////////////////////////////////////////////////////////////
61 #undef prefix_
62 //#include "DVBDemuxSocketProtocol.mpp"
63 
64 
65 // Local Variables:
66 // mode: c++
67 // fill-column: 100
68 // c-file-style: "senf"
69 // indent-tabs-mode: nil
70 // ispell-local-dictionary: "american"
71 // compile-command: "scons -u test"
72 // comment-column: 40
73 // End:
#define SENF_THROW_SYSTEM_EXCEPTION(desc)
int fd() const
Get file descriptor.
#define prefix_
bool eof() const
Check for end-of-file condition.
DVBDemuxSocketProtocol public header.
void setBufferSize(unsigned long size) const
set the size of the circular buffer used for filtered data.
SocketHandle public header.