ushort ReceiveSize() { this.Receive(m_sizeBuffer, 2); DnsBufferReader reader = m_sizeBuffer.CreateReader(); return(reader.ReadUShort()); }
public ushort ReceiveLength() { DnsBuffer lengthBuffer = new DnsBuffer(2); lengthBuffer.Count = m_socket.Receive(lengthBuffer.Buffer, 2, SocketFlags.None); DnsBufferReader reader = lengthBuffer.CreateReader(); return(reader.ReadUShort()); }
internal void Deserialize(ref DnsBufferReader buffer) { this.UniqueID = buffer.ReadUShort(); byte b = buffer.ReadByte(); this.IsRequest = ((b & 0x80) == 0); this.OpCode = (DnsStandard.OpCode)(byte)((b >> 3) & 0x0F); this.IsAuthoritativeAnswer = ((b & 0x04) != 0); this.IsTruncated = ((b & 0x02) != 0); this.IsRecursionDesired = ((b & 0x01) != 0); b = buffer.ReadByte(); this.IsRecursionAvailable = ((b & 0x80) != 0); this.ResponseCode = (DnsStandard.ResponseCode)(byte)(b & 0x0F); this.QuestionCount = buffer.ReadShort(); this.AnswerCount = buffer.ReadShort(); this.NameServerAnswerCount = buffer.ReadShort(); this.AdditionalAnswerCount = buffer.ReadShort(); }
internal void Deserialize(ref DnsBufferReader buffer) { this.UniqueID = buffer.ReadUShort(); byte b = buffer.ReadByte(); this.IsRequest = ((b & 0x80) == 0); this.OpCode = (DnsStandard.OpCode)(byte)((b >> 3) & 0x0F); this.IsAuthoritativeAnswer = ((b & 0x04) != 0); this.IsTruncated = ((b & 0x02) != 0); this.IsRecursionDesired = ((b & 0x01) != 0); b = buffer.ReadByte(); this.IsRecursionAvailable = ((b & 0x80) != 0); this.ResponseCode = (DnsStandard.ResponseCode) (byte)(b & 0x0F); this.QuestionCount = buffer.ReadShort(); this.AnswerCount = buffer.ReadShort(); this.NameServerAnswerCount = buffer.ReadShort(); this.AdditionalAnswerCount = buffer.ReadShort(); }