mirror of https://github.com/getdnsapi/getdns.git
Show dns_root_servers setting in API information
This commit is contained in:
parent
73cee29f55
commit
563b2b113a
|
@ -3896,6 +3896,14 @@ _get_context_settings(const getdns_context* context)
|
||||||
getdns_list_destroy(list);
|
getdns_list_destroy(list);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
if (getdns_context_get_dns_root_servers(context, &list))
|
||||||
|
; /* pass */
|
||||||
|
|
||||||
|
else if (list && _getdns_dict_set_this_list(
|
||||||
|
result, "dns_root_servers", list)) {
|
||||||
|
getdns_list_destroy(list);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
if (context->dns_transport_count > 0) {
|
if (context->dns_transport_count > 0) {
|
||||||
/* create a namespace list */
|
/* create a namespace list */
|
||||||
if (!(list = getdns_list_create_with_context(context)))
|
if (!(list = getdns_list_create_with_context(context)))
|
||||||
|
|
24
src/dict.c
24
src/dict.c
|
@ -892,6 +892,7 @@ getdns_pp_list(gldns_buffer *buf, size_t indent, const getdns_list *list,
|
||||||
struct getdns_bindata *bindata_item;
|
struct getdns_bindata *bindata_item;
|
||||||
uint32_t int_item;
|
uint32_t int_item;
|
||||||
const char *strval;
|
const char *strval;
|
||||||
|
char abuf[80];
|
||||||
|
|
||||||
if (list == NULL)
|
if (list == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -933,7 +934,21 @@ getdns_pp_list(gldns_buffer *buf, size_t indent, const getdns_list *list,
|
||||||
if (getdns_list_get_bindata(list, i, &bindata_item) !=
|
if (getdns_list_get_bindata(list, i, &bindata_item) !=
|
||||||
GETDNS_RETURN_GOOD)
|
GETDNS_RETURN_GOOD)
|
||||||
return -1;
|
return -1;
|
||||||
if (getdns_pp_bindata(
|
|
||||||
|
if (for_literals && (bindata_item->size == 4 ||
|
||||||
|
bindata_item->size == 16 )) {
|
||||||
|
|
||||||
|
if (gldns_buffer_printf(buf,
|
||||||
|
(json ? "\"%s\"" : " <bindata for %s>"),
|
||||||
|
inet_ntop(( bindata_item->size == 4
|
||||||
|
? AF_INET : AF_INET6)
|
||||||
|
, bindata_item->data
|
||||||
|
, abuf
|
||||||
|
, sizeof(abuf) - 1
|
||||||
|
)) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
} else if (getdns_pp_bindata(
|
||||||
buf, bindata_item, 0, json) < 0)
|
buf, bindata_item, 0, json) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
|
@ -1164,7 +1179,7 @@ getdns_pp_dict(gldns_buffer * buf, size_t indent,
|
||||||
, 40
|
, 40
|
||||||
)) < 0)
|
)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} else if (!json &&
|
} else if (!json &&
|
||||||
(strcmp(item->node.key, "pin-sha256") == 0 ||
|
(strcmp(item->node.key, "pin-sha256") == 0 ||
|
||||||
strcmp(item->node.key, "value") == 0) &&
|
strcmp(item->node.key, "value") == 0) &&
|
||||||
|
@ -1199,8 +1214,9 @@ getdns_pp_dict(gldns_buffer * buf, size_t indent,
|
||||||
if (getdns_pp_list(buf, indent, item->i.data.list,
|
if (getdns_pp_list(buf, indent, item->i.data.list,
|
||||||
(strcmp(item->node.key, "namespaces") == 0 ||
|
(strcmp(item->node.key, "namespaces") == 0 ||
|
||||||
strcmp(item->node.key, "dns_transport_list") == 0
|
strcmp(item->node.key, "dns_transport_list") == 0
|
||||||
|| strcmp(item->node.key, "bad_dns") == 0),
|
|| strcmp(item->node.key, "bad_dns") == 0 ||
|
||||||
json) < 0)
|
strcmp(item->node.key, "dns_root_servers") == 0
|
||||||
|
), json) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue