From 3fd6b24ace319b139ec3c4e3031a5f05d21e304e Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Tue, 15 Jun 2010 13:30:55 +0200 Subject: ipset 5 in an almost ready state - milestone 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 --- src/ipset_list_set.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/ipset_list_set.c') 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, -- cgit v1.2.3