File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ public interface ILibPcapLiveDevice : ILiveDevice
4141 /// </summary>
4242 PcapHandle Handle { get ; }
4343
44+ /// <summary>
45+ /// Returns a clone of the current device.
46+ /// This clone can then be opened and used to capture packets independently of the original device.
47+ /// You can set the <see cref="Filter"/> without interfering with the original.
48+ /// </summary>
49+ /// <param name="device">The original device</param>
50+ /// <returns>The cloned device</returns>
51+ ILibPcapLiveDevice Clone ( ) ;
52+
53+
4454 /// <summary>
4555 /// Override the default ToString() implementation
4656 /// </summary>
@@ -68,6 +78,5 @@ public interface ILibPcapLiveDevice : ILiveDevice
6878 /// See https://www.tcpdump.org/manpages/pcap_next_ex.3pcap.html
6979 /// </returns>
7080 int GetNextPacketPointers ( ref IntPtr header , ref IntPtr data ) ;
71-
7281 }
7382}
Original file line number Diff line number Diff line change 77using System ;
88using System . Collections . ObjectModel ;
99using System . Runtime . InteropServices ;
10- using System . Text ;
1110
1211namespace SharpPcap . LibPcap
1312{
@@ -33,6 +32,12 @@ protected LibPcapLiveDevice()
3332 {
3433 }
3534
35+ /// <inheritdoc/>
36+ public ILibPcapLiveDevice Clone ( )
37+ {
38+ return new LibPcapLiveDevice ( Interface ) ;
39+ }
40+
3641 /// <summary>
3742 /// PcapDevice finalizer. Ensure PcapDevices are stopped and closed before exit.
3843 /// </summary>
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ SPDX-License-Identifier: MIT
88<Project Sdk =" Microsoft.NET.Sdk" >
99 <PropertyGroup >
1010 <TargetFramework >net8.0</TargetFramework >
11- <Version >10.0.0-beta.1 </Version > <!-- update manually, this is in sync with the Lansweeper On-Prem version-->
11+ <Version >10.0.0-beta.2 </Version > <!-- update manually, this is in sync with the Lansweeper On-Prem version-->
1212 <PackageId >Lansweeper.SharpPcap</PackageId >
1313 <Company >Lansweeper</Company >
1414 <Title >Lansweeper SharpPcap</Title >
You can’t perform that action at this time.
0 commit comments