EmulatedWLANInterface.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_Ext_NetEmu_WLAN_EmulatedWLANInterface_
18 #define HH_SENF_Ext_NetEmu_WLAN_EmulatedWLANInterface_ 1
19 
20 // Custom includes
22 #include "WLANInterface.hh"
23 
24 #include "EmulatedWLANInterface.ih"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 namespace emu {
29 
38  : private detail::EmulatedWLANInterfaceNet,
39  public InterfaceAPIBase<interface::Wireless, interface::Bidirectional, interface::Emulated, WLANInterface>
40  {
42 
43  public:
45  enum Mode { ADHOC, STA, AP };
46 
49 
51  void init();
52  void mode(Mode);
53  Mode mode();
54  using detail::EmulatedWLANInterfaceNet::beaconInterval;
55 
57 
58  private:
59  void registerVHTModulation(unsigned vhtMcsIndex, unsigned streams, unsigned bandwidth, bool shortGI);
60  void registerHTModulation(unsigned mcsIndex);
61  void registerLegacyModulation(unsigned rate);
62  void registerModulation(WLANModulationParameter::Type type, std::vector<std::string> args);
63 
64  // interface
65  virtual void v_id(MACAddress const & eui) override;
66  virtual MACAddress v_id() const override;
67  std::string const & v_device() const override;
68 
69  // modulation
70  virtual ModulationParameter::id_t v_modulationId() const override;
71  virtual void v_modulationId(ModulationParameter::id_t) override;
72 
73  // txpower
74  virtual int v_txPower() const override;
75  virtual void v_txPower(int power) override;
76 
77  MACAddress id_;
78  ModulationParameter::id_t modulationId_;
79  int power_;
80  Mode mode_;
81  std::string dev_;
82 
83  friend struct detail::EmulatedWLANInterfaceNet;
84  };
85 
86 }}
87 
88 //-/////////////////////////////////////////////////////////////////////////////////////////////////
90 //#include "EmulatedWLANInterface.ct"
91 //#include "EmulatedWLANInterface.cti"
92 #endif
93 
94 
95 // Local Variables:
96 // mode: c++
97 // fill-column: 100
98 // comment-column: 40
99 // c-file-style: "senf"
100 // indent-tabs-mode: nil
101 // ispell-local-dictionary: "american"
102 // compile-command: "scons -u test"
103 // End:
TypedInterfaceDecorator< EmulatedWLANInterface, WirelessInterface::Decorator > Decorator
u8 type
void registerFrequency(unsigned frequency, unsigned bandwidth)
register single frequency/bandwidth combination
void registerModulation(ModulationParameter::id_t id)
InterfaceAPIBase public header.
Interface implementation base-class.
WLANInterface public header.
Specialized Interface decorator base-class.