RawINetSocketProtocol.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 
14 #include "RawINetSocketProtocol.hh"
15 
16 // Custom includes
17 #include <sys/ioctl.h>
18 #include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
19 
20 //#include "RawINetSocketProtocol.mpp"
21 #define prefix_
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
25  const
26 {
27  int n;
28  if (::ioctl(fd(),SIOCINQ,&n) < 0)
29  SENF_THROW_SYSTEM_EXCEPTION("could not call ::ioctl(SIOCINQ) in RawINetSocketProtocol::available()");
30  return n;
31 }
32 
34  const
35 {
36  return false;
37 }
38 
39 //-/////////////////////////////////////////////////////////////////////////////////////////////////
40 #undef prefix_
41 //#include "RawINetSocketProtocol.mpp"
42 
43 
44 // Local Variables:
45 // mode: c++
46 // fill-column: 100
47 // comment-column: 40
48 // c-file-style: "senf"
49 // indent-tabs-mode: nil
50 // ispell-local-dictionary: "american"
51 // compile-command: "scons -u test"
52 // End:
#define SENF_THROW_SYSTEM_EXCEPTION(desc)
unsigned available() const
Return (maximum) number of bytes available for reading without < blocking.
int fd() const
Get file descriptor.
bool eof() const
Check for end-of-file condition.
#define prefix_