EmulatedDVBInterface.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_DVB_EmulatedDVBInterface_
18 #define HH_SENF_Ext_NetEmu_DVB_EmulatedDVBInterface_ 1
19 
20 // Custom includes
22 #include "DVBInterface.hh"
23 
24 #include "EmulatedDVBInterface.ih"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 namespace emu {
29 
32  public DVBInterface
33  {
34  public:
35  void registerFrequency(unsigned frequenc);
36  void registerFrequency(unsigned frequencyLower, unsigned frequencyUpper);
37 
38  protected:
40 
41  void init();
42 
45 
46  virtual void v_id(MACAddress const & id) override;
47  virtual MACAddress v_id() const override;
48  virtual void v_enable() override;
49  virtual void v_disable() override;
50  virtual bool v_enabled() const override;
51  virtual unsigned v_frequency() const override;
52  virtual unsigned v_bandwidth() const override;
53  virtual void v_frequency(unsigned frequency, unsigned bandwidth) override;
54  virtual void v_coverageRange(unsigned distance) override;
55 
56  std::string const & v_device() const override;
57 
60  std::string dev_;
61  };
62 
63 
69  : private detail::EmulatedDVBSenderInterfaceNet,
70  public EmulatedDVBInterface,
72  {
73  public:
76 
78 
81 
82  private:
83  virtual ModulationParameter::id_t v_modulationId() const override;
84  virtual void v_modulationId(ModulationParameter::id_t id) override;
85  virtual int v_txPower() const override;
86  virtual void v_txPower(int power) override;
87  virtual unsigned v_mtu() const override;
88  virtual void v_mtu(unsigned v) override;
89  virtual void v_initEmulationInterface() override;
90  virtual void v_deinitEmulationInterface() override;
91 
92  int power_;
93 
94  friend struct detail::EmulatedDVBSenderInterfaceNet;
95  };
96 
97 
103  : private detail::EmulatedDVBReceiverInterfaceNet,
104  public EmulatedDVBInterface,
106  {
107  public:
108  typedef TypedInterfaceDecorator<
110 
112 
114 
115  private:
116  virtual bool v_promisc() const override;
117  virtual void v_promisc(bool v) override;
118  virtual bool v_annotationMode() const override;
119  virtual void v_annotationMode(bool v) override;
120  virtual void v_mcAdd(MACAddress const & address) override;
121  virtual void v_mcDrop(MACAddress const & address) override;
122  virtual void v_initEmulationInterface() override;
123  virtual void v_deinitEmulationInterface() override;
124 
125  friend struct detail::EmulatedDVBReceiverInterfaceNet;
126  };
127 
128 }}
129 
130 //-/////////////////////////////////////////////////////////////////////////////////////////////////
131 #include "EmulatedDVBInterface.cci"
132 //#include "EmulatedDVBInterface.ct"
133 //#include "EmulatedDVBInterface.cti"
134 #endif
135 
136 
137 // Local Variables:
138 // mode: c++
139 // fill-column: 100
140 // comment-column: 40
141 // c-file-style: "senf"
142 // indent-tabs-mode: nil
143 // ispell-local-dictionary: "american"
144 // compile-command: "scons -u test"
145 // End:
TypedInterfaceDecorator< EmulatedDVBSenderInterface, WirelessInterface::Decorator > Decorator
Emulated wireless receiver base-class.
Emulated wireless transmitter base-class.
virtual void v_initEmulationInterface()=0
Called to initialize the emulated interface.
virtual void v_coverageRange(unsigned distance) override
virtual unsigned v_frequency() const override
Called to get current frequency.
TypedInterfaceDecorator< EmulatedDVBReceiverInterface, WirelessInterface::Decorator > Decorator
Emulated DVBReceiver Interface.
unsigned frequency() const
Get current channel frequency.
Receive capable wireless interface base class.
std::string const & v_device() const override
Emulated DVBSender Interface.
ModulationParameter::id_t modulationId_
Emulated wireless interface base-class.
virtual void v_enable() override
Called to enable interface.
unsigned bandwidth() const
Get current bandwidth.
void registerFrequency(unsigned frequenc)
virtual unsigned v_bandwidth() const override
Called to get current bandwidth.
virtual void v_deinitEmulationInterface()=0
Called to shut down the emulated interface.
virtual void v_disable() override
Called to disable interface.
DVBInterface public header.
virtual void v_tune(DVBModulationParameter::fec_rate_t fec, DVBModulationParameter::modulation_t mod, DVBModulationParameter::guard_interval_t gi, unsigned frequency) override
Specialized Interface decorator base-class.
virtual bool v_enabled() const override
Return true if interface is enabled.
Transmit capable wireless interface base class.
EmulatedWirelessInterface public header.
virtual MACAddress v_id() const override
Return the interface mac address.