Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3668cad724 | ||
|
|
30026b2b02 | ||
|
|
c0f644df1a | ||
|
|
36969eede2 | ||
|
|
bc6d9afa52 | ||
|
|
92f787bbd4 | ||
|
|
eb2ceb5f72 | ||
|
|
4786e9865c | ||
|
|
af8edceca2 | ||
|
|
8e3311bcce | ||
|
|
2c4bc0a558 | ||
|
|
e4d861ef6e | ||
| f93d5e7f01 | |||
|
|
6efec7f07b | ||
|
|
a1125fbb2d | ||
|
|
c64a0f5c46 | ||
|
|
8f2c31f10d | ||
|
|
124bf9eb49 | ||
|
|
33d17a730b | ||
|
|
fc8053451a | ||
|
|
5cd08b978d | ||
|
|
5aa475dd46 | ||
|
|
28d9b9b2f8 | ||
|
|
781636e0a3 | ||
|
|
980cec0332 | ||
|
|
5745cf0421 | ||
|
|
c03d4238bf | ||
|
|
c455dfa0ed | ||
|
|
e8893f85ce | ||
|
|
aa21725182 | ||
|
|
897c5e95ca | ||
|
|
90f807343b | ||
|
|
4a90c8751f | ||
|
|
2d8b66e1e8 | ||
|
|
d69c4cda68 | ||
|
|
799f36dba8 | ||
|
|
260821ed9d | ||
| a340885f89 | |||
|
|
3342141539 | ||
|
|
46798f4df1 | ||
|
|
1e9b321bd7 | ||
|
|
41d90d9360 | ||
|
|
6e35f26528 | ||
|
|
396365fe72 | ||
|
|
6bd2c81b64 | ||
|
|
c324a923de | ||
| 90ac87770d | |||
|
|
7630775d55 | ||
|
|
a46e4ff556 | ||
|
|
fe66c643f8 | ||
|
|
3bdf478a81 | ||
|
|
3da10ae897 | ||
|
|
39f8e936f3 | ||
| b3f92bf407 | |||
| 5bbe8e9dc0 | |||
| cffcd5b9e3 | |||
| f4a3ba7303 | |||
| 9be1ed8fee | |||
| 85dc986965 | |||
| 3a8147c338 | |||
| 22fe9ac386 | |||
| 2cd042c75a | |||
| 0665732caa | |||
| e9c3c7cdf5 | |||
| a4f80b527e | |||
| cd5dc36471 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -132,3 +132,4 @@ imgui.ini
|
||||
/.vs/skyscraper8/CopilotIndices/17.14.1231.31060
|
||||
/.vs/skyscraper8/CopilotIndices/17.14.1290.42047
|
||||
/Documentation/TSDuck-Samples/experiment2/*.ts
|
||||
/.vs/skyscraper8/CopilotIndices/17.14.1431.25910
|
||||
|
||||
@ -18,9 +18,13 @@ using skyscraper5.Skyscraper.IO.CrazycatStreamReader;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.Utilities;
|
||||
using skyscraper5.src.InteractionChannel.Model.Descriptors;
|
||||
using skyscraper5.src.InteractionChannel.Model;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper5.src.Skyscraper.FrequencyListGenerator;
|
||||
using skyscraper5.src.Skyscraper.Scraper.Dns;
|
||||
using skyscraper5.Teletext;
|
||||
using skyscraper8.InteractionChannel.Model;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2.Descriptors;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper5.Data.MySql
|
||||
@ -259,6 +263,142 @@ namespace skyscraper5.Data.MySql
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, byte frameFrameNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void StoreTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, Tbtp2.Frame frame)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForFrameComposition2(ushort networkId, Fct2.Frame fct2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertFct2Frame(ushort networkId, Fct2.Frame frame)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForBroadcastConfiguration(ushort networkId, byte txTypeTxType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertBroadcastConfiguration(ushort networkId, Bct.BroadcastConfiguration txType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForRcs2Nit(RcsNit nit)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertRcs2Nit(RcsNit nit)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool UpdateRcs2Tdt(ushort interactiveNetworkId, DateTime tdtTimestamp)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTmst2(ushort interactiveNetworkId, Tmst2.TransmissionMode mode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTmst2(ushort interactiveNetworkId, Tmst2.TransmissionMode mode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimFramePayloadFormat(ushort networkId, _0xb7_FramePayloadFormatDescriptor.TransmissionContext transmissionContext)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimFramePayloadFormat(ushort networkId, _0xb7_FramePayloadFormatDescriptor.TransmissionContext transmissionContext)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimCorrectionMessageExtension(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimCorrectionMessageExtension(PhysicalAddress macAddress,
|
||||
_0xb1_CorrectionMessageExtensionDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimControlAssignment(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimSatelliteReturnLink(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForLowerLayerService(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimLowerLayerService(PhysicalAddress macAddress, _0xbb_LowerLayerServiceDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForHigherLayerServiceInitalization(PhysicalAddress macAddress, _0xc4_HigherLayersInitializeDescriptor.Layer2Interface layer2Interface)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertHigherLayerServiceInitalization(PhysicalAddress macAddress, _0xc4_HigherLayersInitializeDescriptor.Layer2Interface layer2Interface)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimLogonResponse(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimLogonResponse(PhysicalAddress macAddress, _0xb9_LogonResponseDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimForwardInteractionPath(PhysicalAddress macAddress, _0xad_ForwardInteractionPathDescriptor.ForwardInteractionPath forwardInteractionPath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimForwardInteractionPath(PhysicalAddress macAddress, _0xad_ForwardInteractionPathDescriptor.ForwardInteractionPath forwardInteractionPath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, int, ProgramMapping>> SelectAllPmt()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@ -11,6 +11,8 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Security.Cryptography;
|
||||
using skyscraper8.InteractionChannel.Model;
|
||||
using skyscraper8.InteractionChannel.Model2.Descriptors;
|
||||
|
||||
namespace skyscraper5.Data.PostgreSql
|
||||
{
|
||||
@ -949,6 +951,112 @@ namespace skyscraper5.Data.PostgreSql
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TestForRcs2Nit(RcsNit nit)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertRcs2Nit(RcsNit nit)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool UpdateRcs2Tdt(ushort interactiveNetworkId, DateTime tdtTimestamp)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTmst2(ushort interactiveNetworkId, Tmst2.TransmissionMode mode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTmst2(ushort interactiveNetworkId, Tmst2.TransmissionMode mode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimFramePayloadFormat(ushort networkId, _0xb7_FramePayloadFormatDescriptor.TransmissionContext transmissionContext)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimFramePayloadFormat(ushort networkId, _0xb7_FramePayloadFormatDescriptor.TransmissionContext transmissionContext)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimCorrectionMessageExtension(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimCorrectionMessageExtension(PhysicalAddress macAddress,
|
||||
_0xb1_CorrectionMessageExtensionDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimControlAssignment(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimSatelliteReturnLink(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForLowerLayerService(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimLowerLayerService(PhysicalAddress macAddress, _0xbb_LowerLayerServiceDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForHigherLayerServiceInitalization(PhysicalAddress macAddress, _0xc4_HigherLayersInitializeDescriptor.Layer2Interface layer2Interface)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertHigherLayerServiceInitalization(PhysicalAddress macAddress, _0xc4_HigherLayersInitializeDescriptor.Layer2Interface layer2Interface)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimLogonResponse(PhysicalAddress macAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimLogonResponse(PhysicalAddress macAddress, _0xb9_LogonResponseDescriptor descriptor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForTimForwardInteractionPath(PhysicalAddress macAddress, _0xad_ForwardInteractionPathDescriptor.ForwardInteractionPath forwardInteractionPath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertTimForwardInteractionPath(PhysicalAddress macAddress, _0xad_ForwardInteractionPathDescriptor.ForwardInteractionPath forwardInteractionPath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private bool AreArraysEqual(byte[] l, byte[] r)
|
||||
{
|
||||
if (l.Length != r.Length)
|
||||
@ -972,29 +1080,6 @@ namespace skyscraper5.Data.PostgreSql
|
||||
command.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
public bool TestForTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, byte frameFrameNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public void StoreTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, Tbtp2.Frame frame)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public bool TestForFrameComposition2(ushort networkId, Fct2.Frame fct2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public void InsertFct2Frame(ushort networkId, Fct2.Frame frame)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public bool TestForBroadcastConfiguration(ushort networkId, byte txTypeTxType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public void InsertBroadcastConfiguration(ushort networkId, Bct.BroadcastConfiguration txType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,9 @@ using NpgsqlTypes;
|
||||
using skyscraper5.Dvb.Psi.Model;
|
||||
using skyscraper5.Dvb.TvAnytime;
|
||||
using skyscraper5.Skyscraper.Headless;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.DvbNip;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper5.Data.PostgreSql
|
||||
@ -224,6 +226,36 @@ namespace skyscraper5.Data.PostgreSql
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public bool TestForTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, byte frameFrameNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void StoreTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, Tbtp2.Frame frame)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForFrameComposition2(ushort networkId, Fct2.Frame fct2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertFct2Frame(ushort networkId, Fct2.Frame frame)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForBroadcastConfiguration(ushort networkId, byte txTypeTxType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertBroadcastConfiguration(ushort networkId, Bct.BroadcastConfiguration txType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,12 +7,16 @@ the following Signalling applies:
|
||||
|
||||
|Stream Type|Interpretation |
|
||||
|-----------|-----------------------------------|
|
||||
|0x80 |TBS 6903-X GSE Packets |
|
||||
|0x80 |STiD135 GS/GSE Packets |
|
||||
|0x81 |AC-3 Audio |
|
||||
|0x82 |PID only used for PCR |
|
||||
|0x82 |PID only used for PCR, no payloads |
|
||||
|0x83 |AC-3 True HD Audio |
|
||||
|0x84 |AC-3+ Audio |
|
||||
|0x85 |ULE (RFC 4326) |
|
||||
|0x85 |DTS Audio |
|
||||
|0x86 |SCTE 35 Splice Info |
|
||||
|0x87 |ATSC Enhanced-AC-3 Audio |
|
||||
|0x88 |ULE (RFC 4326) |
|
||||
|0x91 |A52b/AC-3 Audio |
|
||||
|
||||
## Descriptors:
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -27,4 +28,8 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Drawing.Common" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
5
skyscraper8.Tests/AllureConfig.json
Normal file
5
skyscraper8.Tests/AllureConfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"allure": {
|
||||
"directory": "allure-results"
|
||||
}
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
[assembly: CollectionBehavior(DisableTestParallelization = true)]
|
||||
@ -1,102 +0,0 @@
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants;
|
||||
using skyscraper8.Ses;
|
||||
using skyscraper8.Tests.ClassDependencies.AsraBarkerTransponderTests;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Tests
|
||||
{
|
||||
public class AstraBarkerTransponderTests
|
||||
{
|
||||
private const string BARKER_TRANSPONDER_FILE_PATH = "C:\\Temp\\Astra1_12604_v_SGT-000000.ts";
|
||||
private Stream GetBarkerTransponder()
|
||||
{
|
||||
FileInfo fi = new FileInfo(BARKER_TRANSPONDER_FILE_PATH);
|
||||
if (!fi.Exists)
|
||||
{
|
||||
Debug.WriteLine(String.Format("Could not find file: {0}", BARKER_TRANSPONDER_FILE_PATH));
|
||||
return null;
|
||||
}
|
||||
return fi.OpenRead();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestAstraSdt()
|
||||
{
|
||||
Stream stream = GetBarkerTransponder();
|
||||
if (stream == null)
|
||||
return;
|
||||
|
||||
SdtContestant contestant = new SdtContestant(0x002d);
|
||||
|
||||
TsDescriptorUnpacker descriptorUnpacker = TsDescriptorUnpacker.GetInstance();
|
||||
for (byte i = 0x80; i < 0xfe; i++)
|
||||
{
|
||||
descriptorUnpacker.SetUserDefined(i, true);
|
||||
}
|
||||
descriptorUnpacker.SetUserDefined(0xfe, true);
|
||||
|
||||
TsContext tsContext = new TsContext();
|
||||
tsContext.FilterChain = new List<skyscraper5.src.Mpeg2.PacketFilter.IPacketFilter>();
|
||||
tsContext.FilterChain.Add(new DummyFilter());
|
||||
tsContext.RegisterPacketProcessor(0x002d, contestant.PacketProcessor);
|
||||
|
||||
byte[] buffer = new byte[188];
|
||||
while (stream.GetAvailableBytes() >= 188)
|
||||
{
|
||||
stream.Read(buffer, 0, 188);
|
||||
tsContext.PushPacket(buffer);
|
||||
if (contestant.Score >= 10)
|
||||
break;
|
||||
}
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestAstraLcn()
|
||||
{
|
||||
Stream stream = GetBarkerTransponder();
|
||||
if (stream == null)
|
||||
return;
|
||||
|
||||
SgtCandidate contestant = new SgtCandidate(0x0777);
|
||||
SgtCandidate contestant2 = new SgtCandidate(0x0776);
|
||||
|
||||
TsDescriptorUnpacker descriptorUnpacker = TsDescriptorUnpacker.GetInstance();
|
||||
for (byte i = 0x80; i < 0xfe; i++)
|
||||
{
|
||||
descriptorUnpacker.SetUserDefined(i, true);
|
||||
}
|
||||
descriptorUnpacker.SetUserDefined(0xfe, true);
|
||||
|
||||
TsContext tsContext = new TsContext();
|
||||
tsContext.FilterChain = new List<skyscraper5.src.Mpeg2.PacketFilter.IPacketFilter>();
|
||||
tsContext.FilterChain.Add(new DummyFilter());
|
||||
tsContext.RegisterPacketProcessor(0x0777, contestant.PacketProcessor);
|
||||
tsContext.RegisterPacketProcessor(0x0776, contestant2.PacketProcessor);
|
||||
|
||||
byte[] buffer = new byte[188];
|
||||
while (stream.GetAvailableBytes() >= 188)
|
||||
{
|
||||
stream.Read(buffer, 0, 188);
|
||||
tsContext.PushPacket(buffer);
|
||||
bool winnerA = contestant.Score >= 10;
|
||||
bool winnerB = contestant2.Score >= 10;
|
||||
if (winnerA)
|
||||
{
|
||||
if (winnerB)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
stream.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.src.Mpeg2.PacketFilter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Tests.ClassDependencies.AsraBarkerTransponderTests
|
||||
{
|
||||
internal class DummyFilter : IPacketFilter
|
||||
{
|
||||
public bool PassPacket(TsPacket packet)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
using skyscraper5.Docsis;
|
||||
using skyscraper5.Docsis.MacManagement;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Tests.ClassDependencies.DocsisTests
|
||||
{
|
||||
internal class DocsisEventHandlerImpl : IDocsisEventHandler
|
||||
{
|
||||
public void OnCmtsTimestamp(PhysicalAddress source, uint timing)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnDownstreamChannel(PhysicalAddress physicalAddress, MacDomainDescriptor.DownstreamActiveChannel downstreamActiveChannel)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnLearnedIpFromMac(PhysicalAddress arpHeaderSenderHardwareAddress, IPAddress arpHeaderSenderProtocolAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnParticipantDetected(PhysicalAddress pa)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnUpstreamChannel(UpstreamChannelDescriptor mmm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.Filesystem;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5;
|
||||
using skyscraper8.Skyscraper.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper8.Tests
|
||||
{
|
||||
public class DocsisTestsLong
|
||||
{
|
||||
[Fact]
|
||||
public void TestLongBoiSingleStreams()
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo("D:\\DocsisDemo");
|
||||
if (!di.Exists)
|
||||
{
|
||||
Debug.WriteLine("Files not available!");
|
||||
return;
|
||||
}
|
||||
|
||||
FilesystemScraperStorageFactory storageFactory = new FilesystemScraperStorageFactory();
|
||||
storageFactory.Directory = "docsis_longboi";
|
||||
|
||||
Passing passing = new Passing();
|
||||
passing.DataStorage = storageFactory.CreateDataStorage();
|
||||
passing.MassImportDirectory(di);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestM3u8Stream()
|
||||
{
|
||||
FileInfo docsisM3u8 = new FileInfo("D:\\DocsisDemo\\docsis.m3u8");
|
||||
if (!docsisM3u8.Exists)
|
||||
{
|
||||
Debug.WriteLine("File not available!");
|
||||
return;
|
||||
}
|
||||
|
||||
FileInfo alreadyTested = new FileInfo("docsis_m3u8_test.complete");
|
||||
if (alreadyTested.Exists)
|
||||
{
|
||||
Debug.WriteLine("Hello!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
M3U8Stream m3u8 = new M3U8Stream(docsisM3u8.FullName);
|
||||
|
||||
TsContext tsContext = new TsContext();
|
||||
InMemoryScraperStorageFactory storageFactory = new InMemoryScraperStorageFactory();
|
||||
DataStorage scraperStorage = storageFactory.CreateDataStorage();
|
||||
SkyscraperContext skyscraperContext = new SkyscraperContext(tsContext, scraperStorage, null);
|
||||
skyscraperContext.InitalizeFilterChain();
|
||||
skyscraperContext.IngestFromStream(m3u8);
|
||||
|
||||
File.WriteAllText("docsis_m3u8_test.complete", "1");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
126
skyscraper8.Tests/Feyllure.cs
Normal file
126
skyscraper8.Tests/Feyllure.cs
Normal file
@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Allure.Net.Commons;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TestResult = Allure.Net.Commons.TestResult;
|
||||
|
||||
namespace skyscraper8.Tests;
|
||||
|
||||
[TestClass]
|
||||
public class Feyllure
|
||||
{
|
||||
public TestContext TestContext { get; set; }
|
||||
|
||||
protected static readonly AllureLifecycle Allure = AllureLifecycle.Instance;
|
||||
|
||||
private bool assemblyWasInited;
|
||||
private void AssemblyInit(TestContext context)
|
||||
{
|
||||
// Ensure allure-results exists
|
||||
var resultsDir = Allure.ResultsDirectory;
|
||||
Directory.CreateDirectory(resultsDir);
|
||||
|
||||
var envFile = Path.Combine(resultsDir, "environment.properties");
|
||||
|
||||
using (var writer = new StreamWriter(envFile))
|
||||
{
|
||||
writer.WriteLine($"SkyscraperRelease={VersionInfo.GetPublicReleaseNumber()}");
|
||||
writer.WriteLine($"SkyscraperCodeVersion={VersionInfo.GetCurrentAssemblyDisplayVersion()}");
|
||||
writer.WriteLine($"OS={RuntimeInformation.OSDescription}");
|
||||
writer.WriteLine($".NET={Environment.Version}");
|
||||
writer.WriteLine($"Machine={Environment.MachineName}");
|
||||
writer.WriteLine($"User={Environment.UserName}");
|
||||
writer.WriteLine($"Framework={System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}");
|
||||
writer.WriteLine($"BuildDate={DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}");
|
||||
}
|
||||
|
||||
var executorFile = Path.Combine(resultsDir, "executor.json");
|
||||
var executorInfo = new
|
||||
{
|
||||
name = Environment.MachineName,
|
||||
buildName = "My build name",
|
||||
buildUrl = "http://127.0.0.2",
|
||||
};
|
||||
var executorJson = Newtonsoft.Json.JsonConvert.SerializeObject(executorInfo);
|
||||
File.WriteAllText(executorFile, executorJson);
|
||||
}
|
||||
|
||||
[TestInitialize]
|
||||
public void Setup()
|
||||
{
|
||||
if (!assemblyWasInited){
|
||||
AssemblyInit(TestContext);
|
||||
assemblyWasInited = true;
|
||||
}
|
||||
var testName = TestContext.TestName;
|
||||
var fqClass = TestContext.FullyQualifiedTestClassName;
|
||||
|
||||
// Extract namespace and class name
|
||||
var lastDot = fqClass.LastIndexOf('.');
|
||||
var ns = lastDot > 0 ? fqClass.Substring(0, lastDot) : "";
|
||||
var cls = lastDot > 0 ? fqClass.Substring(lastDot + 1) : fqClass;
|
||||
|
||||
TestResult testResult = new TestResult();
|
||||
testResult.uuid = Guid.NewGuid().ToString();
|
||||
testResult.name = testName;
|
||||
testResult.fullName = String.Format("{0}.{1}", TestContext.FullyQualifiedTestClassName, testName);
|
||||
testResult.labels = new List<Label>()
|
||||
{
|
||||
//Packages Tab
|
||||
new Label { name = "package", value = ns},
|
||||
new Label { name = "testClass", value = cls},
|
||||
new Label { name = "testMethod", value = testName},
|
||||
|
||||
//Suites tab
|
||||
new Label { name = "parentSuite", value = ns},
|
||||
new Label { name = "suite", value = cls},
|
||||
};
|
||||
|
||||
Allure.StartTestCase(testResult);
|
||||
|
||||
descriptionWriter = null;
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void TearDown()
|
||||
{
|
||||
switch (TestContext.CurrentTestOutcome)
|
||||
{
|
||||
case UnitTestOutcome.Passed:
|
||||
Allure.UpdateTestCase(tc => tc.status = Status.passed);
|
||||
break;
|
||||
case UnitTestOutcome.Failed:
|
||||
Allure.UpdateTestCase(tc => tc.status = Status.failed);
|
||||
break;
|
||||
default:
|
||||
StepResult stepResult = new StepResult();
|
||||
stepResult.name = String.Format("Current Test Outcome: {0}", TestContext.CurrentTestOutcome);;
|
||||
Allure.UpdateTestCase(tc =>
|
||||
{
|
||||
tc.status = Status.skipped;
|
||||
tc.steps.Add(stepResult);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
if (descriptionWriter != null)
|
||||
{
|
||||
Allure.UpdateTestCase(tc => { tc.description = descriptionWriter.ToString(); });
|
||||
}
|
||||
|
||||
Allure.StopTestCase();
|
||||
Allure.WriteTestCase();
|
||||
}
|
||||
|
||||
private StringWriter descriptionWriter;
|
||||
public void Print(string message, params object[] args)
|
||||
{
|
||||
if (descriptionWriter == null)
|
||||
descriptionWriter = new StringWriter();
|
||||
string formattedMessage = String.Format(message, args);
|
||||
Console.WriteLine(formattedMessage);
|
||||
descriptionWriter.WriteLine(formattedMessage);
|
||||
}
|
||||
}
|
||||
100
skyscraper8.Tests/Properties/Resources.Designer.cs
generated
100
skyscraper8.Tests/Properties/Resources.Designer.cs
generated
@ -59,105 +59,5 @@ namespace skyscraper8.Tests.Properties {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] ModemCapabilitiesEncodingTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ModemCapabilitiesEncodingTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] MultipartRegistrationResponseTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] MultipartRegistrationResponseTest2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest2", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] PushMacManagementMessage_Version4_Type45 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PushMacManagementMessage_Version4_Type45", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] ranging_response_test {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ranging_response_test", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] test_1packet_01 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("test-1packet-01", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] test_2packets_02_03 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("test-2packets-02-03", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] test_3packets_04_05_06 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("test-3packets-04-05-06", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] TransmitChannelConfigurationObject {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("TransmitChannelConfigurationObject", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] UpstreamChannelDescriptorTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("UpstreamChannelDescriptorTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,151 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="ModemCapabilitiesEncodingTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ModemCapabilitiesEncodingTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="MultipartRegistrationResponseTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\T45_V4_MultipartRegistrationResponseTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="PushMacManagementMessage_Version4_Type45" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PushMacManagementMessage_Version4_Type45.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="ranging_response_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ranging_response_test.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="MultipartRegistrationResponseTest2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\T45_V4_MultipartRegistrationResponseTest2.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-1packet-01" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\test-1packet-01.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-2packets-02-03" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\test-2packets-02-03.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-3packets-04-05-06" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\test-3packets-04-05-06.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="TransmitChannelConfigurationObject" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\TransmitChannelConfigurationObject.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="UpstreamChannelDescriptorTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\UpstreamChannelDescriptorTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@ -1,28 +0,0 @@
|
||||
using skyscraper5.Docsis.MacManagement;
|
||||
using System.Net.NetworkInformation;
|
||||
using skyscraper8.Tests.Properties;
|
||||
|
||||
namespace skyscraper8.Tests
|
||||
{
|
||||
public class RangingResponseTest
|
||||
{
|
||||
[Fact]
|
||||
public void OffsetBreakerTest()
|
||||
{
|
||||
|
||||
byte[] blob = Resources.ranging_response_test;
|
||||
Random rng = new Random();
|
||||
|
||||
byte[] sourceMacBuffer = new byte[6];
|
||||
rng.NextBytes(sourceMacBuffer);
|
||||
PhysicalAddress sourceAddress = new PhysicalAddress(sourceMacBuffer);
|
||||
|
||||
byte[] targetMacBuffer = new byte[6];
|
||||
rng.NextBytes(targetMacBuffer);
|
||||
PhysicalAddress targetAddress = new PhysicalAddress(targetMacBuffer);
|
||||
|
||||
RangingResponse rangingResponse = new RangingResponse(sourceAddress, targetAddress, blob);
|
||||
Assert.True(rangingResponse.Valid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,38 +1,24 @@
|
||||
using skyscraper5;
|
||||
using System;
|
||||
using skyscraper5.Docsis;
|
||||
using skyscraper5.Docsis.AnnexC;
|
||||
using skyscraper5.Docsis.MacManagement;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Plugins;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.Filesystem;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.Skyscraper.IO;
|
||||
using skyscraper8.Tests.ClassDependencies.DocsisTests;
|
||||
using skyscraper8.Tests.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit.Sdk;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace skyscraper8.Tests
|
||||
namespace skyscraper8.Tests.ResourceTests
|
||||
{
|
||||
public class DocsisTests
|
||||
[TestClass]
|
||||
public class DocsisTests : Feyllure
|
||||
{
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void ModemCapabilitiesEncoding()
|
||||
{
|
||||
byte[] buffer = Resources.ModemCapabilitiesEncodingTest;
|
||||
byte[] buffer = Resources1.ModemCapabilitiesEncodingTest;
|
||||
ModemCapabilitiesEncoding modemCapabilitiesEncoding = new ModemCapabilitiesEncoding(buffer);
|
||||
Assert.True(modemCapabilitiesEncoding.Valid);
|
||||
Assert.IsTrue(modemCapabilitiesEncoding.Valid);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void MultipartRegistrationResponse()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -45,18 +31,18 @@ namespace skyscraper8.Tests
|
||||
rng.NextBytes(targetBuffer);
|
||||
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||
|
||||
byte[] buffer = Properties.Resources.MultipartRegistrationResponseTest;
|
||||
byte[] buffer = Resources1.MultipartRegistrationResponseTest;
|
||||
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
||||
Assert.True(test.Valid);
|
||||
Assert.IsTrue(test.Valid);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void MacManagement_4_45()
|
||||
{
|
||||
DocsisEventHandlerImpl docsisEventHandler = new DocsisEventHandlerImpl();
|
||||
NullDocsisEventHandler docsisEventHandler = new NullDocsisEventHandler();
|
||||
DocsisEnvironment environment = new DocsisEnvironment(docsisEventHandler);
|
||||
|
||||
byte[] testPayload = Resources.PushMacManagementMessage_Version4_Type45;
|
||||
byte[] testPayload = Resources1.PushMacManagementMessage_Version4_Type45;
|
||||
|
||||
Random rng = new Random();
|
||||
byte[] sourceBuffer = new byte[6];
|
||||
@ -70,10 +56,10 @@ namespace skyscraper8.Tests
|
||||
environment.PushMacManagementMessage(testPayload, 4, 45, source, target, testPayload);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void InvalidUpstreamChannelDescriptorTest()
|
||||
{
|
||||
byte[] testPayload = Resources.UpstreamChannelDescriptorTest;
|
||||
byte[] testPayload = Resources1.UpstreamChannelDescriptorTest;
|
||||
|
||||
Random rng = new Random();
|
||||
byte[] sourceBuffer = new byte[6];
|
||||
@ -85,19 +71,19 @@ namespace skyscraper8.Tests
|
||||
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||
|
||||
UpstreamChannelDescriptor ucd = new UpstreamChannelDescriptor(source, target, testPayload);
|
||||
Assert.False(ucd.Valid);
|
||||
Assert.IsFalse(ucd.Valid);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void TransmitChannelConfigurationObjectTest()
|
||||
{
|
||||
byte[] testPayload = Resources.TransmitChannelConfigurationObject;
|
||||
byte[] testPayload = Resources1.TransmitChannelConfigurationObject;
|
||||
|
||||
CommonTlvEncodingObject.TransmitChannelConfigurationObject child = new CommonTlvEncodingObject.TransmitChannelConfigurationObject(testPayload);
|
||||
Assert.True(child.Valid);
|
||||
Assert.IsTrue(child.Valid);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void MultipartRegistrationResponse2()
|
||||
{
|
||||
Random rng = new Random();
|
||||
@ -110,9 +96,27 @@ namespace skyscraper8.Tests
|
||||
rng.NextBytes(targetBuffer);
|
||||
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||
|
||||
byte[] buffer = Properties.Resources.MultipartRegistrationResponseTest2;
|
||||
byte[] buffer = Resources1.MultipartRegistrationResponseTest2;
|
||||
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
||||
Assert.True(test.Valid);
|
||||
Assert.IsTrue(test.Valid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OffsetBreakerTest()
|
||||
{
|
||||
byte[] blob = Resources1.ranging_response_test;
|
||||
Random rng = new Random();
|
||||
|
||||
byte[] sourceMacBuffer = new byte[6];
|
||||
rng.NextBytes(sourceMacBuffer);
|
||||
PhysicalAddress sourceAddress = new PhysicalAddress(sourceMacBuffer);
|
||||
|
||||
byte[] targetMacBuffer = new byte[6];
|
||||
rng.NextBytes(targetMacBuffer);
|
||||
PhysicalAddress targetAddress = new PhysicalAddress(targetMacBuffer);
|
||||
|
||||
RangingResponse rangingResponse = new RangingResponse(sourceAddress, targetAddress, blob);
|
||||
Assert.IsTrue(rangingResponse.Valid);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
skyscraper8.Tests/ResourceTests/GsType1SanityTest.cs
Normal file
33
skyscraper8.Tests/ResourceTests/GsType1SanityTest.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests;
|
||||
|
||||
[TestClass]
|
||||
public class GsType1SanityTest : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
public void CheckBfbsCrc()
|
||||
{
|
||||
byte[] blob = Resources1.Frame00001343_TSGS1_MIS000_SYNC001;
|
||||
MemoryStream ms = new MemoryStream(blob, false);
|
||||
bool result = DvbCrc32.ValidateCrc(ms, 0, (int)ms.Length);
|
||||
Assert.IsTrue(result);
|
||||
|
||||
blob = Resources1.Frame00000008_TSGS1_MIS000_SYNC001;
|
||||
ms = new MemoryStream(blob, false);
|
||||
result = DvbCrc32.ValidateCrc(ms, 0, (int)ms.Length);
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CheckBfbsCrcSpan()
|
||||
{
|
||||
byte[] blob = Resources1.Frame00000012_TSGS1_MIS000_SYNC001;
|
||||
ReadOnlySpan<byte> span = new ReadOnlySpan<byte>(blob);
|
||||
bool result = DvbCrc32.ValidateCrc(span);
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
}
|
||||
25
skyscraper8.Tests/ResourceTests/SdpTest.cs
Normal file
25
skyscraper8.Tests/ResourceTests/SdpTest.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper8.Ietf.Rfc4566_SDP;
|
||||
|
||||
namespace skyscraper8.Tests.ResourceTests
|
||||
{
|
||||
[TestClass]
|
||||
public class SdpTest : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestSdpParser()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(Resources1.sdpTest, false);
|
||||
Assert.IsTrue(SDP.IsSDP(ms));
|
||||
|
||||
SDP loaded = SDP.Load(ms);
|
||||
Assert.IsNotNull(loaded);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,28 +1,34 @@
|
||||
using skyscraper5.Mpeg2;
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.Tests.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper8.Tests
|
||||
namespace skyscraper8.Tests.ResourceTests
|
||||
{
|
||||
public class TsDuckTestPatterns
|
||||
[TestClass]
|
||||
public class SkyscraperTests : Feyllure
|
||||
{
|
||||
[Fact]
|
||||
[TestMethod]
|
||||
public void RunTestPatterns()
|
||||
{
|
||||
byte[][] buffers = new byte[][] { Resources.test_1packet_01, Resources.test_2packets_02_03, Resources.test_3packets_04_05_06 };
|
||||
byte[][] buffers = new byte[][]
|
||||
{
|
||||
Resources1.test_1packet_01,
|
||||
Resources1.test_2packets_02_03,
|
||||
Resources1.test_3packets_04_05_06
|
||||
};
|
||||
|
||||
InMemoryScraperStorageFactory imssf = new InMemoryScraperStorageFactory();
|
||||
|
||||
foreach (byte[] buffer in buffers)
|
||||
{
|
||||
TsContext mpeg2 = new TsContext();
|
||||
SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, null, null);
|
||||
DataStorage ds = new InMemoryScraperStorageFactory().CreateDataStorage();
|
||||
ObjectStorage os = new NullObjectStorage();
|
||||
|
||||
SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, ds, os);
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
|
||||
skyscraper.InitalizeFilterChain();
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
10
skyscraper8.Tests/Resources/sdpTest.sdp
Normal file
10
skyscraper8.Tests/Resources/sdpTest.sdp
Normal file
@ -0,0 +1,10 @@
|
||||
v=0
|
||||
o=enensys Announcement-BM-SC 3962468565 IN IP4 10.10.10.20
|
||||
s=Announcement delivery session
|
||||
t=0 0
|
||||
a=mbms-mode:broadcast-mbsfn 61712
|
||||
a=source-filter: incl IN IP4 * 10.10.10.20
|
||||
a=flute-tsi:9
|
||||
m=application 50001 FLUTE/UDP 0
|
||||
c=IN IP4 224.0.2.20/10
|
||||
b=AS:200
|
||||
203
skyscraper8.Tests/Resources1.Designer.cs
generated
Normal file
203
skyscraper8.Tests/Resources1.Designer.cs
generated
Normal file
@ -0,0 +1,203 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace skyscraper8.Tests {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources1 {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources1() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("skyscraper8.Tests.Resources1", typeof(Resources1).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Frame00000008_TSGS1_MIS000_SYNC001 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Frame00000008_TSGS1_MIS000_SYNC001", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Frame00000012_TSGS1_MIS000_SYNC001 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Frame00000012_TSGS1_MIS000_SYNC001", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Frame00001343_TSGS1_MIS000_SYNC001 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Frame00001343_TSGS1_MIS000_SYNC001", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] ModemCapabilitiesEncodingTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ModemCapabilitiesEncodingTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] MultipartRegistrationResponseTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] MultipartRegistrationResponseTest2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest2", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] PushMacManagementMessage_Version4_Type45 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PushMacManagementMessage_Version4_Type45", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] ranging_response_test {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ranging_response_test", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] sdpTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("sdpTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] test_1packet_01 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("test-1packet-01", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] test_2packets_02_03 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("test-2packets-02-03", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] test_3packets_04_05_06 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("test-3packets-04-05-06", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] TransmitChannelConfigurationObject {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("TransmitChannelConfigurationObject", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] UpstreamChannelDescriptorTest {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("UpstreamChannelDescriptorTest", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
163
skyscraper8.Tests/Resources1.resx
Normal file
163
skyscraper8.Tests/Resources1.resx
Normal file
@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="ModemCapabilitiesEncodingTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\ModemCapabilitiesEncodingTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="MultipartRegistrationResponseTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\T45_V4_MultipartRegistrationResponseTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="PushMacManagementMessage_Version4_Type45" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\PushMacManagementMessage_Version4_Type45.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="ranging_response_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\ranging_response_test.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="MultipartRegistrationResponseTest2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\T45_V4_MultipartRegistrationResponseTest2.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-1packet-01" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\test-1packet-01.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-2packets-02-03" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\test-2packets-02-03.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="test-3packets-04-05-06" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\test-3packets-04-05-06.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="TransmitChannelConfigurationObject" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\TransmitChannelConfigurationObject.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="UpstreamChannelDescriptorTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\UpstreamChannelDescriptorTest.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00001343_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00001343_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00000008_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00000008_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Frame00000012_TSGS1_MIS000_SYNC001" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\Frame00000012_TSGS1_MIS000_SYNC001.bbf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="sdpTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\sdpTest.sdp;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
600
skyscraper8.Tests/RootTests/DocsisTests.cs
Normal file
600
skyscraper8.Tests/RootTests/DocsisTests.cs
Normal file
@ -0,0 +1,600 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net.NetworkInformation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Docsis;
|
||||
using skyscraper5.Docsis.AnnexC;
|
||||
|
||||
namespace skyscraper8.Tests.RootTests;
|
||||
|
||||
[TestClass]
|
||||
public class DocsisTests : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
public void MacManagementMessageTypeAttributeTest()
|
||||
{
|
||||
MacManagementMessageTypeAttribute mmmta = new MacManagementMessageTypeAttribute(1, 2);
|
||||
Print(mmmta.ToString());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void RcpIdEncodingTest()
|
||||
{
|
||||
RcpIdEncoding rie = new RcpIdEncoding(new byte[] { 7, 1, 0 });
|
||||
SimplifiedReceiveChannelAssignmentEncoding simplifiedReceiveChannelAssignmentEncoding = rie.SimplifiedReceiveChannelConfiguration;
|
||||
Assert.IsNotNull(simplifiedReceiveChannelAssignmentEncoding);
|
||||
Assert.Throws<NotImplementedException>(() => new RcpIdEncoding(new byte[] { 255, 1, 0 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void EthernetLlcPacketClassificationEncodingTest()
|
||||
{
|
||||
EthernetLlcPacketClassificationEncoding epce = new EthernetLlcPacketClassificationEncoding(new byte[] { 3, 3, 1, 0, 1 });
|
||||
ushort epceEProt = epce.EProt;
|
||||
Assert.AreEqual(1, epce.EProt);
|
||||
Assert.AreEqual(1, epce.Type);
|
||||
Assert.Throws<NotImplementedException>(() => new EthernetLlcPacketClassificationEncoding(new byte[] { 255, 1, 0 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void SimplifiedReceiveChannelAssignmentEncodingTest()
|
||||
{
|
||||
SimplifiedReceiveChannelAssignmentEncoding srcae =
|
||||
new SimplifiedReceiveChannelAssignmentEncoding(new byte[] { 1, 1, 0, 2, 1, 0, 3, 1, 0 });
|
||||
Assert.AreEqual(0,srcae.DownstreamChannelAssignment[0]);
|
||||
Assert.AreEqual(0, srcae.DownstreamProfileAssignment[0]);
|
||||
Assert.AreEqual(0, srcae.PrimaryDownstreamChannelAssignment[0]);
|
||||
Assert.Throws<NotImplementedException>(() => new SimplifiedReceiveChannelAssignmentEncoding(new byte[] { 254,0,1 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TransmitChannelConfigurationObjectTest()
|
||||
{
|
||||
CommonTlvEncodingObject.TransmitChannelConfigurationObject tcco =
|
||||
new CommonTlvEncodingObject.TransmitChannelConfigurationObject(
|
||||
new byte[]
|
||||
{
|
||||
1, 1, 0,
|
||||
2, 1, 0,
|
||||
3, 1, 0,
|
||||
5, 4, 0, 0, 0, 0,
|
||||
6, 2, 0, 0,
|
||||
7, 1, 1,
|
||||
9, 1, 0,
|
||||
10, 1, 0,
|
||||
11, 1, 0
|
||||
});
|
||||
Assert.AreEqual(0, tcco.TccReferenceId.Value);
|
||||
Assert.AreEqual(CommonTlvEncodingObject.TransmitChannelConfigurationObject.UpstreamChannelActionEnum.NoAction, tcco.UpstreamChannelAction.Value);
|
||||
Assert.AreEqual(0, tcco.UpstreamChannelId.Value);
|
||||
Assert.IsNotNull(tcco.UpstreamChannelDescriptor);
|
||||
Assert.AreEqual(0, tcco.RangingSid.Value);
|
||||
Assert.AreEqual(InitalizationTechniqueEnum.BroadcastInitialRanging, tcco.InitializationTechnique.Value);
|
||||
Assert.AreEqual(0, tcco.DynamicRangeWindow);
|
||||
Assert.AreEqual(0, tcco.P16Hi);
|
||||
Assert.AreEqual(0, tcco.ListOfIucs[0]);
|
||||
|
||||
Assert.Throws<NotImplementedException>(() =>
|
||||
new CommonTlvEncodingObject.TransmitChannelConfigurationObject(new byte[] { 254, 1, 0 }));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CommonTlvEncodingObjectTest()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(new byte[]
|
||||
{
|
||||
5, 1, 0,
|
||||
47, 1, 0,
|
||||
49, 1, 0,
|
||||
31, 1, 0,
|
||||
27, 1, 0,
|
||||
30, 1, 0,
|
||||
52, 2, 0, 1
|
||||
});
|
||||
CommonTlvEncodingObject commonTlv = new CommonTlvEncodingObject(ms);
|
||||
Assert.IsNotNull(commonTlv.ModemCapabilitiesEncoding);
|
||||
Assert.IsNotNull(commonTlv.ServiceFlowSidClusterAssignment);
|
||||
Assert.IsNotNull(commonTlv.RcpId);
|
||||
Assert.AreEqual(0, commonTlv.KeySequenceNumber);
|
||||
Assert.AreEqual(0, commonTlv.HmacDigest[0]);
|
||||
Assert.IsNotNull(commonTlv.AuthorizationHint);
|
||||
Assert.AreEqual(new TimeSpan(0, 0, 1), commonTlv.InitializingChannelTimeout);
|
||||
|
||||
ms = new MemoryStream(new byte[] { 254, 1, 0 });
|
||||
Assert.Throws<NotImplementedException>(() => new CommonTlvEncodingObject(ms));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GeneralPacketClassifierEncodingTest()
|
||||
{
|
||||
GeneralPacketClassifierEncoding gpce = new GeneralPacketClassifierEncoding(new byte[]
|
||||
{
|
||||
6, 1, 1,
|
||||
5, 1, 0,
|
||||
9, 1, 0,
|
||||
3, 2, 0, 1,
|
||||
1, 1, 0,
|
||||
2, 2, 0, 1,
|
||||
4, 4, 0, 0, 0, 1,
|
||||
7, 1, 0,
|
||||
10, 1, 0,
|
||||
12, 16,
|
||||
//IPv6 Packet Classification Encoding
|
||||
3, 2, 0, 1,
|
||||
4, 4, 127, 0, 0, 1,
|
||||
6, 4, 127, 0, 0, 1
|
||||
});
|
||||
Assert.IsTrue(gpce.ClassifierActivationState.Value);
|
||||
Assert.AreEqual(0, gpce.RulePriority.Value);
|
||||
Assert.IsNotNull(gpce.Ipv4PacketClassification);
|
||||
Assert.AreEqual(1, gpce.ServiceFlowReference.Value);
|
||||
Assert.AreEqual(0, gpce.ClassifierReference.Value);
|
||||
Assert.AreEqual(1, gpce.ClassifierIdentifier.Value);
|
||||
Assert.AreEqual((uint)1, gpce.ServiceFlowIdentifier.Value);
|
||||
Assert.AreEqual(GeneralPacketClassifierEncoding.DynamicServiceChangeActionEnum.Add, gpce.DynamicServiceChangeAction.Value);
|
||||
Assert.IsNotNull(gpce.EthernetLlcPacketClassificationEncodings);
|
||||
|
||||
Assert.Throws<NotImplementedException>(() => new GeneralPacketClassifierEncoding(new byte[]
|
||||
{
|
||||
12, 4,
|
||||
255, 1, 0, 0
|
||||
}));
|
||||
|
||||
Assert.Throws<NotImplementedException>(() => new GeneralPacketClassifierEncoding(new byte[]
|
||||
{
|
||||
254, 1, 0
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Ipv4PacketClassificationEncodingTest()
|
||||
{
|
||||
GeneralPacketClassifierEncoding.Ipv4PacketClassificationEncodings ipce =
|
||||
new GeneralPacketClassifierEncoding.Ipv4PacketClassificationEncodings(new byte[]
|
||||
{
|
||||
3, 4, 127, 0, 0, 1,
|
||||
5, 4, 127, 0, 0, 1,
|
||||
2, 2, 0, 1,
|
||||
4, 4, 255, 255, 255, 0,
|
||||
6, 4, 255, 255, 255, 0,
|
||||
9, 2, 0, 1,
|
||||
10, 2, 0, 1,
|
||||
7, 2, 0, 1,
|
||||
8, 2, 0, 1
|
||||
});
|
||||
Assert.IsNotNull(ipce.Ipv4SourceAddress);
|
||||
Assert.IsNotNull(ipce.Ipv4DestinationAddress);
|
||||
Assert.AreEqual(1, ipce.IpProtocol.Value);
|
||||
Assert.IsNotNull(ipce.Ipv4SourceMask);
|
||||
Assert.IsNotNull(ipce.Ipv4DestinationMask);
|
||||
Assert.AreEqual(1, ipce.DestinationPortStart.Value);
|
||||
Assert.AreEqual(1, ipce.DestinationPortEnd.Value);
|
||||
Assert.AreEqual(1, ipce.SourcePortStart.Value);
|
||||
Assert.AreEqual(1, ipce.SourcePortEnd.Value);
|
||||
|
||||
Assert.Throws<NotImplementedException>(() =>
|
||||
new GeneralPacketClassifierEncoding.Ipv4PacketClassificationEncodings(new byte[]
|
||||
{
|
||||
255, 1, 0
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ServiceFlowSidClusterAssignmentObjectTest()
|
||||
{
|
||||
ServiceFlowSidClusterAssignmentObject sfscao = new ServiceFlowSidClusterAssignmentObject(new byte[]
|
||||
{
|
||||
1, 4, 0, 0, 0, 1,
|
||||
2, 1, 0,
|
||||
3, 1, 0,
|
||||
});
|
||||
Assert.AreEqual(1u, sfscao.SFID.Value);
|
||||
Assert.IsNotNull(sfscao.SidClusterEncoding);
|
||||
Assert.IsNotNull(sfscao.SidClusterSwitchoverCriteria);
|
||||
|
||||
Assert.Throws<NotImplementedException>(() => new ServiceFlowSidClusterAssignmentObject(new byte[]
|
||||
{
|
||||
255, 1, 0
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void SidClusterEncodingObjectTest()
|
||||
{
|
||||
ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject sceo =
|
||||
new ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject(new byte[]
|
||||
{
|
||||
1, 1, 1,
|
||||
2, 1, 0
|
||||
});
|
||||
Assert.AreEqual(1, sceo.SidClusterId.Value);
|
||||
Assert.IsNotNull(sceo.SidToChannelMapping);
|
||||
|
||||
Assert.Throws<NotImplementedException>(() => new ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject(new byte[]
|
||||
{
|
||||
255, 1, 0
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void SidToChannelMappingObjectTest()
|
||||
{
|
||||
ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject.SidToChannelMappingObject stcmo =
|
||||
new ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject.SidToChannelMappingObject(new byte[]
|
||||
{
|
||||
1,1,1,
|
||||
2,2,0,1,
|
||||
3,1,1
|
||||
});
|
||||
Assert.AreEqual(1, stcmo.UpstreamChannelId.Value);
|
||||
Assert.AreEqual(1, stcmo.SID.Value);
|
||||
Assert.AreEqual(ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject.SidToChannelMappingObject.ActionEnum.Add,stcmo.Action.Value);
|
||||
|
||||
Assert.Throws<NotImplementedException>(() =>
|
||||
new ServiceFlowSidClusterAssignmentObject.SidClusterEncodingObject.SidToChannelMappingObject(new byte[]
|
||||
{
|
||||
255, 1, 0
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Ipv6PacketClassificationEncodingTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
{
|
||||
12, //Type Ipv6 Packet Classification Encoding
|
||||
40, //Length of IPv6 Packet Classification Encoding
|
||||
|
||||
3,2, 0x08,0x00, //Next Header Type
|
||||
4,16, 0xfd,0x58,0x2f,0x40,0xec,0xe9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
|
||||
6,16, 0xfd,0x73,0x14,0x63,0x41,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
|
||||
};
|
||||
GeneralPacketClassifierEncoding gpce = new GeneralPacketClassifierEncoding(buffer);
|
||||
Ipv6PacketClassificationEncoding ipce = gpce.Ipv6PacketClassification;
|
||||
Assert.IsNotNull(ipce);
|
||||
Assert.IsNotNull(ipce.Ipv6DestinationAddress);
|
||||
Assert.IsNotNull(ipce.Ipv6SourceAddress);
|
||||
Assert.AreEqual(0x0800, ipce.NextHeaderType);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void SidClusterSwitchoverCriteriaObjectTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
{
|
||||
1, 1, 1,
|
||||
2, 4, 0, 0, 0, 1,
|
||||
3, 4, 0, 0, 0, 1,
|
||||
4, 2, 0, 1
|
||||
};
|
||||
ServiceFlowSidClusterAssignmentObject.SidClusterSwitchoverCriteriaObject scsco =
|
||||
new ServiceFlowSidClusterAssignmentObject.SidClusterSwitchoverCriteriaObject(buffer);
|
||||
Assert.AreEqual((byte)1,scsco.MaximumRequestPerSidCluster);
|
||||
Assert.AreEqual((uint)1, scsco.MaximumOutstandingBytesPerSidCluster);
|
||||
Assert.AreEqual((uint)1, scsco.MaximumTotalBytesRequestedPerSidCluster);
|
||||
Assert.AreEqual((ushort)1, scsco.MaximumTimeInTheSidCluster);
|
||||
|
||||
buffer = new byte[] { 254, 1, 0 };
|
||||
Assert.Throws<NotImplementedException>(() =>
|
||||
new ServiceFlowSidClusterAssignmentObject.SidClusterSwitchoverCriteriaObject(buffer));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ModemCapabilitiesEncodingTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
{
|
||||
1, 1, 1,
|
||||
2, 1, 0,
|
||||
3, 1, 1,
|
||||
4, 1, 1,
|
||||
6, 1, 1,
|
||||
7, 1, 1,
|
||||
8, 1, 1,
|
||||
10, 1, 1,
|
||||
11, 1, 1,
|
||||
12, 1, 1,
|
||||
15, 1, 1,
|
||||
16, 4, 1, 2, 3, 4,
|
||||
17, 1, 1,
|
||||
18, 7, 1, 0, 0, 0, 0, 0, 0,
|
||||
19, 1, 1,
|
||||
20, 1, 2,
|
||||
21, 1, 255,
|
||||
22, 1, 1,
|
||||
23, 1, 1,
|
||||
24, 1, 2,
|
||||
25, 1, 2,
|
||||
26, 1, 2,
|
||||
27, 1, 2,
|
||||
28, 1, 2,
|
||||
29, 1, 2,
|
||||
30, 1, 3,
|
||||
31, 1, 3,
|
||||
32, 1, 3,
|
||||
33, 1, 2,
|
||||
34, 1, 1,
|
||||
35, 1, 255,
|
||||
36, 1, 3,
|
||||
37, 1, 0,
|
||||
38, 2, 0, 3,
|
||||
39, 1, 1,
|
||||
40, 1, 4,
|
||||
44, 0,
|
||||
46, 1, 1,
|
||||
47, 4, 0, 0, 0, 255,
|
||||
48, 2, 0, 4,
|
||||
49, 1, 4,
|
||||
50, 1, 5,
|
||||
51, 1, 5,
|
||||
52, 2, 1, 2,
|
||||
53, 2, 1, 2,
|
||||
54, 1, 1,
|
||||
55, 1, 1,
|
||||
56, 1, 0,
|
||||
57, 1, 3,
|
||||
58, 1, 5,
|
||||
59, 2, 0, 5,
|
||||
60, 1, 3,
|
||||
76, 1, 7,
|
||||
};
|
||||
|
||||
ModemCapabilitiesEncoding mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
Assert.IsTrue(mcs.ConcatenationSupport);
|
||||
Assert.AreEqual(new Version(1, 0), mcs.DocsisVersion);
|
||||
Assert.IsTrue(mcs.FragmentationSupport);
|
||||
Assert.IsTrue(mcs.PayloadHeaderSuppressionSupport);
|
||||
Assert.AreEqual(ModemCapabilitiesEncoding.PrivacySupportValue.BpiPlusSupport,mcs.PrivacySupport.Value);
|
||||
Assert.AreEqual(1, mcs.DownstreamSaidSupport.Value);
|
||||
Assert.AreEqual(1, mcs.UpstreamServiceFlowSupport.Value);
|
||||
Assert.AreEqual(1, mcs.TransmitPreEqualizerTapsPerModulationInterval.Value);
|
||||
Assert.AreEqual(1, mcs.NumberOfTransmitEqualizerTaps.Value);
|
||||
Assert.IsTrue(mcs.DccSupport);
|
||||
Assert.IsNotNull(mcs.RangingHoldOffSupport);
|
||||
Assert.IsTrue(mcs.L2VPN);
|
||||
Assert.IsNotNull(mcs.ESafeHostCapability);
|
||||
Assert.IsTrue(mcs.DownstreamUnencryptedTrafficFiltering);
|
||||
Assert.AreEqual(ModemCapabilitiesEncoding.UpstreamFrequencyRangeSupportEnum.Extended, mcs.UpstreamFrequencyRangeSupport);
|
||||
Assert.IsTrue(mcs._160kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._320kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._640kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._1280kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._2560kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._5120kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs.SelectableActiveCodeMode2Support);
|
||||
Assert.IsTrue(mcs.CodeHoppingMode2Support);
|
||||
Assert.AreEqual(2,mcs.ScQamMultipleTransmitChannelSupport.Value);
|
||||
Assert.AreEqual(2, mcs.TotalSidClusterSupport.Value);
|
||||
Assert.AreEqual(2, mcs.SidClustersPerServiceFlowSupport.Value);
|
||||
Assert.AreEqual(2, mcs.ScQamMultipleReceiveChannelSupport.Value);
|
||||
Assert.AreEqual(3, mcs.TotalDsidSupport.Value);
|
||||
Assert.AreEqual(3, mcs.ResequencingDsidSupport.Value);
|
||||
Assert.AreEqual(3, mcs.MulticastDsidSupport.Value);
|
||||
Assert.AreEqual(ModemCapabilitiesEncoding.MulticastDsidForwardingEnum.SupportPromiscious, mcs.MulticastDsidForwarding.Value);
|
||||
Assert.IsTrue(mcs.FrameControlTypeForwardingCapability);
|
||||
Assert.IsTrue(mcs.DpvPerPathSuppported);
|
||||
Assert.IsTrue(mcs.DpvPerPacketSuppported);
|
||||
Assert.AreEqual(3, mcs.UnsolicitedGrantServiceFlowSupport.Value);
|
||||
Assert.IsTrue(mcs.MapAndUcdReceiptSupport);
|
||||
Assert.AreEqual(3, mcs.UpstreamDropClassifierSupport);
|
||||
Assert.IsTrue(mcs.Ipv6Support.Value);
|
||||
Assert.AreEqual(4, mcs.ExtendedUpstreamTransmitPowerCapability.Value);
|
||||
Assert.IsTrue(mcs.CmStatusAck);
|
||||
Assert.IsTrue(mcs.EnergyManagement1x1Feature);
|
||||
Assert.IsTrue(mcs.DocsisLightSleepMode);
|
||||
Assert.AreEqual(4, mcs.ExtendedPacketLengthSupportCapability);
|
||||
Assert.AreEqual(4, mcs.OfdmMultipleReceiveChannelSupport.Value);
|
||||
Assert.AreEqual(5, mcs.OfdmaMultipleTransmitChannelSupport.Value);
|
||||
Assert.AreEqual(5, mcs.DownstreamOfdmProfileSupport.Value);
|
||||
Assert.IsNotNull(mcs.DownstreamOfdmChannelSubcarrierQamModulationSupport);
|
||||
Assert.IsNotNull(mcs.UpstreamOfdmaChannelSubcarrierQamModulationSupport);
|
||||
Assert.AreEqual(108, mcs.DownstreamFrequencyRangeStarting);
|
||||
Assert.AreEqual(1218, mcs.DownstreamFrequencyRangeUpTo);
|
||||
Assert.AreEqual(42, mcs.UpstreamFrequencyRangeUpTo);
|
||||
Assert.AreEqual(ModemCapabilitiesEncoding.DtpMode.MasterOrSlave, mcs.DocsisTimeProtocolMode.Value);
|
||||
Assert.AreEqual(ModemCapabilitiesEncoding.DtpPerformanceSupport.Level5, mcs.DocsisTimeProtocolPerformanceSupport.Value);
|
||||
Assert.AreEqual(5, mcs.Pmax);
|
||||
Assert.IsTrue(mcs.DownstreamFullDuplex);
|
||||
Assert.AreEqual(7, mcs.LowLatencySupport.Value);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
2, 1, 1,
|
||||
54, 1, 2,
|
||||
55, 1, 2,
|
||||
56, 1, 1,
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
Assert.IsTrue(mcs._160kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._320kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._640kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._1280kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._2560kspsSymbolRateSupport);
|
||||
Assert.IsTrue(mcs._5120kspsSymbolRateSupport);
|
||||
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
2, 1, 2,
|
||||
55, 1, 4,
|
||||
56, 1, 2,
|
||||
60, 1, 1,
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
2, 1, 3,
|
||||
56, 1, 3,
|
||||
60, 1, 2,
|
||||
61, 1, 1
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
2, 1, 4,
|
||||
56, 1, 4,
|
||||
61, 1, 2
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
Assert.IsNull(mcs.DpvPerPathSuppported);
|
||||
Assert.IsNull(mcs.DpvPerPacketSuppported);
|
||||
Assert.IsNull(mcs.EnergyManagement1x1Feature);
|
||||
Assert.IsNull(mcs.DocsisLightSleepMode);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
2, 1, 5,
|
||||
61, 1, 4,
|
||||
62, 1, 0
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
2, 1, 6,
|
||||
62, 1, 1
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
62, 1, 2
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
62, 1, 3
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
62, 1, 4
|
||||
};
|
||||
mcs = new ModemCapabilitiesEncoding(buffer);
|
||||
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
255, 1, 1
|
||||
};
|
||||
Assert.Throws<NotImplementedException>(() => new ModemCapabilitiesEncoding(buffer));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GeneralServiceFlowEncodingTest()
|
||||
{
|
||||
byte[] buffer = new byte[]
|
||||
{
|
||||
1, 2, 0, 1,
|
||||
2, 2, 0, 1,
|
||||
6, 1, 255,
|
||||
7, 1, 1,
|
||||
8, 4, 0, 0, 0, 1,
|
||||
9, 4, 0, 0, 0, 1,
|
||||
10, 4, 0, 0, 0, 1,
|
||||
11, 2, 0, 1,
|
||||
12, 2, 0, 1,
|
||||
14, 2, 0, 1,
|
||||
15, 1, 7,
|
||||
17, 1, 1,
|
||||
19, 2, 0, 1,
|
||||
20, 4, 0, 0, 0, 2,
|
||||
21, 4, 0, 0, 0, 2,
|
||||
22, 1, 2,
|
||||
23, 1, 2,
|
||||
24, 4, 0, 0, 0, 2,
|
||||
26, 1, 2,
|
||||
32, 4, 0, 0, 0, 3,
|
||||
16, 4, 0, 0, 255, 255,
|
||||
};
|
||||
GeneralServiceFlowEncoding gsfe = new GeneralServiceFlowEncoding(buffer);
|
||||
Assert.AreEqual((ushort)1, gsfe.ServiceFlowReference);
|
||||
Assert.AreEqual((ushort)1, gsfe.ServiceFlowIdentifier);
|
||||
Assert.IsTrue(gsfe.ProvisionedSet);
|
||||
Assert.IsTrue(gsfe.AdmittedSet);
|
||||
Assert.IsTrue(gsfe.ActiveSet);
|
||||
Assert.AreEqual((byte)1, gsfe.TrafficPriority);
|
||||
Assert.AreEqual((uint)1, gsfe.UpstreamMaximumSustainedTrafficRate);
|
||||
Assert.AreEqual((uint)1, gsfe.MaximumTrafficBurst);
|
||||
Assert.AreEqual((uint)1, gsfe.MinimumReservedTrafficRate);
|
||||
Assert.AreEqual((ushort)1, gsfe.AssumedMinimumReservedRatePacketSize);
|
||||
Assert.AreEqual((ushort)1, gsfe.TimeoutForActiveQosParameters);
|
||||
Assert.AreEqual(1, gsfe.MaximumConcatenatedBurst);
|
||||
Assert.AreEqual(GeneralServiceFlowEncoding.ServiceFlowSchedulingTypeEnum.ProactiveGrantService, gsfe.ServiceFlowSchedulingType);
|
||||
Assert.AreEqual(1, gsfe.DownstreamResequencing.Value);
|
||||
Assert.AreEqual(1, gsfe.UnsolicitedGrantSize.Value);
|
||||
Assert.AreEqual((uint)2, gsfe.NominalGrantInterval.Value);
|
||||
Assert.AreEqual((uint)2, gsfe.ToleratedGrantJitter.Value);
|
||||
Assert.AreEqual(2, gsfe.GrantsPerInterval.Value);
|
||||
Assert.IsNotNull(gsfe.IpTypeOfServiceOverwrite);
|
||||
Assert.AreEqual((uint)2, gsfe.CmtsTimestamp.Value);
|
||||
Assert.AreEqual(2, gsfe.MultiplierToNumberOfBytesRequested);
|
||||
Assert.AreEqual((uint)3, gsfe.ServiceFlowForbiddenAttributeMask);
|
||||
Assert.IsTrue(gsfe.DoNotUseContentionRegions);
|
||||
Assert.IsTrue(gsfe.DoNotUseSegmentHeaders);
|
||||
Assert.IsTrue(gsfe.DropPacketsTooBigForUnsolicitedGrant);
|
||||
Assert.IsTrue(gsfe.DoNotSupressPayloadHeaders);
|
||||
Assert.IsTrue(gsfe.DoNotFragmentData);
|
||||
Assert.IsTrue(gsfe.DoNotConcatenateData);
|
||||
Assert.IsTrue(gsfe.DoNotPiggybackRequests);
|
||||
Assert.IsTrue(gsfe.DoNotUseRequest2ForData);
|
||||
Assert.IsTrue(gsfe.DoNotUseRequest2ForRequests);
|
||||
Assert.IsTrue(gsfe.DoNotUsePriorityRequest);
|
||||
Assert.IsTrue(gsfe.DoNotUseAllCms);
|
||||
this.Print(gsfe.ToString());
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
17, 4, 0, 0, 0, 1
|
||||
};
|
||||
gsfe = new GeneralServiceFlowEncoding(buffer);
|
||||
Assert.AreEqual((uint)1, gsfe.NominalPollingInterval.Value);
|
||||
|
||||
buffer = new byte[]
|
||||
{
|
||||
254, 1, 1
|
||||
};
|
||||
Assert.Throws<NotImplementedException>(() => new GeneralServiceFlowEncoding(buffer));
|
||||
}
|
||||
|
||||
[MacManagementMessageType(0x90,0x01)]
|
||||
class TestableMacManagementMessage : MacManagementMessage
|
||||
{
|
||||
public TestableMacManagementMessage(PhysicalAddress source, PhysicalAddress destination, byte[] buffer) : base(source, destination, buffer)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class UntestableMacManagementMessage : MacManagementMessage
|
||||
{
|
||||
public UntestableMacManagementMessage(PhysicalAddress source, PhysicalAddress destination, byte[] buffer) : base(source, destination, buffer)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MacManagementMessageTest()
|
||||
{
|
||||
Random rng = new Random();
|
||||
byte[] srcBuffer = new byte[6];
|
||||
byte[] dstBuffer = new byte[6];
|
||||
PhysicalAddress srcAddr = new PhysicalAddress(srcBuffer);
|
||||
PhysicalAddress dstAddr = new PhysicalAddress(dstBuffer);
|
||||
byte[] dataBuffer = new byte[0];
|
||||
|
||||
MacManagementMessageTypeAttribute expected = new MacManagementMessageTypeAttribute(0x90, 0x01);
|
||||
TestableMacManagementMessage tmmm = new TestableMacManagementMessage(srcAddr, dstAddr, dataBuffer);
|
||||
Assert.AreEqual(expected, tmmm.MessageType);
|
||||
Assert.AreEqual(srcAddr, tmmm.Source);
|
||||
Assert.AreEqual(dstAddr, tmmm.Destination);
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new TestableMacManagementMessage(srcAddr, dstAddr, null));
|
||||
|
||||
UntestableMacManagementMessage ummm = new UntestableMacManagementMessage(srcAddr, dstAddr, dataBuffer);
|
||||
Assert.IsNull(ummm.MessageType);
|
||||
}
|
||||
}
|
||||
16
skyscraper8.Tests/RootTests/Mpeg2Tests.cs
Normal file
16
skyscraper8.Tests/RootTests/Mpeg2Tests.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using skyscraper5.Mpeg2;
|
||||
|
||||
namespace skyscraper8.Tests.RootTests;
|
||||
|
||||
|
||||
[TestClass]
|
||||
public class Mpeg2Tests : Feyllure
|
||||
{
|
||||
[TestMethod]
|
||||
public void PsiSectionTest()
|
||||
{
|
||||
PsiSection section = new PsiSection();
|
||||
section.Append(new byte[] { 3 });
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
|
||||
namespace skyscraper8.Tests
|
||||
{
|
||||
public class SanityTests
|
||||
{
|
||||
[Fact]
|
||||
public void Test15bits()
|
||||
{
|
||||
byte[] bcd = new byte[] { 0xa9, 0x23 };
|
||||
MemoryStream ms = new MemoryStream(bcd);
|
||||
byte readUInt8 = ms.ReadUInt8();
|
||||
|
||||
bool msbSet = (readUInt8 & 0x80) != 0;
|
||||
Assert.True(msbSet);
|
||||
|
||||
int result = ms.ReadUInt8();
|
||||
result <<= 8;
|
||||
result += readUInt8;
|
||||
Assert.Equal(9001, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,42 +1,36 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Target .NET 8 -->
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<!-- Mark this as a test project -->
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xunit.SkippableFact" Version="1.5.23" />
|
||||
<!-- MSTest framework -->
|
||||
<PackageReference Include="Allure.Net.Commons" Version="2.14.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skyscraper8\skyscraper8.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Resources1.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources1.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -44,6 +38,10 @@
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources1.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources1.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -51,8 +51,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper5.DNS", "MpePlugi
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper5.Gimmicks.IptvCollector", "Gimmicks\skyscraper5.Gimmicks.IptvCollector\skyscraper5.Gimmicks.IptvCollector.csproj", "{8F17668C-623C-F9B3-EAD4-2922E5414B75}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.Tests", "skyscraper8.Tests\skyscraper8.Tests.csproj", "{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UIs", "UIs", "{E23457C5-3A34-48EE-8107-C91E2C174B2D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper5.UI.WindowsForms", "GUIs\skyscraper5.UI\skyscraper5.UI.WindowsForms.csproj", "{46CACA1C-F9B2-2FE0-2068-716F381325E9}"
|
||||
@ -67,6 +65,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.UI.MonoGame", "
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.UI.MonoGame.Bridge", "GUIs\skyscraper8.UI.ImGui.MonoGame.Bridge\skyscraper8.UI.MonoGame.Bridge.csproj", "{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skyscraper8.Tests", "skyscraper8.Tests\skyscraper8.Tests.csproj", "{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -141,10 +141,6 @@ Global
|
||||
{8F17668C-623C-F9B3-EAD4-2922E5414B75}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8F17668C-623C-F9B3-EAD4-2922E5414B75}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8F17668C-623C-F9B3-EAD4-2922E5414B75}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{46CACA1C-F9B2-2FE0-2068-716F381325E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{46CACA1C-F9B2-2FE0-2068-716F381325E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{46CACA1C-F9B2-2FE0-2068-716F381325E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -169,6 +165,10 @@ Global
|
||||
{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1A29F6E6-4B6A-DCCD-1DF1-AA8D020E17D2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{84EE9FCD-2C7F-DF84-C1BA-99D018CE9412}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -1,12 +1,39 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAllureContext_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fc09614b59cc98c343d268f55e356aaafe85d13755cd5ca217988e9c5362ff_003FAllureContext_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAllureFeatureAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F405349a6f42433abaa8b1d6d06bb6f21c66899533fa9f9648cb1cde8755143_003FAllureFeatureAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F6e_003Fd247db11_003FArray_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F053cba69424c47858472194d509c3cdc12bb0_003F37_003F58cc70f4_003FAssert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa840692e98b74557bc005b38213a22c72dad0_003Fc8_003F58c2e0c9_003FAssert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F83_003Fc73c45bc_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe1ab690537c44e02a014076312b886b7b2e200_003F5a_003Fcf76af61_003FFileInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInterop_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003Fea_003F7d70064b_003FInterop_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F6b_003Fa410ee2c_003FList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMemberInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003Fce_003F751a2c1f_003FMemberInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMemoryStream_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F0d_003F068af3a6_003FMemoryStream_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>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObject_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F55_003F6efc7017_003FObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AQueue_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003Fb6_003F498e7c75_003FQueue_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARuntimeInformation_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F4c_003F5f771d10_003FRuntimeInformation_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASafeFileHandle_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003Fc6_003Fd8e0f2f2_003FSafeFileHandle_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASkip_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fd8c543d93f1559af2ea2be8e9d55839b5bb1a3605f22daa45ea63772e3b4bc_003FSkip_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003Feb_003F3c476997_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe1ab690537c44e02a014076312b886b7b2e200_003F4f_003F7bfc5050_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Ffb63d7b4f026464dbf9b2db60c7f76bc2ac00_003Fbd_003F4080deac_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATuple_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F57d616db882b441b8c50720b4477e03db2e200_003F9f_003F0d16f921_003FTuple_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/Profiling/Configurations/=1/@EntryIndexedValue"><data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="TimelineInfo" /><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data></s:String></wpf:ResourceDictionary>
|
||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||
<Assembly Path="/home/schiemas/.dotnet/packs/Microsoft.NETCore.App.Ref/8.0.21/ref/net8.0/System.Windows.dll" />
|
||||
<Assembly Path="/home/schiemas/.nuget/packages/allure.net.commons/2.14.1/lib/netstandard2.0/Allure.Net.Commons.dll" />
|
||||
</AssemblyExplorer></s:String>
|
||||
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">/home/schiemas/.cache/JetBrains/Rider2025.1/resharper-host/temp/Rider/vAny/CoverageData/_skyscraper8.1808907683/Snapshot/snapshot.utdcvr</s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=92c8346e_002D5416_002D4320_002Dab1d_002D051307b205cd/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="All tests from &lt;skyscraper8.Tests&gt; #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
</SessionState></s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=94eea68c_002Dcaa0_002D4657_002Da521_002D7b96c8ead0ec/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &lt;skyscraper8.Tests&gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="\home\schiemas\RiderProjects\skyscraper8\skyscraper8.Tests" Presentation="&lt;skyscraper8.Tests&gt;" />
|
||||
</SessionState></s:String>
|
||||
|
||||
|
||||
<s:String x:Key="/Default/Profiling/Configurations/=1/@EntryIndexedValue"><data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="TimelineInfo" /><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data></s:String>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=skyscraper8_002ETests_002FResources1/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
|
||||
@ -11,7 +11,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
public EthernetLlcPacketClassificationEncoding(byte[] buffer)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
while (ms.GetAvailableBytes() > 3)
|
||||
while (ms.GetAvailableBytes() >= 3)
|
||||
{
|
||||
byte type = ms.ReadUInt8();
|
||||
ushort length = ms.ReadUInt8();
|
||||
|
||||
@ -149,6 +149,6 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
|
||||
public uint? ServiceFlowIdentifier { get; set; }
|
||||
public EthernetLlcPacketClassificationEncoding EthernetLlcPacketClassificationEncodings { get; }
|
||||
internal Ipv6PacketClassificationEncoding Ipv6PacketClassification { get; }
|
||||
public Ipv6PacketClassificationEncoding Ipv6PacketClassification { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ using System.Net;
|
||||
|
||||
namespace skyscraper5.Docsis.AnnexC
|
||||
{
|
||||
internal class Ipv6PacketClassificationEncoding
|
||||
public class Ipv6PacketClassificationEncoding
|
||||
{
|
||||
public Ipv6PacketClassificationEncoding(byte[] buffer)
|
||||
{
|
||||
|
||||
@ -12,7 +12,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
{
|
||||
private readonly bool? ExpandedUnicastSidSpace;
|
||||
private readonly byte? DpvCapability;
|
||||
private readonly byte EnergyManagementPreference;
|
||||
private readonly byte? EnergyManagementPreference;
|
||||
private byte? UpstreamScQamSymbolRateSupport;
|
||||
private byte? _512MspsUpstreamTransmitScQamChannelSupport;
|
||||
private byte? _256MspsUpstreamTransmitScQamChannelSupport;
|
||||
@ -207,7 +207,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
DownstreamFrequencyRangeStarting = 108;
|
||||
else if (v[0] == 0x02)
|
||||
DownstreamFrequencyRangeStarting = 258;
|
||||
else if (v[0] == 0x003)
|
||||
else if (v[0] == 0x03)
|
||||
DownstreamFullDuplex = true;
|
||||
break;
|
||||
case 61:
|
||||
@ -235,7 +235,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
break;
|
||||
default:
|
||||
//CM-SP-MULPIv4.0-I01-190815.pdf, page 688
|
||||
throw new NotFiniteNumberException(String.Format("{0} {1}", nameof(ModemCapabilitiesEncoding), type));
|
||||
throw new NotImplementedException(String.Format("{0} {1}", nameof(ModemCapabilitiesEncoding), type));
|
||||
}
|
||||
}
|
||||
Valid = true;
|
||||
@ -268,7 +268,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
public byte? TransmitPreEqualizerTapsPerModulationInterval { get; }
|
||||
public byte? NumberOfTransmitEqualizerTaps { get; }
|
||||
public bool? DccSupport { get; }
|
||||
internal RangingHoldOffSupport RangingHoldOffSupport { get; }
|
||||
public RangingHoldOffSupport RangingHoldOffSupport { get; }
|
||||
public bool? L2VPN { get; }
|
||||
public ESafeHostCapability ESafeHostCapability { get; }
|
||||
public bool? DownstreamUnencryptedTrafficFiltering { get; }
|
||||
@ -446,5 +446,5 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
Level5 = 5,
|
||||
NoSpecifiedPerformance = 6,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Docsis.AnnexC
|
||||
{
|
||||
internal class RangingHoldOffSupport
|
||||
public class RangingHoldOffSupport
|
||||
{
|
||||
public RangingHoldOffSupport(byte a, byte b, byte c, byte d)
|
||||
{
|
||||
|
||||
@ -27,7 +27,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
SimplifiedReceiveChannelConfiguration = new SimplifiedReceiveChannelAssignmentEncoding(v);
|
||||
break;
|
||||
default:
|
||||
throw new NotFiniteNumberException(String.Format("{0} {1}", nameof(ModemCapabilitiesEncoding), type));
|
||||
throw new NotImplementedException(String.Format("{0} {1}", nameof(ModemCapabilitiesEncoding), type));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@ namespace skyscraper5.Docsis.AnnexC
|
||||
break;
|
||||
default:
|
||||
//page 728, CM-SP-MULPIv4.0-I01-190815.pdf
|
||||
throw new NotFiniteNumberException(String.Format("{0} {1}", nameof(SimplifiedReceiveChannelAssignmentEncoding), type));
|
||||
throw new NotImplementedException(String.Format("{0} {1}", nameof(SimplifiedReceiveChannelAssignmentEncoding), type));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,8 +30,6 @@ namespace skyscraper5.Docsis
|
||||
{
|
||||
Type type = this.GetType();
|
||||
object[] customAttributes = type.GetCustomAttributes(typeof(MacManagementMessageTypeAttribute), false);
|
||||
if (customAttributes == null)
|
||||
return null;
|
||||
if (customAttributes.Length == 0)
|
||||
return null;
|
||||
MacManagementMessageTypeAttribute attribute = (MacManagementMessageTypeAttribute)customAttributes[0];
|
||||
|
||||
33
skyscraper8/Docsis/NullDocsisEventHandler.cs
Normal file
33
skyscraper8/Docsis/NullDocsisEventHandler.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using skyscraper5.Docsis.MacManagement;
|
||||
|
||||
namespace skyscraper5.Docsis;
|
||||
|
||||
public class NullDocsisEventHandler : IDocsisEventHandler
|
||||
{
|
||||
public void OnParticipantDetected(PhysicalAddress pa)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnCmtsTimestamp(PhysicalAddress source, uint timing)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnUpstreamChannel(UpstreamChannelDescriptor mmm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnDownstreamChannel(PhysicalAddress physicalAddress, MacDomainDescriptor.DownstreamActiveChannel downstreamActiveChannel)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnLearnedIpFromMac(PhysicalAddress arpHeaderSenderHardwareAddress, IPAddress arpHeaderSenderProtocolAddress)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,7 @@ namespace skyscraper5.Dvb.Descriptors
|
||||
public NetworkNameDescriptor(byte[] buffer)
|
||||
{
|
||||
NetworkName = En300468AnnexATextDecoder.GetInstance().Decode(buffer);
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public string NetworkName { get; private set; }
|
||||
|
||||
@ -50,6 +50,8 @@ namespace skyscraper5.Dvb.Descriptors
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public int ModulationType { get; private set; }
|
||||
@ -100,5 +102,20 @@ namespace skyscraper5.Dvb.Descriptors
|
||||
NineOfTen = 9,
|
||||
NoConventionalCoding = 15
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(this.OrbitalPosition);
|
||||
sb.Append("°");
|
||||
sb.Append(this.East ? 'E' : 'W');
|
||||
sb.Append("/");
|
||||
sb.Append(Frequency / 100);
|
||||
sb.Append("/");
|
||||
sb.Append(this.Polarization.ToString()[0]);
|
||||
sb.Append("/");
|
||||
sb.Append(this.SymbolRate / 10);
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,5 +351,10 @@ namespace skyscraper5.Dvb.Descriptors
|
||||
{
|
||||
return HashCode.Combine((int)LinkageType, ServiceId, OriginalNetworkId, TransportStreamId);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{0} on (0x{1:X4},0x{2:X4},0x{3:X4})", LinkageType, OriginalNetworkId, TransportStreamId, ServiceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ using System.Threading.Tasks;
|
||||
using moe.yo3explorer.skyscraper8.DVBI.Model;
|
||||
using skyscraper8.DvbI;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using skyscraper8.Ietf.Rfc4566_SDP;
|
||||
|
||||
namespace skyscraper8.DvbNip
|
||||
{
|
||||
@ -53,16 +54,28 @@ namespace skyscraper8.DvbNip
|
||||
if (discoveryUdpPacket.DestinationPort == 3937)
|
||||
{
|
||||
LctFrame discoveryLctFrame = new LctFrame(discoveryUdpPacket.Payload);
|
||||
if (discoveryLctFrame.LctHeader.NipActualCarrierInformation != null)
|
||||
if (discoveryLctFrame == null)
|
||||
return;
|
||||
LctHeader lctHeader = discoveryLctFrame.LctHeader;
|
||||
if (lctHeader == null)
|
||||
return;
|
||||
if (lctHeader.NipActualCarrierInformation != null)
|
||||
{
|
||||
CurrentCarrierInformation = discoveryLctFrame.LctHeader.NipActualCarrierInformation;
|
||||
EventHandler.OnNipCarrierDetected(CurrentCarrierInformation);
|
||||
bootstrapped = true;
|
||||
}
|
||||
else if (discoveryLctFrame.PayloadContainsNativeIpMulticastTransportObject)
|
||||
{
|
||||
CurrentCarrierInformation = new NipActualCarrierInformation(ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, "(no NIP carrier name provided)");
|
||||
EventHandler.OnNipCarrierDetected(CurrentCarrierInformation);
|
||||
bootstrapped = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
UserDatagram udpPacket = new UserDatagram(ipv4Packet);
|
||||
LctFrame lctFrame = new LctFrame(udpPacket.Payload);
|
||||
if (lctFrame.LctHeader == null)
|
||||
@ -114,6 +127,10 @@ namespace skyscraper8.DvbNip
|
||||
SetFileAssociations(fluteListener, fdtAnnouncement);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("aaa");
|
||||
}
|
||||
fluteStream.Close();
|
||||
fluteStream.Dispose();
|
||||
flutes.Remove(fluteCoordinate);
|
||||
@ -164,62 +181,90 @@ namespace skyscraper8.DvbNip
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DateTime? currentTime;
|
||||
private bool HandleMetadata(FluteListener fluteListener)
|
||||
{
|
||||
switch (fluteListener.FileAssociation.ContentLocation)
|
||||
{
|
||||
case "urn:dvb:metadata:cs:NativeIPMulticastTransportObjectTypeCS:2023:bootstrap":
|
||||
MulticastGatewayConfigurationType multicastGatewayConfiguration2023 = DvbNipUtilities.UnpackMulticastGatewayConfiguration(fluteListener.ToStream());
|
||||
EventHandler?.OnMulticastGatewayConfiguration(CurrentCarrierInformation, multicastGatewayConfiguration2023);
|
||||
return true;
|
||||
case "urn:dvb:metadata:cs:MulticastTransportObjectTypeCS:2021:gateway-configuration":
|
||||
MulticastGatewayConfigurationType multicastGatewayConfiguration2021 = DvbNipUtilities.UnpackMulticastGatewayConfiguration(fluteListener.ToStream());
|
||||
EventHandler?.OnMulticastGatewayConfiguration(CurrentCarrierInformation, multicastGatewayConfiguration2021);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:PrivateDataSignalling":
|
||||
PrivateDataSignallingManifestType privateDataSignallingManifest = DvbNipUtilities.UnpackPrivateDataSignallingManifest(fluteListener.ToStream());
|
||||
EventHandler?.OnPrivateDataSignallingManifest(CurrentCarrierInformation, privateDataSignallingManifest);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:dvb-i-slep":
|
||||
if (currentTime.HasValue)
|
||||
Stream stream = fluteListener.ToStream();
|
||||
if (DvbNipUtilities.IsXml(stream))
|
||||
{
|
||||
Stream rawSlepStream = fluteListener.ToStream();
|
||||
byte[] rawSlepBytes = new byte[rawSlepStream.Length];
|
||||
rawSlepStream.Read(rawSlepBytes, 0, (int)rawSlepStream.Length);
|
||||
string rawSlepString = Encoding.UTF8.GetString(rawSlepBytes);
|
||||
rawSlepString = rawSlepString.Replace("<dvbi-types:", "<");
|
||||
rawSlepString = rawSlepString.Replace("</dvbi-types:", "</");
|
||||
rawSlepString = rawSlepString.Replace("<dvbisdt:", "<");
|
||||
rawSlepString = rawSlepString.Replace("</dvbisdt:", "</");
|
||||
ServiceListEntryPoints serviceListEntryPoints = DvbIUtils.UnpackServiceListEntryPoints(rawSlepString);
|
||||
EventHandler?.OnServiceListEntryPoints(CurrentCarrierInformation, serviceListEntryPoints, currentTime.Value, this);
|
||||
MulticastGatewayConfigurationType multicastGatewayConfiguration2023 = DvbNipUtilities.UnpackMulticastGatewayConfiguration(stream);
|
||||
EventHandler?.OnMulticastGatewayConfiguration(CurrentCarrierInformation, multicastGatewayConfiguration2023);
|
||||
return true;
|
||||
}
|
||||
else if (DvbNipUtilities.IsMime(stream))
|
||||
{
|
||||
stream = DvbNipUtilities.GetFirstMimeBodyPart(stream);
|
||||
if (SDP.IsSDP(stream))
|
||||
{
|
||||
SDP loadedSdp = SDP.Load(stream);
|
||||
MulticastGatewayConfigurationType convertedSdp = loadedSdp.ToMulticastGatewayConfiguration();
|
||||
EventHandler?.OnMulticastGatewayConfiguration(CurrentCarrierInformation, convertedSdp);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.DumpToFile("container2.bin");
|
||||
logger.WarnFormat("Failed to detect the Metadata format of the Native IP Multicast Transport Object.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.WarnFormat("Failed to detect the Metadata format of the Native IP Multicast Transport Object.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "urn:dvb:metadata:nativeip:TimeOffsetFile":
|
||||
TimeOffsetFileType timeOffsetFile = DvbNipUtilities.UnpackTimeOffsetFile(fluteListener.ToStream());
|
||||
EventHandler?.OnTimeOffsetFile(CurrentCarrierInformation, timeOffsetFile);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:NetworkInformationFile":
|
||||
NetworkInformationFileType networkInformationFile = DvbNipUtilities.UnpackNetworkInformationFile(fluteListener.ToStream());
|
||||
EventHandler?.OnNetworkInformationFile(CurrentCarrierInformation, networkInformationFile);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:ServiceInformationFile":
|
||||
ServiceInformationFileType serviceInformationFile = DvbNipUtilities.UnpackServiceInformationFile(fluteListener.ToStream());
|
||||
EventHandler?.OnServiceInformationFile(CurrentCarrierInformation, serviceInformationFile);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:ServiceGuide":
|
||||
//Unfortunately, the NIPServiceGuideManifest does not contain any useful information at all, which is why we ignore it.
|
||||
//There doesn't seem to be a way to get the actual EIT XML from it.
|
||||
return true;
|
||||
default:
|
||||
throw new NotImplementedException(fluteListener.FileAssociation.ContentLocation);
|
||||
}
|
||||
case "urn:dvb:metadata:cs:MulticastTransportObjectTypeCS:2021:gateway-configuration":
|
||||
MulticastGatewayConfigurationType multicastGatewayConfiguration2021 = DvbNipUtilities.UnpackMulticastGatewayConfiguration(fluteListener.ToStream());
|
||||
EventHandler?.OnMulticastGatewayConfiguration(CurrentCarrierInformation, multicastGatewayConfiguration2021);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:PrivateDataSignalling":
|
||||
PrivateDataSignallingManifestType privateDataSignallingManifest = DvbNipUtilities.UnpackPrivateDataSignallingManifest(fluteListener.ToStream());
|
||||
EventHandler?.OnPrivateDataSignallingManifest(CurrentCarrierInformation, privateDataSignallingManifest);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:dvb-i-slep":
|
||||
if (currentTime.HasValue)
|
||||
{
|
||||
Stream rawSlepStream = fluteListener.ToStream();
|
||||
byte[] rawSlepBytes = new byte[rawSlepStream.Length];
|
||||
rawSlepStream.Read(rawSlepBytes, 0, (int)rawSlepStream.Length);
|
||||
string rawSlepString = Encoding.UTF8.GetString(rawSlepBytes);
|
||||
rawSlepString = rawSlepString.Replace("<dvbi-types:", "<");
|
||||
rawSlepString = rawSlepString.Replace("</dvbi-types:", "</");
|
||||
rawSlepString = rawSlepString.Replace("<dvbisdt:", "<");
|
||||
rawSlepString = rawSlepString.Replace("</dvbisdt:", "</");
|
||||
ServiceListEntryPoints serviceListEntryPoints = DvbIUtils.UnpackServiceListEntryPoints(rawSlepString);
|
||||
EventHandler?.OnServiceListEntryPoints(CurrentCarrierInformation, serviceListEntryPoints, currentTime.Value, this);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "urn:dvb:metadata:nativeip:TimeOffsetFile":
|
||||
TimeOffsetFileType timeOffsetFile = DvbNipUtilities.UnpackTimeOffsetFile(fluteListener.ToStream());
|
||||
EventHandler?.OnTimeOffsetFile(CurrentCarrierInformation, timeOffsetFile);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:NetworkInformationFile":
|
||||
NetworkInformationFileType networkInformationFile = DvbNipUtilities.UnpackNetworkInformationFile(fluteListener.ToStream());
|
||||
EventHandler?.OnNetworkInformationFile(CurrentCarrierInformation, networkInformationFile);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:ServiceInformationFile":
|
||||
ServiceInformationFileType serviceInformationFile = DvbNipUtilities.UnpackServiceInformationFile(fluteListener.ToStream());
|
||||
EventHandler?.OnServiceInformationFile(CurrentCarrierInformation, serviceInformationFile);
|
||||
return true;
|
||||
case "urn:dvb:metadata:nativeip:ServiceGuide":
|
||||
//Unfortunately, the NIPServiceGuideManifest does not contain any useful information at all, which is why we ignore it.
|
||||
//There doesn't seem to be a way to get the actual EIT XML from it.
|
||||
return true;
|
||||
default:
|
||||
throw new NotImplementedException(fluteListener.FileAssociation.ContentLocation);
|
||||
}
|
||||
}
|
||||
private void TryPruneCache()
|
||||
{
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using log4net;
|
||||
using MimeKit;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper8.Ietf.FLUTE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using skyscraper8.Ietf.FLUTE;
|
||||
|
||||
namespace skyscraper8.DvbNip
|
||||
{
|
||||
@ -12,8 +16,60 @@ namespace skyscraper8.DvbNip
|
||||
{
|
||||
private DvbNipUtilities() { }
|
||||
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
private static XmlSerializer multicastGatewayConfigurationXmlSerializer;
|
||||
|
||||
public static bool IsXml(Stream s)
|
||||
{
|
||||
byte byteA = s.ReadUInt8();
|
||||
byte byteB = s.ReadUInt8();
|
||||
byte byteC = s.ReadUInt8();
|
||||
byte byteD = s.ReadUInt8();
|
||||
byte byteE = s.ReadUInt8();
|
||||
byte byteF = s.ReadUInt8();
|
||||
s.Position -= 6;
|
||||
|
||||
if (byteA != '<')
|
||||
return false;
|
||||
|
||||
if (byteB != '?')
|
||||
return false;
|
||||
|
||||
if (byteC != 'x')
|
||||
return false;
|
||||
|
||||
if (byteD != 'm')
|
||||
return false;
|
||||
|
||||
if (byteE != 'l')
|
||||
return false;
|
||||
|
||||
if (byteF != ' ')
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static readonly byte[] MimeVersionMagic = new byte[]
|
||||
{
|
||||
0x4D, 0x49, 0x4D, 0x45, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A, 0x20
|
||||
};
|
||||
|
||||
public static bool IsMime(Stream s)
|
||||
{
|
||||
if (s.GetAvailableBytes() <= MimeVersionMagic.Length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[MimeVersionMagic.Length];
|
||||
int bufferReadResult = s.Read(buffer, 0, buffer.Length);
|
||||
bool isMime = Enumerable.SequenceEqual(buffer, MimeVersionMagic);
|
||||
s.Position -= bufferReadResult;
|
||||
return isMime;
|
||||
}
|
||||
|
||||
|
||||
public static MulticastGatewayConfigurationType UnpackMulticastGatewayConfiguration(Stream stream)
|
||||
{
|
||||
if (multicastGatewayConfigurationXmlSerializer == null)
|
||||
@ -120,6 +176,10 @@ namespace skyscraper8.DvbNip
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2023", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
else if (bufferString.Contains("urn:dvb:metadata:nativeip:2022"))
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2022", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
|
||||
object v = networkInformationFileXmlSerializer.Deserialize(new StringReader(bufferString));
|
||||
NetworkInformationFileType result = (NetworkInformationFileType)v;
|
||||
@ -141,10 +201,50 @@ namespace skyscraper8.DvbNip
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2023", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
else if (bufferString.Contains("urn:dvb:metadata:nativeip:2022"))
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2022", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
|
||||
object v = serviceInformationFileXmlSerializer.Deserialize(new StringReader(bufferString));
|
||||
ServiceInformationFileType result = (ServiceInformationFileType)v;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Stream GetFirstMimeBodyPart(Stream stream)
|
||||
{
|
||||
MimeMessage message = MimeMessage.Load(stream);
|
||||
foreach (MimeEntity bodyPart in message.BodyParts)
|
||||
{
|
||||
MimePart part = bodyPart as MimePart;
|
||||
if (part.ContentType.MimeType.Equals("application/mbms-envelope+xml"))
|
||||
continue;
|
||||
if (part.ContentType.MimeType.Equals("application/mbms-user-service-description+xml"))
|
||||
continue;
|
||||
if (part.ContentType.MimeType.Equals("application/mbms-schedule+xml"))
|
||||
continue;
|
||||
return part.Content.Stream;
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static FluteListener PatchMpegDashSegment(FluteListener listener)
|
||||
{
|
||||
Stream stream = listener.ToStream();
|
||||
stream.Position = stream.Length - 1;
|
||||
byte readUInt8 = stream.ReadUInt8();
|
||||
if (readUInt8 != 0)
|
||||
return listener;
|
||||
|
||||
logger.WarnFormat("MPEG-DASH segment {0} is overdumped. It will be patched to become playable.", listener.FileAssociation.ContentLocation);
|
||||
stream.Position = stream.Length - 1;
|
||||
while (stream.ReadUInt8() == 0)
|
||||
{
|
||||
stream.Position -= 2;
|
||||
}
|
||||
|
||||
listener.TrimmedLength = stream.Position;
|
||||
return listener;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,15 @@ namespace skyscraper8.DvbNip
|
||||
NipStreamProviderName = Encoding.UTF8.GetString(ms.ReadBytes(length));
|
||||
}
|
||||
|
||||
public NipActualCarrierInformation(ushort nipNetworkId, ushort nipCarrierId, ushort nipLinkId, ushort nipServiceId, string nipStreamProviderName)
|
||||
{
|
||||
NipNetworkId = nipNetworkId;
|
||||
NipCarrierId = nipCarrierId;
|
||||
NipLinkId = nipLinkId;
|
||||
NipServiceId = nipServiceId;
|
||||
NipStreamProviderName = nipStreamProviderName;
|
||||
}
|
||||
|
||||
public ushort NipNetworkId { get; }
|
||||
public ushort NipCarrierId { get; }
|
||||
public ushort NipLinkId { get; }
|
||||
|
||||
@ -1,19 +1,18 @@
|
||||
using log4net;
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper8.GS;
|
||||
using skyscraper8.Skyscraper.Scraper;
|
||||
|
||||
namespace skyscraper8.GSE;
|
||||
|
||||
public class BbframeDeencapsulator3 : IBbframeDeencapsulator
|
||||
class BbframeDeencapsulator3 : IBbframeDeencapsulator
|
||||
{
|
||||
public BbframeDeencapsulator3(IMultiprotocolEncapsulationEventHandler mpeEventHandler, ISubTsHandler subTsHandler)
|
||||
public BbframeDeencapsulator3(GsContextDto context)
|
||||
{
|
||||
_mpeEventHandler = mpeEventHandler;
|
||||
_subTsHandler = subTsHandler;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
private readonly ISubTsHandler _subTsHandler;
|
||||
private readonly IMultiprotocolEncapsulationEventHandler _mpeEventHandler;
|
||||
private readonly GsContextDto context;
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
private long numPushed;
|
||||
public void PushPacket(byte[] bbframe)
|
||||
@ -38,11 +37,7 @@ public class BbframeDeencapsulator3 : IBbframeDeencapsulator
|
||||
if (mis[bbHeader.Matype2] == null)
|
||||
{
|
||||
logger.InfoFormat("Found a stream on MIS {0}",bbHeader.Matype2);
|
||||
mis[bbHeader.Matype2] = new GsTypeDetector(bbHeader.Matype2)
|
||||
{
|
||||
mpeEventHandler = this._mpeEventHandler,
|
||||
subTsHandler = this._subTsHandler
|
||||
};
|
||||
mis[bbHeader.Matype2] = new GsTypeDetector(context.MisClone(bbHeader.Matype2));
|
||||
}
|
||||
|
||||
mis[bbHeader.Matype2].PushFrame(bbHeader, new ReadOnlySpan<byte>(bbframe, 11, bbframe.Length - 11));
|
||||
|
||||
247
skyscraper8/GS/GSE-BFBS/BfbsGseReader.cs
Normal file
247
skyscraper8/GS/GSE-BFBS/BfbsGseReader.cs
Normal file
@ -0,0 +1,247 @@
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper8.GSE;
|
||||
using skyscraper8.GSE.GSE;
|
||||
using skyscraper8.Skyscraper.IO;
|
||||
using skyscraper8.Skyscraper.Scraper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel;
|
||||
|
||||
namespace skyscraper8.GS.GSE_BFBS
|
||||
{
|
||||
internal class BfbsGseReader : IMisHandler
|
||||
{
|
||||
private GseLabel lastLabel;
|
||||
private int frameNo;
|
||||
public GsContextDto Context { get; set; }
|
||||
|
||||
public BfbsGseReader(GsContextDto context)
|
||||
{
|
||||
this.Context = context;
|
||||
}
|
||||
|
||||
private bool CheckAllZeroes(ReadOnlySpan<byte> span)
|
||||
{
|
||||
for (int i = 0; i < span.Length - 4; i++)
|
||||
{
|
||||
if (span[i] != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan)
|
||||
{
|
||||
frameNo++;
|
||||
bool validCrc = DvbCrc32.ValidateCrc(readOnlySpan);
|
||||
if (!validCrc)
|
||||
return;
|
||||
|
||||
if (readOnlySpan[0] == 0 && readOnlySpan[1] == 0 && readOnlySpan[2] == 0 && readOnlySpan[3] == 0)
|
||||
{
|
||||
if (CheckAllZeroes(readOnlySpan))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException("A BBFrame with data offset not at 0 was found. This not supported yet, please share a sample of this.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
StreamlikeSpan span = new StreamlikeSpan(readOnlySpan);
|
||||
|
||||
while (span.GetAvailableBytes() > 4)
|
||||
{
|
||||
byte byteA = span.ReadUInt8();
|
||||
bool startIndicator = (byteA & 0x80) != 0;
|
||||
bool endIndicator = (byteA & 0x40) != 0;
|
||||
int labelTypeIndicator = (byteA & 0x30) >> 4;
|
||||
if (!startIndicator && !endIndicator && labelTypeIndicator == 0)
|
||||
{
|
||||
//padding bits, packet has ended.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
GsePacket gsePacket = new GsePacket(startIndicator, endIndicator, labelTypeIndicator);
|
||||
int gseLength = (byteA & 0x0f) << 8;
|
||||
gseLength += span.ReadUInt8();
|
||||
|
||||
gsePacket.FragmentId = null;
|
||||
if (!startIndicator || !endIndicator)
|
||||
{
|
||||
gsePacket.FragmentId = span.ReadUInt8();
|
||||
gseLength -= 1;
|
||||
}
|
||||
|
||||
if ((startIndicator) && !endIndicator)
|
||||
{
|
||||
gsePacket.TotalLength = span.ReadUInt16BE();
|
||||
gseLength -= 2;
|
||||
}
|
||||
|
||||
if (startIndicator)
|
||||
{
|
||||
gsePacket.ProtocolType = span.ReadUInt16BE();
|
||||
gseLength -= 2;
|
||||
if (labelTypeIndicator == 0)
|
||||
{
|
||||
gsePacket.Label = new _6byteLabel(span.ReadBytes(6));
|
||||
gseLength -= 6;
|
||||
}
|
||||
else if (labelTypeIndicator == 1)
|
||||
{
|
||||
gsePacket.Label = new _3byteLabel(span.ReadBytes(3));
|
||||
gseLength -= 3;
|
||||
}
|
||||
else if (labelTypeIndicator == 2)
|
||||
{
|
||||
gsePacket.Label = BroadcastLabel.GetInstance();
|
||||
}
|
||||
else if (labelTypeIndicator == 3)
|
||||
{
|
||||
gsePacket.Label = lastLabel;
|
||||
}
|
||||
lastLabel = gsePacket.Label;
|
||||
}
|
||||
|
||||
if (!startIndicator && endIndicator)
|
||||
gseLength -= 4;
|
||||
|
||||
gsePacket.GseDataBytes = span.ReadBytes(gseLength);
|
||||
|
||||
if (!startIndicator && endIndicator)
|
||||
{
|
||||
gsePacket.Crc32 = span.ReadUInt32BE();
|
||||
}
|
||||
|
||||
HandleGseFrame(gsePacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private GseFragmentation[] fragmentations;
|
||||
private void HandleGseFrame(GsePacket gsePacket)
|
||||
{
|
||||
if (gsePacket.StartIndicator & gsePacket.EndIndicator)
|
||||
{
|
||||
HandleAssembledFrame(gsePacket.ProtocolType.Value, gsePacket.GseDataBytes, gsePacket.Label);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gsePacket.StartIndicator && gsePacket.EndIndicator)
|
||||
{
|
||||
if (fragmentations == null)
|
||||
{
|
||||
//This stream had no fragmentations yet, so we cannot reassemble this packet.
|
||||
return;
|
||||
}
|
||||
|
||||
if (fragmentations[gsePacket.FragmentId.Value] == null)
|
||||
{
|
||||
//The previous fragments are missing, so we cannot reassemble this packet.
|
||||
return;
|
||||
}
|
||||
|
||||
fragmentations[gsePacket.FragmentId.Value].AddFragement(gsePacket);
|
||||
if (fragmentations[gsePacket.FragmentId.Value].Validate())
|
||||
{
|
||||
byte[] gseDataBytes = fragmentations[gsePacket.FragmentId.Value].GetGseDataBytes();
|
||||
ushort protocolType = fragmentations[gsePacket.FragmentId.Value].ProtocolType;
|
||||
HandleAssembledFrame(protocolType, gseDataBytes, gsePacket.Label);
|
||||
fragmentations[gsePacket.FragmentId.Value] = null;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
if (gsePacket.StartIndicator && !gsePacket.EndIndicator)
|
||||
{
|
||||
fragmentations = new GseFragmentation[256];
|
||||
fragmentations[gsePacket.FragmentId.Value] = new GseFragmentation(gsePacket);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gsePacket.StartIndicator && !gsePacket.EndIndicator)
|
||||
{
|
||||
if (fragmentations == null)
|
||||
{
|
||||
//This stream had no fragmentations yet, so we cannot reassemble this packet.
|
||||
return;
|
||||
}
|
||||
|
||||
if (fragmentations[gsePacket.FragmentId.Value] == null)
|
||||
{
|
||||
//The previous fragments are missing, so we cannot reassemble this packet.
|
||||
return;
|
||||
}
|
||||
|
||||
fragmentations[gsePacket.FragmentId.Value].AddFragement(gsePacket);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new NotImplementedException(
|
||||
"A unknown frame type was encountered. Please share a sample of this stream.");
|
||||
}
|
||||
|
||||
private void HandleAssembledFrame(ushort protocolType, byte[] buffer, GseLabel label)
|
||||
{
|
||||
switch (protocolType)
|
||||
{
|
||||
case 0x0081:
|
||||
//Network clock reference
|
||||
HandleNetworkClockReference(buffer);
|
||||
return;
|
||||
case 0x0082:
|
||||
//Lower Layer Signalling, see en_30154502v010401p.pdf, page 49
|
||||
HandleLowerLayerSignalling(buffer, label);
|
||||
return;
|
||||
case 0x0091:
|
||||
//according to https://www.iana.org/assignments/ule-next-headers/ule-next-headers.xhtml it's private
|
||||
return;
|
||||
case 0x0800:
|
||||
Context.IpOutput.OnIpDatagram(0x010e, buffer);
|
||||
return;
|
||||
default:
|
||||
throw new NotImplementedException(protocolType.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private GseL2SHandler rcs2;
|
||||
private void HandleLowerLayerSignalling(byte[] buffer, GseLabel label)
|
||||
{
|
||||
if (rcs2 == null)
|
||||
{
|
||||
rcs2 = new GseL2SHandler(Context);
|
||||
}
|
||||
|
||||
rcs2.PushPacket(buffer, label);
|
||||
|
||||
}
|
||||
|
||||
private void HandleNetworkClockReference(byte[] buffer)
|
||||
{
|
||||
MemoryStream binaryReader = new MemoryStream(buffer);
|
||||
uint pcrA = binaryReader.ReadUInt32BE();
|
||||
ushort pcrB = binaryReader.ReadUInt16BE();
|
||||
ulong pcr_base = ((ulong)pcrA << 1) | ((ulong)pcrB >> 15);
|
||||
ulong pcr_ext = (ulong)pcrB & 0x01ff;
|
||||
ulong PCR = pcr_base * 300 + pcr_ext;
|
||||
ulong seconds = PCR / 27000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
170
skyscraper8/GS/GSE-BFBS/GseL2SHandler.cs
Normal file
170
skyscraper8/GS/GSE-BFBS/GseL2SHandler.cs
Normal file
@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel;
|
||||
using skyscraper5.src.InteractionChannel.Model;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.GSE.GSE;
|
||||
using skyscraper8.InteractionChannel;
|
||||
using skyscraper8.InteractionChannel.Model;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
|
||||
namespace skyscraper8.GS.GSE_BFBS
|
||||
{
|
||||
internal class GseL2SHandler
|
||||
{
|
||||
public GsContextDto Context { get; }
|
||||
|
||||
public GseL2SHandler(GsContextDto context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public void PushPacket(byte[] buffer, GseLabel label)
|
||||
{
|
||||
GseTableStructure gseTableStructure = new GseTableStructure(buffer);
|
||||
if (!gseTableStructure.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.GseTableStructureInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
MemoryStream ms = new MemoryStream(gseTableStructure.TableContent, false);
|
||||
switch (gseTableStructure.TableId)
|
||||
{
|
||||
case 0x40:
|
||||
RcsNit nit = new RcsNit(ms);
|
||||
if (!nit.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.NitInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
Context.Rcs2Output.OnRcs2Nit(gseTableStructure.InteractiveNetworkId, nit);
|
||||
return;
|
||||
case 0x41:
|
||||
Rmt rmt = new Rmt(ms, true);
|
||||
if (!rmt.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.RmtInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
Context.Rcs2Output.OnRcsMap(rmt);
|
||||
return;
|
||||
case 0x70:
|
||||
Rcs2Tdt tdt = new Rcs2Tdt(ms);
|
||||
if (!tdt.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.TdtInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
Context.Rcs2Output.OnRcs2Tdt(gseTableStructure.InteractiveNetworkId, tdt);
|
||||
return;
|
||||
case 0xa0:
|
||||
Sct sct = new Sct(ms);
|
||||
if (!sct.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.SctInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
Context.Rcs2Output.OnSuperframeComposition(gseTableStructure.InteractiveNetworkId, sct);
|
||||
return;
|
||||
case 0xa3:
|
||||
Spt spt = new Spt(ms);
|
||||
if (!spt.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.SptInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
Context.Rcs2Output.OnSatellitePosition(gseTableStructure.InteractiveNetworkId, spt);
|
||||
return;
|
||||
case 0xa4:
|
||||
Cmt cmt = new Cmt(ms);
|
||||
if (!cmt.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.CmtInvalid);
|
||||
return;
|
||||
}
|
||||
Context.Rcs2Output.OnCorrectionMessage(gseTableStructure.InteractiveNetworkId, cmt);
|
||||
return;
|
||||
case 0xab:
|
||||
Fct2 fct2 = new Fct2(ms);
|
||||
if (!fct2.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.Fct2Invalid);
|
||||
return;
|
||||
}
|
||||
Context.Rcs2Output.OnFrameComposition2(gseTableStructure.InteractiveNetworkId, fct2);
|
||||
return;
|
||||
case 0xac:
|
||||
Bct bct = new Bct(ms);
|
||||
if (!bct.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.BctInvalid);
|
||||
return;
|
||||
}
|
||||
Context.Rcs2Output.OnBroadcastConfiguration(gseTableStructure.InteractiveNetworkId, bct);
|
||||
return;
|
||||
case 0xad:
|
||||
Tbtp2 tbtp2 = new Tbtp2(ms);
|
||||
if (!tbtp2.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.Tbtp2Invalid);
|
||||
return;
|
||||
}
|
||||
Context.Rcs2Output.OnTerminalBurstTimePlan2(gseTableStructure.InteractiveNetworkId, tbtp2);
|
||||
return;
|
||||
case 0xae:
|
||||
int rmtTransmissionStandard = Context.Rcs2Output.GetRmtTransmissionStandard(gseTableStructure.InteractiveNetworkId);
|
||||
Tmst2 tmst2 = new Tmst2(ms, rmtTransmissionStandard);
|
||||
if (!tmst2.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.Tmst2Invalid);
|
||||
return;
|
||||
}
|
||||
Context.Rcs2Output.OnTransmissionModeSupport2(gseTableStructure.InteractiveNetworkId, tmst2);
|
||||
return;
|
||||
case 0xb0:
|
||||
Tim tim = new Tim(ms, label.IsBroadcast());
|
||||
if (!tim.Valid)
|
||||
{
|
||||
Context.Rcs2Output.OnInteractionChannelError(InteractionChannelErrorState.TimInvalid);
|
||||
return;
|
||||
}
|
||||
|
||||
PhysicalAddress physicalAddress;
|
||||
if (label.IsBroadcast())
|
||||
{
|
||||
physicalAddress = _6byteLabel.BROADCAST;
|
||||
}
|
||||
else if (label.Length == 6)
|
||||
{
|
||||
physicalAddress = ((_6byteLabel)label).MAC;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException("Found a TIM-U Table with a 3-byte GSE Label in this stream. This is not supported yet, please share a sample of this stream.");
|
||||
}
|
||||
|
||||
tim.Handle(physicalAddress, gseTableStructure.InteractiveNetworkId, Context.Rcs2Output);
|
||||
return;
|
||||
case 0xc0:
|
||||
//User defined, we have no way of knowing what this is.
|
||||
return;
|
||||
default:
|
||||
//See en_30154502v010401p.pdf
|
||||
//page 49
|
||||
throw new NotImplementedException(String.Format(
|
||||
"Unknown DVB-RCS2 Table Id: 0x{0:X2}\nIf this is reproducible on this stream, please consider submitting me a sample.",
|
||||
gseTableStructure.TableId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,24 +1,26 @@
|
||||
using log4net;
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper8.GS;
|
||||
using skyscraper8.GSE.GSE;
|
||||
|
||||
namespace skyscraper8.GSE.GSE_HEM;
|
||||
|
||||
public class GseHemReader : IMisHandler
|
||||
class GseHemReader : IMisHandler
|
||||
{
|
||||
public GseHemReader(IMultiprotocolEncapsulationEventHandler mpeEventHandler)
|
||||
public GseHemReader(GsContextDto context)
|
||||
{
|
||||
rayBuffer = new RayBuffer();
|
||||
this.mpeEventHandler = mpeEventHandler;
|
||||
this.Context = context;
|
||||
}
|
||||
|
||||
private IMultiprotocolEncapsulationEventHandler mpeEventHandler;
|
||||
private GseLabel lastLabel;
|
||||
private RayBuffer rayBuffer;
|
||||
private const int BUFFER_THRESHOLD = 65536 * 2; //Twice the maximum PDU size of GSE. That way we can guarantee we have one full PDU in buffer.
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public GsContextDto Context { get; set; }
|
||||
|
||||
public void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(readOnlySpan.ToArray());
|
||||
@ -101,7 +103,7 @@ public class GseHemReader : IMisHandler
|
||||
switch (packet.ProtocolType)
|
||||
{
|
||||
case 0x0800:
|
||||
mpeEventHandler.OnIpDatagram(0x010e,packet.GseDataBytes);
|
||||
Context.IpOutput.OnIpDatagram(0x010e,packet.GseDataBytes);
|
||||
return;
|
||||
default:
|
||||
logger.WarnFormat("This GSE-HEM stream contains traffic other than IP. IP is type 0x0800, but we got 0x{0:X4} here.", packet.ProtocolType);
|
||||
|
||||
@ -7,10 +7,22 @@ public class GseFragmentation
|
||||
this.ProtocolType = child.ProtocolType.Value;
|
||||
this.Label = child.Label;
|
||||
AddFragement(child);
|
||||
this.TotalLength = child.TotalLength.Value;
|
||||
this.Crc32 = child.Crc32;
|
||||
}
|
||||
|
||||
public uint Crc32 { get; set; }
|
||||
|
||||
public ushort TotalLength { get; set; }
|
||||
|
||||
private List<byte[]> fragments;
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
//TODO: Implement proper CRC-32 checking here
|
||||
return true;
|
||||
}
|
||||
|
||||
public void AddFragement(GsePacket packet)
|
||||
{
|
||||
if (fragments == null)
|
||||
@ -23,12 +35,11 @@ public class GseFragmentation
|
||||
|
||||
public ushort ProtocolType { get; private set; }
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
//To be implemented...
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assembles the payload
|
||||
/// </summary>
|
||||
/// <returns>The concatenated GSE Data Bytes of each packet.</returns>
|
||||
public byte[] GetGseDataBytes()
|
||||
{
|
||||
int totalLength = fragments.Select(x => x.Length).Sum();
|
||||
|
||||
@ -6,6 +6,9 @@ public abstract class GseLabel
|
||||
{
|
||||
public abstract int Length { get; }
|
||||
public abstract string ToString();
|
||||
|
||||
public abstract int LabelTypeIndicator { get; }
|
||||
public abstract bool IsBroadcast();
|
||||
}
|
||||
|
||||
public class _6byteLabel : GseLabel
|
||||
@ -15,6 +18,11 @@ public class _6byteLabel : GseLabel
|
||||
MAC = new PhysicalAddress(buffer);
|
||||
}
|
||||
|
||||
public _6byteLabel(PhysicalAddress macAddress)
|
||||
{
|
||||
MAC = macAddress;
|
||||
}
|
||||
|
||||
public PhysicalAddress MAC { get; private set; }
|
||||
|
||||
override public string ToString()
|
||||
@ -23,23 +31,49 @@ public class _6byteLabel : GseLabel
|
||||
}
|
||||
|
||||
public override int Length => 6;
|
||||
public override int LabelTypeIndicator => 0;
|
||||
|
||||
public static PhysicalAddress BROADCAST = new PhysicalAddress(new byte[] { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff });
|
||||
public override bool IsBroadcast()
|
||||
{
|
||||
return MAC.Equals(BROADCAST);
|
||||
}
|
||||
}
|
||||
|
||||
public class _3byteLabel : GseLabel
|
||||
{
|
||||
public _3byteLabel(byte[] buffer)
|
||||
{
|
||||
Label = buffer;
|
||||
this.buffer = buffer;
|
||||
}
|
||||
|
||||
public byte[] Label { get; private set; }
|
||||
private byte[] buffer;
|
||||
|
||||
override public string ToString()
|
||||
public byte GroupId => buffer[0];
|
||||
|
||||
public ushort LogonId
|
||||
{
|
||||
return BitConverter.ToString(Label);
|
||||
get
|
||||
{
|
||||
ushort result = buffer[1];
|
||||
result <<= 8;
|
||||
result += buffer[2];
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(GroupId)}: {GroupId}, {nameof(LogonId)}: {LogonId}";
|
||||
}
|
||||
|
||||
override public int Length => 3;
|
||||
|
||||
public override int LabelTypeIndicator => 1;
|
||||
public override bool IsBroadcast()
|
||||
{
|
||||
return buffer[1] == 0xff && buffer[2] == 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
public class BroadcastLabel : GseLabel
|
||||
@ -62,4 +96,11 @@ public class BroadcastLabel : GseLabel
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public override int LabelTypeIndicator => 2;
|
||||
|
||||
public override bool IsBroadcast()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,17 @@
|
||||
using log4net;
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper8.GS;
|
||||
|
||||
namespace skyscraper8.GSE.GSE;
|
||||
|
||||
internal class GseReader : IMisHandler
|
||||
{
|
||||
|
||||
private GseLabel lastLabel;
|
||||
public IMultiprotocolEncapsulationEventHandler mpeEventHandler { get; set; }
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
public GsContextDto Context { get; set; }
|
||||
|
||||
public void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(readOnlySpan.ToArray());
|
||||
@ -115,7 +118,7 @@ internal class GseReader : IMisHandler
|
||||
currentFragmentation.AddFragement(child);
|
||||
if (currentFragmentation.Validate())
|
||||
{
|
||||
mpeEventHandler.OnIpDatagram(0x010e,currentFragmentation.GetGseDataBytes());
|
||||
Context.IpOutput.OnIpDatagram(0x010e,currentFragmentation.GetGseDataBytes());
|
||||
}
|
||||
|
||||
fragmentations[child.FragmentId.Value] = null;
|
||||
@ -150,7 +153,7 @@ internal class GseReader : IMisHandler
|
||||
switch (child.ProtocolType)
|
||||
{
|
||||
case 0x0800:
|
||||
mpeEventHandler.OnIpDatagram(0x010e, child.GseDataBytes);
|
||||
Context.IpOutput.OnIpDatagram(0x010e, child.GseDataBytes);
|
||||
break;
|
||||
default:
|
||||
if (warnedEthertypes == null)
|
||||
|
||||
53
skyscraper8/GS/GsContextDto.cs
Normal file
53
skyscraper8/GS/GsContextDto.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper5.src.InteractionChannel;
|
||||
using skyscraper8.Skyscraper.Scraper;
|
||||
|
||||
namespace skyscraper8.GS
|
||||
{
|
||||
internal class GsContextDto
|
||||
{
|
||||
public GsContextMisDto MisClone(byte mis)
|
||||
{
|
||||
GsContextMisDto misClone = new GsContextMisDto(mis);
|
||||
|
||||
Type type = this.GetType();
|
||||
PropertyInfo[] propertyInfos = type.GetProperties();
|
||||
foreach (PropertyInfo propertyInfo in propertyInfos)
|
||||
{
|
||||
object? value = propertyInfo.GetValue(this);
|
||||
propertyInfo.SetValue(misClone, value);
|
||||
}
|
||||
|
||||
return misClone;
|
||||
}
|
||||
|
||||
public byte GetMisId()
|
||||
{
|
||||
GsContextMisDto misDto = this as GsContextMisDto;
|
||||
if (misDto == null)
|
||||
return 0;
|
||||
return misDto.Mis;
|
||||
}
|
||||
|
||||
public ISubTsHandler TsOutput { get; set; }
|
||||
public IMultiprotocolEncapsulationEventHandler IpOutput { get; set; }
|
||||
|
||||
public InteractionChannelHandler Rcs2Output { get; set; }
|
||||
}
|
||||
|
||||
internal class GsContextMisDto : GsContextDto
|
||||
{
|
||||
public byte Mis { get; }
|
||||
|
||||
public GsContextMisDto(byte mis)
|
||||
{
|
||||
Mis = mis;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
skyscraper8/GS/GsException.cs
Normal file
23
skyscraper8/GS/GsException.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.GS
|
||||
{
|
||||
public class GsException : Exception
|
||||
{
|
||||
public GsException()
|
||||
{
|
||||
}
|
||||
|
||||
public GsException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public GsException(string message, Exception inner) : base(message, inner)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
using log4net;
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper8.GS;
|
||||
using skyscraper8.GS.GSE_BFBS;
|
||||
using skyscraper8.GS.SiminnRadiomidun;
|
||||
using skyscraper8.GSE.GSE_HEM;
|
||||
using skyscraper8.GSE.GSE;
|
||||
@ -7,23 +9,24 @@ using skyscraper8.Skyscraper.Scraper;
|
||||
|
||||
namespace skyscraper8.GSE;
|
||||
|
||||
public class GsTypeDetector : IMisHandler
|
||||
class GsTypeDetector : IMisHandler
|
||||
{
|
||||
public IMultiprotocolEncapsulationEventHandler mpeEventHandler { get; set; }
|
||||
private readonly byte _misId;
|
||||
private readonly ILog logger;
|
||||
public GsContextDto Context { get; set; }
|
||||
private readonly ILog logger;
|
||||
private HashSet<Tuple<int, byte>> _postedStreamTypes;
|
||||
public ISubTsHandler subTsHandler;
|
||||
public GsTypeDetector(byte misId)
|
||||
|
||||
public GsTypeDetector(GsContextMisDto context)
|
||||
{
|
||||
_misId = misId;
|
||||
logger = LogManager.GetLogger(String.Format("{0} MIS {1}",System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name,misId));
|
||||
this.logger = LogManager.GetLogger(String.Format("{0} MIS {1}",System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name,context.Mis));
|
||||
this.Context = context;
|
||||
}
|
||||
|
||||
private GseReader gseReader;
|
||||
private GseHemReader gseHemReader;
|
||||
private SiminnRadiomidunReader siminnRadiomidunReader;
|
||||
private BfbsGseReader bfbsGseReader;
|
||||
private int simminRadiomidunScore;
|
||||
private int bfbsScore;
|
||||
|
||||
public void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan)
|
||||
{
|
||||
@ -38,7 +41,7 @@ public class GsTypeDetector : IMisHandler
|
||||
if (gseReader == null)
|
||||
{
|
||||
gseReader = new GseReader();
|
||||
gseReader.mpeEventHandler = mpeEventHandler;
|
||||
gseReader.Context = Context;
|
||||
}
|
||||
|
||||
gseReader.PushFrame(bbHeader, readOnlySpan);
|
||||
@ -50,7 +53,7 @@ public class GsTypeDetector : IMisHandler
|
||||
//Looks like GSE-HEM
|
||||
if (gseHemReader == null)
|
||||
{
|
||||
gseHemReader = new GseHemReader(mpeEventHandler);
|
||||
gseHemReader = new GseHemReader(Context);
|
||||
}
|
||||
gseHemReader.PushFrame(bbHeader, readOnlySpan);
|
||||
return;
|
||||
@ -65,7 +68,7 @@ public class GsTypeDetector : IMisHandler
|
||||
if (siminnRadiomidunReader == null)
|
||||
{
|
||||
//These behave similar to T2-MI. Interesting.
|
||||
siminnRadiomidunReader = new SiminnRadiomidunReader(_misId,subTsHandler);
|
||||
siminnRadiomidunReader = new SiminnRadiomidunReader(Context);
|
||||
}
|
||||
|
||||
siminnRadiomidunReader.PushFrame(bbHeader, readOnlySpan);
|
||||
@ -82,6 +85,17 @@ public class GsTypeDetector : IMisHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (bbHeader.TsGs == 1 && bbHeader.SyncByte == 1 && bbHeader.UserPacketLength == 0)
|
||||
{
|
||||
if (bfbsGseReader == null)
|
||||
{
|
||||
bfbsGseReader = new BfbsGseReader(Context);
|
||||
}
|
||||
|
||||
bfbsGseReader.PushFrame(bbHeader, readOnlySpan);
|
||||
return;
|
||||
}
|
||||
|
||||
//We have no idea what this is.
|
||||
Tuple<int, byte> streamTypeToPost = new Tuple<int, byte>(bbHeader.TsGs, bbHeader.SyncByte);
|
||||
if (_postedStreamTypes == null)
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
using skyscraper8.GS;
|
||||
|
||||
namespace skyscraper8.GSE;
|
||||
|
||||
public interface IMisHandler
|
||||
interface IMisHandler
|
||||
{
|
||||
public GsContextDto Context { get; set; }
|
||||
|
||||
void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan);
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class Pts2Bbf
|
||||
FileStream fileStream = file.OpenRead();
|
||||
|
||||
TsContext mpeg2 = new TsContext();
|
||||
mpeg2.RegisterPacketProcessor(0x010e, new Stid135BbFrameReader(null, null, dumper));
|
||||
mpeg2.RegisterPacketProcessor(0x010e, new Stid135BbFrameReader(null, dumper));
|
||||
DataStorage dataStorage = new InMemoryScraperStorage();
|
||||
ObjectStorage objectStorage = new NullObjectStorage();
|
||||
SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, dataStorage, objectStorage);
|
||||
|
||||
62
skyscraper8/GS/POC/Pts2Bbf2.cs
Normal file
62
skyscraper8/GS/POC/Pts2Bbf2.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using log4net;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper8.GSE;
|
||||
|
||||
public class Pts2Bbf2 : IBbframeDeencapsulator
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
private readonly FileInfo _fi;
|
||||
private readonly DirectoryInfo outputDir;
|
||||
|
||||
public Pts2Bbf2(FileInfo fi)
|
||||
{
|
||||
_fi = fi;
|
||||
string outputPath = Path.Combine(_fi.Directory.FullName, Path.GetFileNameWithoutExtension(_fi.Name) + "_frames");
|
||||
outputDir = new DirectoryInfo(outputPath);
|
||||
outputDir.EnsureExists();
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TsContext mpeg2 = new TsContext();
|
||||
Stid135BbFrameReader bbFrameReader = new Stid135BbFrameReader(null, this);
|
||||
mpeg2.RegisterPacketProcessor(0x010e, bbFrameReader);
|
||||
|
||||
SkyscraperContext context = new SkyscraperContext(mpeg2, new InMemoryScraperStorage(), new NullObjectStorage());
|
||||
context.InitalizeFilterChain();
|
||||
|
||||
FileStream fileStream = _fi.OpenRead();
|
||||
context.IngestFromStream(fileStream);
|
||||
}
|
||||
|
||||
private int frameNo;
|
||||
public void PushPacket(byte[] bbframe)
|
||||
{
|
||||
if (bbframe[0] != 0xb8)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BBHeader bbHeader = new BBHeader(bbframe, 1);
|
||||
if (!bbHeader.Valid)
|
||||
return;
|
||||
|
||||
string fname = String.Format("Frame{0:D8}_TSGS{1}_MIS{2:D3}_SYNC{3:D3}.bbframe", ++frameNo,bbHeader.TsGs,bbHeader.SisMis ? bbHeader.Matype2 : 0,bbHeader.SyncByte);
|
||||
|
||||
string outfname = Path.Combine(outputDir.FullName, fname);
|
||||
ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(bbframe, 11, bbframe.Length - 11);
|
||||
byte[] buffer = readOnlySpan.ToArray();
|
||||
File.WriteAllBytes(outfname, buffer);
|
||||
|
||||
if (IpPacketFinder.TestForHttpContents(buffer))
|
||||
{
|
||||
logger.InfoFormat("Found unencrypted HTTP traffic in {0}", fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.Scraper;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.Filesystem;
|
||||
using skyscraper5.Skyscraper.Scraper.Storage.InMemory;
|
||||
using skyscraper8.GS;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
|
||||
namespace skyscraper8.GSE;
|
||||
@ -19,7 +20,8 @@ public class Stid135Test
|
||||
ObjectStorage objectStorage = new FilesystemStorage(new DirectoryInfo("nip"));
|
||||
SkyscraperContext skyscraper = new SkyscraperContext(mpeg2, dataStorage, objectStorage);
|
||||
|
||||
mpeg2.RegisterPacketProcessor(0x010e, new Stid135BbFrameReader(skyscraper,skyscraper));
|
||||
GsContextDto context = new GsContextDto();
|
||||
mpeg2.RegisterPacketProcessor(0x010e, new Stid135BbFrameReader(context));
|
||||
|
||||
skyscraper.InitalizeFilterChain();
|
||||
skyscraper.IngestFromStream(fileStream);
|
||||
|
||||
@ -13,19 +13,18 @@ namespace skyscraper8.GS.SiminnRadiomidun
|
||||
{
|
||||
internal class SiminnRadiomidunReader : IMisHandler
|
||||
{
|
||||
public SiminnRadiomidunReader(byte mis, ISubTsHandler tsOutput)
|
||||
public SiminnRadiomidunReader(GsContextDto context)
|
||||
{
|
||||
this.packetQueue = new Queue<Tuple<BBHeader,MemoryStream>>();
|
||||
this.isInSync = false;
|
||||
this.subTsKey = new SiminnRadiomidunSubTsIdentifier(mis);
|
||||
this.tsOutput = tsOutput;
|
||||
this.subTsKey = new SiminnRadiomidunSubTsIdentifier(context.GetMisId());
|
||||
this.Context = context;
|
||||
}
|
||||
|
||||
private bool isInSync;
|
||||
private Queue<Tuple<BBHeader, MemoryStream>> packetQueue;
|
||||
private MemoryStream currentItem;
|
||||
private SiminnRadiomidunSubTsIdentifier subTsKey;
|
||||
private ISubTsHandler tsOutput;
|
||||
|
||||
public long PacketQueueSize
|
||||
{
|
||||
@ -37,6 +36,9 @@ namespace skyscraper8.GS.SiminnRadiomidun
|
||||
return packetQueue.Select(x => x.Item2.Length).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public GsContextDto Context { get; set; }
|
||||
|
||||
public void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan)
|
||||
{
|
||||
if (packetQueue == null)
|
||||
@ -87,7 +89,7 @@ namespace skyscraper8.GS.SiminnRadiomidun
|
||||
private void OutputPacket(byte[] buffer)
|
||||
{
|
||||
buffer[0] = 0x47;
|
||||
tsOutput.OnSubTsPacket(subTsKey, buffer);
|
||||
Context.TsOutput.OnSubTsPacket(subTsKey, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.DataBroadcasting;
|
||||
using skyscraper8.GS;
|
||||
using skyscraper8.Skyscraper.Scraper;
|
||||
|
||||
namespace skyscraper8.GSE
|
||||
@ -15,10 +16,10 @@ namespace skyscraper8.GSE
|
||||
{
|
||||
private IBbframeDeencapsulator deencapsulator;
|
||||
|
||||
public Stid135BbFrameReader(IMultiprotocolEncapsulationEventHandler mpeEventHandler, ISubTsHandler subTsHandler, IBbframeDeencapsulator deencapsulator = null)
|
||||
public Stid135BbFrameReader(GsContextDto context, IBbframeDeencapsulator deencapsulator = null)
|
||||
{
|
||||
if (deencapsulator == null)
|
||||
deencapsulator = new BbframeDeencapsulator3(mpeEventHandler, subTsHandler);
|
||||
deencapsulator = new BbframeDeencapsulator3(context);
|
||||
|
||||
this.deencapsulator = deencapsulator;
|
||||
}
|
||||
|
||||
23
skyscraper8/Ietf/FLUTE/FluteException.cs
Normal file
23
skyscraper8/Ietf/FLUTE/FluteException.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.FLUTE
|
||||
{
|
||||
public class FluteException : IetfException
|
||||
{
|
||||
public FluteException()
|
||||
{
|
||||
}
|
||||
|
||||
public FluteException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public FluteException(string message, Exception inner) : base(message, inner)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@ using System.Runtime.Serialization;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MimeKit;
|
||||
using skyscraper5.Teletext.Wss;
|
||||
|
||||
namespace skyscraper8.Ietf.FLUTE
|
||||
@ -118,7 +119,7 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
|
||||
}
|
||||
|
||||
internal bool IsComplete()
|
||||
internal virtual bool IsComplete()
|
||||
{
|
||||
if (_disabled)
|
||||
return false;
|
||||
@ -148,7 +149,7 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
}
|
||||
}
|
||||
|
||||
public Stream ToStream()
|
||||
public virtual Stream ToStream()
|
||||
{
|
||||
if (!IsComplete())
|
||||
throw new InvalidOperationException();
|
||||
@ -164,6 +165,10 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
blockPayloads.Sort(new FluteBlockComparer());
|
||||
level1 = new FluteListenerStream(blockPayloads);
|
||||
}
|
||||
if (TrimmedLength.HasValue)
|
||||
{
|
||||
level1.SetLength(TrimmedLength.Value);
|
||||
}
|
||||
|
||||
if (FileAssociation != null)
|
||||
{
|
||||
@ -287,5 +292,6 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
}
|
||||
|
||||
public double LastReportedProgress { get; internal set; }
|
||||
public long? TrimmedLength { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
23
skyscraper8/Ietf/FLUTE/FluteListenerMime.cs
Normal file
23
skyscraper8/Ietf/FLUTE/FluteListenerMime.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.FLUTE
|
||||
{
|
||||
internal class FluteListenerMime : FluteListener
|
||||
{
|
||||
public FluteListenerMime(IPAddress destinationAddress, ushort destinationPort, ulong destinationTsi, ulong destinationToi) : base(destinationAddress, destinationPort, destinationTsi, destinationToi)
|
||||
{
|
||||
}
|
||||
|
||||
public Stream WrappedStream { get; set; }
|
||||
|
||||
public override Stream ToStream()
|
||||
{
|
||||
return WrappedStream;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -118,9 +118,17 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
return currentPosition;
|
||||
}
|
||||
|
||||
private bool _isLengthLimited;
|
||||
private long _limitedLength;
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException("Can't modify the length of a ModuleInfo");
|
||||
if (value > myModuleLength)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(String.Format("Argument must be between 0 and {0}", myModuleLength));
|
||||
}
|
||||
|
||||
_limitedLength = value;
|
||||
_isLengthLimited = true;
|
||||
}
|
||||
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
@ -131,7 +139,17 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
public override bool CanRead => true;
|
||||
public override bool CanSeek => true;
|
||||
public override bool CanWrite => false;
|
||||
public override long Length => myModuleLength;
|
||||
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_isLengthLimited)
|
||||
return _limitedLength;
|
||||
else
|
||||
return myModuleLength;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Position
|
||||
{
|
||||
|
||||
@ -53,6 +53,11 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
return;
|
||||
|
||||
Payload = ms.ReadBytes(ms.GetAvailableBytes());
|
||||
if (Payload[0] == 0x3c && Payload[1] == 0x3f && Payload[2] == 0x78 && Payload[3] == 0x6d &&
|
||||
Payload[4] == 0x6c && Payload[5] == 0x20)
|
||||
{
|
||||
PayloadAsString = Encoding.UTF8.GetString(Payload);
|
||||
}
|
||||
}
|
||||
|
||||
public int Version { get; }
|
||||
@ -67,5 +72,19 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
public bool CloseObjectFlag { get; }
|
||||
public FecHeader FecHeader { get; }
|
||||
public byte[] Payload { get; }
|
||||
|
||||
public string PayloadAsString { get; private set; }
|
||||
|
||||
public bool PayloadContainsNativeIpMulticastTransportObject
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(PayloadAsString))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return PayloadAsString.Contains("NativeIPMulticastTransportObjectTypeCS");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
159
skyscraper8/Ietf/Rfc4566_SDP/SDP.cs
Normal file
159
skyscraper8/Ietf/Rfc4566_SDP/SDP.cs
Normal file
@ -0,0 +1,159 @@
|
||||
using log4net;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper8.DvbNip;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public class SDP
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public static bool IsSDP(Stream ms)
|
||||
{
|
||||
if (ms.GetAvailableBytes() < 3)
|
||||
return false;
|
||||
|
||||
byte byteA = ms.ReadUInt8();
|
||||
byte byteB = ms.ReadUInt8();
|
||||
ms.Position -= 2;
|
||||
|
||||
if (byteA != 'v')
|
||||
return false;
|
||||
|
||||
if (byteB != '=')
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static SDP Load(Stream stream)
|
||||
{
|
||||
StreamReader sr = new StreamReader(stream);
|
||||
SDP result = null;
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
string line = sr.ReadLine();
|
||||
if (line[1] != '=')
|
||||
{
|
||||
logger.ErrorFormat("Invalid SDP description!");
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
result = new SDP();
|
||||
char opcode = line[0];
|
||||
string args = line.Substring(2);
|
||||
switch (opcode)
|
||||
{
|
||||
case 'v':
|
||||
result.Version = new Version(int.Parse(args), 0);
|
||||
break;
|
||||
case 'o':
|
||||
result.Originator = new SdpOriginator(args.Split(' '));
|
||||
break;
|
||||
case 's':
|
||||
result.SessionName = args;
|
||||
break;
|
||||
case 't':
|
||||
result.Times = new SdpTimes(args.Split(' '));
|
||||
break;
|
||||
case 'a':
|
||||
if (result.Attributes == null)
|
||||
result.Attributes = new SdpAttributeCollection();
|
||||
result.Attributes.SetHint(args);
|
||||
break;
|
||||
case 'm':
|
||||
if (result._mediaAnnouncements == null)
|
||||
result._mediaAnnouncements = new List<SdpMedia>();
|
||||
result._mediaAnnouncements.Add(new SdpMedia(args.Split(' ')));
|
||||
break;
|
||||
case 'c':
|
||||
if (result._connections == null)
|
||||
result._connections = new List<SdpConnectionData>();
|
||||
result._connections.Add(new SdpConnectionData(args.Split(' ')));
|
||||
break;
|
||||
case 'b':
|
||||
string bandwidthType = args.Substring(0, 2);
|
||||
string bandwidthValue = args.Substring(3);
|
||||
switch (bandwidthType)
|
||||
{
|
||||
case "CT":
|
||||
result.ConferenceTotalBandwidth = long.Parse(bandwidthValue);
|
||||
break;
|
||||
case "AS":
|
||||
result.ApplicationSpecificMaximumBandwidth = long.Parse(bandwidthValue);
|
||||
break;
|
||||
default:
|
||||
logger.WarnFormat("Unknown bandwidth type: {0}", bandwidthType);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
logger.ErrorFormat("Invalid SDP opcode \"{0}\", please consider sharing a sample of this stream for further analysis.", opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public long? ApplicationSpecificMaximumBandwidth { get; private set; }
|
||||
|
||||
public long? ConferenceTotalBandwidth { get; private set; }
|
||||
|
||||
|
||||
private List<SdpMedia> _mediaAnnouncements;
|
||||
private List<SdpConnectionData> _connections;
|
||||
|
||||
public IReadOnlyList<SdpConnectionData> ConnectionData
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connections.AsReadOnly();
|
||||
}
|
||||
}
|
||||
public IReadOnlyList<SdpMedia> MediaAnnouncements
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaAnnouncements.AsReadOnly();
|
||||
}
|
||||
}
|
||||
public SdpAttributeCollection Attributes { get; private set; }
|
||||
public SdpTimes Times { get; private set; }
|
||||
|
||||
public string SessionName { get; private set; }
|
||||
|
||||
public SdpOriginator Originator { get; private set; }
|
||||
|
||||
public Version Version { get; private set; }
|
||||
|
||||
public MulticastGatewayConfigurationType ToMulticastGatewayConfiguration()
|
||||
{
|
||||
MulticastGatewayConfigurationType result = new MulticastGatewayConfigurationType();
|
||||
result.MulticastSession = new MulticastSessionType[_connections.Count];
|
||||
|
||||
for (int i = 0; i < _connections.Count; i++)
|
||||
{
|
||||
result.MulticastSession[i] = new MulticastSessionType();
|
||||
result.MulticastSession[i].serviceIdentifier = Originator.ToString();
|
||||
result.MulticastSession[i].MulticastTransportSession = new MulticastTransportSessionType[1];
|
||||
result.MulticastSession[i].MulticastTransportSession[0] = new MulticastTransportSessionType();
|
||||
result.MulticastSession[i].MulticastTransportSession[0].EndpointAddress = new MulticastEndpointAddressType[1];
|
||||
result.MulticastSession[i].MulticastTransportSession[0].EndpointAddress[0] = new MulticastEndpointAddressType();
|
||||
result.MulticastSession[i].MulticastTransportSession[0].EndpointAddress[0].NetworkDestinationGroupAddress = _connections[i].DestinationAddress;
|
||||
result.MulticastSession[i].MulticastTransportSession[0].EndpointAddress[0].NetworkSourceAddress = Originator.Address.ToString();
|
||||
result.MulticastSession[i].MulticastTransportSession[0].EndpointAddress[0].TransportDestinationPort = _mediaAnnouncements[i].Port.ToString();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
14
skyscraper8/Ietf/Rfc4566_SDP/SdpAddressType.cs
Normal file
14
skyscraper8/Ietf/Rfc4566_SDP/SdpAddressType.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public enum SdpAddressType
|
||||
{
|
||||
IP4,
|
||||
IP6
|
||||
}
|
||||
}
|
||||
208
skyscraper8/Ietf/Rfc4566_SDP/SdpAttributes.cs
Normal file
208
skyscraper8/Ietf/Rfc4566_SDP/SdpAttributes.cs
Normal file
@ -0,0 +1,208 @@
|
||||
using log4net;
|
||||
using log4net.Repository.Hierarchy;
|
||||
using skyscraper5.Skyscraper.IO.TunerInterface;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public class SdpAttributeCollection : IEnumerable<SdpAttribute>
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
private Dictionary<string, SdpAttribute> _attributes;
|
||||
|
||||
internal void SetHint(string args)
|
||||
{
|
||||
if (_attributes == null)
|
||||
_attributes = new Dictionary<string, SdpAttribute>();
|
||||
|
||||
int indexOf = args.IndexOf(':');
|
||||
string key = args.Substring(0, indexOf);
|
||||
string value = args.Substring(indexOf + 1);
|
||||
switch (key)
|
||||
{
|
||||
case "mbms-mode":
|
||||
_attributes.Add(key, new MbmsMode(value));
|
||||
break;
|
||||
case "source-filter":
|
||||
if (!_attributes.ContainsKey(key))
|
||||
_attributes.Add(key, new SourceFilter());
|
||||
SourceFilter sourceFilter = _attributes[key] as SourceFilter;
|
||||
sourceFilter.SetHint(value);
|
||||
break;
|
||||
case "flute-tsi":
|
||||
_attributes.Add(key, new FluteTsi(value));
|
||||
break;
|
||||
default:
|
||||
logger.ErrorFormat("Unknown SDP Attribute: \"{0}\" - please consider sharing a sample of this stream for further analysis.", key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<SdpAttribute> GetEnumerator()
|
||||
{
|
||||
return _attributes.Values.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return _attributes.Values.GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
internal class FluteTsi : SdpAttribute
|
||||
{
|
||||
public FluteTsi(string value) : base("flute-tsi")
|
||||
{
|
||||
TSI = long.Parse(value);
|
||||
}
|
||||
|
||||
public long TSI { get; private set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return TSI.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
internal class SourceFilter : SdpAttribute
|
||||
{
|
||||
public SourceFilter() : base("source-filter")
|
||||
{
|
||||
}
|
||||
|
||||
public void SetHint(string value)
|
||||
{
|
||||
if (_filterChain == null)
|
||||
_filterChain = new List<SourceFilterChainLink>();
|
||||
_filterChain.Add(new SourceFilterChainLink(value.Split(' ',StringSplitOptions.RemoveEmptyEntries)));
|
||||
}
|
||||
|
||||
private List<SourceFilterChainLink> _filterChain;
|
||||
|
||||
class SourceFilterChainLink
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public SourceFilterChainLink(string[] args)
|
||||
{
|
||||
if (args[0].Equals("incl"))
|
||||
{
|
||||
Include = true;
|
||||
}
|
||||
else if (args[0].Equals("excl"))
|
||||
{
|
||||
Include = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.ErrorFormat("Unknown Filter Mode \"{0}\", assuming exclusion just to be sure.", args[0]);
|
||||
}
|
||||
|
||||
if (!SdpNetworkType.TryParse(args[1], true, out _networkType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Network Type \"{0}\", assuming \"IN\" - please consider sharing a sample of this stream so this can be implemented.", args[1]);
|
||||
_networkType = SdpNetworkType.IN;
|
||||
}
|
||||
|
||||
if (!SdpAddressType.TryParse(args[2], true, out _addressType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Address Type \"{0}\", assuming \"IP4\" - please consider sharing a sample of this stream so this can be implemented.", args[2]);
|
||||
_addressType = SdpAddressType.IP4;
|
||||
}
|
||||
|
||||
DestinationAddress = args[3];
|
||||
|
||||
int numSources = args.Length - 4;
|
||||
Sources = new string[numSources];
|
||||
Array.Copy(args, 4, Sources, 0, numSources);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If this is true, an incoming packet is accepted, if not it gets discarded.
|
||||
/// </summary>
|
||||
public bool Include { get; private set; }
|
||||
|
||||
public string[] Sources { get; private set; }
|
||||
public string DestinationAddress { get; private set; }
|
||||
private SdpAddressType _addressType;
|
||||
public SdpAddressType AddressType
|
||||
{
|
||||
get => _addressType;
|
||||
}
|
||||
|
||||
private SdpNetworkType _networkType;
|
||||
public SdpNetworkType NetworkType
|
||||
{
|
||||
get => _networkType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class MbmsMode : SdpAttribute
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public MbmsMode(string value)
|
||||
: base("mbms-mode")
|
||||
{
|
||||
string[] args = value.Split(' ');
|
||||
if (args[0].Equals("broadcast-mbsfn"))
|
||||
{
|
||||
BigInteger tmgi = BigInteger.Parse(args[1]);
|
||||
this.Tmgi = tmgi.ToByteArray();
|
||||
}
|
||||
else if (args[0].Equals("broadcast"))
|
||||
{
|
||||
BigInteger tmgi = BigInteger.Parse(args[1]);
|
||||
this.Tmgi = tmgi.ToByteArray();
|
||||
this.MbmsCountingIndication = int.Parse(args[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.ErrorFormat("Unknown MBMS Mode: {0} - please consider a sharing a sample of this stream if you'd like the developer to look further into this.", args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public int? MbmsCountingIndication { get; private set; }
|
||||
|
||||
public byte[] Tmgi { get; private set; }
|
||||
|
||||
internal enum MbmsBearerMode
|
||||
{
|
||||
Unknown,
|
||||
Broadcast,
|
||||
BroadcastMbsfn
|
||||
}
|
||||
|
||||
public MbmsBearerMode BearerMode
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tmgi == null)
|
||||
return MbmsBearerMode.Unknown;
|
||||
if (MbmsCountingIndication == null)
|
||||
return MbmsBearerMode.BroadcastMbsfn;
|
||||
else
|
||||
return MbmsBearerMode.Broadcast;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class SdpAttribute
|
||||
{
|
||||
protected SdpAttribute(string key)
|
||||
{
|
||||
this.SdpAttributeName = key;
|
||||
}
|
||||
|
||||
public string SdpAttributeName { get; private set; }
|
||||
}
|
||||
}
|
||||
45
skyscraper8/Ietf/Rfc4566_SDP/SdpConnectionData.cs
Normal file
45
skyscraper8/Ietf/Rfc4566_SDP/SdpConnectionData.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using log4net;
|
||||
using log4net.Repository.Hierarchy;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public class SdpConnectionData
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public SdpConnectionData(string[] args)
|
||||
{
|
||||
if (!SdpNetworkType.TryParse(args[0], true, out _networkType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Network Type \"{0}\", assuming \"IN\" - please consider sharing a sample of this stream so this can be implemented.", args[0]);
|
||||
_networkType = SdpNetworkType.IN;
|
||||
}
|
||||
|
||||
if (!SdpAddressType.TryParse(args[1], true, out _addressType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Address Type \"{0}\", assuming \"IP4\" - please consider sharing a sample of this stream so this can be implemented.", args[1]);
|
||||
_addressType = SdpAddressType.IP4;
|
||||
}
|
||||
|
||||
DestinationAddress = args[2];
|
||||
}
|
||||
|
||||
public string DestinationAddress { get; private set; }
|
||||
private SdpAddressType _addressType;
|
||||
public SdpAddressType AddressType
|
||||
{
|
||||
get => _addressType;
|
||||
}
|
||||
|
||||
private SdpNetworkType _networkType;
|
||||
public SdpNetworkType NetworkType
|
||||
{
|
||||
get => _networkType;
|
||||
}
|
||||
}
|
||||
}
|
||||
51
skyscraper8/Ietf/Rfc4566_SDP/SdpMedia.cs
Normal file
51
skyscraper8/Ietf/Rfc4566_SDP/SdpMedia.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public class SdpMedia
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public SdpMedia(string[] args)
|
||||
{
|
||||
if (!MediaType.TryParse(args[0], true, out _mediaType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Media Type \"{0}\", assuming \"data\"", args[0]);
|
||||
_mediaType = MediaType.Data;
|
||||
}
|
||||
|
||||
Port = ushort.Parse(args[1]);
|
||||
Transport = args[2];
|
||||
|
||||
int numFormats = args.Length - 3;
|
||||
FormatList = new string[numFormats];
|
||||
Array.Copy(args, 3, FormatList, 0, numFormats);
|
||||
}
|
||||
|
||||
public string[] FormatList { get; private set; }
|
||||
|
||||
public string Transport { get; private set; }
|
||||
|
||||
public ushort Port { get; private set; }
|
||||
|
||||
private MediaType _mediaType;
|
||||
public MediaType MediaType
|
||||
{
|
||||
get => _mediaType;
|
||||
}
|
||||
}
|
||||
|
||||
public enum MediaType
|
||||
{
|
||||
Audio,
|
||||
Video,
|
||||
Application,
|
||||
Data,
|
||||
Control
|
||||
}
|
||||
}
|
||||
13
skyscraper8/Ietf/Rfc4566_SDP/SdpNetworkType.cs
Normal file
13
skyscraper8/Ietf/Rfc4566_SDP/SdpNetworkType.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public enum SdpNetworkType
|
||||
{
|
||||
IN
|
||||
}
|
||||
}
|
||||
58
skyscraper8/Ietf/Rfc4566_SDP/SdpOriginator.cs
Normal file
58
skyscraper8/Ietf/Rfc4566_SDP/SdpOriginator.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public class SdpOriginator
|
||||
{
|
||||
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||
|
||||
public SdpOriginator(string[] args)
|
||||
{
|
||||
Username = args[0];
|
||||
Id = args[1];
|
||||
this.Version = long.Parse(args[2]);
|
||||
if (!SdpNetworkType.TryParse(args[3], true, out _networkType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Network Type \"{0}\", assuming \"IN\" - please consider sharing a sample of this stream so this can be implemented.", _networkType);
|
||||
_networkType = SdpNetworkType.IN;
|
||||
}
|
||||
|
||||
if (!SdpAddressType.TryParse(args[4], true, out _addressType))
|
||||
{
|
||||
logger.ErrorFormat("Unknown Address Type \"{0}\", assuming \"IP4\" - please consider sharing a sample of this stream so this can be implemented.", _addressType);
|
||||
_addressType = SdpAddressType.IP4;
|
||||
}
|
||||
|
||||
Address = IPAddress.Parse(args[5]);
|
||||
}
|
||||
|
||||
public IPAddress Address { get; private set; }
|
||||
private SdpAddressType _addressType;
|
||||
public SdpAddressType AddressType
|
||||
{
|
||||
get => _addressType;
|
||||
}
|
||||
|
||||
private SdpNetworkType _networkType;
|
||||
public SdpNetworkType NetworkType
|
||||
{
|
||||
get => _networkType;
|
||||
}
|
||||
public long Version { get; set; }
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Username { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{0} {1} {2} {3} {4}", Username, Id, NetworkType, AddressType, Address);
|
||||
}
|
||||
}
|
||||
}
|
||||
51
skyscraper8/Ietf/Rfc4566_SDP/SdpTimes.cs
Normal file
51
skyscraper8/Ietf/Rfc4566_SDP/SdpTimes.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper8.Skyscraper;
|
||||
|
||||
namespace skyscraper8.Ietf.Rfc4566_SDP
|
||||
{
|
||||
public struct SdpTimes
|
||||
{
|
||||
private const long NTP_OFFSET = 2208988800L;
|
||||
private readonly long _startTime;
|
||||
private readonly long _stopTime;
|
||||
|
||||
public SdpTimes(string[] args)
|
||||
{
|
||||
_startTime = long.Parse(args[0]);
|
||||
_stopTime = long.Parse(args[1]);
|
||||
}
|
||||
|
||||
public bool IsNull
|
||||
{
|
||||
get => _startTime == 0;
|
||||
}
|
||||
|
||||
public DateTime? StartTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_startTime == 0)
|
||||
return null;
|
||||
|
||||
long tmp = _startTime - NTP_OFFSET;
|
||||
return tmp.AsUnixtime();
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime? EndTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_stopTime == 0)
|
||||
return null;
|
||||
|
||||
long tmp = _stopTime - NTP_OFFSET;
|
||||
return tmp.AsUnixtime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
skyscraper8/InteractionChannel/GseTableStructure.cs
Normal file
40
skyscraper8/InteractionChannel/GseTableStructure.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
|
||||
namespace skyscraper8.InteractionChannel
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the structure in ETSI EN 301 545-2 V1.4.1, clause 6.4.3.1.1
|
||||
/// </summary>
|
||||
internal class GseTableStructure : Validatable
|
||||
{
|
||||
public GseTableStructure(byte[] buffer)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
TableId = ms.ReadUInt8();
|
||||
InteractiveNetworkId = ms.ReadUInt16BE();
|
||||
|
||||
byte byteA = ms.ReadUInt8();
|
||||
VersionNumber = (byteA & 0x3e) >> 1;
|
||||
CurrentNextIndicator = (byteA & 0x01) != 0;
|
||||
|
||||
TableContent = ms.ReadBytes(ms.GetAvailableBytes());
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public byte[] TableContent { get; private set; }
|
||||
|
||||
public bool CurrentNextIndicator { get; private set; }
|
||||
|
||||
public int VersionNumber { get; private set; }
|
||||
|
||||
public ushort InteractiveNetworkId { get; private set; }
|
||||
|
||||
public byte TableId { get; private set; }
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,9 @@ namespace skyscraper5.src.InteractionChannel
|
||||
Fct2Invalid,
|
||||
Tbtp2Invalid,
|
||||
Tmst2Invalid,
|
||||
BctInvalid
|
||||
BctInvalid,
|
||||
GseTableStructureInvalid,
|
||||
NitInvalid,
|
||||
TdtInvalid
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,10 @@ using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.GSE.GSE;
|
||||
using skyscraper8.InteractionChannel.Model;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2.Descriptors;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel
|
||||
{
|
||||
@ -33,5 +36,16 @@ namespace skyscraper5.src.InteractionChannel
|
||||
void OnTerminalBurstTimePlan2(ushort interactiveNetworkId, Tbtp2 tbtp2);
|
||||
void OnFrameComposition2(ushort networkId, Fct2 fct2);
|
||||
void OnBroadcastConfiguration(ushort networkId, Bct bct);
|
||||
void OnRcs2Nit(ushort interactiveNetworkId, RcsNit nit);
|
||||
void OnRcs2Tdt(ushort interactiveNetworkId, Rcs2Tdt tdt);
|
||||
void OnTransmissionModeSupport2(ushort interactiveNetworkId, Tmst2 tmst2);
|
||||
void OnFramePayloadFormatAnnouncement(ushort networkId, _0xb7_FramePayloadFormatDescriptor descriptor);
|
||||
void OnCorrectionMessageExtension(PhysicalAddress macAddress, _0xb1_CorrectionMessageExtensionDescriptor descriptor);
|
||||
void OnControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor);
|
||||
void OnSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor);
|
||||
void OnLowerLayerService(PhysicalAddress macAddress, _0xbb_LowerLayerServiceDescriptor descriptor);
|
||||
void OnHigherLayerInitalization(PhysicalAddress macAddress, _0xc4_HigherLayersInitializeDescriptor descriptor);
|
||||
void LogonResponseDescriptor(PhysicalAddress macAddress, _0xb9_LogonResponseDescriptor descriptor);
|
||||
void OnForwardInteractionPath(PhysicalAddress macAddress, _0xad_ForwardInteractionPathDescriptor descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,12 @@ namespace skyscraper5.src.InteractionChannel
|
||||
switch (buffer[0])
|
||||
{
|
||||
case 0x40: //NIT
|
||||
//see ETSI EN 301 545-2
|
||||
InteractionChannelSiSectionHeader nitHeader = new InteractionChannelSiSectionHeader(ms);
|
||||
if (!nitHeader.Valid)
|
||||
{
|
||||
_handler.OnInteractionChannelError(InteractionChannelErrorState.HeaderInvalid);
|
||||
return;
|
||||
}
|
||||
throw new NotImplementedException("NIT");
|
||||
case 0x41: //RMT
|
||||
Rmt rmt = new Rmt(ms);
|
||||
|
||||
@ -6,6 +6,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Mpeg2;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel.Model
|
||||
{
|
||||
|
||||
@ -12,7 +12,7 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
|
||||
{
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xa4,"TIM")]
|
||||
internal class _0xa4_SyncAssignDescriptor : TsDescriptor
|
||||
public class _0xa4_SyncAssignDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xa4_SyncAssignDescriptor(byte[] buffer)
|
||||
{
|
||||
|
||||
@ -12,7 +12,7 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
|
||||
{
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xad,"TIM")]
|
||||
internal class _0xad_ForwardInteractionPathDescriptor : TsDescriptor
|
||||
public class _0xad_ForwardInteractionPathDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xad_ForwardInteractionPathDescriptor(byte[] buffer)
|
||||
{
|
||||
@ -48,6 +48,59 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
|
||||
public ushort OriginalNetworkId { get; internal set; }
|
||||
public ushort TransportStreamId { get; internal set; }
|
||||
public ushort[] Pids { get; internal set; }
|
||||
|
||||
public string PidsAsString
|
||||
{
|
||||
get
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var p in Pids)
|
||||
{
|
||||
sb.Append(p);
|
||||
sb.Append(";");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
protected bool Equals(ForwardInteractionPath other)
|
||||
{
|
||||
return PidsAsString.Equals(other.PidsAsString) && OriginalNetworkId == other.OriginalNetworkId && TransportStreamId == other.TransportStreamId;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((ForwardInteractionPath)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(OriginalNetworkId, TransportStreamId);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
bool suspect = false;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendFormat("ONID: {0}, TSID: {1}, PIDs: ", OriginalNetworkId, TransportStreamId);
|
||||
foreach (var p in Pids)
|
||||
{
|
||||
sb.Append(p);
|
||||
sb.Append(";");
|
||||
if (p > 8192)
|
||||
suspect = true;
|
||||
}
|
||||
|
||||
if (suspect)
|
||||
{
|
||||
sb.AppendFormat(" (suspected GS)");
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public List<ForwardInteractionPath> Paths { get; }
|
||||
|
||||
@ -12,7 +12,7 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
|
||||
{
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xb1,"TIM")]
|
||||
internal class _0xb1_CorrectionMessageExtensionDescriptor : TsDescriptor
|
||||
public class _0xb1_CorrectionMessageExtensionDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xb1_CorrectionMessageExtensionDescriptor(byte[] buffer)
|
||||
{
|
||||
|
||||
127
skyscraper8/InteractionChannel/Model/RcsNit.cs
Normal file
127
skyscraper8/InteractionChannel/Model/RcsNit.cs
Normal file
@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Dvb.Descriptors;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model
|
||||
{
|
||||
public class RcsNit : Validatable
|
||||
{
|
||||
private static TsDescriptorUnpacker unpacker;
|
||||
public RcsNit(MemoryStream ms)
|
||||
{
|
||||
byte byteA = ms.ReadUInt8();
|
||||
byteA &= 0x0f;
|
||||
int networkDescriptorsLength = byteA << 8;
|
||||
networkDescriptorsLength += ms.ReadUInt8();
|
||||
byte[] networkDescriptorsBytes = ms.ReadBytes(networkDescriptorsLength);
|
||||
|
||||
if (unpacker == null)
|
||||
unpacker = TsDescriptorUnpacker.GetInstance();
|
||||
if (!ParseNetworkDescriptors(unpacker.UnpackDescriptors(networkDescriptorsBytes, "NIT")))
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
byteA = ms.ReadUInt8();
|
||||
byteA &= 0x0f;
|
||||
int multiplexStreamsSpecLength = byteA << 8;
|
||||
multiplexStreamsSpecLength += ms.ReadUInt8();
|
||||
byte[] multiplexStreamsSpecBytes = ms.ReadBytes(multiplexStreamsSpecLength);
|
||||
Valid = ParseMultiplexStreamsSpec(multiplexStreamsSpecBytes);
|
||||
}
|
||||
|
||||
private bool ParseNetworkDescriptors(IEnumerable<TsDescriptor> descriptors)
|
||||
{
|
||||
foreach (TsDescriptor descriptor in descriptors)
|
||||
{
|
||||
if (!descriptor.Valid)
|
||||
continue;
|
||||
switch (descriptor)
|
||||
{
|
||||
case NetworkNameDescriptor nnd:
|
||||
this.NetworkName = nnd.NetworkName;
|
||||
break;
|
||||
case LinkageDescriptor ld:
|
||||
if (Linkages == null)
|
||||
Linkages = new List<LinkageDescriptor>();
|
||||
Linkages.Add(ld);
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException(String.Format(
|
||||
"The RCS2-NIT Parser doesn't understand descriptors of type 0x{0:X2} yet. Please consider sharing a sample of this stream.",
|
||||
descriptor.GetDescriptorId()));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public string NetworkName { get; set; }
|
||||
|
||||
public List<LinkageDescriptor> Linkages { get; private set; }
|
||||
|
||||
private bool ParseMultiplexStreamsSpec(byte[] buffer)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
ForwardMultiplex = ms.ReadUInt16BE();
|
||||
OriginalNetworkId = ms.ReadUInt16BE();
|
||||
|
||||
byte byteA = ms.ReadUInt8();
|
||||
byteA &= 0x0f;
|
||||
int transportDescriptorsLength = byteA << 8;
|
||||
transportDescriptorsLength += ms.ReadUInt8();
|
||||
IEnumerable<TsDescriptor> descriptors = unpacker.UnpackDescriptors(ms.ReadBytes(transportDescriptorsLength), "NIT");
|
||||
foreach (TsDescriptor descriptor in descriptors)
|
||||
{
|
||||
if (!descriptor.Valid)
|
||||
continue;
|
||||
switch (descriptor)
|
||||
{
|
||||
case SatelliteDeliverySystemDescriptor sdsd:
|
||||
this.SatelliteDeliverySystem = sdsd;
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException(String.Format(
|
||||
"The RCS2-NIT Muliplex-Stream-Spec Parser doesn't understand descriptors of type 0x{0:X2} yet. Please consider sharing a sample of this stream.",
|
||||
descriptor.GetDescriptorId()));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public SatelliteDeliverySystemDescriptor SatelliteDeliverySystem { get; set; }
|
||||
|
||||
public ushort OriginalNetworkId { get; set; }
|
||||
|
||||
public ushort ForwardMultiplex { get; set; }
|
||||
|
||||
protected bool Equals(RcsNit other)
|
||||
{
|
||||
return OriginalNetworkId == other.OriginalNetworkId && ForwardMultiplex == other.ForwardMultiplex;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj.GetType() != this.GetType())
|
||||
return false;
|
||||
return Equals((RcsNit)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(OriginalNetworkId, ForwardMultiplex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -16,48 +16,51 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
{
|
||||
private static TsDescriptorUnpacker tsDescriptorUnpacker;
|
||||
|
||||
public Rmt(MemoryStream ms)
|
||||
public Rmt(MemoryStream ms, bool gseMode = false)
|
||||
{
|
||||
if (tsDescriptorUnpacker == null)
|
||||
tsDescriptorUnpacker = TsDescriptorUnpacker.GetInstance();
|
||||
|
||||
byte tableId = ms.ReadUInt8();
|
||||
if (tableId != 0x41)
|
||||
if (!gseMode)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
byte tableId = ms.ReadUInt8();
|
||||
if (tableId != 0x41)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
byte byteA = ms.ReadUInt8();
|
||||
bool sectionSyntaxIndicator = (byteA & 0x80) != 1;
|
||||
if (!sectionSyntaxIndicator)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
bool reservedFutureUse = (byteA & 0x40) != 1;
|
||||
int reserved = (byteA & 0x30) >> 4;
|
||||
|
||||
int sectionLength = (byteA & 0x0f);
|
||||
sectionLength <<= 8;
|
||||
sectionLength += ms.ReadUInt8();
|
||||
if (sectionLength != ms.GetAvailableBytes())
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkId = ms.ReadUInt16BE();
|
||||
|
||||
byte byteB = ms.ReadUInt8();
|
||||
reserved = (byteB & 0xc0) >> 6;
|
||||
int versionNumber = (byteB & 0x3e) >> 1;
|
||||
bool currentNextIndicator = (byteB & 0x01) != 0;
|
||||
|
||||
byte sectionNumber = ms.ReadUInt8();
|
||||
byte lastSectionNumber = ms.ReadUInt8();
|
||||
}
|
||||
|
||||
byte byteA = ms.ReadUInt8();
|
||||
bool sectionSyntaxIndicator = (byteA & 0x80) != 1;
|
||||
if (!sectionSyntaxIndicator)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
bool reservedFutureUse = (byteA & 0x40) != 1;
|
||||
int reserved = (byteA & 0x30) >> 4;
|
||||
|
||||
int sectionLength = (byteA & 0x0f);
|
||||
sectionLength <<= 8;
|
||||
sectionLength += ms.ReadUInt8();
|
||||
if (sectionLength != ms.GetAvailableBytes())
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkId = ms.ReadUInt16BE();
|
||||
|
||||
byte byteB = ms.ReadUInt8();
|
||||
reserved = (byteB & 0xc0) >> 6;
|
||||
int versionNumber = (byteB & 0x3e) >> 1;
|
||||
bool currentNextIndicator = (byteB & 0x01) != 0;
|
||||
|
||||
byte sectionNumber = ms.ReadUInt8();
|
||||
byte lastSectionNumber = ms.ReadUInt8();
|
||||
|
||||
byte byteC = ms.ReadUInt8();
|
||||
int reservedFutureUseB = (byteC & 0xf0) >> 4;
|
||||
int networkDescriptorsLength = (byteC & 0x0f);
|
||||
@ -85,7 +88,8 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
Linkages.Add((_0x4a_LinkageDescriptor)descriptor);
|
||||
continue;
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
|
||||
throw new NotImplementedException(String.Format("Unknown descriptor 0x{0:X2} in RCS Map Table. If this is reproducible, consider submitting a sample of this stream."));
|
||||
}
|
||||
|
||||
byte byteD = ms.ReadUInt8();
|
||||
@ -141,7 +145,7 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
child.SatelliteReturnLink = (_0xa9_SatelliteReturnLinkDescriptor)descriptor;
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
throw new NotImplementedException(String.Format("Unknown descriptor 0x{0:X2} in RCS Map Table. If this is reproducible, consider submitting a sample of this stream."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel.Model
|
||||
{
|
||||
internal class Tct : Validatable
|
||||
public class Tct : Validatable
|
||||
{
|
||||
public Tct(MemoryStream ms)
|
||||
{
|
||||
|
||||
@ -10,6 +10,8 @@ using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper8.GSE.GSE;
|
||||
using skyscraper8.InteractionChannel.Model2.Descriptors;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel.Model
|
||||
{
|
||||
@ -33,7 +35,7 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
//we don't have a way to read single descriptors so far
|
||||
byte descriptorTag = ms.ReadUInt8();
|
||||
byte descriptorLength = ms.ReadUInt8();
|
||||
if (ms.GetAvailableBytes() < minimumRequiredLength)
|
||||
if (ms.GetAvailableBytes() < descriptorLength)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
@ -178,6 +180,38 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 0xb7:
|
||||
Descriptors[i] = new _0xb7_FramePayloadFormatDescriptor(descriptorBuffer);
|
||||
if (!Descriptors[i].Valid)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 0xb9:
|
||||
Descriptors[i] = new _0xb9_LogonResponseDescriptor(descriptorBuffer);
|
||||
if (!Descriptors[i].Valid)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 0xbb:
|
||||
Descriptors[i] = new _0xbb_LowerLayerServiceDescriptor(descriptorBuffer);
|
||||
if (!Descriptors[i].Valid)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 0xc4:
|
||||
Descriptors[i] = new _0xc4_HigherLayersInitializeDescriptor(descriptorBuffer);
|
||||
if (!Descriptors[i].Valid)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (descriptorTag >= 0x00 && descriptorTag <= 0x49)
|
||||
{
|
||||
@ -189,7 +223,7 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
//Reserved
|
||||
continue;
|
||||
}
|
||||
if (descriptorTag >= 0xb7 && descriptorTag <= 0xdf)
|
||||
if (descriptorTag >= 0xcc && descriptorTag <= 0xdf)
|
||||
{
|
||||
//Reserved
|
||||
continue;
|
||||
@ -254,6 +288,9 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
byte id = descriptor.GetDescriptorId();
|
||||
switch(id)
|
||||
{
|
||||
case 0xa0:
|
||||
handler.OnNetworkLayerInfo(macAddress, (_0xa0_NetworkLayerInfoDescriptor)descriptor);
|
||||
break;
|
||||
case 0xa1:
|
||||
if (Broadcast)
|
||||
{
|
||||
@ -267,25 +304,46 @@ namespace skyscraper5.src.InteractionChannel.Model
|
||||
handler.OnCorrectionMessage(macAddress, ((_0xa1_CorrectionMessageDescriptor)descriptor));
|
||||
}
|
||||
break;
|
||||
case 0xa4:
|
||||
handler.OnControlAssignment(macAddress,(_0xa4_SyncAssignDescriptor)descriptor);
|
||||
break;
|
||||
case 0xa9:
|
||||
handler.OnSatelliteReturnLink(macAddress, (_0xa9_SatelliteReturnLinkDescriptor)descriptor);
|
||||
break;
|
||||
case 0xab:
|
||||
handler.OnContentionControl(macAddress, ((_0xab_ContentionControlDescriptor)descriptor));
|
||||
break;
|
||||
case 0xac:
|
||||
handler.OnCorrectionControl(macAddress, (_0xac_CorrectionControlDescriptor)descriptor);
|
||||
break;
|
||||
case 0xad:
|
||||
handler.OnForwardInteractionPath(macAddress, (_0xad_ForwardInteractionPathDescriptor)descriptor);
|
||||
break;
|
||||
case 0xaf:
|
||||
handler.OnConnectionControl(macAddress, (_0xaf_ConnectionControlDescriptor)descriptor);
|
||||
break;
|
||||
case 0xa0:
|
||||
handler.OnNetworkLayerInfo(macAddress, (_0xa0_NetworkLayerInfoDescriptor)descriptor);
|
||||
case 0xb1:
|
||||
handler.OnCorrectionMessageExtension(macAddress, (_0xb1_CorrectionMessageExtensionDescriptor)descriptor);
|
||||
break;
|
||||
case 0xb2:
|
||||
handler.OnReturnTransmissionMOdes(macAddress, (_0xb2_ReturnTransmissionModesDescriptor)descriptor);
|
||||
break;
|
||||
case 0xb7:
|
||||
handler.OnFramePayloadFormatAnnouncement(networkId.Value, (_0xb7_FramePayloadFormatDescriptor)descriptor);
|
||||
break;
|
||||
case 0xb9:
|
||||
handler.LogonResponseDescriptor(macAddress, (_0xb9_LogonResponseDescriptor)descriptor);
|
||||
break;
|
||||
case 0xbb:
|
||||
handler.OnLowerLayerService(macAddress, (_0xbb_LowerLayerServiceDescriptor)descriptor);
|
||||
break;
|
||||
case 0xc4:
|
||||
handler.OnHigherLayerInitalization(macAddress, (_0xc4_HigherLayersInitializeDescriptor)descriptor);
|
||||
break;
|
||||
default:
|
||||
if (id >= 0xe0 && id <= 0xfe)
|
||||
break;
|
||||
throw new NotImplementedException(String.Format("TIM Handle 0x{0:X2}", id));
|
||||
throw new NotImplementedException(String.Format("TIM Descriptor 0x{0:X2} ({1}) is not fully implemented yet. Please share a sample of this stream.", id, descriptor.GetType().Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper5.Skyscraper.Plugins;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model2.Descriptors;
|
||||
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xb7,"TIM")]
|
||||
public class _0xb7_FramePayloadFormatDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xb7_FramePayloadFormatDescriptor(byte[] buffer)
|
||||
{
|
||||
InBitStream bitstream = new InBitStream(buffer);
|
||||
byte contextLoopCount = bitstream.ReadBitsAsByte(8);
|
||||
Contexts = new TransmissionContext[contextLoopCount];
|
||||
for (int i = 0; i < contextLoopCount; i++)
|
||||
{
|
||||
TransmissionContext child = new TransmissionContext();
|
||||
Contexts[i] = child;
|
||||
child.TransmissionContextId = bitstream.ReadBitsAsByte(8);
|
||||
bitstream.Reserved(3);
|
||||
child.AllowPTypeOmission = bitstream.ReadBitAsBoolean();
|
||||
child.UseCompressedPType = bitstream.ReadBitAsBoolean();
|
||||
child.AllowAlpduCrc = bitstream.ReadBitAsBoolean();
|
||||
child.AllowAlpduSequenceNumber = bitstream.ReadBitAsBoolean();
|
||||
child.UseExplicitPayloadHeaderMap = bitstream.ReadBitAsBoolean();
|
||||
child.ImplicitProtocolType = bitstream.ReadBitsAsByte(8);
|
||||
child.ImplicitPpduLabelSize = bitstream.ReadBitsAsByte(4);
|
||||
child.ImplicitPayloadLabelSize = bitstream.ReadBitsAsByte(4);
|
||||
bitstream.Reserved(4);
|
||||
child.Type0AlpduLabelSize = bitstream.ReadBitsAsByte(4);
|
||||
}
|
||||
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public TransmissionContext[] Contexts;
|
||||
|
||||
public class TransmissionContext
|
||||
{
|
||||
public byte TransmissionContextId { get; set; }
|
||||
public bool AllowPTypeOmission { get; set; }
|
||||
public bool UseCompressedPType { get; set; }
|
||||
public bool AllowAlpduCrc { get; set; }
|
||||
public bool AllowAlpduSequenceNumber { get; set; }
|
||||
public bool UseExplicitPayloadHeaderMap { get; set; }
|
||||
public byte ImplicitProtocolType { get; set; }
|
||||
public byte ImplicitPpduLabelSize { get; set; }
|
||||
public byte ImplicitPayloadLabelSize { get; set; }
|
||||
public byte Type0AlpduLabelSize { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper5.Skyscraper.Plugins;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model2.Descriptors
|
||||
{
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xb9,"TIM")]
|
||||
public class _0xb9_LogonResponseDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xb9_LogonResponseDescriptor(byte[] buffer)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
byte byteA = ms.ReadUInt8();
|
||||
KeepIdentifiersAfterLogoff = (byteA & 0x40) != 0;
|
||||
PowerControlMode = (EirpControlModes)((byteA & 0x30) >> 4);
|
||||
RcstAccessStatus = (byteA & 0x0f);
|
||||
GroupId = ms.ReadUInt8();
|
||||
LogonId = ms.ReadUInt16BE();
|
||||
LowestAssignmentId = ms.ReadUInt24BE();
|
||||
|
||||
byte byteB = ms.ReadUInt8();
|
||||
AssignmentIdCount = (byteB & 0xf0) >> 4;
|
||||
int unicastMac24Count = (byteB & 0x0f);
|
||||
UnicastMac24s = new Mac24[unicastMac24Count];
|
||||
for (int i = 0; i < unicastMac24Count; i++)
|
||||
{
|
||||
Mac24 child = new Mac24();
|
||||
UnicastMac24s[i] = child;
|
||||
child.Mac24PrefixSize = ms.ReadUInt8() & 0x1f;
|
||||
child.UnicastMac24 = ms.ReadBytes(3);
|
||||
byte byteC = ms.ReadUInt8();
|
||||
child.MulticastMappingMethod = (byteC & 0x40) != 0;
|
||||
child.MulticastIpVersionIndicatorPresence = (byteC & 0x20) != 0;
|
||||
child.MulticastSynthesisFieldSize = (byteC & 0x1f);
|
||||
}
|
||||
|
||||
DefaultSvnNumber = ms.ReadUInt16BE();
|
||||
byte reserved = ms.ReadUInt8();
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public ushort DefaultSvnNumber { get; set; }
|
||||
|
||||
public Mac24[] UnicastMac24s { get; private set; }
|
||||
public class Mac24
|
||||
{
|
||||
public int Mac24PrefixSize { get; set; }
|
||||
public byte[] UnicastMac24 { get; set; }
|
||||
public bool MulticastMappingMethod { get; set; }
|
||||
public bool MulticastIpVersionIndicatorPresence { get; set; }
|
||||
public int MulticastSynthesisFieldSize { get; set; }
|
||||
}
|
||||
public int AssignmentIdCount { get; set; }
|
||||
|
||||
public uint LowestAssignmentId { get; set; }
|
||||
|
||||
public ushort LogonId { get; set; }
|
||||
|
||||
public byte GroupId { get; set; }
|
||||
|
||||
public int RcstAccessStatus { get; set; }
|
||||
|
||||
public EirpControlModes PowerControlMode { get; set; }
|
||||
|
||||
public bool KeepIdentifiersAfterLogoff { get; set; }
|
||||
|
||||
public enum EirpControlModes
|
||||
{
|
||||
ConstantEirp = 0,
|
||||
AutonomousEirp = 1,
|
||||
ConstantPowerSpectrum = 2,
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(GroupId)}: {GroupId}, {nameof(LogonId)}: {LogonId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper5.Skyscraper.Plugins;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model2.Descriptors
|
||||
{
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xbb,"TIM")]
|
||||
public class _0xbb_LowerLayerServiceDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xbb_LowerLayerServiceDescriptor(byte[] buffer)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
DefaultControlRandomizationInterval = ms.ReadUInt8();
|
||||
DynamicRatePersistence = ms.ReadUInt8();
|
||||
VolumeBacklogPersistence = ms.ReadUInt8();
|
||||
int lowerLayerServiceCount = (ms.ReadUInt8() & 0x0f);
|
||||
LowerLayerServices = new LowerLayerService[lowerLayerServiceCount];
|
||||
for (int a = 0; a < lowerLayerServiceCount; a++)
|
||||
{
|
||||
LowerLayerService child = new LowerLayerService();
|
||||
LowerLayerServices[a] = child;
|
||||
|
||||
byte byteA = ms.ReadUInt8();
|
||||
child.LowerLayerServiceIndex = (byteA & 0x3c) >> 2;
|
||||
bool randomAccess = (byteA & 0x02) != 0;
|
||||
bool dedicatedAccess = (byteA & 0x01) != 0;
|
||||
|
||||
if (dedicatedAccess)
|
||||
{
|
||||
child.DedicatedAccess = new DedicatedAccessClass();
|
||||
byteA = ms.ReadUInt8();
|
||||
child.DedicatedAccess.NominalRcIndex = (byteA & 0xf0) >> 4;
|
||||
child.DedicatedAccess.NominalDaAcIndex = (byteA & 0x0f);
|
||||
child.DedicatedAccess.ConditionalDemandRcMap = ms.ReadUInt16BE();
|
||||
child.DedicatedAccess.ConditionalSchedulerDaAcMap = ms.ReadUInt16BE();
|
||||
}
|
||||
|
||||
if (randomAccess)
|
||||
{
|
||||
child.RandomAccess = new RandomAccessClass();
|
||||
child.RandomAccess.NominalRaAcIndex = (byteA & 0x0f);
|
||||
child.RandomAccess.ConditionalSchedulerRaAcMap = ms.ReadUInt8();
|
||||
}
|
||||
}
|
||||
|
||||
int rcCount = (ms.ReadUInt8() & 0x0f);
|
||||
Rcs = new RcClass[rcCount];
|
||||
for (int c = 0; c < rcCount; c++)
|
||||
{
|
||||
RcClass child = new RcClass();
|
||||
Rcs[c] = child;
|
||||
byte byteB = ms.ReadUInt8();
|
||||
child.RcIndex = (byteB & 0xf0) >> 4;
|
||||
bool constantAssignmentProvided = (byteB & 0x04) != 0;
|
||||
bool volumeAllowed = (byteB & 0x02) != 0;
|
||||
child.RbdcAllowed = (byteB & 0x01) != 0;
|
||||
child.MaximumServiceRate = ms.ReadUInt16BE();
|
||||
child.MinimumServiceRate = ms.ReadUInt16BE();
|
||||
if (constantAssignmentProvided)
|
||||
{
|
||||
child.ConstantServiceRate = ms.ReadUInt16BE();
|
||||
}
|
||||
|
||||
if (volumeAllowed)
|
||||
{
|
||||
child.MaximumBacklog = ms.ReadUInt8();
|
||||
}
|
||||
}
|
||||
|
||||
int raAcCount = (ms.ReadUInt8() & 0x0f);
|
||||
RaRcs = new RaAcClass[raAcCount];
|
||||
for (int b = 0; b < raAcCount; b++)
|
||||
{
|
||||
RaAcClass child = new RaAcClass();
|
||||
RaRcs[b] = child;
|
||||
child.RaAcIndex = (ms.ReadUInt8() & 0x0f);
|
||||
child.MaxUniquePayloadPerBlock = ms.ReadUInt8();
|
||||
child.MaxConsecutiveBlockAccessed = ms.ReadUInt8();
|
||||
child.MinIdleBlock = ms.ReadUInt8();
|
||||
byte defaultsFieldSize = ms.ReadUInt8();
|
||||
child.DefaultsForRaLoadControl = ms.ReadBytes(defaultsFieldSize);
|
||||
}
|
||||
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public RaAcClass[] RaRcs { get; private set; }
|
||||
public RcClass[] Rcs { get; private set; }
|
||||
public LowerLayerService[] LowerLayerServices { get; set; }
|
||||
|
||||
public byte VolumeBacklogPersistence { get; set; }
|
||||
|
||||
public byte DynamicRatePersistence { get; set; }
|
||||
|
||||
public byte DefaultControlRandomizationInterval { get; set; }
|
||||
|
||||
public class LowerLayerService
|
||||
{
|
||||
public int LowerLayerServiceIndex { get; set; }
|
||||
public DedicatedAccessClass DedicatedAccess { get; set; }
|
||||
public RandomAccessClass RandomAccess { get; set; }
|
||||
}
|
||||
|
||||
public class DedicatedAccessClass
|
||||
{
|
||||
public int NominalRcIndex { get; set; }
|
||||
public int NominalDaAcIndex { get; set; }
|
||||
public ushort ConditionalDemandRcMap { get; set; }
|
||||
public ushort ConditionalSchedulerDaAcMap { get; set; }
|
||||
}
|
||||
|
||||
public class RandomAccessClass
|
||||
{
|
||||
public int NominalRaAcIndex { get; set; }
|
||||
public byte ConditionalSchedulerRaAcMap { get; set; }
|
||||
}
|
||||
|
||||
public class RcClass
|
||||
{
|
||||
public int RcIndex { get; set; }
|
||||
public bool RbdcAllowed { get; set; }
|
||||
public ushort MaximumServiceRate { get; set; }
|
||||
public ushort MinimumServiceRate { get; set; }
|
||||
public ushort? ConstantServiceRate { get; set; }
|
||||
public byte? MaximumBacklog { get; set; }
|
||||
}
|
||||
|
||||
public class RaAcClass
|
||||
{
|
||||
public int RaAcIndex { get; set; }
|
||||
public byte MaxUniquePayloadPerBlock { get; set; }
|
||||
public byte MaxConsecutiveBlockAccessed { get; set; }
|
||||
public byte MinIdleBlock { get; set; }
|
||||
public byte[] DefaultsForRaLoadControl { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Mpeg2;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
using skyscraper5.Skyscraper.Plugins;
|
||||
using skyscraper8.GSE.GSE;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model2.Descriptors
|
||||
{
|
||||
[SkyscraperPlugin]
|
||||
[TsDescriptor(0xc4,"TIM")]
|
||||
public class _0xc4_HigherLayersInitializeDescriptor : TsDescriptor
|
||||
{
|
||||
public _0xc4_HigherLayersInitializeDescriptor(byte[] buffer)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(buffer, false);
|
||||
int satL2ifCount = (ms.ReadUInt8() & 0x0f);
|
||||
Layer2Interfaces = new Layer2Interface[satL2ifCount];
|
||||
for (int i = 0; i < satL2ifCount; i++)
|
||||
{
|
||||
Layer2Interface child = new Layer2Interface();
|
||||
Layer2Interfaces[i] = child;
|
||||
child.Mac24 = ms.ReadBytes(3);
|
||||
child.Ipv4McAddress = new IPAddress(ms.ReadBytes(4));
|
||||
child.OfferStreamIpv4Adress = new IPAddress(ms.ReadBytes(4));
|
||||
child.OfferStreamPort = ms.ReadUInt16BE();
|
||||
child.HigherLayerPepSwitchOff = (ms.ReadUInt8() & 0x01) != 0;
|
||||
}
|
||||
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public Layer2Interface[] Layer2Interfaces { get; set; }
|
||||
|
||||
public class Layer2Interface
|
||||
{
|
||||
public byte[] Mac24 { get; set; }
|
||||
public IPAddress Ipv4McAddress { get; set; }
|
||||
public IPAddress OfferStreamIpv4Adress { get; set; }
|
||||
public ushort OfferStreamPort { get; set; }
|
||||
public bool HigherLayerPepSwitchOff { get; set; }
|
||||
|
||||
public string Mac24AsString => BitConverter.ToString(Mac24);
|
||||
|
||||
protected bool Equals(Layer2Interface other)
|
||||
{
|
||||
return Mac24AsString.Equals(other.Mac24AsString) && Ipv4McAddress.Equals(other.Ipv4McAddress) && OfferStreamIpv4Adress.Equals(other.OfferStreamIpv4Adress) && OfferStreamPort == other.OfferStreamPort && HigherLayerPepSwitchOff == other.HigherLayerPepSwitchOff;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((Layer2Interface)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(Mac24AsString, Ipv4McAddress, OfferStreamIpv4Adress, OfferStreamPort, HigherLayerPepSwitchOff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ namespace skyscraper5.src.InteractionChannel.Model2
|
||||
public Fct2(MemoryStream ms)
|
||||
{
|
||||
byte frameTypeLoopCount = ms.ReadUInt8();
|
||||
frameTypeLoopCount--;
|
||||
frameTypeLoopCount++;
|
||||
FrameTypes = new Frame[frameTypeLoopCount];
|
||||
for (int i = 0; i < frameTypeLoopCount; i++)
|
||||
{
|
||||
@ -40,9 +40,11 @@ namespace skyscraper5.src.InteractionChannel.Model2
|
||||
}
|
||||
|
||||
byte sectionLoopCount = ms.ReadUInt8();
|
||||
sectionLoopCount++;
|
||||
FrameTypes[i].SectionLoop = new SectionLoop[sectionLoopCount];
|
||||
for (int j = 0; j < sectionLoopCount; j++)
|
||||
{
|
||||
FrameTypes[i].SectionLoop[j] = new SectionLoop();
|
||||
FrameTypes[i].SectionLoop[j].DefaultTxType = ms.ReadUInt8();
|
||||
FrameTypes[i].SectionLoop[j].FixedAccessMethod = (ms.ReadUInt8() & 0x0f);
|
||||
FrameTypes[i].SectionLoop[j].RepeatCount = ms.ReadUInt16BE();
|
||||
|
||||
28
skyscraper8/InteractionChannel/Model2/Rcs2Tdt.cs
Normal file
28
skyscraper8/InteractionChannel/Model2/Rcs2Tdt.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model2
|
||||
{
|
||||
public class Rcs2Tdt : Validatable
|
||||
{
|
||||
public Rcs2Tdt(MemoryStream ms)
|
||||
{
|
||||
DateTime? dateTime = ms.ReadEtsiEn300468AnnexCDateTime();
|
||||
if (!dateTime.HasValue)
|
||||
{
|
||||
Valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Timestamp = dateTime.Value;
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel.Model2
|
||||
{
|
||||
internal class Tmst2 : Validatable
|
||||
public class Tmst2 : Validatable
|
||||
{
|
||||
public Tmst2(MemoryStream ms, int transmissionStandard)
|
||||
{
|
||||
@ -28,7 +28,7 @@ namespace skyscraper5.src.InteractionChannel.Model2
|
||||
}
|
||||
if (transmissionStandard == 3)
|
||||
{
|
||||
throw new NotImplementedException("Transmisison standard 3");
|
||||
throw new NotImplementedException("Transmisison standard 3 in DVB-RCS2 is not yet supported. If possible, please share a sample of this stream.");
|
||||
}
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2.Descriptors;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel
|
||||
{
|
||||
@ -37,6 +39,61 @@ namespace skyscraper5.src.InteractionChannel
|
||||
{
|
||||
}
|
||||
|
||||
public void OnRcs2Nit(ushort interactiveNetworkId, RcsNit nit)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnRcs2Tdt(ushort interactiveNetworkId, Rcs2Tdt tdt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnTransmissionModeSupport2(ushort interactiveNetworkId, Tmst2 tmst2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnFramePayloadFormatAnnouncement(ushort networkId, _0xb7_FramePayloadFormatDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnCorrectionMessageExtension(PhysicalAddress macAddress, _0xb1_CorrectionMessageExtensionDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnLowerLayerService(PhysicalAddress macAddress, _0xbb_LowerLayerServiceDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnHigherLayerInitalization(PhysicalAddress macAddress, _0xc4_HigherLayersInitializeDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogonResponseDescriptor(PhysicalAddress macAddress, _0xb9_LogonResponseDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnForwardInteractionPath(PhysicalAddress macAddress, _0xad_ForwardInteractionPathDescriptor descriptor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnFrameComposition2(ushort? networkId, Fct2 fct2)
|
||||
{
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ using static System.Collections.Specialized.BitVector32;
|
||||
|
||||
namespace skyscraper5.Mpeg2
|
||||
{
|
||||
internal class DvbCrc32
|
||||
public class DvbCrc32
|
||||
{
|
||||
private DvbCrc32()
|
||||
{
|
||||
@ -112,6 +112,20 @@ namespace skyscraper5.Mpeg2
|
||||
return crc == 0;
|
||||
}
|
||||
|
||||
public static bool ValidateCrc(ReadOnlySpan<byte> data)
|
||||
{
|
||||
uint crc = 0xffffffff;
|
||||
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
uint b = (crc >> 24) & 0xff;
|
||||
int c = (data[i]) & 0xff;
|
||||
crc = (crc << 8) ^ table[b ^ c];
|
||||
}
|
||||
|
||||
return crc == 0;
|
||||
}
|
||||
|
||||
public static uint CreateCrc(MemoryStream ms, int offset, int end)
|
||||
{
|
||||
long restorePosition = ms.Position;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user