summaryrefslogtreecommitdiffstats
path: root/lib/ipset_hash_ipmark.c
diff options
context:
space:
mode:
authorVytas Dauksa <vytas.dauksa@smoothwall.net>2013-12-17 14:01:44 +0000
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2014-01-23 07:12:51 +0100
commit2dfb973c0dcc6d22113e2370f461f1733035baaf (patch)
treef07f9273a8b91c7ec45e871baf914608b8972033 /lib/ipset_hash_ipmark.c
parent14ea38fca9e40df4f172a573c222591b5f3cc241 (diff)
add markmask for hash:ip,mark data type
Introduce packet mark mask for hash:ip,mark data type. This allows to set mark bit filter for the ip set. Change-Id: Id8dd9ca7e64477c4f7b022a1d9c1a5b187f1c96e Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'lib/ipset_hash_ipmark.c')
-rw-r--r--lib/ipset_hash_ipmark.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ipset_hash_ipmark.c b/lib/ipset_hash_ipmark.c
index 6976371..fdea32f 100644
--- a/lib/ipset_hash_ipmark.c
+++ b/lib/ipset_hash_ipmark.c
@@ -26,6 +26,10 @@ static const struct ipset_arg hash_ipmark_create_args0[] = {
.has_arg = IPSET_NO_ARG, .opt = IPSET_OPT_FAMILY,
.parse = ipset_parse_family,
},
+ { .name = { "markmask", NULL },
+ .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_MARKMASK,
+ .parse = ipset_parse_uint32, .print = ipset_print_number,
+ },
{ .name = { "hashsize", NULL },
.has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_HASHSIZE,
.parse = ipset_parse_uint32, .print = ipset_print_number,
@@ -92,7 +96,7 @@ static const struct ipset_arg hash_ipmark_add_args0[] = {
static const char hash_ipmark_usage0[] =
"create SETNAME hash:ip,mark\n"
-" [family inet|inet6]\n"
+" [family inet|inet6] [markmask VALUE]\n"
" [hashsize VALUE] [maxelem VALUE]\n"
" [timeout VALUE] [counters] [comment]\n"
"add SETNAME IP,MARK [timeout VALUE]\n"
@@ -138,7 +142,8 @@ static struct ipset_type ipset_hash_ipmark0 = {
| IPSET_FLAG(IPSET_OPT_MARK),
},
.full = {
- [IPSET_CREATE] = IPSET_FLAG(IPSET_OPT_HASHSIZE)
+ [IPSET_CREATE] = IPSET_FLAG(IPSET_OPT_MARKMASK)
+ | IPSET_FLAG(IPSET_OPT_HASHSIZE)
| IPSET_FLAG(IPSET_OPT_MAXELEM)
| IPSET_FLAG(IPSET_OPT_TIMEOUT)
| IPSET_FLAG(IPSET_OPT_COUNTERS)