Patches for Voile to display contents from DVB-NIP file deliveries.
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 8s

This commit is contained in:
feyris-tan 2026-03-13 22:27:13 +01:00
parent b50eb3b5e6
commit 0e3c138a1e
15 changed files with 364 additions and 189 deletions

View File

@ -379,5 +379,13 @@ namespace skyscraper8.DvbNip
{ {
this.sourceHash = sourceHash; this.sourceHash = sourceHash;
} }
public void Reset()
{
bootstrapped = false;
fluteHits = 0;
fluteMisses = 0;
flutes = null;
}
} }
} }

View File

@ -250,5 +250,6 @@ namespace skyscraper8.DvbNip
listener.TrimmedLength = stream.Position; listener.TrimmedLength = stream.Position;
return listener; return listener;
} }
} }
} }

View File

@ -12,7 +12,8 @@
// This source code was auto-generated by xsd, Version=4.8.9037.0. // This source code was auto-generated by xsd, Version=4.8.9037.0.
// //
namespace skyscraper8.Ietf.FLUTE { namespace skyscraper8.Ietf.FLUTE {
using System.Xml.Serialization; using System.ComponentModel;
using System.Xml.Serialization;
/// <remarks/> /// <remarks/>
@ -23,8 +24,9 @@ namespace skyscraper8.Ietf.FLUTE {
[System.Xml.Serialization.XmlTypeAttribute(TypeName="FDT-InstanceType", Namespace="urn:IETF:metadata:2005:FLUTE:FDT")] [System.Xml.Serialization.XmlTypeAttribute(TypeName="FDT-InstanceType", Namespace="urn:IETF:metadata:2005:FLUTE:FDT")]
[System.Xml.Serialization.XmlRootAttribute("FDT-Instance", Namespace="urn:IETF:metadata:2005:FLUTE:FDT", IsNullable=false)] [System.Xml.Serialization.XmlRootAttribute("FDT-Instance", Namespace="urn:IETF:metadata:2005:FLUTE:FDT", IsNullable=false)]
public partial class FDTInstanceType { public partial class FDTInstanceType {
[TypeConverter(typeof(ExpandableObjectConverter))]
private FileType[] fileField;
private FileType[] fileField;
private uint schemaVersionField; private uint schemaVersionField;

View File

@ -169,6 +169,18 @@ namespace skyscraper5.Skyscraper
IniSection section = this[category]; IniSection section = this[category];
section[key] = value.ToString(CultureInfo.InvariantCulture); section[key] = value.ToString(CultureInfo.InvariantCulture);
} }
public static void WriteIniValue(FileInfo outputIni, string category, string key, string value)
{
Ini ini;
if (outputIni.Exists)
ini = new Ini(outputIni.FullName);
else
ini = new Ini();
ini.WriteValue(category, key, value);
ini.Export(outputIni);
}
} }
public class IniSection : Dictionary<string,string> public class IniSection : Dictionary<string,string>

View File

@ -1,4 +1,5 @@
using log4net; using log4net;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.Net.Pcap; using skyscraper5.Skyscraper.Net.Pcap;
using skyscraper5.Skyscraper.Plugins; using skyscraper5.Skyscraper.Plugins;
using skyscraper8.Skyscraper.Scraper.Storage; using skyscraper8.Skyscraper.Scraper.Storage;
@ -17,13 +18,31 @@ namespace skyscraper8.Skyscraper.Net.Pcap
{ {
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name); private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
private PcapWriter[] pcapWriters; private PcapWriter[] pcapWriters;
private DirectoryInfo outputDirectory;
public void HandlePacket(int pid, byte[] payload) public void HandlePacket(int pid, byte[] payload)
{ {
if (pcapWriters == null) if (pcapWriters == null)
{
pcapWriters = new PcapWriter[0x1fff]; pcapWriters = new PcapWriter[0x1fff];
PluginManager pluginManager = PluginManager.GetInstance();
string outDirPath = pluginManager.Ini.ReadValue("pcapwriter", "outdir", null);
if (!string.IsNullOrEmpty(outDirPath))
{
outputDirectory = new DirectoryInfo(outDirPath);
if (!outputDirectory.Exists)
outputDirectory.EnsureExists();
}
}
if (pcapWriters[pid] == null) if (pcapWriters[pid] == null)
{ {
string fname = String.Format("{0:X4},{1}.pcap", pid, DateTime.Now.Ticks); string fname = String.Format("{0:X4},{1}.pcap", pid, DateTime.Now.Ticks);
if (outputDirectory != null)
{
fname = Path.Combine(outputDirectory.FullName, fname);
}
logger.InfoFormat("Opening file for writing: {0}", fname); logger.InfoFormat("Opening file for writing: {0}", fname);
FileStream fs = File.OpenWrite(fname); FileStream fs = File.OpenWrite(fname);
pcapWriters[pid] = new PcapWriter(fs, TcpdumpNetworkType.RawIp); pcapWriters[pid] = new PcapWriter(fs, TcpdumpNetworkType.RawIp);

View File

@ -0,0 +1,43 @@
using skyscraper5.Skyscraper;
using skyscraper5.Skyscraper.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Skyscraper.Plugins
{
public class ConfigureFromForeignApplication
{
private ConfigureFromForeignApplication()
{
pluginManager = PluginManager.GetInstance();
}
private PluginManager pluginManager;
private static ConfigureFromForeignApplication instance;
public static ConfigureFromForeignApplication GetInstance()
{
if (instance == null)
{
instance = new ConfigureFromForeignApplication();
}
return instance;
}
public void SaveConfig()
{
pluginManager.SaveConfiguration();
}
public Ini Ini
{
get
{
return pluginManager.Ini;
}
}
}
}

View File

@ -10,5 +10,6 @@ namespace skyscraper5.Skyscraper.Plugins
bool CanHandlePacket(InternetHeader internetHeader, byte[] ipv4Packet); bool CanHandlePacket(InternetHeader internetHeader, byte[] ipv4Packet);
void HandlePacket(InternetHeader internetHeader, byte[] ipv4Packet); void HandlePacket(InternetHeader internetHeader, byte[] ipv4Packet);
bool StopProcessingAfterThis(); bool StopProcessingAfterThis();
} }
} }

View File

@ -22,6 +22,7 @@ using skyscraper8.Skyscraper.Net.Pcap;
using skyscraper8.Skyscraper.Plugins; using skyscraper8.Skyscraper.Plugins;
using skyscraper8.Skyscraper.Scraper.Storage; using skyscraper8.Skyscraper.Scraper.Storage;
using skyscraper8.Skyscraper.Text; using skyscraper8.Skyscraper.Text;
using skyscraper5.src.InteractionChannel.Model.Descriptors;
namespace skyscraper5.Skyscraper.Plugins namespace skyscraper5.Skyscraper.Plugins
{ {
@ -31,7 +32,7 @@ namespace skyscraper5.Skyscraper.Plugins
private PluginManager() private PluginManager()
{ {
_mpePlugins = new List<ISkyscraperMpePlugin>(); _mpePluginTypes = new List<Type>();
_gpsReceiverFactories = new Dictionary<int, IGpsReceiverFactory>(); _gpsReceiverFactories = new Dictionary<int, IGpsReceiverFactory>();
descriptorBannedTables = new Dictionary<string, bool[]>(); descriptorBannedTables = new Dictionary<string, bool[]>();
descriptorMap = new Dictionary<string, ConstructorInfo[]>(); descriptorMap = new Dictionary<string, ConstructorInfo[]>();
@ -48,7 +49,32 @@ namespace skyscraper5.Skyscraper.Plugins
FileInfo skyscraperMainAssembly = GetSkyscraperMainAssembly(); FileInfo skyscraperMainAssembly = GetSkyscraperMainAssembly();
DirectoryInfo skyscraperHome = skyscraperMainAssembly.Directory; DirectoryInfo skyscraperHome = skyscraperMainAssembly.Directory;
LoadIni(skyscraperHome);
if (skyscraperMainAssembly != null)
{
DirectoryInfo directory = skyscraperMainAssembly.Directory;
logger.DebugFormat("Found skyscraper main assembly at: {0}", directory.FullName);
FileInfo[] fileInfos = directory.GetFiles("skyscraper5.*.dll");
foreach (FileInfo fileInfo in fileInfos)
{
try
{
logger.Info(String.Format("Trying to load: {0}", fileInfo.Name));
Assembly loadFile = Assembly.LoadFile(fileInfo.FullName);
ScanAssembly(loadFile);
logger.Debug(String.Format("Loaded {0}", fileInfo.Name));
}
catch (Exception e)
{
logger.ErrorFormat("Failed to scan assembly {0}", fileInfo.Name);
}
}
}
}
private void LoadIni(DirectoryInfo skyscraperHome)
{
iniFileInfo = new FileInfo(Path.Combine(skyscraperHome.FullName, iniFilename)); iniFileInfo = new FileInfo(Path.Combine(skyscraperHome.FullName, iniFilename));
if (iniFileInfo.Exists) if (iniFileInfo.Exists)
{ {
@ -61,7 +87,7 @@ namespace skyscraper5.Skyscraper.Plugins
FileInfo pluginFileInfo = new FileInfo(valuePair.Value); FileInfo pluginFileInfo = new FileInfo(valuePair.Value);
if (!pluginFileInfo.Exists) if (!pluginFileInfo.Exists)
continue; continue;
if (resolveDirectoryInfos == null) if (resolveDirectoryInfos == null)
resolveDirectoryInfos = new HashSet<DirectoryInfo>(); resolveDirectoryInfos = new HashSet<DirectoryInfo>();
if (IsOnWindows()) if (IsOnWindows())
@ -84,28 +110,6 @@ namespace skyscraper5.Skyscraper.Plugins
Debug.WriteLine(String.Format("{0} was not found. Create it using the UI!", iniFileInfo.FullName)); Debug.WriteLine(String.Format("{0} was not found. Create it using the UI!", iniFileInfo.FullName));
Ini = new Ini(); Ini = new Ini();
} }
if (skyscraperMainAssembly != null)
{
DirectoryInfo directory = skyscraperMainAssembly.Directory;
logger.DebugFormat("Found skyscraper main assembly at: {0}", directory.FullName);
FileInfo[] fileInfos = directory.GetFiles("skyscraper5.*.dll");
foreach (FileInfo fileInfo in fileInfos)
{
try
{
logger.Info(String.Format("Trying to load: {0}", fileInfo.Name));
Assembly loadFile = Assembly.LoadFile(fileInfo.FullName);
ScanAssembly(loadFile);
logger.Debug(String.Format("Loaded {0}", fileInfo.Name));
}
catch (Exception e)
{
logger.ErrorFormat("Failed to scan assembly {0}", fileInfo.Name);
}
}
}
} }
private FileInfo GetSkyscraperMainAssembly() private FileInfo GetSkyscraperMainAssembly()
@ -193,6 +197,14 @@ namespace skyscraper5.Skyscraper.Plugins
return _instance; return _instance;
} }
public static void NotifyIniUpdate(Ini newIni)
{
if (_instance == null)
return;
_instance.Ini = newIni;
}
private Type storageIdAttributeTyoe = typeof(StorageIdAttribute); private Type storageIdAttributeTyoe = typeof(StorageIdAttribute);
private Type objectStorageFactoryType = typeof(ObjectStorageFactory); private Type objectStorageFactoryType = typeof(ObjectStorageFactory);
private Type dataStorageFactoryType = typeof(DataStorageFactory); private Type dataStorageFactoryType = typeof(DataStorageFactory);
@ -210,7 +222,7 @@ namespace skyscraper5.Skyscraper.Plugins
private Type ipTrafficHandler = typeof(IpTrafficHandler); private Type ipTrafficHandler = typeof(IpTrafficHandler);
private List<IDnsParser> _dnsParsers; private List<IDnsParser> _dnsParsers;
private List<ISkyscraperMpePlugin> _mpePlugins; private List<Type> _mpePluginTypes;
private Dictionary<int, IGpsReceiverFactory> _gpsReceiverFactories; private Dictionary<int, IGpsReceiverFactory> _gpsReceiverFactories;
private Dictionary<string, ConstructorInfo[]> descriptorMap; private Dictionary<string, ConstructorInfo[]> descriptorMap;
private Dictionary<string, bool[]> descriptorBannedTables; private Dictionary<string, bool[]> descriptorBannedTables;
@ -252,8 +264,7 @@ namespace skyscraper5.Skyscraper.Plugins
if (type.IsAssignableTo(mpePluginType)) if (type.IsAssignableTo(mpePluginType))
{ {
ISkyscraperMpePlugin mpePlugin = (ISkyscraperMpePlugin)Activator.CreateInstance(type); _mpePluginTypes.Add(type);
_mpePlugins.Add(mpePlugin);
continue; continue;
} }
else if (type.IsAssignableTo(gpsReceiverFactoryType)) else if (type.IsAssignableTo(gpsReceiverFactoryType))
@ -338,7 +349,7 @@ namespace skyscraper5.Skyscraper.Plugins
throw new NotImplementedException(); throw new NotImplementedException();
} }
_mpePlugins.Sort(sorter); _mpePluginTypes.Sort(sorter);
} }
private void HandleIpTrafficHandler(Type type) private void HandleIpTrafficHandler(Type type)
@ -682,7 +693,15 @@ namespace skyscraper5.Skyscraper.Plugins
public ReadOnlyCollection<ISkyscraperMpePlugin> GetMpePlugins() public ReadOnlyCollection<ISkyscraperMpePlugin> GetMpePlugins()
{ {
return _mpePlugins.AsReadOnly(); List<ISkyscraperMpePlugin> result = new List<ISkyscraperMpePlugin>();
foreach(Type t in _mpePluginTypes)
{
object? v = Activator.CreateInstance(t);
ISkyscraperMpePlugin mpePlugin = v as ISkyscraperMpePlugin;
if (mpePlugin != null)
result.Add(mpePlugin);
}
return result.AsReadOnly();
} }
public ReadOnlyDictionary<int, IGpsReceiverFactory> GetGpsReceiverFactories() public ReadOnlyDictionary<int, IGpsReceiverFactory> GetGpsReceiverFactories()

