diff options
Diffstat (limited to 'src/ipset_tree_ip.c')
-rw-r--r-- | src/ipset_tree_ip.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/ipset_tree_ip.c b/src/ipset_tree_ip.c deleted file mode 100644 index 7f7d842..0000000 --- a/src/ipset_tree_ip.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright 2007-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include <libipset/data.h> /* IPSET_OPT_* */ -#include <libipset/parse.h> /* parser functions */ -#include <libipset/print.h> /* printing functions */ -#include <libipset/types.h> /* prototypes */ - -/* Parse commandline arguments */ -static const struct ipset_arg tree_ip_create_args[] = { - { .name = { "gc", "--gc", NULL }, - .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_GC, - .parse = ipset_parse_uint32, .print = ipset_print_number, - }, - { .name = { "timeout", "--timeout", NULL }, - .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT, - .parse = ipset_parse_uint32, .print = ipset_print_number, - }, - { }, -}; - -static const struct ipset_arg tree_ip_add_args[] = { - { .name = { "timeout", "--timeout", NULL }, - .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT, - .parse = ipset_parse_uint32, .print = ipset_print_number, - }, - { }, -}; - -static const char tree_ip_usage[] = -"create SETNAME tree:ip\n" -" [gc VALUE] [timeout VALUE]\n" -"add SETNAME IP|IP/CIDR|FROM-TO [timeout VALUE]\n" -"del SETNAME IP|IP/CIDR|FROM-TO\n" -"test SETNAME IP\n"; - -struct ipset_type ipset_tree_ip0 = { - .name = "tree:ip", - .alias = "iptree", - .revision = 0, - .family = AF_INET, - .dimension = IPSET_DIM_ONE, - .elem = { - [IPSET_DIM_ONE] = { - .parse = ipset_parse_ip, - .print = ipset_print_ip, - .opt = IPSET_OPT_IP - }, - }, - .args = { - [IPSET_CREATE] = tree_ip_create_args, - [IPSET_ADD] = tree_ip_add_args, - }, - .mandatory = { - [IPSET_CREATE] = 0, - [IPSET_ADD] = IPSET_FLAG(IPSET_OPT_IP), - [IPSET_DEL] = IPSET_FLAG(IPSET_OPT_IP), - [IPSET_TEST] = IPSET_FLAG(IPSET_OPT_IP), - }, - .full = { - [IPSET_CREATE] = IPSET_FLAG(IPSET_OPT_GC) - | IPSET_FLAG(IPSET_OPT_TIMEOUT), - [IPSET_ADD] = IPSET_FLAG(IPSET_OPT_IP) - | IPSET_FLAG(IPSET_OPT_IP_TO) - | IPSET_FLAG(IPSET_OPT_TIMEOUT), - [IPSET_DEL] = IPSET_FLAG(IPSET_OPT_IP) - | IPSET_FLAG(IPSET_OPT_IP_TO), - [IPSET_TEST] = IPSET_FLAG(IPSET_OPT_IP), - }, - - .usage = tree_ip_usage, -}; |