The oldconfig mode can now select between multiple modes of operations.
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 1m1s
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 1m1s
This commit is contained in:
parent
ccf1bb34f0
commit
97b9d779b0
@ -27,6 +27,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodBaseInvoker_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2026_002E1_003Fresharper_002Dhost_003FSourcesCache_003F3ad82f9910d5c82d76b445db10584a60305639dcad2533e08e6c47f85e3b6d83_003FMethodBaseInvoker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodBaseInvoker_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F7a_003F86728bdc_003FMethodBaseInvoker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodBaseInvoker_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2026_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F1f03371654aa41ca984353e7e344e822b2e200_003Fc3_003F355fe836_003FMethodBaseInvoker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANetworkStream_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2026_002E2_003Fresharper_002Dhost_003FSourcesCache_003F02ece58f2cb8b2c950c683cf599a9e387c8c8bd47c4514c6534331316be3_003FNetworkStream_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANotImplementedException_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003Fa3_003F2c4f9089_003FNotImplementedException_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANullable_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F0d_003F6549c49b_003FNullable_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANullAsserts_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F3f4719f7ce375226774d6991a6afc2f6932e58b42fd58ff13c7c03771642e_003FNullAsserts_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
||||
@ -21,7 +21,6 @@ namespace skyscraper8
|
||||
internal class QuickAndDirtySatIpClient
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
private const bool ENABLE_TS_WRITER = true;
|
||||
|
||||
public QuickAndDirtySatIpClient(string[] args)
|
||||
{
|
||||
@ -73,6 +72,7 @@ namespace skyscraper8
|
||||
return;
|
||||
}
|
||||
symbolRate = Int32.Parse(args[6]);
|
||||
_modeOfOperation = SatIpOldconfigModeOfOperation.RunSkyscraper;
|
||||
}
|
||||
|
||||
public void SetPlayoutMode(string[] args)
|
||||
@ -83,7 +83,7 @@ namespace skyscraper8
|
||||
return;
|
||||
}
|
||||
destinationPort = int.Parse(args[7]);
|
||||
playoutMode = true;
|
||||
_modeOfOperation = SatIpOldconfigModeOfOperation.MulticastPlayout;
|
||||
if (args.Length == 10)
|
||||
{
|
||||
if (args[8].ToLowerInvariant().Equals("multicast"))
|
||||
@ -161,7 +161,7 @@ namespace skyscraper8
|
||||
dataStorage = new InMemoryScraperStorage();
|
||||
if (objectStorage == null)
|
||||
objectStorage = new FilesystemStorage(new DirectoryInfo("."));
|
||||
if (!playoutMode)
|
||||
if (_modeOfOperation == SatIpOldconfigModeOfOperation.RunSkyscraper)
|
||||
{
|
||||
context = new SkyscraperContext(new TsContext(), dataStorage, objectStorage);
|
||||
context.EnableTimeout = true;
|
||||
@ -173,20 +173,37 @@ namespace skyscraper8
|
||||
DateTime lastTimestamp = DateTime.Now;
|
||||
bool initMessagePrinted = false;
|
||||
|
||||
while (true)
|
||||
bool runLoop = true;
|
||||
while (runLoop)
|
||||
{
|
||||
if (playoutMode)
|
||||
switch (_modeOfOperation)
|
||||
{
|
||||
case SatIpOldconfigModeOfOperation.MulticastPlayout:
|
||||
Thread.Sleep(1000);
|
||||
Keepalive(url);
|
||||
if (!initMessagePrinted)
|
||||
{
|
||||
if (destinationPort == 0)
|
||||
{
|
||||
destinationPort = oldconfig.DestinationPort;
|
||||
}
|
||||
logger.InfoFormat("Began SAT>IP playout to port {0}", destinationPort);
|
||||
initMessagePrinted = true;
|
||||
}
|
||||
break;
|
||||
case SatIpOldconfigModeOfOperation.RecordSample:
|
||||
TimeSpan duration = DateTime.Now - lastTimestamp;
|
||||
if (duration.TotalSeconds > oldconfig.SampleLength)
|
||||
{
|
||||
runLoop = false;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
break;
|
||||
case SatIpOldconfigModeOfOperation.RunSkyscraper:
|
||||
if (packetQueue.Count >= 1)
|
||||
{
|
||||
byte[] buffer;
|
||||
@ -207,13 +224,20 @@ namespace skyscraper8
|
||||
}
|
||||
|
||||
if (context.IsAbortConditionMet())
|
||||
{
|
||||
runLoop = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (DateTime.Now.Second != lastTimestamp.Second)
|
||||
{
|
||||
Keepalive(url);
|
||||
lastTimestamp = DateTime.Now;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException(_modeOfOperation.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,12 +276,14 @@ namespace skyscraper8
|
||||
|
||||
private void DumpPacket(byte[] buffer)
|
||||
{
|
||||
if (!ENABLE_TS_WRITER)
|
||||
if (_modeOfOperation != SatIpOldconfigModeOfOperation.RecordSample)
|
||||
return;
|
||||
|
||||
if (fs == null)
|
||||
{
|
||||
string fname = String.Format("{0}.ts", DateTime.Now.Ticks);
|
||||
FileInfo fi = new FileInfo(fname);
|
||||
logger.InfoFormat("Writing Sample to: {0}", fi.FullName);
|
||||
fs = File.OpenWrite(fname);
|
||||
}
|
||||
|
||||
@ -267,7 +293,7 @@ namespace skyscraper8
|
||||
private int rtcps;
|
||||
private IPAddress destinationIp;
|
||||
private int destinationPort;
|
||||
private bool playoutMode;
|
||||
private SatIpOldconfigModeOfOperation _modeOfOperation;
|
||||
private bool multicastMode;
|
||||
private readonly SatIpOldconfig oldconfig;
|
||||
|
||||
@ -291,10 +317,10 @@ namespace skyscraper8
|
||||
this.symbolRate = args.SymbolRate;
|
||||
|
||||
//Playout mode
|
||||
this.destinationPort = args.DestinationPort;
|
||||
this.playoutMode = true;
|
||||
this.destinationPort = _modeOfOperation == SatIpOldconfigModeOfOperation.MulticastPlayout ? args.DestinationPort : 0;
|
||||
this._modeOfOperation = args.ModeOfOperation;
|
||||
this.destinationIp = IPAddress.Parse(args.DestinationIp);
|
||||
this.multicastMode = true;
|
||||
this.multicastMode = (_modeOfOperation == SatIpOldconfigModeOfOperation.MulticastPlayout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ namespace skyscraper8.Skyscraper.Net.Pcap
|
||||
EnsureOutputdirExists();
|
||||
}
|
||||
|
||||
if (pcapWritersLlc[network] == null)
|
||||
if (!pcapWritersLlc.ContainsKey(network))
|
||||
{
|
||||
string fname = String.Format("{0:X4},llc,{1}.pcap", network, DateTime.Now.Ticks);
|
||||
if (outputDirectory != null)
|
||||
|
||||
@ -24,6 +24,8 @@ public class SatIpOldconfig
|
||||
public byte MisSelection{ get; private set; }
|
||||
public string DestinationIp{ get; private set; }
|
||||
public ushort DestinationPort{ get; private set; }
|
||||
public SatIpOldconfigModeOfOperation ModeOfOperation { get; private set; }
|
||||
public int SampleLength { get; private set; }
|
||||
|
||||
public void Run()
|
||||
{
|
||||
@ -46,7 +48,8 @@ public class SatIpOldconfig
|
||||
MisSelection = ini.ReadValue(INI_CATEGORY, "misSelector", (byte)1);
|
||||
DestinationIp = ini.ReadValue(INI_CATEGORY, "destinationIp", "239.192.0.1");
|
||||
DestinationPort = ini.ReadValue(INI_CATEGORY, "destinationPort", (ushort)6969);
|
||||
|
||||
ModeOfOperation = Enum.Parse<SatIpOldconfigModeOfOperation>(ini.ReadValue(INI_CATEGORY, "modeOfOperation", SatIpOldconfigModeOfOperation.MulticastPlayout.ToString()));
|
||||
SampleLength = ini.ReadValue(INI_CATEGORY, "sampleLength", 60);
|
||||
|
||||
ConfigOption ipOption = new ConfigOption("ip", "The IP of the SAT>IP server or \"auto\"", ConfigType.ValidatedString, ServerIp);
|
||||
ipOption.Validator = validateIpTuple;
|
||||
@ -96,6 +99,8 @@ public class SatIpOldconfig
|
||||
PlsValue = Int32.Parse(configEngine.PromptUser(plsValueOption));
|
||||
}
|
||||
|
||||
if (!ForceBbframeOutput && !ForceIqOutput)
|
||||
{
|
||||
ConfigOption misEnabledOption = new ConfigOption("misEnabled", "Tune for Multi Input Stream?", ConfigType.Bool, "false");
|
||||
EnableMis = Boolean.Parse(configEngine.PromptUser(misEnabledOption));
|
||||
if (EnableMis)
|
||||
@ -105,7 +110,22 @@ public class SatIpOldconfig
|
||||
MisSelection = Byte.Parse(configEngine.PromptUser(misSelectorOptions));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConfigOption modeOfOperation = new ConfigOption("modeOfOperation", "Mode of Operation?", ConfigType.Choice, ModeOfOperation.ToString());
|
||||
modeOfOperation.Choices = new List<string>(Enum.GetNames<SatIpOldconfigModeOfOperation>());
|
||||
ModeOfOperation = Enum.Parse<SatIpOldconfigModeOfOperation>(configEngine.PromptUser(modeOfOperation));
|
||||
|
||||
switch (ModeOfOperation)
|
||||
{
|
||||
case SatIpOldconfigModeOfOperation.RunSkyscraper:
|
||||
break;
|
||||
case SatIpOldconfigModeOfOperation.RecordSample:
|
||||
ConfigOption sampleLengthOption = new ConfigOption("sampleLength", "Sample Length in seconds?", ConfigType.ValidatedString, "60");
|
||||
sampleLengthOption.Validator = frequencyValid;
|
||||
SampleLength = int.Parse(configEngine.PromptUser(sampleLengthOption));
|
||||
break;
|
||||
case SatIpOldconfigModeOfOperation.MulticastPlayout:
|
||||
ConfigOption destIpOption = new ConfigOption("destinationIp", "SAT>IP Multicast destination IP address?",ConfigType.ValidatedString, DestinationIp);
|
||||
destIpOption.Validator = serverIpValidatorTuple;
|
||||
DestinationIp = configEngine.PromptUser(destIpOption);
|
||||
@ -113,6 +133,8 @@ public class SatIpOldconfig
|
||||
ConfigOption destPortOption = new ConfigOption("destinationPort", "SAT>IP Multicast destination Port?", ConfigType.ValidatedString, DestinationPort.ToString());
|
||||
destPortOption.Validator = destinationTypeValidatorTuple;
|
||||
DestinationPort = ushort.Parse(configEngine.PromptUser(destPortOption));
|
||||
break;
|
||||
}
|
||||
|
||||
ini.WriteValue(INI_CATEGORY, "ip", ServerIp);
|
||||
ini.WriteValue(INI_CATEGORY, "diseqc", Diseqc);
|
||||
@ -129,6 +151,8 @@ public class SatIpOldconfig
|
||||
ini.WriteValue(INI_CATEGORY, "misSelector", MisSelection);
|
||||
ini.WriteValue(INI_CATEGORY, "destinationIp", DestinationIp);
|
||||
ini.WriteValue(INI_CATEGORY, "destinationPort", DestinationPort);
|
||||
ini.WriteValue(INI_CATEGORY, "modeOfOperation", ModeOfOperation.ToString());
|
||||
ini.WriteValue(INI_CATEGORY, "sampleLength", SampleLength);
|
||||
pluginManager.SaveConfiguration();
|
||||
Console.WriteLine("Settings saved.");
|
||||
|
||||
|
||||
8
skyscraper8/Skyscraper/SatIpOldconfigModeOfOperation.cs
Normal file
8
skyscraper8/Skyscraper/SatIpOldconfigModeOfOperation.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace skyscraper8.Skyscraper;
|
||||
|
||||
public enum SatIpOldconfigModeOfOperation : int
|
||||
{
|
||||
RunSkyscraper = 0,
|
||||
RecordSample = 1,
|
||||
MulticastPlayout = 2
|
||||
}
|
||||
@ -3242,6 +3242,10 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
if (dsap == 0xff || ssap == 0xff)
|
||||
{
|
||||
ushort llcLength = llcStream.ReadUInt16BE();
|
||||
if (llcLength > llcStream.Length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (llcLength == etherType)
|
||||
{
|
||||
//TEST or XID PDU, likely unneeded.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user