View File

@ -210,13 +210,14 @@ namespace skyscraper5.Skyscraper.Scraper
void OnDvbNipCarrierDetected(NipActualCarrierInformation currentCarrierInformation); void OnDvbNipCarrierDetected(NipActualCarrierInformation currentCarrierInformation);
void OnDvbNipPrivateDataSignallingManifest(PrivateDataSignallingManifestType privateDataSignallingManifest); void OnDvbNipPrivateDataSignallingManifest(PrivateDataSignallingManifestType privateDataSignallingManifest);
void OnDvbNipServiceListEntryPoints(NipActualCarrierInformation currentCarrierInformation, ServiceListEntryPoints serviceListEntryPoints, DateTime dvbNipTime); void OnDvbNipServiceListEntryPoints(NipActualCarrierInformation currentCarrierInformation, ServiceListEntryPoints serviceListEntryPoints, DateTime dvbNipTime);
void OnDvbNipServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId1, string serviceListId2); void OnDvbNipServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId1, ServiceListType serviceListId2);
void OnDvbNipTimeOffsetFile(NipActualCarrierInformation currentCarrierInformation, TimeOffsetFileType timeOffsetFile); void OnDvbNipTimeOffsetFile(NipActualCarrierInformation currentCarrierInformation, TimeOffsetFileType timeOffsetFile);
void OnDvbNipNetworkInformationFile(NipActualCarrierInformation currentCarrierInformation, NetworkInformationFileType networkInformationFile); void OnDvbNipNetworkInformationFile(NipActualCarrierInformation currentCarrierInformation, NetworkInformationFileType networkInformationFile);
void DvbNipServiceInformation(NipActualCarrierInformation currentCarrierInformation, ServiceInformationFileType serviceInformationFile); void DvbNipServiceInformation(NipActualCarrierInformation currentCarrierInformation, ServiceInformationFileType serviceInformationFile);
void OnDvbNipFileAnnouncement(FDTInstanceType flute); void OnDvbNipFileAnnouncement(FDTInstanceType flute);
void OnAstraSgtList(SgtList list); void OnAstraSgtList(SgtList list);
void OnAstraSgtService(SgtService child); void OnAstraSgtService(SgtService child);
void NotifyTransportStreamId(int tsid, int nid);
TaskQueue Tasks { get; set; } TaskQueue Tasks { get; set; }

