diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index 1efc618..3d4178c 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -1800,7 +1800,48 @@ namespace EduNetworkBuilder foreach (NetTest NT in NetTests) { - //Here we test it. + IPAddress destination; + NetworkDevice src = null; + //Here we do any pings or actions + switch (NT.TheTest) + { + case NetTestType.FailedPing: + case NetTestType.SuccessfullyPings: + case NetTestType.SuccessfullyPingsAgain: + //We need to generate a ping request + src = GetDeviceFromName(NT.sHost); + if (src == null) continue; + destination = DNSLookup(src, NT.dHost); + if (destination == null || destination.GetIPString == NB.ZeroIPString) + destination = new IPAddress(NT.dHost); + src.PingFromHere(destination); + break; + case NetTestType.SuccessfullyArps: + src = GetDeviceFromName(NT.sHost); + if (src == null) continue; + destination = DNSLookup(src, NT.dHost); + if (destination == null || destination.GetIPString == NB.ZeroIPString) + destination = new IPAddress(NT.dHost); + src.AskArpFromHere(destination); + break; + case NetTestType.SuccessfullyTraceroutes: + src = GetDeviceFromName(NT.sHost); + if (src == null) continue; + destination = DNSLookup(src, NT.dHost); + if (destination == null || destination.GetIPString == NB.ZeroIPString) + destination = new IPAddress(NT.dHost); + src.TracerouteFromHere(destination); + break; + } + NonVisualProcessPacketsOnce(); //loop until we "timeout" or all packets are done. + DumpInvisibleNetMessages(); + } + + foreach (NetTest NT in NetTests) + { + //Here we test it. + bool WasComplete = NT.TestComplete(this); + Console.WriteLine(NT.GetDescription(NetTestVerbosity.full) + " done: " + WasComplete.ToString()); } NB.UnregisterInvisibleNetwork();