functions we will need when breaking things

This commit is contained in:
Tim Young 2017-08-25 16:11:06 -05:00
parent 2e73b622e4
commit 01eb63b401
1 changed files with 25 additions and 0 deletions

View File

@ -59,5 +59,30 @@ namespace EduNetworkBuilder
}
Console.WriteLine(""); //blank line.
}
public string Destination()
{
//When we do a ping, only the return trip is registered. source/dest are reversed
if (PathTaken.Count >= 1) return PathTaken[0].host;
return "";
}
public string Source()
{
//When we do a ping, only the return trip is registered. source/dest are reversed
if (PathTaken.Count >= 1) return PathTaken[PathTaken.Count -1].host;
return "";
}
public string HostnameFromTechnology(TraversalTechnology What)
{
//make a randomized copy of the list, and return the first item that has the technology
List<TraversalRecord> tPathTaken= NB.Randomize<TraversalRecord>(PathTaken);
foreach(TraversalRecord one in tPathTaken)
{
if (one.WhatUsed == What) return one.host;
}
return "";
}
}
}