Esempio n. 1
0
        public override byte[] GetBytes()
        {
            DnsWriter bw = new DnsWriter();

            bw.Write(_flags);
            bw.Write(_ipAddress.GetAddressBytes());

            return(bw.GetBytes());
        }
Esempio n. 2
0
        public override byte[] GetBytes()
        {
            DnsWriter bw = new DnsWriter();

            bw.Write(_flags);
            bw.Write(_ipAddress.GetAddressBytes());

            return bw.GetBytes();
        }
        internal void Write(DnsWriter bw)
        {

            byte[] record = Record.GetBytes();

            bw.WriteDomain(Domain);
            bw.Write((short)Type);
            bw.Write((short)Class);
            bw.Write(Ttl);
            bw.Write((short)record.Length);
            bw.Write(record);
        }
Esempio n. 4
0
        public byte[] ToArray()
        {
            DnsWriter byteWriter = new DnsWriter();

            // Header
            Header.WriteBytes(byteWriter);

            // Question, Answer, Authority, Additional Counts
            byteWriter.Write((short)this.QuestionRecordCount);
            byteWriter.Write((short)this.AnswerRecordCount);
            byteWriter.Write((short)this.AuthorityRecordCount);
            byteWriter.Write((short)this.AdditionalRecordCount);

            // Write Records
            foreach (Question record in Questions)
            {
                record.Write(byteWriter);
            }

            foreach (Answer record in Answers)
            {
                record.Write(byteWriter);
            }

            foreach (Authority record in Authorities)
            {
                record.Write(byteWriter);
            }

            foreach (Additional record in Additionals)
            {
                record.Write(byteWriter);
            }

            return(byteWriter.GetBytes());
        }
Esempio n. 5
0
 internal void Write(DnsWriter bw)
 {
     bw.WriteDomain(Domain);
     bw.Write((short)Type);
     bw.Write((short)Class);
 }
Esempio n. 6
0
        internal void Write(DnsWriter bw)
        {
            byte[] record = Record.GetBytes();

            bw.WriteDomain(Domain);
            bw.Write((short)Type);
            bw.Write((short)Class);
            bw.Write(Ttl);
            bw.Write((short)record.Length);
            bw.Write(record);
        }
Esempio n. 7
0
        public byte[] ToArray()
        {
            DnsWriter byteWriter = new DnsWriter();

            // Header
            Header.WriteBytes(byteWriter);

            // Question, Answer, Authority, Additional Counts
            byteWriter.Write((short)this.QuestionRecordCount);
            byteWriter.Write((short)this.AnswerRecordCount);
            byteWriter.Write((short)this.AuthorityRecordCount);
            byteWriter.Write((short)this.AdditionalRecordCount);

            // Write Records
            foreach (Question record in Questions)
            {
                record.Write(byteWriter);
            }

            foreach (Answer record in Answers)
            {
                record.Write(byteWriter);
            }

            foreach (Authority record in Authorities)
            {
                record.Write(byteWriter);
            }

            foreach (Additional record in Additionals)
            {
                record.Write(byteWriter);
            }

            return byteWriter.GetBytes();
        }
Esempio n. 8
0
 internal void Write(DnsWriter bw)
 {
     bw.WriteDomain(Domain);
     bw.Write((short)Type);
     bw.Write((short)Class);
 }