-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Handle Exceptions in Traceroute (#1994)
* Fix: Handle Exceptions in Traceroute * Docs: Add #1994
- Loading branch information
1 parent
048655a
commit eb30944
Showing
5 changed files
with
185 additions
and
69 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
17 changes: 17 additions & 0 deletions
17
Source/NETworkManager.Models/Network/TracerouteErrorArgs.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace NETworkManager.Models.Network | ||
{ | ||
public class TracerouteErrorArgs : System.EventArgs | ||
{ | ||
public string ErrorMessage { get; set; } | ||
|
||
public TracerouteErrorArgs() | ||
{ | ||
|
||
} | ||
|
||
public TracerouteErrorArgs(string errorMessage) | ||
{ | ||
ErrorMessage = errorMessage; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
namespace NETworkManager.Models.Network; | ||
|
||
/// <summary> | ||
/// Class contains the options for the traceroute. | ||
/// </summary> | ||
public class TracerouteOptions | ||
{ | ||
/// <summary> | ||
/// Timeout in milliseconds after which a ping is considered lost. | ||
/// </summary> | ||
public int Timeout { get; set; } | ||
|
||
/// <summary> | ||
/// Size of the buffer used in the ping in bytes. | ||
/// </summary> | ||
public byte[] Buffer { get; set; } | ||
|
||
/// <summary> | ||
/// Maximum number of hops between the local and remote computer. | ||
/// </summary> | ||
public int MaximumHops { get; set; } | ||
|
||
/// <summary> | ||
/// Do not fragment the ping packet. | ||
/// </summary> | ||
public bool DontFragment { get; set; } | ||
|
||
/// <summary> | ||
/// Resolve the hostname for an IP address. | ||
/// </summary> | ||
public bool ResolveHostname { get; set; } | ||
|
||
/// <summary> | ||
/// Create an instance of <see cref="TracerouteOptions"/>. | ||
/// </summary> | ||
public TracerouteOptions() | ||
{ | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Create an instance of <see cref="TracerouteOptions"/> with parameters. | ||
/// </summary> | ||
/// <param name="timeout">Timeout in milliseconds after which a ping is considered lost.</param> | ||
/// <param name="buffer">Size of the buffer used in the ping in bytes.</param> | ||
/// <param name="maximumHops">Maximum number of hops between the local and remote computer.</param> | ||
/// <param name="dontFragment">Do not fragment the ping packet.</param> | ||
/// <param name="resolveHostname">Resolve the hostname for an IP address.</param> | ||
public TracerouteOptions(int timeout, byte[] buffer, int maximumHops, bool dontFragment, bool resolveHostname) | ||
{ | ||
Timeout = timeout; | ||
Buffer = buffer; | ||
MaximumHops = maximumHops; | ||
DontFragment = dontFragment; | ||
ResolveHostname = resolveHostname; | ||
} | ||
} | ||
|
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