コード例 #1
0
                //Typical data in navigator: <test weight="5" type="exact" flag="SA" tcpsig="65535:128:1:48:M1460,N,N,S:."/>
                internal Test(XPathNavigator testXPathNavigator, string osClass, string osDetails)
                {
                    testXPathNavigator.MoveToFirstAttribute();
                    //attributeList=new System.Collections.Specialized.NameValueCollection();
                    this.tcpflags = new HashSet <char>();

                    this.p0fFingerprint = null;

                    do
                    {
                        //attributeList.Add(testXPathNavigator.Name, testXPathNavigator.Value);
                        if (testXPathNavigator.Name == "weight")
                        {
                            this.weight = Convert.ToInt32(testXPathNavigator.Value);
                        }
                        if (testXPathNavigator.Name == "tcpsig")
                        {
                            this.p0fFingerprint = new P0fOsFingerprintCollection.P0fFingerprint(testXPathNavigator.Value + ":" + osClass + ":" + osDetails);
                        }
                        if (testXPathNavigator.Name == "tcpflag")
                        {
                            foreach (char c in testXPathNavigator.Value.ToCharArray())
                            {
                                tcpflags.Add(c);
                            }
                        }
                    }while(testXPathNavigator.MoveToNextAttribute());
                }
コード例 #2
0
                //Typical data in navigator: <test weight="5" type="exact" flag="SA" tcpsig="65535:128:1:48:M1460,N,N,S:."/>
                internal Test(XPathNavigator testXPathNavigator, string osClass, string osDetails)
                {
                    testXPathNavigator.MoveToFirstAttribute();
                    attributeList = new System.Collections.Specialized.NameValueCollection();

                    this.p0fFingerprint = null;

                    do
                    {
                        attributeList.Add(testXPathNavigator.Name, testXPathNavigator.Value);
                        if (testXPathNavigator.Name == "weight")
                        {
                            this.weight = Convert.ToInt32(testXPathNavigator.Value);
                        }
                        if (testXPathNavigator.Name == "tcpsig")
                        {
                            this.p0fFingerprint = new P0fOsFingerprintCollection.P0fFingerprint(testXPathNavigator.Value + ":" + osClass + ":" + osDetails);
                        }
                    }while(testXPathNavigator.MoveToNextAttribute());
                }