View File

@ -1395,14 +1395,15 @@ namespace skyscraper5.Skyscraper.Scraper
public void NotifyFileArrival(VfsFile vfsFile) public void NotifyFileArrival(VfsFile vfsFile)
{ {
UiJunction?.DsmCcVfs(vfsFile);
if (!CurrentTransportStreamId.HasValue) if (!CurrentTransportStreamId.HasValue)
return; return;
if (!CurrentNetworkId.HasValue) if (!CurrentNetworkId.HasValue)
return; return;
if (ObjectStorage.ObjectCarouselFileArrival(vfsFile, CurrentTransportStreamId.Value, CurrentNetworkId.Value)) UiJunction?.NotifyTransportStreamId(CurrentTransportStreamId.Value, CurrentNetworkId.Value);
UiJunction?.DsmCcVfs(vfsFile);
if (ObjectStorage.ObjectCarouselFileArrival(vfsFile, CurrentTransportStreamId.Value, CurrentNetworkId.Value))
{ {
LogEvent(SkyscraperContextEvent.FileArrival, String.Format("PID {0:X4}, Path {1}", vfsFile.SourcePid, vfsFile.ToString())); LogEvent(SkyscraperContextEvent.FileArrival, String.Format("PID {0:X4}, Path {1}", vfsFile.SourcePid, vfsFile.ToString()));
} }
@ -2980,7 +2981,7 @@ namespace skyscraper5.Skyscraper.Scraper
public void OnServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId, public void OnServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId,
ServiceListType serviceList) ServiceListType serviceList)
{ {
UiJunction?.OnDvbNipServiceList(currentCarrierInformation, serviceListId, serviceListId); UiJunction?.OnDvbNipServiceList(currentCarrierInformation, serviceListId, serviceList);
List<DvbIService> services = DvbIUtils.FlattenServiceList(serviceList).ToList(); List<DvbIService> services = DvbIUtils.FlattenServiceList(serviceList).ToList();
DvbIDataStorage dataStorage = DataStorage; DvbIDataStorage dataStorage = DataStorage;

View File

@ -1623,6 +1623,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
public bool DvbNipTestForFile(string announcedFileContentLocation) public bool DvbNipTestForFile(string announcedFileContentLocation)
{ {
string saneFilename = DvbNipUtilities.MakeFilename(announcedFileContentLocation); string saneFilename = DvbNipUtilities.MakeFilename(announcedFileContentLocation);
saneFilename = Path.Combine(rootDirectory.FullName, "DVB-NIP-Content", saneFilename);
FileInfo fi = new FileInfo(saneFilename); FileInfo fi = new FileInfo(saneFilename);
return fi.Exists; return fi.Exists;
} }
@ -1630,6 +1631,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
public void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener) public void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener)
{ {
string filename = DvbNipUtilities.MakeFilename(listener.FileAssociation.ContentLocation); string filename = DvbNipUtilities.MakeFilename(listener.FileAssociation.ContentLocation);
filename = Path.Combine(rootDirectory.FullName, "DVB-NIP-Content", filename);
FileInfo fi = new FileInfo(filename); FileInfo fi = new FileInfo(filename);
fi.Directory.EnsureExists(); fi.Directory.EnsureExists();
FileStream outStream = fi.OpenWrite(); FileStream outStream = fi.OpenWrite();
@ -2000,5 +2002,31 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
fileStream.Flush(); fileStream.Flush();
fileStream.Close(); fileStream.Close();
} }
}
public bool TestForObjectCarouselFileArrival(string file, int transportStreamId, int pid, int networkId)
{
if (file.StartsWith("\\"))
file = file.Substring(1);
string combine = Path.Combine(rootDirectory.FullName, "DSM-CC_Objects", networkId.ToString(), transportStreamId.ToString(), pid.ToString(), file);
FileInfo fi = new FileInfo(combine);
return fi.Exists;
}
public byte[] GetObjectCarouselFileArrival(string file, int transportStreamId, int pid, int networkId)
{
if (file.StartsWith("\\"))
file = file.Substring(1);
string combine = Path.Combine(rootDirectory.FullName, "DSM-CC_Objects", networkId.ToString(), transportStreamId.ToString(), pid.ToString(), file);
FileInfo fi = new FileInfo(combine);
return File.ReadAllBytes(fi.FullName);
}
public byte[] DvbNipGetFile(string path)
{
string saneFilename = DvbNipUtilities.MakeFilename(path);
saneFilename = Path.Combine(rootDirectory.FullName, "DVB-NIP-Content", saneFilename);
FileInfo fi = new FileInfo(saneFilename);
return File.ReadAllBytes(fi.FullName);
}
}
} }

