}
else
opm_check_enable(false);
+
+ /* Configure DNSBLs */
+ rb_dictionary_iter iter;
+ struct DNSBLEntry *entry;
+ RB_DICTIONARY_FOREACH(entry, &iter, dnsbl_stats)
+ {
+ rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", entry->host,
+ entry->iptype, entry->filters, entry->reason);
+ }
}
static void
{
if(client_p->preClient->auth.timeout < rb_current_time())
{
- authd_free_client(client_p);
rb_dlinkAddAlloc(client_p, &freelist);
}
}
RB_DLINK_FOREACH_SAFE(ptr, nptr, freelist.head)
{
client_p = ptr->data;
- rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->auth.cid));
+ authd_abort_client(client_p);
+ rb_dlinkDestroy(ptr, &freelist);
}
}
add_dnsbl_entry(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters)
{
rb_dlink_node *ptr;
- struct DNSBLEntryStats *stats = rb_malloc(sizeof(*stats));
+ struct DNSBLEntry *entry = rb_malloc(sizeof(*entry));
char filterbuf[BUFSIZE] = "*";
size_t s = 0;
if(s)
filterbuf[s - 1] = '\0';
- stats->host = rb_strdup(host);
- stats->iptype = iptype;
- stats->hits = 0;
- rb_dictionary_add(dnsbl_stats, stats->host, stats);
+ entry->host = rb_strdup(host);
+ entry->reason = rb_strdup(reason);
+ entry->filters = rb_strdup(filterbuf);
+ entry->iptype = iptype;
+ entry->hits = 0;
+ rb_dictionary_add(dnsbl_stats, entry->host, entry);
rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", host, iptype, filterbuf, reason);
}
void
del_dnsbl_entry(const char *host)
{
- struct DNSBLEntryStats *stats = rb_dictionary_retrieve(dnsbl_stats, host);
- if(stats != NULL)
+ struct DNSBLEntry *entry = rb_dictionary_retrieve(dnsbl_stats, host);
+
+ if(entry != NULL)
{
- rb_dictionary_delete(dnsbl_stats, host);
- rb_free(stats->host);
- rb_free(stats);
+ rb_dictionary_delete(dnsbl_stats, entry->host);
+ rb_free(entry->host);
+ rb_free(entry->reason);
+ rb_free(entry->filters);
+ rb_free(entry);
}
rb_helper_write(authd_helper, "O rbl_del %s", host);
static void
dnsbl_delete_elem(rb_dictionary_element *delem, void *unused)
{
- struct DNSBLEntryStats *stats = delem->data;
+ struct DNSBLEntry *entry = delem->data;
- rb_free(stats->host);
- rb_free(stats);
+ rb_free(entry->host);
+ rb_free(entry->reason);
+ rb_free(entry->filters);
+ rb_free(entry);
}
/* Delete all the DNSBL entries. */