Skip to content

Commit 32e83a2

Browse files
authored
Merge branch 'master' into ci/enable-managed-pool
2 parents 294f654 + d7cb170 commit 32e83a2

104 files changed

Lines changed: 15223 additions & 296 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Applications/ConsoleReferenceServer/ConsoleReferenceServer.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
<ItemGroup Condition=" '$(NoHttps)' != 'true' ">
1717
<ProjectReference Include="..\..\Stack\Opc.Ua.Bindings.Https\Opc.Ua.Bindings.Https.csproj" />
1818
</ItemGroup>
19+
<!-- Server-side pcap capture (Opc.Ua.Core.Diagnostics). The diagnostics
20+
package resolves to net10.0 in every solution build configuration
21+
(including the netstandard test builds where it collapses to net10.0
22+
only), so gate the reference on net10.0 to keep the multi-TFM solution
23+
build consistent. -->
24+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">
25+
<ProjectReference Include="..\..\Stack\Opc.Ua.Core.Diagnostics\Opc.Ua.Core.Diagnostics.csproj" />
26+
</ItemGroup>
1927
<ItemGroup>
2028
<ProjectReference Include="..\..\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
2129
<ProjectReference Include="..\..\Libraries\Opc.Ua.Configuration\Opc.Ua.Configuration.csproj" />

Applications/ConsoleReferenceServer/Ctt.ReferenceServer.Config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@
197197
<ua:String>http://opcfoundation.org/UA-Profile/Server/Methods</ua:String>
198198
<ua:String>http://opcfoundation.org/UA-Profile/Server/ReverseConnect</ua:String>
199199
<ua:String>http://opcfoundation.org/UA-Profile/Server/ClientRedundancy</ua:String>
200+
<ua:String>http://opcfoundation.org/UA-Profile/Server/HistoricalRawData2022</ua:String>
201+
<ua:String>http://opcfoundation.org/UA-Profile/Server/AggregateHistorical2022</ua:String>
200202
</ServerProfileArray>
201203
<ShutdownDelay>5</ShutdownDelay>
202204
<ServerCapabilities>

Applications/ConsoleReferenceServer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ COPY ["Tools/Opc.Ua.SourceGeneration/Opc.Ua.SourceGeneration.csproj", "Tools/Opc
1313
COPY ["Stack/Opc.Ua.Core.Types/Opc.Ua.Core.Types.csproj", "Stack/Opc.Ua.Core.Types/"]
1414
COPY ["Stack/Opc.Ua.Core/Opc.Ua.Core.csproj", "Stack/Opc.Ua.Core/"]
1515
COPY ["Stack/Opc.Ua.Core.Schema/Opc.Ua.Core.Schema.csproj", "Stack/Opc.Ua.Core.Schema/"]
16+
COPY ["Stack/Opc.Ua.Core.Diagnostics/Opc.Ua.Core.Diagnostics.csproj", "Stack/Opc.Ua.Core.Diagnostics/"]
1617
COPY ["Stack/Opc.Ua.Types/Opc.Ua.Types.csproj", "Stack/Opc.Ua.Types/"]
1718
COPY ["Stack/Opc.Ua.Security.Certificates/Opc.Ua.Security.Certificates.csproj", "Stack/Opc.Ua.Security.Certificates/"]
19+
COPY ["Libraries/Opc.Ua.Client/Opc.Ua.Client.csproj", "Libraries/Opc.Ua.Client/"]
1820
COPY ["Libraries/Opc.Ua.Configuration/Opc.Ua.Configuration.csproj", "Libraries/Opc.Ua.Configuration/"]
1921
COPY ["Libraries/Opc.Ua.Server/Opc.Ua.Server.csproj", "Libraries/Opc.Ua.Server/"]
2022
COPY ["Applications/Quickstarts.Servers/Quickstarts.Servers.csproj", "Applications/Quickstarts.Servers/"]

Applications/ConsoleReferenceServer/Quickstarts.ReferenceServer.Config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@
320320
<ua:String>http://opcfoundation.org/UA-Profile/Server/Methods</ua:String>
321321
<ua:String>http://opcfoundation.org/UA-Profile/Server/ReverseConnect</ua:String>
322322
<ua:String>http://opcfoundation.org/UA-Profile/Server/ClientRedundancy</ua:String>
323+
<ua:String>http://opcfoundation.org/UA-Profile/Server/HistoricalRawData2022</ua:String>
324+
<ua:String>http://opcfoundation.org/UA-Profile/Server/AggregateHistorical2022</ua:String>
323325
</ServerProfileArray>
324326
<ShutdownDelay>5</ShutdownDelay>
325327
<ServerCapabilities>

Applications/ConsoleReferenceServer/UAServer.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
using Microsoft.Extensions.Logging;
3838
using Opc.Ua;
3939
using Opc.Ua.Configuration;
40+
#if NET10_0_OR_GREATER
41+
using Opc.Ua.Pcap.Capture;
42+
#endif
4043
using Opc.Ua.Security.Certificates;
4144
using Opc.Ua.Server;
4245

@@ -162,6 +165,19 @@ public async Task StartAsync(CancellationToken ct = default)
162165
// create the server.
163166
Server ??= m_factory(m_telemetry);
164167

168+
#if NET10_0_OR_GREATER
169+
// Opt-in diagnostics: when OPCUA_PCAP_FILE / OPCUA_KEYLOGFILE are
170+
// set, install server-side pcap capture into the transport
171+
// bindings before the listeners open. Mirrors the client env-var
172+
// path and honours the same variables; a complete no-op (nothing
173+
// installed, no files written) when the variables are unset.
174+
// The pcap capture package targets net8.0+ only.
175+
m_pcapCapture = await PcapServerCapture.TryStartFromEnvironmentAsync(
176+
Server!.TransportBindings,
177+
m_telemetry.LoggerFactory,
178+
ct).ConfigureAwait(false);
179+
#endif
180+
165181
// start the server
166182
await Application.StartAsync(Server, ct).ConfigureAwait(false);
167183

@@ -211,7 +227,16 @@ public async Task StopAsync(CancellationToken ct = default)
211227
await server.StopAsync(ct).ConfigureAwait(false);
212228
}
213229

214-
ExitCode = ExitCode.Ok;
230+
#if NET10_0_OR_GREATER
231+
// Stop any env-var-driven pcap capture installed at start.
232+
if (m_pcapCapture != null)
233+
{
234+
await m_pcapCapture.DisposeAsync().ConfigureAwait(false);
235+
m_pcapCapture = null;
236+
}
237+
#endif
238+
239+
ExitCode = ExitCode.Ok;
215240
}
216241
catch (Exception ex)
217242
{
@@ -360,5 +385,8 @@ public override async Task<bool> ShowAsync()
360385
private readonly ILogger m_logger;
361386
private Task m_status = Task.CompletedTask;
362387
private DateTime m_lastEventTime;
388+
#if NET10_0_OR_GREATER
389+
private IAsyncDisposable? m_pcapCapture;
390+
#endif
363391
}
364392
}

0 commit comments

Comments
 (0)