Example #1
0
 public void Serialize(DNSOutputStream stream)
 {
     stream.WriteDomain(PrimaryNameServer);
     stream.WriteDomain(Hostmaster);
     stream.WriteUInt32(Serial);
     stream.WriteUInt32(RefreshSeconds);
     stream.WriteUInt32(RetrySeconds);
     stream.WriteUInt32(ExpireSeconds);
     stream.WriteUInt32(MinimumTTL);
 }
Example #2
0
        /**
         * Converts a record object into the raw bytes that represent
         * it on the wire.
         */
        public void Serialize(DNSOutputStream stream)
        {
            stream.WriteDomain(Name);
            stream.WriteUInt16((UInt16)Resource.Type);
            stream.WriteUInt16((UInt16)AddressClass);
            stream.WriteUInt32(TimeToLive);

            var length_hole = stream.WriteUInt16Hole();
            var start_posn  = stream.Position;

            Resource.Serialize(stream);
            var end_posn = stream.Position;

            length_hole.Fill((UInt16)(end_posn - start_posn));
        }