void clearlist(struct ntt * ntt, const char *ip) { char entry[128]; //LOG(LOG_ALERT, "Clearing: %s", ip); snprintf(entry, sizeof(entry), "WHITELIST_%s", ip); ntt_delete(ntt, entry); }
int ntt_destroy(struct ntt *ntt) { struct ntt_node *node, *next; struct ntt_c c; if (ntt == NULL) return -1; node = c_ntt_first(ntt, &c); while(node != NULL) { next = c_ntt_next(ntt, &c); ntt_delete(ntt, node->key); node = next; } free(ntt->tbl); free(ntt); ntt = (struct ntt *) NULL; return 0; }