namespace Swan.Net.Dns { using System; using System.Threading.Tasks; using System.Collections.Generic; /// /// DnsClient public interfaces. /// internal partial class DnsClient { public interface IDnsMessage { IList Questions { get; } int Size { get; } byte[] ToArray(); } public interface IDnsMessageEntry { DnsDomain Name { get; } DnsRecordType Type { get; } DnsRecordClass Class { get; } int Size { get; } byte[] ToArray(); } public interface IDnsResourceRecord : IDnsMessageEntry { TimeSpan TimeToLive { get; } int DataLength { get; } byte[] Data { get; } } public interface IDnsRequest : IDnsMessage { int Id { get; set; } DnsOperationCode OperationCode { get; set; } bool RecursionDesired { get; set; } } public interface IDnsResponse : IDnsMessage { int Id { get; set; } IList AnswerRecords { get; } IList AuthorityRecords { get; } IList AdditionalRecords { get; } bool IsRecursionAvailable { get; set; } bool IsAuthorativeServer { get; set; } bool IsTruncated { get; set; } DnsOperationCode OperationCode { get; set; } DnsResponseCode ResponseCode { get; set; } } public interface IDnsRequestResolver { Task Request(DnsClientRequest request); } } }