Ejemplo n.º 1
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(PrimaryName);
     writer.WriteDomainName(Mailbox);
     writer.WriteUInt32(SerialNumber);
     writer.WriteTimeSpan32(Refresh);
     writer.WriteTimeSpan32(Retry);
     writer.WriteTimeSpan32(Expire);
     writer.WriteTimeSpan32(Minimum, appendSpace: false);
 }
Ejemplo n.º 2
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(Priority);
     writer.WriteUInt16(Weight);
     writer.WriteUInt16(Port);
     writer.WriteDomainName(Target, appendSpace: false);
 }
Ejemplo n.º 3
0
        public void WriteDomainName_Escaped()
        {
            var text   = new StringWriter();
            var writer = new PresentationWriter(text);

            writer.WriteDomainName(new DomainName(@"dr\. smith.com"), false);
            Assert.AreEqual(@"dr\.\032smith.com", text.ToString());
        }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(Algorithm);
     writer.WriteDateTime(Inception);
     writer.WriteDateTime(Expiration);
     writer.WriteUInt16((ushort)Mode);
     writer.WriteUInt16((ushort)Error);
     writer.WriteBase64String(Key);
     writer.WriteBase64String(OtherData ?? NoData, appendSpace: false);
 }
Ejemplo n.º 5
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(Algorithm);
     writer.WriteDateTime(TimeSigned);
     writer.WriteTimeSpan16(Fudge);
     writer.WriteBase64String(MAC);
     writer.WriteUInt16(OriginalMessageId);
     writer.WriteUInt16((ushort)Error);
     writer.WriteBase64String(OtherData ?? NoData, appendSpace: false);
 }
Ejemplo n.º 6
0
 /// <inheritdoc />
 public override string ToString()
 {
     using (var s = new StringWriter())
     {
         var writer = new PresentationWriter(s);
         writer.WriteDomainName(Name);
         writer.WriteDnsClass(Class);
         writer.WriteDnsType(Type, appendSpace: false);
         return(s.ToString());
     }
 }
Ejemplo n.º 7
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDnsType(TypeCovered);
     writer.WriteByte((byte)Algorithm);
     writer.WriteByte(Labels);
     writer.WriteTimeSpan32(OriginalTTL);
     writer.WriteDateTime(SignatureExpiration);
     writer.WriteDateTime(SignatureInception);
     writer.WriteUInt16(KeyTag);
     writer.WriteDomainName(SignerName);
     writer.WriteBase64String(Signature, appendSpace: false);
 }
Ejemplo n.º 8
0
        /// <inheritdoc />
        public void Write(PresentationWriter writer)
        {
            writer.WriteDomainName(Name);
            if (TTL != DefaultTTL)
            {
                writer.WriteTimeSpan32(TTL);
            }
            writer.WriteDnsClass(Class);
            writer.WriteDnsType(Type);

            WriteData(writer);
            writer.WriteEndOfLine();
        }
Ejemplo n.º 9
0
        public void WriteDomainName()
        {
            var text   = new StringWriter();
            var writer = new PresentationWriter(text);

            writer.WriteString("alpha.com");
            writer.WriteString("omega.com", appendSpace: false);
            Assert.AreEqual("alpha.com omega.com", text.ToString());

            text   = new StringWriter();
            writer = new PresentationWriter(text);
            writer.WriteDomainName(new DomainName("alpha.com"), false);
            Assert.AreEqual("alpha.com", text.ToString());
        }
Ejemplo n.º 10
0
        /// <inheritdoc />
        public override void WriteData(PresentationWriter writer)
        {
            writer.WriteDomainName(NextOwnerName);

            bool next = false;

            foreach (var type in Types)
            {
                if (next)
                {
                    writer.WriteSpace();
                }
                writer.WriteDnsType(type, appendSpace: false);
                next = true;
            }
        }
Ejemplo n.º 11
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(Mailbox);
     writer.WriteDomainName(TextName, appendSpace: false);
 }
Ejemplo n.º 12
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(Authority, appendSpace: false);
 }
Ejemplo n.º 13
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(Preference);
     writer.WriteDomainName(Exchange, appendSpace: false);
 }
Ejemplo n.º 14
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(Subtype);
     writer.WriteDomainName(Target, appendSpace: false);
 }