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.
Switch back IEnumerable<IPPackets> to IPPacket[]
- Loading branch information
Showing
21 changed files
with
55 additions
and
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using PacketDotNet; | ||
|
||
namespace VpnHood.Client.Device | ||
{ | ||
public class PacketReceivedEventArgs : EventArgs | ||
{ | ||
public PacketReceivedEventArgs(IEnumerable<IPPacket> ipPackets, IPacketCapture packetCapture) | ||
public PacketReceivedEventArgs(IPPacket[] ipPackets, IPacketCapture packetCapture) | ||
{ | ||
IpPackets = ipPackets ?? throw new ArgumentNullException(nameof(ipPackets)); | ||
PacketCapture = packetCapture ?? throw new ArgumentNullException(nameof(packetCapture)); | ||
} | ||
|
||
public IEnumerable<IPPacket> IpPackets { get; } | ||
public IPPacket[] IpPackets { get; } | ||
public IPacketCapture PacketCapture { get; } | ||
} | ||
} |
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,17 +1,19 @@ | ||
using System; | ||
using System.Net; | ||
using VpnHood.Common.Exceptions; | ||
using VpnHood.Common.Messaging; | ||
|
||
namespace VpnHood.Client.Exceptions | ||
{ | ||
public class RedirectHostException : Exception | ||
public class RedirectHostException : SessionException | ||
{ | ||
public RedirectHostException(IPEndPoint redirectHostEndPoint, string? message) | ||
: base(message) | ||
public RedirectHostException(ResponseBase responseBase) | ||
: base(responseBase) | ||
{ | ||
RedirectHostEndPoint = | ||
redirectHostEndPoint ?? throw new ArgumentNullException(nameof(redirectHostEndPoint)); | ||
if (responseBase.RedirectHostEndPoint == null) | ||
throw new ArgumentNullException(nameof(responseBase.RedirectHostEndPoint)); | ||
} | ||
|
||
public IPEndPoint RedirectHostEndPoint { get; } | ||
public IPEndPoint RedirectHostEndPoint => SessionResponse.RedirectHostEndPoint!; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...d.Tunneling/Messaging/SessionException.cs → ...ood.Common/Exceptions/SessionException.cs
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 was deleted.
Oops, something went wrong.
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,18 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using PacketDotNet; | ||
|
||
namespace VpnHood.Tunneling | ||
{ | ||
public class ChannelPacketReceivedEventArgs : EventArgs | ||
{ | ||
public ChannelPacketReceivedEventArgs(IEnumerable<IPPacket> ipPackets, IChannel channel) | ||
public IPPacket[] IpPackets { get; } | ||
public IChannel Channel { get; } | ||
|
||
public ChannelPacketReceivedEventArgs(IPPacket[] ipPackets, IChannel channel) | ||
{ | ||
IpPackets = ipPackets; | ||
Channel = channel; | ||
} | ||
|
||
public IEnumerable<IPPacket> IpPackets { get; } | ||
public IChannel Channel { get; } | ||
} | ||
} |
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
Oops, something went wrong.