Lines Matching defs:level

228 static void dns_server_verified(DnsServer *s, DnsServerFeatureLevel level) {
231 if (s->verified_feature_level > level)
234 if (s->verified_feature_level != level) {
235 log_debug("Verified we get a response at feature level %s from DNS server %s.",
236 dns_server_feature_level_to_string(level),
238 s->verified_feature_level = level;
244 void dns_server_packet_received(DnsServer *s, int protocol, DnsServerFeatureLevel level, usec_t rtt, size_t size) {
248 if (s->possible_feature_level == level)
252 if (s->packet_rrsig_missing && level >= DNS_SERVER_FEATURE_LEVEL_DO)
253 level = DNS_SERVER_FEATURE_LEVEL_DO - 1;
256 if (s->packet_bad_opt && level >= DNS_SERVER_FEATURE_LEVEL_EDNS0)
257 level = DNS_SERVER_FEATURE_LEVEL_EDNS0 - 1;
261 if (level == DNS_SERVER_FEATURE_LEVEL_LARGE)
262 level = DNS_SERVER_FEATURE_LEVEL_LARGE - 1;
266 if (s->possible_feature_level == level)
269 /* Successful TCP connections are only useful to verify the TCP feature level. */
270 level = DNS_SERVER_FEATURE_LEVEL_TCP;
273 dns_server_verified(s, level);
287 void dns_server_packet_lost(DnsServer *s, int protocol, DnsServerFeatureLevel level, usec_t usec) {
291 if (s->possible_feature_level == level) {
304 void dns_server_packet_failed(DnsServer *s, DnsServerFeatureLevel level) {
309 if (s->possible_feature_level != level)
315 void dns_server_packet_truncated(DnsServer *s, DnsServerFeatureLevel level) {
320 if (s->possible_feature_level != level)
326 void dns_server_packet_rrsig_missing(DnsServer *s, DnsServerFeatureLevel level) {
329 if (level < DNS_SERVER_FEATURE_LEVEL_DO)
339 void dns_server_packet_bad_opt(DnsServer *s, DnsServerFeatureLevel level) {
342 if (level < DNS_SERVER_FEATURE_LEVEL_EDNS0)
381 * grace period ends, but not when lowering the possible feature level, as a lower level feature level should
417 /* We are at the TCP (lowest) level, and we tried a couple of TCP connections, and it didn't
430 log_debug("Server doesn't support EDNS(0) properly, downgrading feature level...");
441 log_debug("Detected server responses lack RRSIG records, downgrading feature level...");
447 /* We lost too many UDP packets in a row, and are on a feature level of UDP or higher. If the
451 log_debug("Lost too many UDP packets, downgrading feature level...");
457 /* We got a failure packet, and are at a feature level above UDP. Note that in this case we
461 log_debug("Got server failure, downgrading feature level...");
469 * are on a feature level above UDP. By downgrading things and getting rid of DNSSEC or EDNS0
471 * appears not to be a fallback. Note that if we are already at the lowest UDP level, we don't
474 log_debug("Got too many failed TCP connection failures and truncated UDP packets, downgrading feature level...");
480 /* We changed the feature level, reset the counting */
492 int dns_server_adjust_opt(DnsServer *server, DnsPacket *packet, DnsServerFeatureLevel level) {
501 /* Fix the OPT field in the packet to match our current feature level. */
507 if (level < DNS_SERVER_FEATURE_LEVEL_EDNS0)
510 edns_do = level >= DNS_SERVER_FEATURE_LEVEL_DO;
512 if (level >= DNS_SERVER_FEATURE_LEVEL_LARGE)