EmulatedEthernetInterface.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_Ethernet_EmulatedEthernetInterface_
18 #define HH_SENF_Ext_NetEmu_Ethernet_EmulatedEthernetInterface_ 1
19 
20 // Custom includes
21 #include "EthernetInterface.hh"
22 
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 
26 namespace senf {
27 namespace emu {
28 
37  : private detail::EmulatedEthernetInterfaceNet,
38  public InterfaceAPIBase<interface::Wired, interface::Bidirectional, interface::Emulated, EthernetInterface>
39  {
41 
42  public:
45 
47 
48  std::string const & v_device() const override;
49 
50  void init();
51  //TODO: limit vlanID to 12 usable bits
52  void vlan(boost::uint16_t id);
53  boost::uint16_t vlan() const;
54 
55  private:
56  // interface
57  virtual void v_id(MACAddress const & eui) override;
58  virtual MACAddress v_id() const override;
59 
60  INet4Network vlanGroupRange_;
61  unsigned portbase_;
62  MACAddress id_;
63  boost::uint16_t vlanId_;
64  std::string dev_;
65 
66  friend struct detail::EmulatedEthernetInterfaceNet;
67  };
68 
69 }}
70 
71 //-/////////////////////////////////////////////////////////////////////////////////////////////////
73 //#include "EmulatedEthernetInterface.ct"
74 //#include "EmulatedEthernetInterface.cti"
75 #endif
76 
77 
78 // Local Variables:
79 // mode: c++
80 // fill-column: 100
81 // comment-column: 40
82 // c-file-style: "senf"
83 // indent-tabs-mode: nil
84 // ispell-local-dictionary: "american"
85 // compile-command: "scons -u test"
86 // End:
std::string const & v_device() const override
Interface implementation base-class.
TypedInterfaceDecorator< EmulatedEthernetInterface, WiredInterface::Decorator > Decorator
Specialized Interface decorator base-class.
EthernetInterface public header.