コード例 #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
ファイル: OSScanResult.cs プロジェクト: jonaslsl/modSIC
 /// <summary>
 /// Initializes a new instance of the <see cref="OSScanResult"/> class.
 /// </summary>
 public OSScanResult()
 {
     Guesses = new List<OSGuess>();
     Best = null;
 }