From 280fe2d4eecb2a546087fbf28bb45168f96d8d52 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 21 Sep 2020 20:13:07 +0200 Subject: Expose the initval hash parameter to userspace It makes possible to reproduce exactly the same set after a save/restore. Signed-off-by: Jozsef Kadlecsik --- include/libipset/args.h | 1 + include/libipset/data.h | 1 + include/libipset/linux_ip_set.h | 2 +- include/libipset/print.h | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include/libipset') diff --git a/include/libipset/args.h b/include/libipset/args.h index 93b4456..ef861c1 100644 --- a/include/libipset/args.h +++ b/include/libipset/args.h @@ -57,6 +57,7 @@ enum ipset_keywords { IPSET_ARG_SKBPRIO, /* skbprio */ IPSET_ARG_SKBQUEUE, /* skbqueue */ IPSET_ARG_BUCKETSIZE, /* bucketsize */ + IPSET_ARG_INITVAL, /* initval */ IPSET_ARG_MAX, }; diff --git a/include/libipset/data.h b/include/libipset/data.h index cce6407..0e33c67 100644 --- a/include/libipset/data.h +++ b/include/libipset/data.h @@ -68,6 +68,7 @@ enum ipset_opt { IPSET_OPT_SKBQUEUE, IPSET_OPT_IFACE_WILDCARD, IPSET_OPT_BUCKETSIZE, + IPSET_OPT_INITVAL, /* Internal options */ IPSET_OPT_FLAGS = 48, /* IPSET_FLAG_EXIST| */ IPSET_OPT_CADT_FLAGS, /* IPSET_FLAG_BEFORE| */ diff --git a/include/libipset/linux_ip_set.h b/include/libipset/linux_ip_set.h index e67116f..1852636 100644 --- a/include/libipset/linux_ip_set.h +++ b/include/libipset/linux_ip_set.h @@ -92,7 +92,7 @@ enum { /* Reserve empty slots */ IPSET_ATTR_CADT_MAX = 16, /* Create-only specific attributes */ - IPSET_ATTR_GC, + IPSET_ATTR_INITVAL, /* was unused IPSET_ATTR_GC */ IPSET_ATTR_HASHSIZE, IPSET_ATTR_MAXELEM, IPSET_ATTR_NETMASK, diff --git a/include/libipset/print.h b/include/libipset/print.h index f455259..9443ee1 100644 --- a/include/libipset/print.h +++ b/include/libipset/print.h @@ -35,6 +35,9 @@ extern int ipset_print_ipaddr(char *buf, unsigned int len, extern int ipset_print_number(char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env); +extern int ipset_print_hexnumber(char *buf, unsigned int len, + const struct ipset_data *data, + enum ipset_opt opt, uint8_t env); extern int ipset_print_name(char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env); -- cgit v1.2.3