internal override byte[] GetBytes() { DnsWriter bw = new DnsWriter(); bw.Write(_flags); bw.Write(_ipAddress.GetAddressBytes()); return(bw.GetBytes()); }
internal void Write(DnsWriter bw) { bw.WriteDomain(Domain); bw.Write((short)Type); bw.Write((short)Class); bw.Write(Ttl); byte[] record = Record.GetBytes(); bw.Write((short)record.Length); bw.Write(record); }
public byte[] GetMessage() { DnsWriter bw = new DnsWriter(); _header.WriteBytes(bw); // Question #if (MF) bw.Write((short)_questions.Length); #else bw.Write((short)_questions.Count); #endif // Answer, Authority, Additional // Those three records are not available in a query. bw.Write(new byte[] { 0x0, 0x0, // how many answers 0x0, 0x0 // how many name server records }); // Additional #if (MF) bw.Write((short)_additionalRecords.Length); #else bw.Write((short)_additionalRecords.Count); #endif foreach (Question q in _questions) { q.Write(bw); } foreach (Additional a in _additionalRecords) { a.Write(bw); } return(bw.GetBytes()); }
internal void Write(DnsWriter bw) { bw.WriteDomain(Domain); bw.Write((short)Type); bw.Write((short)Class); }