private int calculateBestAccurancy(OSScanResult OSScanResults, XmlNode OSClassNode, OSGuess OSGuess, int bestAccuracy) { XmlAttribute attOSGen = OSClassNode.Attributes["osgen"]; OSGuess.OSGen = (attOSGen == null) ? null : attOSGen.Value; OSScanResults.Guesses.Add(OSGuess); if (OSGuess.Accuracy > bestAccuracy) { OSScanResults.Best = OSGuess; return OSGuess.Accuracy; } return bestAccuracy; }
private OSScanResult getBestAccurrancy(XmlNodeList OSClassNodeList) { int bestAccuracy = 0; OSScanResult OSScanResults = new OSScanResult(); foreach (XmlNode OSClassNode in OSClassNodeList) { var accuracy = int.Parse(OSClassNode.Attributes["accuracy"].Value); var vendor = OSClassNode.Attributes["vendor"].Value; var family = OSClassNode.Attributes["osfamily"].Value; var OSGuess = new OSGuess() { Accuracy = accuracy, Vendor = vendor, OSFamily = family }; bestAccuracy = this.calculateBestAccurancy(OSScanResults, OSClassNode, OSGuess, bestAccuracy); } return(OSScanResults); }
/// <summary> /// Initializes a new instance of the <see cref="OSScanResult"/> class. /// </summary> public OSScanResult() { Guesses = new List <OSGuess>(); Best = null; }
private OSScanResult getBestAccurrancy(XmlNodeList OSClassNodeList) { int bestAccuracy = 0; OSScanResult OSScanResults = new OSScanResult(); foreach (XmlNode OSClassNode in OSClassNodeList) { var accuracy = int.Parse(OSClassNode.Attributes["accuracy"].Value); var vendor = OSClassNode.Attributes["vendor"].Value; var family = OSClassNode.Attributes["osfamily"].Value; var OSGuess = new OSGuess() { Accuracy = accuracy, Vendor = vendor, OSFamily = family }; bestAccuracy = this.calculateBestAccurancy(OSScanResults, OSClassNode, OSGuess, bestAccuracy); } return OSScanResults; }
private int calculateBestAccurancy(OSScanResult OSScanResults, XmlNode OSClassNode, OSGuess OSGuess, int bestAccuracy) { XmlAttribute attOSGen = OSClassNode.Attributes["osgen"]; OSGuess.OSGen = (attOSGen == null) ? null : attOSGen.Value; OSScanResults.Guesses.Add(OSGuess); if (OSGuess.Accuracy > bestAccuracy) { OSScanResults.Best = OSGuess; return(OSGuess.Accuracy); } return(bestAccuracy); }
/// <summary> /// Initializes a new instance of the <see cref="OSScanResult"/> class. /// </summary> public OSScanResult() { Guesses = new List<OSGuess>(); Best = null; }