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
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
15 \brief TAPEthernetInterface internal header */
17 #ifndef IH_SENF_Ext_NetEmu_TAPEthernetInterface_
18 #define IH_SENF_Ext_NetEmu_TAPEthernetInterface_ 1
21 #include <senf/Socket/Protocols/Raw/TunTapSocketHandle.hh>
22 #include <senf/PPI/SocketSink.hh>
23 #include <senf/PPI/Jack.hh>
24 #include <senf/Ext/NetEmu/config.hh>
25 #include <senf/Ext/NetEmu/Ethernet/EthernetAnnotator.hh>
27 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32 class TAPEthernetInterface;
36 /** \brief Internal: Hardware Ethernet interface PPI network */
37 struct TAPEthernetInterfaceNet
39 TapSocketHandle socket;
40 senf::ppi::module::ActiveSocketSource<senf::ppi::DgramReader<EthernetPacket, SENF_EMU_MAXMTU> > source;
41 senf::ppi::module::PassiveSocketSink<> sink;
43 EthernetController ctrl_;
45 EthernetAnnotator annotatorRx_;
46 EthernetAnnotator annotatorTx_;
48 ppi::connector::ActiveOutputJack<EthernetPacket> netOutput;
49 ppi::connector::PassiveInputJack<EthernetPacket> netInput;
51 TAPEthernetInterfaceNet(std::string const & device);
53 TAPEthernetInterface & self();
54 TAPEthernetInterface const & self() const;
56 void assignSockets(bool on);
61 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // c-file-style: "senf"
70 // indent-tabs-mode: nil
71 // ispell-local-dictionary: "american"
72 // compile-command: "scons -u test"