aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipf/ippool
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2021-12-20 17:07:20 +0000
committerCy Schubert <cy@FreeBSD.org>2022-01-04 02:06:42 +0000
commitefeb8bffe34422937c7f8df836afb5b817366d16 (patch)
tree488c0bccb66ed43ceb0c87ec6c6c386f70ab4179 /sbin/ipf/ippool
parent064a5a95649d05ac084bcf2612cbac5575d76358 (diff)
downloadsrc-efeb8bffe34422937c7f8df836afb5b817366d16.tar.gz
src-efeb8bffe34422937c7f8df836afb5b817366d16.zip
ipflter: ANSIfy userland function declarations
Convert ipfilter userland function declarations from K&R to ANSI. This syncs our function declarations with NetBSD hg commit 75edcd7552a0 (apply our changes). Though not copied from NetBSD, this change was partially inspired by NetBSD's work and inspired by style(9). Reviewed by: glebius (for #network) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33595
Diffstat (limited to 'sbin/ipf/ippool')
-rw-r--r--sbin/ipf/ippool/ippool.c61
-rw-r--r--sbin/ipf/ippool/ippool_y.y24
2 files changed, 23 insertions, 62 deletions
diff --git a/sbin/ipf/ippool/ippool.c b/sbin/ipf/ippool/ippool.c
index 98666f9868fd..b339c617c3de 100644
--- a/sbin/ipf/ippool/ippool.c
+++ b/sbin/ipf/ippool/ippool.c
@@ -65,8 +65,7 @@ int nohdrfields = 0;
void
-usage(prog)
- char *prog;
+usage(char *prog)
{
fprintf(stderr, "Usage:\t%s\n", prog);
fprintf(stderr, "\t-a [-dnv] -m <name> [-o <role>] [-t type] [-T ttl] -i <ipaddr>[/netmask]\n");
@@ -82,9 +81,7 @@ usage(prog)
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int err = 1;
@@ -130,9 +127,7 @@ main(argc, argv)
int
-poolnodecommand(remove, argc, argv)
- int remove, argc;
- char *argv[];
+poolnodecommand(int remove, int argc, char *argv[])
{
int err = 0, c, ipset, role, type = IPLT_POOL, ttl = 0;
char *poolname = NULL;
@@ -252,9 +247,7 @@ poolnodecommand(remove, argc, argv)
int
-poolcommand(remove, argc, argv)
- int remove, argc;
- char *argv[];
+poolcommand(int remove, int argc, char *argv[])
{
int type, role, c, err;
char *poolname, *typearg = NULL;
@@ -375,9 +368,7 @@ poolcommand(remove, argc, argv)
int
-loadpoolfile(argc, argv, infile)
- int argc;
- char *argv[], *infile;
+loadpoolfile(int argc, char *argv[], char *infile)
{
int c;
@@ -427,9 +418,7 @@ loadpoolfile(argc, argv, infile)
int
-poolstats(argc, argv)
- int argc;
- char *argv[];
+poolstats(int argc, char *argv[])
{
int c, type, role;
ipf_pool_stat_t plstat;
@@ -544,9 +533,7 @@ poolstats(argc, argv)
int
-poolflush(argc, argv)
- int argc;
- char *argv[];
+poolflush(int argc, char *argv[])
{
int c, role, type, arg;
iplookupflush_t flush;
@@ -617,8 +604,7 @@ poolflush(argc, argv)
int
-getrole(rolename)
- char *rolename;
+getrole(char *rolename)
{
int role;
@@ -649,9 +635,7 @@ getrole(rolename)
int
-gettype(typename, minor)
- char *typename;
- u_int *minor;
+gettype(char *typename, u_int *minor)
{
int type;
@@ -673,9 +657,7 @@ gettype(typename, minor)
int
-poollist(argc, argv)
- int argc;
- char *argv[];
+poollist(int argc, char *argv[])
{
char *kernel, *core, *poolname;
int c, role, type, live_kernel;
@@ -767,9 +749,7 @@ poollist(argc, argv)
void
-poollist_dead(role, poolname, type, kernel, core)
- int role, type;
- char *poolname, *kernel, *core;
+poollist_dead(int role, char *poolname, int type, char *kernel, char *core)
{
iphtable_t *hptr;
ip_pool_t *ptr;
@@ -838,9 +818,7 @@ poollist_dead(role, poolname, type, kernel, core)
void
-poollist_live(role, poolname, type, fd)
- int role, type, fd;
- char *poolname;
+poollist_live(int role, char *poolname, int type, int fd)
{
ipf_pool_stat_t plstat;
iplookupop_t op;
@@ -951,10 +929,7 @@ poollist_live(role, poolname, type, fd)
void
-showpools_live(fd, role, plstp, poolname)
- int fd, role;
- ipf_pool_stat_t *plstp;
- char *poolname;
+showpools_live(int fd, int role, ipf_pool_stat_t *plstp, char *poolname)
{
ipflookupiter_t iter;
ip_pool_t pool;
@@ -990,10 +965,7 @@ showpools_live(fd, role, plstp, poolname)
void
-showhashs_live(fd, role, htstp, poolname)
- int fd, role;
- iphtstat_t *htstp;
- char *poolname;
+showhashs_live(int fd, int role, iphtstat_t *htstp, char *poolname)
{
ipflookupiter_t iter;
iphtable_t table;
@@ -1026,10 +998,7 @@ showhashs_live(fd, role, htstp, poolname)
void
-showdstls_live(fd, role, dlstp, poolname)
- int fd, role;
- ipf_dstl_stat_t *dlstp;
- char *poolname;
+showdstls_live(int fd, int role, ipf_dstl_stat_t *dlstp, char *poolname)
{
ipflookupiter_t iter;
ippool_dst_t table;
diff --git a/sbin/ipf/ippool/ippool_y.y b/sbin/ipf/ippool/ippool_y.y
index 03ee1731f24f..5ec9b6ef0083 100644
--- a/sbin/ipf/ippool/ippool_y.y
+++ b/sbin/ipf/ippool/ippool_y.y
@@ -609,10 +609,8 @@ static wordtab_t yywords[] = {
};
-int ippool_parsefile(fd, filename, iocfunc)
-int fd;
-char *filename;
-ioctlfunc_t iocfunc;
+int
+ippool_parsefile(int fd, char *filename, ioctlfunc_t iocfunc)
{
FILE *fp = NULL;
char *s;
@@ -644,10 +642,8 @@ ioctlfunc_t iocfunc;
}
-int ippool_parsesome(fd, fp, iocfunc)
-int fd;
-FILE *fp;
-ioctlfunc_t iocfunc;
+int
+ippool_parsesome(int fd, FILE *fp, ioctlfunc_t iocfunc)
{
char *s;
int i;
@@ -676,8 +672,7 @@ ioctlfunc_t iocfunc;
static iphtent_t *
-add_htablehosts(url)
-char *url;
+add_htablehosts(char *url)
{
iphtent_t *htop, *hbot, *h;
alist_t *a, *hlist;
@@ -722,8 +717,7 @@ char *url;
static ip_pool_node_t *
-add_poolhosts(url)
-char *url;
+add_poolhosts(char *url)
{
ip_pool_node_t *ptop, *pbot, *p;
alist_t *a, *hlist;
@@ -777,8 +771,7 @@ char *url;
ip_pool_node_t *
-read_whoisfile(file)
- char *file;
+read_whoisfile(char *file)
{
ip_pool_node_t *ntop, *ipn, node, *last;
char line[1024];
@@ -812,8 +805,7 @@ read_whoisfile(file)
static void
-setadflen(afp)
- addrfamily_t *afp;
+setadflen(addrfamily_t *afp)
{
afp->adf_len = offsetof(addrfamily_t, adf_addr);
switch (afp->adf_family)