dirmngr: Add command to print the resolver version.

* dirmngr/server.c (cmd_getinfo): Add sub-command "dnsinfo".
This commit is contained in:
Werner Koch 2015-12-03 18:05:32 +01:00
parent 28c53ddbcb
commit 4ff2cae7de
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 12 additions and 0 deletions

View File

@ -2190,6 +2190,7 @@ static const char hlp_getinfo[] =
"version - Return the version of the program.\n"
"pid - Return the process id of the server.\n"
"tor - Return OK if running in Tor mode\n"
"dnsinfo - Return info about the DNS resolver\n"
"socket_name - Return the name of the socket.\n";
static gpg_error_t
cmd_getinfo (assuan_context_t ctx, char *line)
@ -2235,6 +2236,17 @@ cmd_getinfo (assuan_context_t ctx, char *line)
else
err = set_error (GPG_ERR_FALSE, "Tor mode is NOT enabled");
}
else if (!strcmp (line, "dnsinfo"))
{
#if USE_ADNS && HAVE_ADNS_IF_TORMODE
assuan_set_okay_line (ctx, "- ADNS with Tor support");
#elif USE_ADNS
assuan_set_okay_line (ctx, "- ADNS w/o Tor support");
#else
assuan_set_okay_line (ctx, "- System resolver w/o Tor support");
#endif
err = 0;
}
else
err = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");