# as -version-info 2:0:0. This release has a new, but backwards incompatible
# interface.
-LIBVERSION = 1:0:0
+LIBVERSION = 2:0:0
AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \
-I/usr/local/include
extern const char *ipset_typename_resolve(const char *str);
extern bool ipset_match_typename(const char *str,
const struct ipset_type *t);
+extern void ipset_load_types(void);
#endif /* LIBIPSET_TYPES_H */
parse.c \
print.c \
session.c \
- types.c
+ types.c \
+ ipset_bitmap_ip.c \
+ ipset_bitmap_ipmac.c \
+ ipset_bitmap_port.c \
+ ipset_hash_ip.c \
+ ipset_hash_ipport.c \
+ ipset_hash_ipportip.c \
+ ipset_hash_ipportnet.c \
+ ipset_hash_net.c \
+ ipset_hash_netport.c \
+ ipset_hash_netiface.c \
+ ipset_list_set.c
#%.o: %.c
# ${AM_VERBOSE_CC} ${CC} ${AM_DEPFLAGS} ${AM_CFLAGS} ${CFLAGS} -o $@ -c $<
local: *;
};
+
+LIBIPSET_2.0 {
+global:
+ ipset_load_types;
+} LIBIPSET_1.0;
#include <libipset/utils.h> /* STREQ */
#include <libipset/types.h> /* prototypes */
+/* 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;
+
/* Userspace cache of sets which exists in the kernel */
struct ipset {
free(set);
}
}
+
+/**
+ * ipset_load_types - load known set types
+ *
+ * Load in (register) all known set types for the system
+ */
+ void
+ ipset_load_types(void)
+ {
+ if (typelist != NULL)
+ return;
+
+ 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);
+}
+
\ No newline at end of file
include $(top_srcdir)/Make_global.am
sbin_PROGRAMS = ipset
-ipset_SOURCES = ipset.c \
- ipset_bitmap_ip.c \
- ipset_bitmap_ipmac.c \
- ipset_bitmap_port.c \
- ipset_hash_ip.c \
- ipset_hash_ipport.c \
- ipset_hash_ipportip.c \
- ipset_hash_ipportnet.c \
- ipset_hash_net.c \
- ipset_hash_netport.c \
- ipset_hash_netiface.c \
- ipset_list_set.c \
- ui.c
+ipset_SOURCES = ipset.c ui.c
ipset_LDADD = ../lib/libipset.la
AM_LDFLAGS = -static
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,
{
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);