You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

49 lines
968 B

/* -*- coding: utf-8 -*-
* ----------------------------------------------------------------------
* Copyright © 2009-2012, RedJack, LLC.
* All rights reserved.
*
* Please see the LICENSE.txt file in this distribution for license
* details.
* ----------------------------------------------------------------------
*/
#include <libcork/core.h>
#include "ipset/bdd/nodes.h"
#include "ipset/ipset.h"
void
ipset_init(struct ip_set *set)
{
/* The set starts empty, so every value assignment should yield
* false. */
set->cache = ipset_node_cache_new();
set->set_bdd = ipset_terminal_node_id(false);
}
struct ip_set *
ipset_new(void)
{
struct ip_set *result = cork_new(struct ip_set);
ipset_init(result);
return result;
}
void
ipset_done(struct ip_set *set)
{
ipset_node_decref(set->cache, set->set_bdd);
ipset_node_cache_free(set->cache);
}
void
ipset_free(struct ip_set *set)
{
ipset_done(set);
free(set);
}