2using System.Collections.Generic;
3using System.Net.NetworkInformation;
4using System.Threading.Tasks;
62 using (System.Net.NetworkInformation.Ping Icmp =
new System.Net.NetworkInformation.Ping())
65 PingOptions Options =
new PingOptions()
69 LinkedList<IElement> Elements =
new LinkedList<IElement>();
74 Response = await Icmp.SendPingAsync(
Argument, 2000,
Ping.data, Options);
77 Elements.AddLast(
new ObjectValue(Response.Address));
79 if (Response.Status == IPStatus.Success)
81 else if (Response.Status == IPStatus.TimedOut ||
82 Response.Status == IPStatus.TimeExceeded ||
83 Response.Status == IPStatus.TtlExpired)
96 if (Names.Length == 1)
109 while (Response.Status != IPStatus.Success && Options.Ttl < 256);
111 return new ObjectMatrix(Elements.Count / 4, 4, Elements)
113 ColumnNames =
new string[] {
"TTL",
"IP",
"Roundtrip",
"Name" }
DNS resolver, as defined in:
static async Task< string[]> ReverseDns(IPAddress Address)
Performs a reverse DNS lookup of an IP address.
Class managing a script expression.
Base class for funcions of one scalar variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
int Start
Start position in script expression.
Performs an ICMP Echo to ping a remote endpoint, and return the roundtrip time.
Uses the ICMP Echo protocol to find the route in the IP network to a given host.
override Task< IElement > EvaluateScalarAsync(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
override IElement EvaluateScalar(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
override async Task< IElement > EvaluateScalarAsync(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
override string FunctionName
Name of the function
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
Route(ScriptNode Argument, int Start, int Length, Expression Expression)
Uses the ICMP Echo protocol to find the route in the IP network to a given host.
static readonly ObjectValue Null
Null value.
static Unit Parse(string UnitString)
Parses a unit string.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.