internal Question(String Name, RecordType RecordType, RecordClass RecordClass) { this.Name = Name; this.RecordType = RecordType; this.RecordClass = RecordClass; this.EncodedName = DnsPacket.EncodeName(Name); }
internal Byte[] ToIxfrByte() { Byte[] NameBytes = DnsPacket.EncodeName(base.Name.TrimEnd(new char[] { '.' })); UInt16 RecordDataLength = 22; Int32 TotalLength = NameBytes.Length + 32; Int32 CurrentIndex = 0; // Create the Byte Array Byte[] RecordBytes = new Byte[TotalLength]; // Populate the Byte Array Array.Copy(NameBytes, RecordBytes, NameBytes.Length); CurrentIndex += NameBytes.Length; Array.Copy(EndianBitConverter.ToByte((UInt16)base.RecordType, false), 0, RecordBytes, CurrentIndex, 2); CurrentIndex += 2; Array.Copy(EndianBitConverter.ToByte((UInt16)base.RecordClass, false), 0, RecordBytes, CurrentIndex, 2); CurrentIndex += 6; Array.Copy(EndianBitConverter.ToByte(RecordDataLength, false), 0, RecordBytes, CurrentIndex, 2); CurrentIndex += 4; Array.Copy(EndianBitConverter.ToByte(Serial, false), 0, RecordBytes, CurrentIndex, 4); return(RecordBytes); }
// Constructors internal Question(String Name, RecordType RecordType) { this.Name = Name.TrimEnd(new char[] { '.' }); this.RecordType = RecordType; this.EncodedName = DnsPacket.EncodeName(this.Name); }