View File

@ -1,142 +1,142 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using skyscraper5.Dvb.DataBroadcasting.SkyscraperVfs; using skyscraper5.Dvb.DataBroadcasting.SkyscraperVfs;
using skyscraper5.Dvb.Descriptors; using skyscraper5.Dvb.Descriptors;
using skyscraper8.DvbNip; using skyscraper8.DvbNip;
using skyscraper8.Experimentals.NdsSsu; using skyscraper8.Experimentals.NdsSsu;
using skyscraper8.Ietf.FLUTE; using skyscraper8.Ietf.FLUTE;
using skyscraper8.SimpleServiceDiscoveryProtocol; using skyscraper8.SimpleServiceDiscoveryProtocol;
using skyscraper8.Skyscraper.Drawing; using skyscraper8.Skyscraper.Drawing;
namespace skyscraper8.Skyscraper.Scraper.Storage namespace skyscraper8.Skyscraper.Scraper.Storage
{ {
public class NullObjectStorage : ObjectStorage public class NullObjectStorage : ObjectStorage
{ {
public bool ObjectCarouselFileArrival(VfsFile vfsFile, int transportStreamId, int networkId) public bool ObjectCarouselFileArrival(VfsFile vfsFile, int transportStreamId, int networkId)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void DataCarouselModuleArrival(int currentNetworkId, int currentTransportStreamId, int elementaryPid, public void DataCarouselModuleArrival(int currentNetworkId, int currentTransportStreamId, int elementaryPid,
ushort moduleModuleId, byte moduleModuleVersion, Stream result) ushort moduleModuleId, byte moduleModuleVersion, Stream result)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool IsDsmCcModuleWanted(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleId, public bool IsDsmCcModuleWanted(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleId,
byte moduleVersion) byte moduleVersion)
{ {
return false; return false;
} }
public bool TestForFramegrab(int currentNetworkId, int transportStreamId, ushort mappingProgramNumber, public bool TestForFramegrab(int currentNetworkId, int transportStreamId, ushort mappingProgramNumber,
int mappingStreamElementaryPid) int mappingStreamElementaryPid)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void StoreFramegrab(int currentNetworkId, int transportStreamId, ushort mappingProgramNumber, ushort pid, public void StoreFramegrab(int currentNetworkId, int transportStreamId, ushort mappingProgramNumber, ushort pid,
byte[] imageData) byte[] imageData)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void WaitForCompletion() public void WaitForCompletion()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void UiSetVersion(int version) public void UiSetVersion(int version)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public class NullToken public class NullToken
{ {
} }
public object[] GetPluginConnector() public object[] GetPluginConnector()
{ {
return new object[1] return new object[1]
{ {
new NullToken() new NullToken()
}; };
} }
public void Ping() public void Ping()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool DvbNipTestForFile(string announcedFileContentLocation) public bool DvbNipTestForFile(string announcedFileContentLocation)
{ {
return true; return true;
} }
public void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener) public void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener)
{ {
} }
public void StoreIqGraph(Guid jobGuid, long frequency, char polarity, IqChartData plot) public void StoreIqGraph(Guid jobGuid, long frequency, char polarity, IqChartData plot)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void StoreRfSpectrum(Guid jobGuid, RfSpectrumData rfSpectrum) public void StoreRfSpectrum(Guid jobGuid, RfSpectrumData rfSpectrum)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void DeleteIqGraph(Guid selectedGuid, int frequencyItem1, SatelliteDeliverySystemDescriptor.PolarizationEnum frequencyItem2) public void DeleteIqGraph(Guid selectedGuid, int frequencyItem1, SatelliteDeliverySystemDescriptor.PolarizationEnum frequencyItem2)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void DeleteRfSpectrum(Guid selectedGuid) public void DeleteRfSpectrum(Guid selectedGuid)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool OtvSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int sourcePid, ushort tableIdExtension, public bool OtvSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int sourcePid, ushort tableIdExtension,
uint fileId, uint unknown1, uint length) uint fileId, uint unknown1, uint length)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void OnOtvSsuComplete(int? currentNetworkId, int? currentTransportStreamId, int sourcePid, Stream getStream, public void OnOtvSsuComplete(int? currentNetworkId, int? currentTransportStreamId, int sourcePid, Stream getStream,
ushort tableIdExtension, uint fileId, uint unknown1, uint length) ushort tableIdExtension, uint fileId, uint unknown1, uint length)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void OnNdsSsuComplete(int? currentNetworkId, int? currentTransportStreamId, int pid, ushort tableIdExtension, public void OnNdsSsuComplete(int? currentNetworkId, int? currentTransportStreamId, int pid, ushort tableIdExtension,
NdsSsuDataMap dataMap) NdsSsuDataMap dataMap)
{ {
dataMap.Dispose(); dataMap.Dispose();
} }
public bool NdsSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int pid, ushort tableIdExtension) public bool NdsSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int pid, ushort tableIdExtension)
{ {
return true; return true;
} }
public bool SsdpDeviceKnown(SsdpDevice ssdpDevice) public bool SsdpDeviceKnown(SsdpDevice ssdpDevice)
{ {
return false; return false;
} }
public void SsdpStoreMetadata(SsdpDevice ssdpDevice, byte[] ssdpMetadataByteArray) public void SsdpStoreMetadata(SsdpDevice ssdpDevice, byte[] ssdpMetadataByteArray)
{ {
} }
public byte[] SsdpGetMetadata(SsdpDevice ssdpDevice) public byte[] SsdpGetMetadata(SsdpDevice ssdpDevice)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool TestForSisDsaci(int value1, int value2, ushort groupId, int versionNumber) public bool TestForSisDsaci(int value1, int value2, ushort groupId, int versionNumber)
@ -148,5 +148,20 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
}
} public bool TestForObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId)
{
throw new NotImplementedException();
}
public byte[] GetObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId)
{
throw new NotImplementedException();
}
public byte[] DvbNipGetFile(string path)
{
return new byte[0] { };
}
}
}

