From e57d6caa8ddbe268adea991bcf6e58dc6ca43389 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 5 Jan 2012 21:30:20 +0100 Subject: Set types moved into libipset library The libipset library is complete by this step, and "ipset" just a CLI interface based on the lib. --- src/ipset.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'src/ipset.c') diff --git a/src/ipset.c b/src/ipset.c index e835f06..4a20ca1 100644 --- a/src/ipset.c +++ b/src/ipset.c @@ -33,22 +33,6 @@ static char cmdline[1024]; static char *newargv[255]; static int newargc; -/* The known set types: (typename, revision, family) is unique */ -extern struct ipset_type ipset_bitmap_ip0; -extern struct ipset_type ipset_bitmap_ipmac0; -extern struct ipset_type ipset_bitmap_port0; -extern struct ipset_type ipset_hash_ip0; -extern struct ipset_type ipset_hash_net0; -extern struct ipset_type ipset_hash_net1; -extern struct ipset_type ipset_hash_netport1; -extern struct ipset_type ipset_hash_netport2; -extern struct ipset_type ipset_hash_netiface0; -extern struct ipset_type ipset_hash_ipport1; -extern struct ipset_type ipset_hash_ipportip1; -extern struct ipset_type ipset_hash_ipportnet1; -extern struct ipset_type ipset_hash_ipportnet2; -extern struct ipset_type ipset_list_set0; - enum exittype { NO_PROBLEM = 0, OTHER_PROBLEM, @@ -725,21 +709,8 @@ main(int argc, char *argv[]) { int ret; - /* Register types */ - ipset_type_add(&ipset_bitmap_ip0); - ipset_type_add(&ipset_bitmap_ipmac0); - ipset_type_add(&ipset_bitmap_port0); - ipset_type_add(&ipset_hash_ip0); - ipset_type_add(&ipset_hash_net0); - ipset_type_add(&ipset_hash_net1); - ipset_type_add(&ipset_hash_netport1); - ipset_type_add(&ipset_hash_netport2); - ipset_type_add(&ipset_hash_netiface0); - ipset_type_add(&ipset_hash_ipport1); - ipset_type_add(&ipset_hash_ipportip1); - ipset_type_add(&ipset_hash_ipportnet1); - ipset_type_add(&ipset_hash_ipportnet2); - ipset_type_add(&ipset_list_set0); + /* Load set types */ + ipset_load_types(); /* Initialize session */ session = ipset_session_init(printf); -- cgit v1.2.3