74 references to QueryType
Microsoft.Extensions.ServiceDiscovery.Dns (48)
Resolver\DnsDataReader.cs (3)
37
internal bool TryReadQuestion(out EncodedDomainName name, out
QueryType
type, out QueryClass @class)
48
type = (
QueryType
)typeAsInt;
95
record = new DnsResourceRecord(name, (
QueryType
)type, (QueryClass)@class, (int)ttl, data);
Resolver\DnsDataWriter.cs (1)
33
internal bool TryWriteQuestion(EncodedDomainName name,
QueryType
type, QueryClass @class)
Resolver\DnsResolver.cs (30)
72
return SendQueryWithTelemetry(name, dnsSafeName,
QueryType
.SRV, ProcessResponse, cancellationToken);
74
static (SendQueryError, ServiceResult[]) ProcessResponse(EncodedDomainName dnsSafeName,
QueryType
queryType, DnsResponse response)
80
if (answer.Type ==
QueryType
.SRV)
102
if (additional.Name.Equals(target) && (additional.Type ==
QueryType
.A || additional.Type ==
QueryType
.AAAA))
152
var
queryType = addressFamily == AddressFamily.InterNetwork ?
QueryType
.A :
QueryType
.AAAA;
155
static (SendQueryError error, AddressResult[] result) ProcessResponse(EncodedDomainName dnsSafeName,
QueryType
queryType, DnsResponse response)
178
case
QueryType
.CNAME:
224
if (answer.Type ==
QueryType
.CNAME)
284
Debug.Assert(record.Type ==
QueryType
.CNAME, "Only CNAME records should be processed here.");
307
static bool TryReadAddress(in DnsResourceRecord record,
QueryType
type, [NotNullWhen(true)] out IPAddress? target)
309
Debug.Assert(record.Type is
QueryType
.A or
QueryType
.AAAA, "Only CNAME records should be processed here.");
312
if (record.Type ==
QueryType
.A && record.Data.Length != IPv4Length ||
313
record.Type ==
QueryType
.AAAA && record.Data.Length != IPv6Length)
359
private async ValueTask<TResult[]> SendQueryWithTelemetry<TResult>(string name, EncodedDomainName dnsSafeName,
QueryType
queryType, Func<EncodedDomainName,
QueryType
, DnsResponse, (SendQueryError error, TResult[] result)> processResponseFunc, CancellationToken cancellationToken)
375
async ValueTask<(SendQueryError error, TResult[] result)> SendQueryWithRetriesAsync<TResult>(string name, EncodedDomainName dnsSafeName,
QueryType
queryType, Func<EncodedDomainName,
QueryType
, DnsResponse, (SendQueryError error, TResult[] result)> processResponseFunc, CancellationToken cancellationToken)
480
internal async ValueTask<SendQueryResult> SendQueryToServerWithTimeoutAsync(IPEndPoint serverEndPoint, string name, EncodedDomainName dnsSafeName,
QueryType
queryType, int attempt, CancellationToken cancellationToken)
512
private async ValueTask<SendQueryResult> SendQueryToServerAsync(IPEndPoint serverEndPoint, string name, EncodedDomainName dnsSafeName,
QueryType
queryType, int attempt, CancellationToken cancellationToken)
559
!responseReader.TryReadQuestion(out var qName, out
var
qType, out var qClass) ||
638
DnsResourceRecord? soa = authorities.Find(r => r.Type ==
QueryType
.SOA);
672
if (!authorities.Exists(r => r.Type ==
QueryType
.NS) && GetNegativeCacheExpiration(createdAt, authorities, out DateTime newExpiration))
702
internal static (DnsDataReader reader, DnsMessageHeader header, SendQueryError sendError) SendDnsQueryCustomTransport(Func<Memory<byte>, int, int> callback, EncodedDomainName dnsSafeName,
QueryType
queryType)
732
internal static async ValueTask<(DnsDataReader reader, DnsMessageHeader header)> SendDnsQueryCoreUdpAsync(IPEndPoint serverEndPoint, EncodedDomainName dnsSafeName,
QueryType
queryType, CancellationToken cancellationToken)
781
internal static async ValueTask<(DnsDataReader reader, DnsMessageHeader header, SendQueryError error)> SendDnsQueryCoreTcpAsync(IPEndPoint serverEndPoint, EncodedDomainName dnsSafeName,
QueryType
queryType, CancellationToken cancellationToken)
845
private static (ushort id, int length) EncodeQuestion(Memory<byte> buffer, EncodedDomainName dnsSafeName,
QueryType
queryType)
Resolver\DnsResolver.Log.cs (9)
13
public static partial void Query(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt);
16
public static partial void ResultTruncated(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt);
19
public static partial void ErrorResponseCode(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, QueryResponseCode responseCode);
22
public static partial void Timeout(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt);
25
public static partial void NoData(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt);
28
public static partial void NameError(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt);
31
public static partial void MalformedResponse(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt);
34
public static partial void NetworkError(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt, Exception exception);
37
public static partial void QueryError(ILogger logger,
QueryType
queryType, string queryName, IPEndPoint server, int attempt, Exception exception);
Resolver\DnsResolver.Telemetry.cs (3)
18
public static NameResolutionActivity StartNameResolution(string hostName,
QueryType
queryType, long startingTimestamp)
28
public static void StopNameResolution(string hostName,
QueryType
queryType, in NameResolutionActivity activity, object? answers, SendQueryError error, long endingTimestamp)
61
public NameResolutionActivity(string hostName,
QueryType
queryType, long startingTimestamp)
Resolver\DnsResourceRecord.cs (2)
9
public
QueryType
Type { get; }
14
public DnsResourceRecord(EncodedDomainName name,
QueryType
type, QueryClass @class, int ttl, ReadOnlyMemory<byte> data)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (26)
Resolver\DnsDataReaderTests.cs (1)
33
Assert.Equal(
QueryType
.A, record.Type);
Resolver\DnsDataWriterTests.cs (4)
29
DnsResourceRecord record = new DnsResourceRecord(EncodeDomainName("www.example.com"),
QueryType
.A, QueryClass.Internet, 3600, new byte[4]);
56
DnsResourceRecord record = new DnsResourceRecord(EncodeDomainName("www.example.com"),
QueryType
.A, QueryClass.Internet, 3600, new byte[4]);
81
Assert.True(writer.TryWriteQuestion(EncodeDomainName("www.example.com"),
QueryType
.A, QueryClass.Internet));
102
Assert.False(writer.TryWriteQuestion(EncodeDomainName("www.example.com"),
QueryType
.A, QueryClass.Internet));
Resolver\LoopbackDnsServer.cs (11)
37
!reader.TryReadQuestion(out var name, out
var
type, out var @class))
123
public LoopbackDnsResponseBuilder(string name,
QueryType
type, QueryClass @class)
141
public
QueryType
Type { get; }
144
public List<(string,
QueryType
, QueryClass)> Questions { get; } = new List<(string,
QueryType
, QueryClass)>();
236
QueryType
type = address.AddressFamily == AddressFamily.InterNetwork ?
QueryType
.A :
QueryType
.AAAA;
249
records.Add(new DnsResourceRecord(EncodeDomainName(name),
QueryType
.CNAME, QueryClass.Internet, ttl, buff.AsMemory(0, length)));
268
records.Add(new DnsResourceRecord(EncodeDomainName(name),
QueryType
.SRV, QueryClass.Internet, ttl, buff.AsMemory(0, length)));
290
records.Add(new DnsResourceRecord(EncodeDomainName(name),
QueryType
.SOA, QueryClass.Internet, ttl, buff.AsMemory(0, length)));
Resolver\ResolveAddressesTests.cs (6)
270
[InlineData("not-example.com", (int)
QueryType
.A, (int)QueryClass.Internet)]
271
[InlineData("example.com", (int)
QueryType
.AAAA, (int)QueryClass.Internet)]
272
[InlineData("example.com", (int)
QueryType
.A, 0)]
280
builder.Questions[0] = (name, (
QueryType
)type, (QueryClass)@class);
317
LoopbackDnsResponseBuilder responseBuilder = new LoopbackDnsResponseBuilder(name,
QueryType
.A, QueryClass.Internet)
323
responseBuilder.Questions.Add((name,
QueryType
.A, QueryClass.Internet));
Resolver\TcpFailoverTests.cs (4)
107
[InlineData("not-example.com", (int)
QueryType
.A, (int)QueryClass.Internet)]
108
[InlineData("example.com", (int)
QueryType
.AAAA, (int)QueryClass.Internet)]
109
[InlineData("example.com", (int)
QueryType
.A, 0)]
124
builder.Questions[0] = (name, (
QueryType
)type, (QueryClass)@class);