View File

@ -18,6 +18,9 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
public interface ObjectStorage : ISsdpCache public interface ObjectStorage : ISsdpCache
{ {
bool ObjectCarouselFileArrival(VfsFile vfsFile, int transportStreamId, int networkId); bool ObjectCarouselFileArrival(VfsFile vfsFile, int transportStreamId, int networkId);
bool TestForObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId);
byte[] GetObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId);
void DataCarouselModuleArrival(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleModuleId, byte moduleModuleVersion, Stream result); void DataCarouselModuleArrival(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleModuleId, byte moduleModuleVersion, Stream result);
bool IsDsmCcModuleWanted(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleId, byte moduleVersion); bool IsDsmCcModuleWanted(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleId, byte moduleVersion);
bool TestForFramegrab(int currentNetworkId, int transportStreamId, ushort mappingProgramNumber, int mappingStreamElementaryPid); bool TestForFramegrab(int currentNetworkId, int transportStreamId, ushort mappingProgramNumber, int mappingStreamElementaryPid);
@ -39,5 +42,6 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
bool NdsSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int pid, ushort tableIdExtension); bool NdsSsuTestFile(int? currentNetworkId, int? currentTransportStreamId, int pid, ushort tableIdExtension);
bool TestForSisDsaci(int value1, int value2, ushort groupId, int versionNumber); bool TestForSisDsaci(int value1, int value2, ushort groupId, int versionNumber);
void StoreSisDsaci(int value1, int value2, ushort currentDsaGroupId, int versionNumber, Stream dsaci); void StoreSisDsaci(int value1, int value2, ushort currentDsaGroupId, int versionNumber, Stream dsaci);
} byte[] DvbNipGetFile(string path);
}
} }

