AnalyzerBase.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 
14 #ifndef __ANALYZERBASE_HH__
15 #define __ANALYZERBASE_HH__
16 
17 // Custom includes
21 #include <senf/PPI/Module.hh>
23 #include "Configuration.hh"
24 
26 
29 {
31 
32 public:
34 
35  AnalyzerBase(Configuration const & configuration);
36 
37  std::string stats();
38  bool startSpectralScan();
39 
41 
42 protected:
44 
45  virtual void v_timerInterval(senf::ClockService::clock_type const & timestamp, senf::ClockService::clock_type const & actualDuration) = 0;
46  virtual void v_terminate(senf::ClockService::clock_type const & sessionDuration) = 0;
47 
48  virtual void v_80211FrameReceived(std::uint64_t tsft, unsigned frequency, signed rssi, unsigned rate, unsigned length, senf::RadiotapPacket & rt) = 0;
49 
50  void processSpectralEvent(std::uint64_t tsft, std::uint16_t frequency, unsigned numBins, void * spectralSample);
51  virtual void v_SpectralDataReceived(std::uint64_t tsft, unsigned frequency, unsigned bins, fft_sample_ht20 const &) = 0;
52  virtual void v_SpectralDataReceived(std::uint64_t tsft, unsigned frequency, unsigned bins, fft_sample_ht20_40 const &) = 0;
53  virtual void v_SpectralDataReceived(std::uint64_t tsft, unsigned frequency, unsigned bins, fft_sample_ath10k const &) = 0;
54 
55 private:
58  senf::ClockService::clock_type nextTimeout_;
59 
60  senf::emu::AthSpectralScan athSpectralScan_;
61 
62  unsigned spectralUnknownType_;
63  unsigned pktData_;
64  unsigned pktManagement_;
65  unsigned pktControl_;
66  unsigned pktOther_;
67  unsigned pktTx_;
68  unsigned pktExceptions_;
69  unsigned pktFrequencyMismatch_;
70 
71  void request();
72  void timerEvent();
73 };
74 
76 #endif
77 
config::time_type clock_type
virtual void v_80211FrameReceived(std::uint64_t tsft, unsigned frequency, signed rssi, unsigned rate, unsigned length, senf::RadiotapPacket &rt)=0
virtual void v_terminate(senf::ClockService::clock_type const &sessionDuration)=0
void processSpectralEvent(std::uint64_t tsft, std::uint16_t frequency, unsigned numBins, void *spectralSample)
std::string stats()
#define SENF_PPI_MODULE(name)
virtual void v_timerInterval(senf::ClockService::clock_type const &timestamp, senf::ClockService::clock_type const &actualDuration)=0
AnalyzerBase(Configuration const &configuration)
Definition: AnalyzerBase.cc:27
senf::emu::AthSpectralScan & athSpectralScan()
Definition: AnalyzerBase.cc:51
s8 rssi
Configuration const & configuration_
Definition: AnalyzerBase.hh:43
senf::ppi::connector::PassiveInput< senf::RadiotapPacket > input
Definition: AnalyzerBase.hh:30
bool startSpectralScan()
Definition: AnalyzerBase.cc:72
virtual void v_SpectralDataReceived(std::uint64_t tsft, unsigned frequency, unsigned bins, fft_sample_ht20 const &)=0
__be16 length