public static int CompareAuthority(IEnumerable <DNSResource> aFrom, IEnumerable <DNSResource> aTo) { DNSResource[] array = new List <DNSResource>(aFrom).ToArray(); Array.Sort <DNSResource>(array, delegate(DNSResource a, DNSResource b) { return(((int)a.Type).CompareTo((int)b.Type)); }); DNSResource[] resourceArray2 = new List <DNSResource>(aTo).ToArray(); Array.Sort <DNSResource>(resourceArray2, delegate(DNSResource a, DNSResource b) { return(((int)a.Type).CompareTo((int)b.Type)); }); for (int i = 0; i < Math.Min(array.Length, resourceArray2.Length); i++) { DNSResource resource = array[i]; DNSResource resource2 = resourceArray2[i]; int num = ((int)resource.Type).CompareTo((int)resource2.Type); if (num != 0) { return(num); } num = CompareBytes(resource.BodyWriteTo(), resource2.BodyWriteTo()); if (num != 0) { return(num); } } return(array.Length.CompareTo(resourceArray2.Length)); }
public void ReadFrom(BinaryReader aSrc) { this.fSequenceID = N2H(aSrc.ReadUInt16()); this.fFlags = N2H(aSrc.ReadUInt16()); ushort num = N2H(aSrc.ReadUInt16()); ushort num2 = N2H(aSrc.ReadUInt16()); ushort num3 = N2H(aSrc.ReadUInt16()); ushort num4 = N2H(aSrc.ReadUInt16()); int num6 = num - 1; int num5 = 0; if (num5 <= num6) { num6++; do { DNSQuestion item = new DNSQuestion(); item.ReadFrom(aSrc); this.fQuestions.Add(item); num5++; }while (num5 != num6); } int num7 = num2 - 1; num5 = 0; if (num5 <= num7) { num7++; do { this.fAnswers.Add(DNSResource.ReadFrom(aSrc)); num5++; }while (num5 != num7); } int num8 = num3 - 1; num5 = 0; if (num5 <= num8) { num8++; do { this.fAuthorityRecords.Add(DNSResource.ReadFrom(aSrc)); num5++; }while (num5 != num8); } int num9 = num4 - 1; num5 = 0; if (num5 <= num9) { num9++; do { this.fAdditionalRecords.Add(DNSResource.ReadFrom(aSrc)); num5++; }while (num5 != num9); } }
public bool IntEquals(object obj) { if (!(obj is DNSResource)) { return(false); } DNSResource resource = obj as DNSResource; return(((resource.fClass == this.fClass) && (resource.fName == this.fName)) && (resource.Type == this.Type)); }
public override DNSResource Clone() { DNSTXTRecord record = new DNSTXTRecord(); DNSResource resource = record; record.Name = this.Name; record.Class = this.Class; record.ClearCache = this.ClearCache; record.TTL = this.TTL; record.fData = this.fData; return(resource); }
public override DNSResource Clone() { DNSSRVRecord record = new DNSSRVRecord(); DNSResource resource = record; record.Name = this.Name; record.Class = this.Class; record.ClearCache = this.ClearCache; record.TTL = this.TTL; record.fPriority = this.fPriority; record.fWeight = this.fWeight; record.fPort = this.fPort; record.fTargetName = this.fTargetName; return(resource); }