summaryrefslogtreecommitdiffstats
path: root/ipset_iptree.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipset_iptree.c')
-rw-r--r--ipset_iptree.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/ipset_iptree.c b/ipset_iptree.c
index f2c9a5c..379c113 100644
--- a/ipset_iptree.c
+++ b/ipset_iptree.c
@@ -31,7 +31,8 @@
#define OPT_CREATE_TIMEOUT 0x01U
/* Initialize the create. */
-void create_init(void *data)
+static void
+create_init(void *data)
{
struct ip_set_req_iptree_create *mydata =
(struct ip_set_req_iptree_create *) data;
@@ -41,7 +42,8 @@ void create_init(void *data)
}
/* Function which parses command options; returns true if it ate an option */
-int create_parse(int c, char *argv[], void *data, unsigned *flags)
+static int
+create_parse(int c, char *argv[], void *data, unsigned *flags)
{
struct ip_set_req_iptree_create *mydata =
(struct ip_set_req_iptree_create *) data;
@@ -65,18 +67,20 @@ int create_parse(int c, char *argv[], void *data, unsigned *flags)
}
/* Final check; exit if not ok. */
-void create_final(void *data, unsigned int flags)
+static void
+create_final(void *data, unsigned int flags)
{
}
/* Create commandline options */
-static struct option create_opts[] = {
- {"timeout", 1, 0, '1'},
- {0}
+static const struct option create_opts[] = {
+ {.name = "timeout", .has_arg = required_argument, .val = '1'},
+ {NULL},
};
/* Add, del, test parser */
-ip_set_ip_t adt_parser(unsigned cmd, const char *optarg, void *data)
+static ip_set_ip_t
+adt_parser(unsigned cmd, const char *optarg, void *data)
{
struct ip_set_req_iptree *mydata =
(struct ip_set_req_iptree *) data;
@@ -101,7 +105,8 @@ ip_set_ip_t adt_parser(unsigned cmd, const char *optarg, void *data)
* Print and save
*/
-void initheader(struct set *set, const void *data)
+static void
+initheader(struct set *set, const void *data)
{
struct ip_set_req_iptree_create *header =
(struct ip_set_req_iptree_create *) data;
@@ -111,7 +116,8 @@ void initheader(struct set *set, const void *data)
map->timeout = header->timeout;
}
-void printheader(struct set *set, unsigned options)
+static void
+printheader(struct set *set, unsigned options)
{
struct ip_set_iptree *mysetdata =
(struct ip_set_iptree *) set->settype->header;
@@ -121,7 +127,8 @@ void printheader(struct set *set, unsigned options)
printf("\n");
}
-void printips_sorted(struct set *set, void *data, size_t len, unsigned options)
+static void
+printips_sorted(struct set *set, void *data, size_t len, unsigned options)
{
struct ip_set_iptree *mysetdata =
(struct ip_set_iptree *) set->settype->header;
@@ -139,7 +146,8 @@ void printips_sorted(struct set *set, void *data, size_t len, unsigned options)
}
}
-void saveheader(struct set *set, unsigned options)
+static void
+saveheader(struct set *set, unsigned options)
{
struct ip_set_iptree *mysetdata =
(struct ip_set_iptree *) set->settype->header;
@@ -153,7 +161,8 @@ void saveheader(struct set *set, unsigned options)
set->name, set->settype->typename);
}
-void saveips(struct set *set, void *data, size_t len, unsigned options)
+static void
+saveips(struct set *set, void *data, size_t len, unsigned options)
{
struct ip_set_iptree *mysetdata =
(struct ip_set_iptree *) set->settype->header;
@@ -177,7 +186,7 @@ void saveips(struct set *set, void *data, size_t len, unsigned options)
}
}
-void usage(void)
+static void usage(void)
{
printf
("-N set iptree [--timeout value]\n"