HardwareWLANInterface.ih
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 /** \file
15  \brief HardwareWLANInterface internal header */
16 
17 #ifndef IH_SENF_Ext_NetEmu_WLAN_HardwareWLANInterface_
18 #define IH_SENF_Ext_NetEmu_WLAN_HardwareWLANInterface_ 1
19 
20 // Custom includes
21 #include <senf/Socket/Protocols/Raw/MMapPacketSocketHandle.hh>
22 #include <senf/Packets/DefaultBundle/EthernetPacket.hh>
23 #include <senf/Packets/80211Bundle/RadiotapPacket.hh>
24 #include <senf/PPI/QueueSocketSourceSink.hh>
25 #include "../Ethernet/EthernetAnnotator.hh"
26 #include "MonitorDataFilter.hh"
27 #include "TSFTHistogram.hh"
28 
29 //-/////////////////////////////////////////////////////////////////////////////////////////////////
30 
31 namespace senf {
32 namespace emu {
33 
34  class HardwareWLANInterface;
35 
36 namespace detail {
37 
38  /** \brief Internal: Hardware WLAN interface PPI network */
39  struct HardwareWLANInterfaceNet
40  {
41  ConnectedMMapPacketSocketHandle socket;
42  ppi::module::ActiveQueueSocketSource<EthernetPacket> source;
43  ppi::module::PassiveQueueSocketSink<> sink;
44  EthernetAnnotator annotatorRx_;
45  EthernetAnnotator annotatorTx_;
46 
47  ConnectedMMapReadPacketSocketHandle monSocket;
48  ppi::module::ActiveQueueSocketSource<RadiotapPacket> monSource;
49  MonitorDataFilter monitorDataFilter;
50 
51  ppi::connector::ActiveOutputJack<EthernetPacket> netOutput;
52  ppi::connector::PassiveInputJack<EthernetPacket> netInput;
53 
54  HardwareWLANInterfaceNet();
55 
56  HardwareWLANInterface & self();
57  HardwareWLANInterface const & self() const;
58 
59  void assignDataSocket(ConnectedMMapPacketSocketHandle & socket);
60  void assignMonitorSocket(ConnectedMMapReadPacketSocketHandle & monSocket);
61 
62  unsigned rcvBuf();
63  void rcvBuf(unsigned);
64  unsigned sndBuf();
65  void sndBuf(unsigned);
66  void flush();
67 
68  void dataSource(bool on);
69 
70  TSFTHistogram & tsftHistogram();
71  };
72 
73 }}}
74 
75 //-/////////////////////////////////////////////////////////////////////////////////////////////////
76 #endif
77 
78 
79 // Local Variables:
80 // mode: c++
81 // fill-column: 100
82 // comment-column: 40
83 // c-file-style: "senf"
84 // indent-tabs-mode: nil
85 // ispell-local-dictionary: "american"
86 // compile-command: "scons -u test"
87 // End: