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 HardwareDVBInterface internal header */
17 #ifndef IH_SENF_Ext_NetEmu_Ethernet_HardwareDVBInterface_
18 #define IH_SENF_Ext_NetEmu_Ethernet_HardwareDVBInterface_ 1
21 #include <senf/Socket/Protocols/Raw/PacketSocketHandle.hh>
22 #include <senf/Socket/Protocols/DVB.hh>
23 #include <senf/Packets/MPEGDVBBundle/MPESection.hh>
24 #include <senf/PPI/SocketSource.hh>
25 #include <senf/PPI/SocketSink.hh>
26 #include "ForwardSwitch.hh"
28 //-/////////////////////////////////////////////////////////////////////////////////////////////////
33 class HardwareDVBSenderInterface;
34 class HardwareDVBReceiverInterface;
38 struct HardwareDVBSenderInterfaceNet
40 HardwareDVBSenderInterfaceNet(std::string const & iface);
42 PacketSocketHandle socket;
43 ppi::module::PassiveSocketSink<ppi::TargetDgramWriter<PacketSocketHandle> > sink;
44 ForwardSwitch forwardSwitch;
48 class ActiveDVBSocketSource
49 : public ppi::module::Module
51 SENF_PPI_MODULE( ActiveDVBSocketSource );
52 SENF_LOG_CLASS_AREA();
55 ppi::connector::ActiveOutput<EthernetPacket> output;
57 typedef ppi::DgramReader<MPESection> Reader;
58 typedef Reader::Handle Handle;
60 ActiveDVBSocketSource(Handle handle);
63 void read(ppi::IOEvent::Event event);
64 void outputMPE2Eth(MPESection mpei);
71 class DVBReceiverInterfaceAnnotator
72 : public senf::ppi::module::Module
74 SENF_PPI_MODULE(DVBReceiverInterfaceAnnotator);
77 ppi::connector::PassiveInput<> input;
78 ppi::connector::ActiveOutput<> output;
80 explicit DVBReceiverInterfaceAnnotator(HardwareDVBReceiverInterface const & interface, DVBSocketController const & dvbSocketCtrl);
85 HardwareDVBReceiverInterface const & interface_;
86 DVBSocketController const & dvbSocketCtrl_;
87 senf::ClockService::clock_type lastSNRUpdate_;
92 struct HardwareDVBReceiverInterfaceNet
94 HardwareDVBReceiverInterfaceNet();
97 HardwareDVBReceiverInterface const & self() const;
99 DVBDemuxSectionHandle dvbSourceHandle;
100 DVBDemuxPESHandle dvbControlHandle;
101 DVBDvrHandle dvbStuffingHandle;
102 ActiveDVBSocketSource dvbSource;
103 DVBReceiverInterfaceAnnotator annotator;
104 ForwardSwitch forwardSwitch;
110 //-/////////////////////////////////////////////////////////////////////////////////////////////////