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 HardwareEthernetInterface internal header */
17 #ifndef IH_SENF_Ext_NetEmu_HardwareEthernetInterface_
18 #define IH_SENF_Ext_NetEmu_HardwareEthernetInterface_ 1
21 #include <senf/Socket/Protocols/Raw/MMapPacketSocketHandle.hh>
22 #include <senf/PPI/QueueSocketSourceSink.hh>
23 #include "EthernetAnnotator.hh"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
30 class HardwareEthernetInterface;
34 /** \brief Internal: Hardware Ethernet interface PPI network */
35 struct HardwareEthernetInterfaceNet
37 ConnectedMMapPacketSocketHandle socket;
39 ppi::module::ActiveQueueSocketSource<EthernetPacket> source;
40 ppi::module::PassiveQueueSocketSink<> sink;
42 EthernetAnnotator annotatorRx_;
43 EthernetAnnotator annotatorTx_;
45 ppi::connector::ActiveOutputJack<EthernetPacket> netOutput;
46 ppi::connector::PassiveInputJack<EthernetPacket> netInput;
48 HardwareEthernetInterfaceNet();
50 HardwareEthernetInterface & self();
51 HardwareEthernetInterface const & self() const;
53 void assignSockets(ConnectedMMapPacketSocketHandle & socket);
56 void rcvBuf(unsigned);
58 void sndBuf(unsigned);
60 void setupBPF(senf::MACAddress const & hwAddr, bool srcOnly = true);
66 //-/////////////////////////////////////////////////////////////////////////////////////////////////
74 // c-file-style: "senf"
75 // indent-tabs-mode: nil
76 // ispell-local-dictionary: "american"
77 // compile-command: "scons -u test"