예제 #1
0
파일: NMAPService.cs 프로젝트: ywcsz/modSIC
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OSScanResult"/> class.
 /// </summary>
 public OSScanResult()
 {
     Guesses = new List <OSGuess>();
     Best    = null;
 }
예제 #4
0
파일: NMAPService.cs 프로젝트: ywcsz/modSIC
        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;
        }
예제 #5
0
        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);
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OSScanResult"/> class.
 /// </summary>
 public OSScanResult()
 {
     Guesses = new List<OSGuess>();
     Best = null;
 }