Example #1
0
 public void WriteTo(BinaryWriter aDest)
 {
     DNSPacket.GenerateName(aDest, this.fName);
     aDest.Write(DNSPacket.H2N((ushort)this.fType));
     if (this.fClearCache)
     {
         aDest.Write(DNSPacket.H2N((ushort)(this.fClass | ((DNSClass)0x8000))));
     }
     else
     {
         aDest.Write(DNSPacket.H2N((ushort)this.fClass));
     }
 }
Example #2
0
        public override byte[] BodyWriteTo()
        {
            BinaryWriter aDest = new BinaryWriter(new MemoryStream());

            aDest.Write(DNSPacket.H2N(this.fPriority));
            aDest.Write(DNSPacket.H2N(this.fWeight));
            aDest.Write(DNSPacket.H2N(this.fPort));
            DNSPacket.GenerateName(aDest, this.fTargetName);
            aDest.Flush();
            byte[] buffer = (aDest.BaseStream as MemoryStream).ToArray();
            aDest.Close();
            return(buffer);
        }
Example #3
0
 public void WriteTo(BinaryWriter aDest)
 {
     DNSPacket.GenerateName(aDest, this.fName);
     aDest.Write(DNSPacket.H2N((ushort)this.Type));
     if (this.fClearCache)
     {
         aDest.Write(DNSPacket.H2N((ushort)(this.fClass | ((DNSClass)0x8000))));
     }
     else
     {
         aDest.Write(DNSPacket.H2N((ushort)this.fClass));
     }
     byte[] buffer = this.BodyWriteTo();
     aDest.Write(DNSPacket.H2N((uint)this.fTTL));
     aDest.Write(DNSPacket.H2N((ushort)buffer.Length));
     aDest.Write(buffer, 0, buffer.Length);
 }