View File

@ -210,5 +210,23 @@ namespace skyscraper8.Skyscraper.Scraper.Storage.Tar
string filename = String.Format("dvb-sis/{0}/{1}/Group{2}_Version{3}.xml", nid, tsid, currentDsaGroupId, versionNumber); string filename = String.Format("dvb-sis/{0}/{1}/Group{2}_Version{3}.xml", nid, tsid, currentDsaGroupId, versionNumber);
tarArchive.WriteEntry(filename, dsaci); tarArchive.WriteEntry(filename, dsaci);
} }
public bool TestForObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId)
{
string filename = string.Format("dsm-cc/objects/{0}/{1}/{2}/{3}", networkId, transportStreamId, pid, vfsFile.ToString());
return tarArchive.HasEntry(filename);
}
public byte[] GetObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId)
{
string filename = string.Format("dsm-cc/objects/{0}/{1}/{2}/{3}", networkId, transportStreamId, pid, vfsFile.ToString());
return tarArchive.ReadEntry(filename);
}
public byte[] DvbNipGetFile(string path)
{
string filename = "/nip/" + DvbNipUtilities.MakeFilename(path);
return tarArchive.ReadEntry(filename);
}
} }
} }

View File

@ -43,22 +43,25 @@ namespace skyscraper8.Skyscraper.Scraper.Storage.Utilities
public ushort CarrierId { get; set; } public ushort CarrierId { get; set; }
protected bool Equals(DatabaseKeyNipMulticastGatewayConfigurationTransportSession other)
{
return TSI == other.TSI && DestinationPort == other.DestinationPort && DestinationAddress.Equals(other.DestinationAddress) && SourceAddress.Equals(other.SourceAddress) && ServiceId == other.ServiceId && NetworkId == other.NetworkId && LinkId == other.LinkId && CarrierId == other.CarrierId;
}
public override bool Equals(object? obj) public override bool Equals(object? obj)
{ {
if (ReferenceEquals(null, obj)) return false; return obj is DatabaseKeyNipMulticastGatewayConfigurationTransportSession session &&
if (ReferenceEquals(this, obj)) return true; TSI == session.TSI &&
if (obj.GetType() != this.GetType()) return false; DestinationPort == session.DestinationPort &&
return Equals((DatabaseKeyNipMulticastGatewayConfigurationTransportSession)obj); EqualityComparer<IPAddress>.Default.Equals(DestinationAddress, session.DestinationAddress) &&
EqualityComparer<IPAddress>.Default.Equals(SourceAddress, session.SourceAddress) &&
ServiceId == session.ServiceId &&
NetworkId == session.NetworkId &&
LinkId == session.LinkId &&
CarrierId == session.CarrierId;
} }
public override int GetHashCode() public override int GetHashCode()
{ {
return HashCode.Combine(TSI, DestinationPort, DestinationAddress, SourceAddress, ServiceId, NetworkId, LinkId, CarrierId); return HashCode.Combine(TSI, DestinationPort, DestinationAddress, SourceAddress, ServiceId, NetworkId, LinkId, CarrierId);
} }
} }
} }