MMapSocketProtocol.hh
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 
17 #ifndef HH_SENF_Socket_Protocols_Raw_MMapSocketProtocol_
18 #define HH_SENF_Socket_Protocols_Raw_MMapSocketProtocol_ 1
19 
20 // Custom includes
23 
24 //#include "MMapSocketProtocol.mpp"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 
30  : public virtual SocketProtocol,
31  private FileHandleAccess
32  {
33  public:
34  void close();
35  void terminate() const;
36  detail::QueueInfo::TxStats txStats() const;
37  detail::QueueInfo::RxStats rxStats() const;
38  bool interfaceDead() const;
39 
40  void timestamping(int sofFlags);
41 
42  protected:
43  void init_mmap(unsigned frameSize, unsigned rxqlen, unsigned txqlen, unsigned reserve = 0, bool qDiscBypass = false) const;
44  void close_mmap() const;
45  void terminate_mmap() const;
46 
47  mutable detail::QueueInfo qi_;
48  };
49 
51  : public virtual SocketProtocol,
52  private FileHandleAccess
53  {
54  public:
55  unsigned available() const;
56  };
57 
58 }
59 
60 //-/////////////////////////////////////////////////////////////////////////////////////////////////
61 //#include "MMapSocketProtocol.cci"
62 //#include "MMapSocketProtocol.ct"
63 //#include "MMapSocketProtocol.cti"
64 #endif
65 
66 
67 // Local Variables:
68 // mode: c++
69 // fill-column: 100
70 // comment-column: 40
71 // c-file-style: "senf"
72 // indent-tabs-mode: nil
73 // ispell-local-dictionary: "american"
74 // compile-command: "scons -u test"
75 // End:
QueueReadWritePolicy public header.
detail::QueueInfo::TxStats txStats() const
Socket Protocol base class.
void close()
Close socket.
virtual unsigned available() const =0
Return (maximum) number of bytes available for reading without < blocking.
void timestamping(int sofFlags)
access FileHandle extra data information
Definition: FileHandle.hh:63
void terminate() const
Forcibly close socket.
SocketProtocol and ConcreteSocketProtocol public header.
void init_mmap(unsigned frameSize, unsigned rxqlen, unsigned txqlen, unsigned reserve=0, bool qDiscBypass=false) const
detail::QueueInfo::RxStats rxStats() const