forked from vpnhood/VpnHood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove IsHandled from OnPacketArrivalFromInbound
- Loading branch information
Showing
6 changed files
with
20 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,17 @@ | ||
using PacketDotNet; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace VpnHood.Client.Device | ||
{ | ||
public class PacketCaptureArrivalEventArgs : EventArgs | ||
{ | ||
public class ArivalPacket | ||
{ | ||
private bool _passthru; | ||
|
||
public ArivalPacket(IPPacket ipPacket, bool isPassthruSupported) | ||
{ | ||
IpPacket = ipPacket; | ||
IsPassthruSupported = isPassthruSupported; | ||
} | ||
|
||
public IPPacket IpPacket { get; } | ||
public bool IsPassthruSupported { get; } | ||
public bool Passthru | ||
{ | ||
get => _passthru; | ||
set | ||
{ | ||
if (!IsPassthruSupported) throw new NotSupportedException($"{nameof(Passthru)} is not supported by this PacketCapture!"); | ||
_passthru = value; | ||
} | ||
} | ||
public bool IsHandled { get; set; } | ||
} | ||
|
||
public ArivalPacket[] ArivalPackets { get; } | ||
public IEnumerable<IPPacket> IpPackets { get; } | ||
public IPacketCapture PacketCapture { get; } | ||
|
||
public PacketCaptureArrivalEventArgs(IEnumerable<IPPacket> ipPackets, IPacketCapture packetCapture) | ||
{ | ||
if (ipPackets is null) throw new ArgumentNullException(nameof(ipPackets)); | ||
ArivalPackets = ipPackets.Select(x => new ArivalPacket(x, packetCapture.CanSendPacketToOutbound)).ToArray(); | ||
PacketCapture = packetCapture; | ||
IpPackets = ipPackets ?? throw new ArgumentNullException(nameof(ipPackets)); | ||
PacketCapture = packetCapture ?? throw new ArgumentNullException(nameof(packetCapture)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters