diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2010-06-15 13:30:55 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2010-06-15 13:30:55 +0200 |
commit | 3fd6b24ace319b139ec3c4e3031a5f05d21e304e (patch) | |
tree | e6ac952e95fa44968196149e0172b1ef13e8236f /src/ipset_list_set.c | |
parent | 00bcb2b40450eca4c7ad785bf85b12692e8d29af (diff) |
ipset 5 in an almost ready state - milestonev5.0-pre1
Reworked protocol and internal interfaces, missing set types added,
backward compatibility verified, lots of tests added (and thanks to the tests,
bugs fixed), even the manpage is rewritten ;-). Countless changes everywhere...
The missing bits before announcing ipset 5:
- net namespace support
- new iptables/ip6tables extension library
- iptables/ip6tables match and target tests (backward/forward compatibility)
- tests on catching syntax errors
Diffstat (limited to 'src/ipset_list_set.c')
-rw-r--r-- | src/ipset_list_set.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/ipset_list_set.c b/src/ipset_list_set.c index 11b2523..76cf9b2 100644 --- a/src/ipset_list_set.c +++ b/src/ipset_list_set.c @@ -11,48 +11,59 @@ /* Parse commandline arguments */ static const struct ipset_arg list_set_create_args[] = { - { .name = { "size", "--size", NULL }, - .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_MAXELEM, - .parse = ipset_parse_uint32, .print = ipset_print_ip, + { .name = { "size", NULL }, + .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_SIZE, + .parse = ipset_parse_uint32, .print = ipset_print_number, }, - { .name = { "timeout", "--timeout", NULL }, + { .name = { "timeout", NULL }, .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT, .parse = ipset_parse_uint32, .print = ipset_print_number, }, { }, }; -static const struct ipset_arg list_set_add_args[] = { - { .name = { "timeout", "--timeout", NULL }, +static const struct ipset_arg list_set_adt_args[] = { + { .name = { "timeout", NULL }, .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT, .parse = ipset_parse_uint32, .print = ipset_print_number, }, + { .name = { "before", NULL }, + .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_NAMEREF, + .parse = ipset_parse_before, + }, + { .name = { "after", NULL }, + .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_NAMEREF, + .parse = ipset_parse_after, + }, { }, }; static const char list_set_usage[] = "create SETNAME list:set\n" " [size VALUE] [timeout VALUE]\n" -"add SETNAME NAME[,before|after,NAME] [timeout VALUE]\n" +"add SETNAME NAME [before|after NAME] [timeout VALUE]\n" "del SETNAME NAME\n" "test SETNAME NAME\n"; struct ipset_type ipset_list_set0 = { .name = "list:set", - .alias = "setlist", + .alias = { "setlist", NULL }, .revision = 0, .family = AF_UNSPEC, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE] = { - .parse = ipset_parse_name, + .parse = ipset_parse_setname, .print = ipset_print_name, .opt = IPSET_OPT_NAME }, }, + .compat_parse_elem = ipset_parse_name_compat, .args = { [IPSET_CREATE] = list_set_create_args, - [IPSET_ADD] = list_set_add_args, + [IPSET_ADD] = list_set_adt_args, + [IPSET_DEL] = list_set_adt_args, + [IPSET_TEST] = list_set_adt_args, }, .mandatory = { [IPSET_CREATE] = 0, |