static rb_dictionary *cid_clients;
static struct ev_entry *timeout_ev;
-rb_dictionary *bl_stats;
+rb_dictionary *dnsbl_stats;
rb_dlink_list opm_list;
struct OPMListener opm_listeners[LISTEN_LAST];
ssize_t len;
int parc;
char buf[READBUF_SIZE];
- char *parv[MAXPARA + 1];
+ char *parv[MAXPARA];
while((len = rb_helper_read(helper, buf, sizeof(buf))) > 0)
{
struct authd_cb *cmd;
- parc = rb_string_to_array(buf, parv, MAXPARA+1);
+ parc = rb_string_to_array(buf, parv, sizeof(parv));
cmd = &authd_cmd_tab[(unsigned char)*parv[0]];
if(cmd->fn != NULL)
{
rb_helper_write(authd_helper, "O opm_listener %s %hu",
opm_listeners[LISTEN_IPV4].ipaddr, opm_listeners[LISTEN_IPV4].port);
-#ifdef RB_IPV6
if(opm_listeners[LISTEN_IPV6].ipaddr[0] != '\0')
rb_helper_write(authd_helper, "O opm_listener %s %hu",
opm_listeners[LISTEN_IPV6].ipaddr, opm_listeners[LISTEN_IPV6].port);
-#endif
RB_DLINK_FOREACH(ptr, opm_list.head)
{
static void
restart_authd_cb(rb_helper * helper)
{
- rb_dictionary_iter iter;
- struct Client *client_p;
-
iwarn("authd: restart_authd_cb called, authd died?");
sendto_realops_snomask(SNO_GENERAL, L_ALL, "authd: restart_authd_cb called, authd died?");
/* Add a bit of a fudge factor... */
client_p->preClient->auth.timeout = rb_current_time() + ConfigFileEntry.connect_timeout + 10;
- rb_helper_write(authd_helper, "C %x %s %hu %s %hu", authd_cid, listen_ipaddr, listen_port, client_ipaddr, client_port);
+ rb_helper_write(authd_helper, "C %x %s %hu %s %hu %x", authd_cid, listen_ipaddr, listen_port, client_ipaddr, client_port,
+#ifdef HAVE_LIBSCTP
+ IsSCTP(client_p) ? IPPROTO_SCTP : IPPROTO_TCP);
+#else
+ IPPROTO_TCP);
+#endif
}
static inline void
}
}
-/* Send a new blacklist to authd */
+/* Send a new DNSBL entry to authd */
void
-add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters)
+add_dnsbl_entry(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters)
{
rb_dlink_node *ptr;
- struct BlacklistStats *stats = rb_malloc(sizeof(struct BlacklistStats));
+ struct DNSBLEntryStats *stats = rb_malloc(sizeof(*stats));
char filterbuf[BUFSIZE] = "*";
size_t s = 0;
- if(bl_stats == NULL)
- bl_stats = rb_dictionary_create("blacklist statistics", rb_strcasecmp);
+ if(dnsbl_stats == NULL)
+ dnsbl_stats = rb_dictionary_create("dnsbl statistics", rb_strcasecmp);
/* Build a list of comma-separated values for authd.
* We don't check for validity - do it elsewhere.
stats->host = rb_strdup(host);
stats->iptype = iptype;
stats->hits = 0;
- rb_dictionary_add(bl_stats, stats->host, stats);
+ rb_dictionary_add(dnsbl_stats, stats->host, stats);
rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", host, iptype, filterbuf, reason);
}
-/* Delete a blacklist */
+/* Delete a DNSBL entry. */
void
-del_blacklist(const char *host)
+del_dnsbl_entry(const char *host)
{
- struct BlacklistStats *stats = rb_dictionary_retrieve(bl_stats, host);
+ struct DNSBLEntryStats *stats = rb_dictionary_retrieve(dnsbl_stats, host);
if(stats != NULL)
{
- rb_dictionary_delete(bl_stats, host);
+ rb_dictionary_delete(dnsbl_stats, host);
rb_free(stats->host);
rb_free(stats);
}
}
static void
-blacklist_delete(rb_dictionary_element *delem, void *unused)
+dnsbl_delete_elem(rb_dictionary_element *delem, void *unused)
{
- struct BlacklistStats *stats = delem->data;
+ struct DNSBLEntryStats *stats = delem->data;
rb_free(stats->host);
rb_free(stats);
}
-/* Delete all the blacklists */
+/* Delete all the DNSBL entries. */
void
-del_blacklist_all(void)
+del_dnsbl_entry_all(void)
{
- if(bl_stats != NULL)
- rb_dictionary_destroy(bl_stats, blacklist_delete, NULL);
- bl_stats = NULL;
+ if(dnsbl_stats != NULL)
+ rb_dictionary_destroy(dnsbl_stats, dnsbl_delete_elem, NULL);
+ dnsbl_stats = NULL;
rb_helper_write(authd_helper, "O rbl_del_all");
}