*/
#include <stdinc.h>
-#include <ratbox_lib.h>
-#include <struct.h>
+#include <rb_lib.h>
+#include <client.h>
#include <ircd_defs.h>
#include <parse.h>
#include <authd.h>
"Unable to execute authd in %s or %s/libexec/charybdis",
PKGLIBEXECDIR, ConfigFileEntry.dpath);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "Unable to execute resolver in %s or %s/libexec/charybdis",
+ "Unable to execute authd in %s or %s/libexec/charybdis",
PKGLIBEXECDIR, ConfigFileEntry.dpath);
return 1;
}
ssize_t len;
int parc;
char dnsBuf[READBUF_SIZE];
-
char *parv[MAXPARA + 1];
+
while((len = rb_helper_read(helper, dnsBuf, sizeof(dnsBuf))) > 0)
{
- parc = rb_string_to_array(dnsBuf, parv, MAXPARA+1);
+ parc = rb_string_to_array(dnsBuf, parv, MAXPARA+1);
- if(*parv[0] == 'R')
+ switch (*parv[0])
{
+ case 'E':
if(parc != 5)
{
ilog(L_MAIN, "authd sent a result with wrong number of arguments: got %d", parc);
return;
}
dns_results_callback(parv[1], parv[2], parv[3], parv[4]);
+ break;
+ case 'X':
+ case 'Y':
+ case 'Z':
+ if(parc < 3)
+ {
+ ilog(L_MAIN, "authd sent a result with wrong number of arguments: got %d", parc);
+ restart_authd();
+ return;
+ }
+
+ /* Select by type */
+ switch(*parv[2])
+ {
+ case 'D':
+ /* parv[0] conveys status */
+ if(parc < 4)
+ {
+ ilog(L_MAIN, "authd sent a result with wrong number of arguments: got %d", parc);
+ restart_authd();
+ return;
+ }
+ dns_stats_results_callback(parv[1], parv[0], parc - 3, (const char **)&parv[3]);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
}
- else
- return;
}
}
restart_authd_cb(rb_helper * helper)
{
ilog(L_MAIN, "authd: restart_authd_cb called, authd died?");
- sendto_realops_snomask(SNO_GENERAL, L_ALL, "authd - restart_authd_cb called, authd died?");
+ sendto_realops_snomask(SNO_GENERAL, L_ALL, "authd: restart_authd_cb called, authd died?");
if(helper != NULL)
{
rb_helper_close(helper);