tree-wide: port over to new builder apis

This commit is contained in:
Lennart Poettering
2024-06-19 22:50:02 +02:00
parent 004c69a27f
commit be5bee2a13
54 changed files with 1250 additions and 1267 deletions
+7 -7
View File
@@ -1726,13 +1726,13 @@ int dns_scope_dump_cache_to_json(DnsScope *scope, sd_json_variant **ret) {
if (r < 0)
return r;
return sd_json_build(ret,
SD_JSON_BUILD_OBJECT(
SD_JSON_BUILD_PAIR_STRING("protocol", dns_protocol_to_string(scope->protocol)),
SD_JSON_BUILD_PAIR_CONDITION(scope->family != AF_UNSPEC, "family", SD_JSON_BUILD_INTEGER(scope->family)),
SD_JSON_BUILD_PAIR_CONDITION(!!scope->link, "ifindex", SD_JSON_BUILD_INTEGER(scope->link ? scope->link->ifindex : 0)),
SD_JSON_BUILD_PAIR_CONDITION(!!scope->link, "ifname", SD_JSON_BUILD_STRING(scope->link ? scope->link->ifname : NULL)),
SD_JSON_BUILD_PAIR_VARIANT("cache", cache)));
return sd_json_buildo(
ret,
SD_JSON_BUILD_PAIR_STRING("protocol", dns_protocol_to_string(scope->protocol)),
SD_JSON_BUILD_PAIR_CONDITION(scope->family != AF_UNSPEC, "family", SD_JSON_BUILD_INTEGER(scope->family)),
SD_JSON_BUILD_PAIR_CONDITION(!!scope->link, "ifindex", SD_JSON_BUILD_INTEGER(scope->link ? scope->link->ifindex : 0)),
SD_JSON_BUILD_PAIR_CONDITION(!!scope->link, "ifname", SD_JSON_BUILD_STRING(scope->link ? scope->link->ifname : NULL)),
SD_JSON_BUILD_PAIR_VARIANT("cache", cache));
}
int dns_type_suitable_for_protocol(uint16_t type, DnsProtocol protocol) {