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
This commit is contained in:
Cy Schubert 2021-12-20 09:07:20 -08:00
parent 064a5a9564
commit efeb8bffe3
155 changed files with 864 additions and 1627 deletions

View File

@ -1983,11 +1983,8 @@ static struct wordtab logwords[] = {
int ipf_parsefile(fd, addfunc, iocfuncs, filename)
int fd;
addfunc_t addfunc;
ioctlfunc_t *iocfuncs;
char *filename;
int
ipf_parsefile(int fd, addfunc_t addfunc, ioctlfunc_t *iocfuncs, char *filename)
{
FILE *fp = NULL;
char *s;
@ -2019,11 +2016,8 @@ char *filename;
}
int ipf_parsesome(fd, addfunc, iocfuncs, fp)
int fd;
addfunc_t addfunc;
ioctlfunc_t *iocfuncs;
FILE *fp;
int
ipf_parsesome(int fd, addfunc_t addfunc, ioctlfunc_t *iocfuncs, FILE *fp)
{
char *s;
int i;
@ -2054,7 +2048,8 @@ FILE *fp;
}
static void newrule()
static void
newrule(void)
{
frentry_t *frn;
@ -2086,7 +2081,8 @@ static void newrule()
}
static void setipftype()
static void
setipftype(void)
{
for (fr = frc; fr != NULL; fr = fr->fr_next) {
if (fr->fr_type == FR_T_NONE) {
@ -2111,7 +2107,8 @@ static void setipftype()
}
static frentry_t *addrule()
static frentry_t *
addrule(void)
{
frentry_t *f, *f1, *f2;
int count;
@ -2141,9 +2138,7 @@ static frentry_t *addrule()
static int
lookuphost(name, addrp)
char *name;
i6addr_t *addrp;
lookuphost(char *name, i6addr_t *addrp)
{
int i;
@ -2169,9 +2164,8 @@ lookuphost(name, addrp)
}
static void dobpf(v, phrase)
int v;
char *phrase;
static void
dobpf(int v, char *phrase)
{
#ifdef IPFILTER_BPF
struct bpf_program bpf;
@ -2264,7 +2258,8 @@ char *phrase;
}
static void resetaddr()
static void
resetaddr(void)
{
hashed = 0;
pooled = 0;
@ -2272,8 +2267,8 @@ static void resetaddr()
}
static alist_t *newalist(ptr)
alist_t *ptr;
static alist_t *
newalist(alist_t *ptr)
{
alist_t *al;
@ -2287,8 +2282,7 @@ alist_t *ptr;
static int
makepool(list)
alist_t *list;
makepool(alist_t *list)
{
ip_pool_node_t *n, *top;
ip_pool_t pool;
@ -2344,8 +2338,8 @@ makepool(list)
}
static u_int makehash(list)
alist_t *list;
static u_int
makehash(alist_t *list)
{
iphtent_t *n, *top;
iphtable_t iph;
@ -2393,10 +2387,8 @@ alist_t *list;
}
int ipf_addrule(fd, ioctlfunc, ptr)
int fd;
ioctlfunc_t ioctlfunc;
void *ptr;
int
ipf_addrule(int fd, ioctlfunc_t ioctlfunc, void *ptr)
{
ioctlcmd_t add, del;
frentry_t *fr;
@ -2487,22 +2479,24 @@ void *ptr;
return 0;
}
static void setsyslog()
static void
setsyslog(void)
{
yysetdict(logwords);
yybreakondot = 1;
}
static void unsetsyslog()
static void
unsetsyslog(void)
{
yyresetdict();
yybreakondot = 0;
}
static void fillgroup(fr)
frentry_t *fr;
static void
fillgroup(frentry_t *fr)
{
frentry_t *f;
@ -2544,8 +2538,8 @@ frentry_t *fr;
}
static void doipfexpr(line)
char *line;
static void
doipfexpr(char *line)
{
int *array;
char *error;
@ -2563,9 +2557,8 @@ char *line;
}
static void do_tuneint(varname, value)
char *varname;
int value;
static void
do_tuneint(char *varname, int value)
{
char buffer[80];
@ -2577,8 +2570,8 @@ int value;
}
static void do_tunestr(varname, value)
char *varname, *value;
static void
do_tunestr(char *varname, char *value)
{
if (!strcasecmp(value, "true")) {
@ -2591,10 +2584,8 @@ char *varname, *value;
}
static void setifname(frp, idx, name)
frentry_t **frp;
int idx;
char *name;
static void
setifname(frentry_t **frp, int idx, char *name)
{
int pos;
@ -2605,9 +2596,8 @@ char *name;
}
static int addname(frp, name)
frentry_t **frp;
char *name;
static int
addname(frentry_t **frp, char *name)
{
frentry_t *f;
int nlen;
@ -2631,7 +2621,8 @@ char *name;
}
static frentry_t *allocfr()
static frentry_t *
allocfr(void)
{
frentry_t *fr;
@ -2654,9 +2645,8 @@ static frentry_t *allocfr()
}
static void setgroup(frp, name)
frentry_t **frp;
char *name;
static void
setgroup(frentry_t **frp, char *name)
{
int pos;
@ -2667,9 +2657,8 @@ char *name;
}
static void setgrhead(frp, name)
frentry_t **frp;
char *name;
static void
setgrhead(frentry_t **frp, char *name)
{
int pos;
@ -2680,9 +2669,8 @@ char *name;
}
static void seticmphead(frp, name)
frentry_t **frp;
char *name;
static void
seticmphead(frentry_t **frp, char *name)
{
int pos;
@ -2694,9 +2682,7 @@ char *name;
static void
build_dstaddr_af(fp, ptr)
frentry_t *fp;
void *ptr;
build_dstaddr_af(frentry_t *fp, void *ptr)
{
struct ipp_s *ipp = ptr;
frentry_t *f = fp;
@ -2725,9 +2711,7 @@ build_dstaddr_af(fp, ptr)
static void
build_srcaddr_af(fp, ptr)
frentry_t *fp;
void *ptr;
build_srcaddr_af(frentry_t *fp, void *ptr)
{
struct ipp_s *ipp = ptr;
frentry_t *f = fp;

View File

@ -60,8 +60,8 @@ static char *yytexttostr(int, int);
static void yystrtotext(char *);
static char *yytexttochar(void);
static int yygetc(docont)
int docont;
static int
yygetc(int docont)
{
int c;
@ -98,8 +98,8 @@ static int yygetc(docont)
}
static void yyunputc(c)
int c;
static void
yyunputc(int c)
{
if (c == '\n')
yylineNum--;
@ -107,8 +107,8 @@ static void yyunputc(c)
}
static int yyswallow(last)
int last;
static int
yyswallow(int last)
{
int c;
@ -123,7 +123,8 @@ static int yyswallow(last)
}
static char *yytexttochar()
static char *
yytexttochar(void)
{
int i;
@ -134,8 +135,8 @@ static char *yytexttochar()
}
static void yystrtotext(str)
char *str;
static void
yystrtotext(char *str)
{
int len;
char *s;
@ -150,8 +151,8 @@ static void yystrtotext(str)
}
static char *yytexttostr(offset, max)
int offset, max;
static char *
yytexttostr(int offset, int max)
{
char *str;
int i;
@ -174,7 +175,8 @@ static char *yytexttostr(offset, max)
}
int yylex()
int
yylex(void)
{
static int prior = 0;
static int priornum = 0;
@ -616,8 +618,8 @@ static wordtab_t *yyfindkey(key)
}
char *yykeytostr(num)
int num;
char *
yykeytostr(int num)
{
wordtab_t *w;
@ -631,8 +633,8 @@ char *yykeytostr(num)
}
wordtab_t *yysettab(words)
wordtab_t *words;
wordtab_t *
yysettab(wordtab_t *words)
{
wordtab_t *save;
@ -642,8 +644,8 @@ wordtab_t *yysettab(words)
}
void yyerror(msg)
char *msg;
void
yyerror(char *msg)
{
char *txt, letter[2];
int freetxt = 0;
@ -669,8 +671,8 @@ void yyerror(msg)
}
void yysetfixeddict(newdict)
wordtab_t *newdict;
void
yysetfixeddict(wordtab_t *newdict)
{
if (yydebug)
printf("yysetfixeddict(%lx)\n", (u_long)newdict);
@ -688,8 +690,8 @@ void yysetfixeddict(newdict)
}
void yysetdict(newdict)
wordtab_t *newdict;
void
yysetdict(wordtab_t *newdict)
{
if (yydebug)
printf("yysetdict(%lx)\n", (u_long)newdict);
@ -705,7 +707,8 @@ void yysetdict(newdict)
printf("yysavedepth++ => %d\n", yysavedepth);
}
void yyresetdict()
void
yyresetdict(void)
{
if (yydebug)
printf("yyresetdict(%d)\n", yysavedepth);
@ -720,9 +723,8 @@ void yyresetdict()
#ifdef TEST_LEXER
int main(argc, argv)
int argc;
char *argv[];
int
main(int argc, char *argv[])
{
int n;

View File

@ -66,9 +66,8 @@ static void usage()
}
int main(argc,argv)
int argc;
char *argv[];
int
main(int argc, char *argv[])
{
int c, *filter = NULL;
@ -171,9 +170,8 @@ int main(argc,argv)
}
static int opendevice(ipfdev, check)
char *ipfdev;
int check;
static int
opendevice(char *ipfdev, int check)
{
if (opts & OPT_DONOTHING)
return -2;
@ -194,14 +192,16 @@ static int opendevice(ipfdev, check)
}
static void closedevice()
static void
closedevice(void)
{
close(fd);
fd = -1;
}
static int get_flags()
static int
get_flags(void)
{
int i = 0;
@ -214,8 +214,8 @@ static int get_flags()
}
static void set_state(enable)
u_int enable;
static void
set_state(u_int enable)
{
if (opendevice(ipfname, 0) != -2) {
if (ioctl(fd, SIOCFRENB, &enable) == -1) {
@ -231,8 +231,8 @@ static void set_state(enable)
}
static void procfile(file)
char *file;
static void
procfile(char *file)
{
(void) opendevice(ipfname, 1);
@ -248,10 +248,8 @@ static void procfile(file)
}
static int ipf_interceptadd(fd, ioctlfunc, ptr)
int fd;
ioctlfunc_t ioctlfunc;
void *ptr;
static int
ipf_interceptadd(int fd, ioctlfunc_t ioctlfunc, void *ptr)
{
if (outputc)
printc(ptr);
@ -262,8 +260,8 @@ static int ipf_interceptadd(fd, ioctlfunc, ptr)
}
static void packetlogon(opt)
char *opt;
static void
packetlogon(char *opt)
{
int flag, xfd, logopt, change = 0;
@ -346,9 +344,8 @@ static void packetlogon(opt)
}
static void flushfilter(arg, filter)
char *arg;
int *filter;
static void
flushfilter(char *arg, int *filter)
{
int fl = 0, rem;
@ -441,7 +438,8 @@ static void flushfilter(arg, filter)
}
static void swapactive()
static void
swapactive(void)
{
int in = 2;
@ -452,7 +450,8 @@ static void swapactive()
}
void ipf_frsync()
void
ipf_frsync(void)
{
int frsyn = 0;
@ -463,7 +462,8 @@ void ipf_frsync()
}
void zerostats()
void
zerostats(void)
{
ipfobj_t obj;
friostat_t fio;
@ -488,8 +488,8 @@ void zerostats()
/*
* read the kernel stats for packets blocked and passed
*/
static void showstats(fp)
friostat_t *fp;
static void
showstats(friostat_t *fp)
{
printf("bad packets:\t\tin %lu\tout %lu\n",
fp->f_st[0].fr_bad, fp->f_st[1].fr_bad);
@ -508,7 +508,8 @@ static void showstats(fp)
}
static int showversion()
static int
showversion(void)
{
struct friostat fio;
ipfobj_t ipfo;

View File

@ -62,8 +62,8 @@ static FILE *cfile = NULL;
* This is called once per filter rule being loaded to emit data structures
* required.
*/
void printc(fr)
frentry_t *fr;
void
printc(frentry_t *fr)
{
u_long *ulp;
char *and;
@ -162,9 +162,8 @@ void printc(fr)
static frgroup_t *groups = NULL;
static void addrule(fp, fr)
FILE *fp;
frentry_t *fr;
static void
addrule(FILE *fp, frentry_t *fr)
{
frentry_t *f, **fpp;
frgroup_t *g;
@ -243,8 +242,8 @@ static u_long ipf%s_rule_data_%s_%u[] = {\n",
}
int intcmp(c1, c2)
const void *c1, *c2;
int
intcmp(const void *c1, const void *c2)
{
const mc_t *i1 = (const mc_t *)c1, *i2 = (const mc_t *)c2;
@ -255,18 +254,15 @@ int intcmp(c1, c2)
}
static void indent(fp, in)
FILE *fp;
int in;
static void
indent(FILE *fp, int in)
{
for (; in; in--)
fputc('\t', fp);
}
static void printeq(fp, var, m, max, v)
FILE *fp;
char *var;
int m, max, v;
static void
printeq(FILE *fp, char *var, int m, int max, int v)
{
if (m == max)
fprintf(fp, "%s == %#x) {\n", var, v);
@ -280,10 +276,8 @@ static void printeq(fp, var, m, max, v)
* m - netmask
* v - required address
*/
static void printipeq(fp, var, fl, m, v)
FILE *fp;
char *var;
int fl, m, v;
static void
printipeq(FILE *fp, char *var, int fl, int m, int v)
{
if (m == 0xffffffff)
fprintf(fp, "%s ", var);
@ -294,10 +288,8 @@ static void printipeq(fp, var, fl, m, v)
}
void emit(num, dir, v, fr)
int num, dir;
void *v;
frentry_t *fr;
void
emit(int num, int dir, void *v, frentry_t *fr)
{
u_int incnt, outcnt;
frgroup_t *g;
@ -346,9 +338,8 @@ void emit(num, dir, v, fr)
}
static void emitheader(grp, incount, outcount)
frgroup_t *grp;
u_int incount, outcount;
static void
emitheader(frgroup_t *grp, u_int incount, u_int outcount)
{
static FILE *fph = NULL;
frgroup_t *g;
@ -401,7 +392,8 @@ extern int ipfrule_remove_out_%s(void));\n",
}
}
static void emittail()
static void
emittail(void)
{
frgroup_t *g;
@ -438,12 +430,9 @@ int ipfrule_remove()\n\
}
static void emitGroup(num, dir, v, fr, group, incount, outcount)
int num, dir;
void *v;
frentry_t *fr;
char *group;
u_int incount, outcount;
static void
emitGroup(int num, int dir, void *v, frentry_t *fr, char *group,
u_int incount, u_int outcount)
{
static FILE *fp = NULL;
static int header[2] = { 0, 0 };
@ -956,8 +945,8 @@ static void emitGroup(num, dir, v, fr, group, incount, outcount)
}
void printC(dir)
int dir;
void
printC(int dir)
{
static mc_t *m = NULL;
frgroup_t *g;
@ -979,11 +968,8 @@ void printC(dir)
/*
* Now print out code to implement all of the rules.
*/
static void printCgroup(dir, top, m, group)
int dir;
frentry_t *top;
mc_t *m;
char *group;
static void
printCgroup(int dir, frentry_t *top, mc_t *m, char *group)
{
frentry_t *fr, *fr1;
int i, n, rn;
@ -1229,11 +1215,8 @@ static void printCgroup(dir, top, m, group)
}
}
static void printhooks(fp, in, out, grp)
FILE *fp;
int in;
int out;
frgroup_t *grp;
static void
printhooks(FILE *fp, int in, int out, frgroup_t *grp)
{
frentry_t *fr;
char *group;

View File

@ -87,8 +87,7 @@ void usage()
/*
* Change interface names in state information saved out to disk.
*/
int changestateif(ifs, fname)
char *ifs, *fname;
int changestateif(char *ifs, char *fname)
{
int fd, olen, nlen, rw;
ipstate_save_t ips;
@ -150,8 +149,7 @@ int changestateif(ifs, fname)
/*
* Change interface names in NAT information saved out to disk.
*/
int changenatif(ifs, fname)
char *ifs, *fname;
int changenatif(char *ifs, char *fname)
{
int fd, olen, nlen, rw;
nat_save_t ipn;
@ -204,9 +202,7 @@ int changenatif(ifs, fname)
}
int main(argc,argv)
int argc;
char *argv[];
int main(int argc, char *argv[])
{
int c, lock = -1, devfd = -1, err = 0, rw = -1, ns = -1, set = 0;
char *dirname = NULL, *filename = NULL, *ifs = NULL;
@ -335,8 +331,7 @@ int main(argc,argv)
}
int opendevice(ipfdev)
char *ipfdev;
int opendevice(char *ipfdev)
{
int fd = -1;
@ -353,15 +348,13 @@ int opendevice(ipfdev)
}
void closedevice(fd)
int fd;
void closedevice(int fd)
{
close(fd);
}
int setlock(fd, lock)
int fd, lock;
int setlock(int fd, int lock)
{
if (opts & OPT_VERBOSE)
printf("Turn lock %s\n", lock ? "on" : "off");
@ -377,9 +370,7 @@ int setlock(fd, lock)
}
int writestate(fd, file)
int fd;
char *file;
int writestate(int fd, char *file)
{
ipstate_save_t ips, *ipsp;
ipfobj_t obj;
@ -429,9 +420,7 @@ int writestate(fd, file)
}
int readstate(fd, file)
int fd;
char *file;
int readstate(int fd, char *file)
{
ipstate_save_t ips, *is, *ipshead = NULL, *is1, *ipstail = NULL;
int sfd = -1, i;
@ -546,9 +535,7 @@ int readstate(fd, file)
}
int readnat(fd, file)
int fd;
char *file;
int readnat(int fd, char *file)
{
nat_save_t ipn, *in, *ipnhead = NULL, *in1, *ipntail = NULL;
ipfobj_t obj;
@ -693,9 +680,7 @@ int readnat(fd, file)
}
int writenat(fd, file)
int fd;
char *file;
int writenat(int fd, char *file)
{
nat_save_t *ipnp = NULL, *next = NULL;
ipfobj_t obj;
@ -777,8 +762,7 @@ int writenat(fd, file)
}
int writeall(dirname)
char *dirname;
int writeall(char *dirname)
{
int fd, devfd;
@ -828,8 +812,7 @@ int writeall(dirname)
}
int readall(dirname)
char *dirname;
int readall(char *dirname)
{
int fd, devfd;

View File

@ -183,9 +183,7 @@ static void usage(name)
}
int main(argc,argv)
int argc;
char *argv[];
int main(int argc, char *argv[])
{
ipf_authstat_t frauthst;
ipf_authstat_t *frauthstp = &frauthst;
@ -453,13 +451,9 @@ int main(argc,argv)
* Fill in the stats structures from the live kernel, using a combination
* of ioctl's and copying directly from kernel memory.
*/
static void ipfstate_live(device, fiopp, ipsstpp, ifrstpp, frauthstpp, frfp)
char *device;
friostat_t **fiopp;
ips_stat_t **ipsstpp;
ipfrstat_t **ifrstpp;
ipf_authstat_t **frauthstpp;
u_32_t *frfp;
static void ipfstate_live(char *device, friostat_t **fiopp,
ips_stat_t **ipsstpp, ipfrstat_t **ifrstpp,
ipf_authstat_t **frauthstpp, u_32_t *frfp)
{
ipfobj_t ipfo;
@ -538,13 +532,9 @@ static void ipfstate_live(device, fiopp, ipsstpp, ifrstpp, frauthstpp, frfp)
* This is mainly useful when looking at data in crash dumps and ioctl's
* just won't work any more.
*/
static void ipfstate_dead(kernel, fiopp, ipsstpp, ifrstpp, frauthstpp, frfp)
char *kernel;
friostat_t **fiopp;
ips_stat_t **ipsstpp;
ipfrstat_t **ifrstpp;
ipf_authstat_t **frauthstpp;
u_32_t *frfp;
static void ipfstate_dead( char *kernel, friostat_t **fiopp,
ips_stat_t **ipsstpp, ipfrstat_t **ifrstpp,
ipf_authstat_t **frauthstpp, u_32_t *frfp)
{
static ipf_authstat_t frauthst, *frauthstp;
static ipftq_t ipstcptab[IPF_TCP_NSTATES];
@ -710,9 +700,7 @@ static void ipfstate_dead(kernel, fiopp, ipsstpp, ifrstpp, frauthstpp, frfp)
}
static void printside(side, frs)
char *side;
ipf_statistics_t *frs;
static void printside(char *side, ipf_statistics_t *frs)
{
int i;
@ -748,9 +736,7 @@ static void printside(side, frs)
* Display the kernel stats for packets blocked and passed and other
* associated running totals which are kept.
*/
static void showstats(fp, frf)
struct friostat *fp;
u_32_t frf;
static void showstats( struct friostat *fp, u_32_t frf)
{
printside("input", &fp->f_st[0]);
printside("output", &fp->f_st[1]);
@ -781,11 +767,8 @@ static void showstats(fp, frf)
* Print out a list of rules from the kernel, starting at the one passed.
*/
static int
printlivelist(fiop, out, set, fp, group, comment)
struct friostat *fiop;
int out, set;
frentry_t *fp;
char *group, *comment;
printlivelist( struct friostat *fiop, int out, int set, frentry_t *fp,
char *group, char *comment)
{
struct frentry fb;
ipfruleiter_t rule;
@ -912,11 +895,8 @@ printlivelist(fiop, out, set, fp, group, comment)
}
static void printdeadlist(fiop, out, set, fp, group, comment)
friostat_t *fiop;
int out, set;
frentry_t *fp;
char *group, *comment;
static void printdeadlist(friostat_t *fiop, int out, int set, frentry_t *fp,
char *group, char *comment)
{
frgroup_t *grtop, *grtail, *g;
struct frentry fb;
@ -1022,8 +1002,7 @@ static void printdeadlist(fiop, out, set, fp, group, comment)
* print out all of the asked for rule sets, using the stats struct as
* the base from which to get the pointers.
*/
static void showlist(fiop)
struct friostat *fiop;
static void showlist(struct friostat *fiop)
{
struct frentry *fp = NULL;
int i, set;
@ -1082,9 +1061,7 @@ static void showlist(fiop)
/*
* Display ipfilter stateful filtering information
*/
static void showipstates(ipsp, filter)
ips_stat_t *ipsp;
int *filter;
static void showipstates(ips_stat_t *ipsp, int *filter)
{
ipstate_t *is;
int i;
@ -1136,8 +1113,7 @@ static void showipstates(ipsp, filter)
}
static void showstatestats(ipsp)
ips_stat_t *ipsp;
static void showstatestats(ips_stat_t *ipsp)
{
int minlen, maxlen, totallen;
ipftable_t table;
@ -1301,17 +1277,8 @@ static void showstatestats(ipsp)
#ifdef STATETOP
static int handle_resize = 0, handle_break = 0;
static void topipstates(saddr, daddr, sport, dport, protocol, ver,
refreshtime, topclosed, filter)
i6addr_t saddr;
i6addr_t daddr;
int sport;
int dport;
int protocol;
int ver;
int refreshtime;
int topclosed;
int *filter;
static void topipstates(i6addr_t saddr, i6addr_t daddr, int sport, int dport,
int protocol, int ver, int refreshtime, int topclosed, int *filter)
{
char str1[STSTRSIZE], str2[STSTRSIZE], str3[STSTRSIZE], str4[STSTRSIZE];
int maxtsentries = 0, reverse = 0, sorting = STSORT_DEFAULT;
@ -1747,9 +1714,7 @@ static void topipstates(saddr, daddr, sport, dport, protocol, ver,
/*
* Show fragment cache information that's held in the kernel.
*/
static void showfrstates(ifsp, ticks)
ipfrstat_t *ifsp;
u_long ticks;
static void showfrstates(ipfrstat_t *ifsp, u_long ticks)
{
struct ipfr *ipfrtab[IPFT_SIZE], ifr;
int i;
@ -1829,8 +1794,7 @@ static void showfrstates(ifsp, ticks)
/*
* Show stats on how auth within IPFilter has been used
*/
static void showauthstates(asp)
ipf_authstat_t *asp;
static void showauthstates(ipf_authstat_t *asp)
{
frauthent_t *frap, fra;
ipfgeniter_t auth;
@ -1880,8 +1844,7 @@ static void showauthstates(asp)
* Display groups used for each of filter rules, accounting rules and
* authentication, separately.
*/
static void showgroups(fiop)
struct friostat *fiop;
static void showgroups(struct friostat *fiop)
{
static char *gnames[3] = { "Filter", "Accounting", "Authentication" };
static int gnums[3] = { IPL_LOGIPF, IPL_LOGCOUNT, IPL_LOGAUTH };
@ -1910,10 +1873,7 @@ static void showgroups(fiop)
}
static void parse_ipportstr(argument, ip, port)
const char *argument;
i6addr_t *ip;
int *port;
static void parse_ipportstr(const char *argument, i6addr_t *ip, int *port)
{
char *s, *comma;
int ok = 0;
@ -1964,21 +1924,17 @@ static void parse_ipportstr(argument, ip, port)
#ifdef STATETOP
static void sig_resize(s)
int s;
static void sig_resize(int s)
{
handle_resize = 1;
}
static void sig_break(s)
int s;
static void sig_break(int s)
{
handle_break = 1;
}
static char *getip(v, addr)
int v;
i6addr_t *addr;
static char *getip(int v, i6addr_t *addr)
{
#ifdef USE_INET6
static char hostbuf[MAXHOSTNAMELEN+1];
@ -2000,8 +1956,7 @@ static char *getip(v, addr)
}
static char *ttl_to_string(ttl)
long int ttl;
static char *ttl_to_string(long int ttl)
{
static char ttlbuf[STSTRSIZE];
int hours, minutes, seconds;
@ -2022,9 +1977,7 @@ static char *ttl_to_string(ttl)
}
static int sort_pkts(a, b)
const void *a;
const void *b;
static int sort_pkts(const void *a, const void *b)
{
register const statetop_t *ap = a;
@ -2038,9 +1991,7 @@ static int sort_pkts(a, b)
}
static int sort_bytes(a, b)
const void *a;
const void *b;
static int sort_bytes(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2053,9 +2004,7 @@ static int sort_bytes(a, b)
}
static int sort_p(a, b)
const void *a;
const void *b;
static int sort_p(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2068,9 +2017,7 @@ static int sort_p(a, b)
}
static int sort_ttl(a, b)
const void *a;
const void *b;
static int sort_ttl(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2082,9 +2029,7 @@ static int sort_ttl(a, b)
return -1;
}
static int sort_srcip(a, b)
const void *a;
const void *b;
static int sort_srcip(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2108,9 +2053,7 @@ static int sort_srcip(a, b)
return -1;
}
static int sort_srcpt(a, b)
const void *a;
const void *b;
static int sort_srcpt(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2122,9 +2065,7 @@ static int sort_srcpt(a, b)
return -1;
}
static int sort_dstip(a, b)
const void *a;
const void *b;
static int sort_dstip(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2148,9 +2089,7 @@ static int sort_dstip(a, b)
return -1;
}
static int sort_dstpt(a, b)
const void *a;
const void *b;
static int sort_dstpt(const void *a, const void *b)
{
register const statetop_t *ap = a;
register const statetop_t *bp = b;
@ -2165,8 +2104,7 @@ static int sort_dstpt(a, b)
#endif
ipstate_t *fetchstate(src, dst)
ipstate_t *src, *dst;
ipstate_t *fetchstate(ipstate_t *src, ipstate_t *dst)
{
if (live_kernel == 1) {
@ -2196,9 +2134,7 @@ ipstate_t *fetchstate(src, dst)
}
static int fetchfrag(fd, type, frp)
int fd, type;
ipfr_t *frp;
static int fetchfrag( int fd, int type, ipfr_t *frp)
{
ipfgeniter_t frag;
ipfobj_t obj;
@ -2218,9 +2154,7 @@ static int fetchfrag(fd, type, frp)
}
static int state_matcharray(stp, array)
ipstate_t *stp;
int *array;
static int state_matcharray(ipstate_t *stp, int *array)
{
int i, n, *x, rv, p;
ipfexp_t *e;
@ -2365,8 +2299,7 @@ static int state_matcharray(stp, array)
}
static void showtqtable_live(fd)
int fd;
static void showtqtable_live(int fd)
{
ipftq_t table[IPF_TCP_NSTATES];
ipfobj_t obj;

View File

@ -63,9 +63,7 @@ static ipf_main_softc_t *softc = NULL;
int
main(argc,argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
char *datain, *iface, *ifname, *logout;
int fd, i, dir, c, loaded, dump, hlen;
@ -354,7 +352,8 @@ int ipftestioctl(int dev, ioctlcmd_t cmd, ...)
}
int ipnattestioctl(int dev, ioctlcmd_t cmd, ...)
int
ipnattestioctl(int dev, ioctlcmd_t cmd, ...)
{
caddr_t data;
va_list ap;
@ -377,7 +376,8 @@ int ipnattestioctl(int dev, ioctlcmd_t cmd, ...)
}
int ipstatetestioctl(int dev, ioctlcmd_t cmd, ...)
int
ipstatetestioctl(int dev, ioctlcmd_t cmd, ...)
{
caddr_t data;
va_list ap;
@ -400,7 +400,8 @@ int ipstatetestioctl(int dev, ioctlcmd_t cmd, ...)
}
int ipauthtestioctl(int dev, ioctlcmd_t cmd, ...)
int
ipauthtestioctl(int dev, ioctlcmd_t cmd, ...)
{
caddr_t data;
va_list ap;
@ -423,7 +424,8 @@ int ipauthtestioctl(int dev, ioctlcmd_t cmd, ...)
}
int ipscantestioctl(int dev, ioctlcmd_t cmd, ...)
int
ipscantestioctl(int dev, ioctlcmd_t cmd, ...)
{
caddr_t data;
va_list ap;
@ -446,7 +448,8 @@ int ipscantestioctl(int dev, ioctlcmd_t cmd, ...)
}
int ipsynctestioctl(int dev, ioctlcmd_t cmd, ...)
int
ipsynctestioctl(int dev, ioctlcmd_t cmd, ...)
{
caddr_t data;
va_list ap;
@ -469,7 +472,8 @@ int ipsynctestioctl(int dev, ioctlcmd_t cmd, ...)
}
int ipooltestioctl(int dev, ioctlcmd_t cmd, ...)
int
ipooltestioctl(int dev, ioctlcmd_t cmd, ...)
{
caddr_t data;
va_list ap;
@ -492,20 +496,16 @@ int ipooltestioctl(int dev, ioctlcmd_t cmd, ...)
}
int kmemcpy(addr, offset, size)
char *addr;
long offset;
int size;
int
kmemcpy(char *addr, long offset, int size)
{
bcopy((char *)offset, addr, size);
return 0;
}
int kstrncpy(buf, pos, n)
char *buf;
long pos;
int n;
int
kstrncpy(char *buf, long pos, int n)
{
char *ptr;
@ -520,8 +520,8 @@ int kstrncpy(buf, pos, n)
/*
* Display the built up NAT table rules and mapping entries.
*/
void dumpnat(arg)
void *arg;
void
dumpnat(void *arg)
{
ipf_nat_softc_t *softn = arg;
hostmap_t *hm;
@ -544,8 +544,8 @@ void dumpnat(arg)
}
void dumpgroups(softc)
ipf_main_softc_t *softc;
void
dumpgroups(ipf_main_softc_t *softc)
{
frgroup_t *fg;
int i;
@ -587,8 +587,8 @@ void dumpgroups(softc)
dumprules(softc->ipf_acct[1][1]);
}
void dumprules(rulehead)
frentry_t *rulehead;
void
dumprules(frentry_t *rulehead)
{
frentry_t *fr;
@ -603,8 +603,8 @@ void dumprules(rulehead)
}
void drain_log(filename)
char *filename;
void
drain_log(char *filename)
{
char buffer[DEFAULT_IPFLOGSIZE];
struct iovec iov;
@ -645,9 +645,8 @@ void drain_log(filename)
}
void fixv4sums(m, ip)
mb_t *m;
ip_t *ip;
void
fixv4sums(mb_t *m, ip_t *ip)
{
u_char *csump, *hdr, p;
fr_info_t tmp;

View File

@ -105,8 +105,7 @@ static unsigned char PADDING[64] = {
/* The routine MD5Init initializes the message-digest context
mdContext. All fields are set to zero.
*/
void MD5Init (mdContext)
MD5_CTX *mdContext;
void MD5Init (MD5_CTX *mdContext)
{
mdContext->i[0] = mdContext->i[1] = (UINT4)0;
@ -122,10 +121,7 @@ MD5_CTX *mdContext;
account for the presence of each of the characters inBuf[0..inLen-1]
in the message whose digest is being computed.
*/
void MD5Update (mdContext, inBuf, inLen)
MD5_CTX *mdContext;
unsigned char *inBuf;
unsigned int inLen;
void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen)
{
UINT4 in[16];
int mdi;
@ -160,9 +156,7 @@ unsigned int inLen;
/* The routine MD5Final terminates the message-digest computation and
ends with the desired message digest in mdContext->digest[0...15].
*/
void MD5Final (hash, mdContext)
unsigned char hash[];
MD5_CTX *mdContext;
void MD5Final (unsigned char hash[], MD5_CTX *mdContext)
{
UINT4 in[16];
int mdi;
@ -203,9 +197,7 @@ MD5_CTX *mdContext;
/* Basic MD5 step. Transforms buf based on in.
*/
static void Transform (buf, in)
UINT4 *buf;
UINT4 *in;
static void Transform (UINT4 *buf, UINT4 *in)
{
UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];

View File

@ -185,7 +185,7 @@ char *msg;
}
void push_proto()
void push_proto(void)
{
numpr++;
if (!prstack)
@ -197,7 +197,7 @@ void push_proto()
}
void pop_proto()
void pop_proto(void)
{
numpr--;
ipproto = prstack[numpr];
@ -210,7 +210,7 @@ void pop_proto()
}
int save_token()
int save_token(void)
{
yylval.str = strdup((char *)yytext);
@ -218,8 +218,7 @@ int save_token()
}
int next_item(nstate)
int nstate;
int next_item(int nstate)
{
struct lwordtab *wt;
@ -244,8 +243,7 @@ int nstate;
}
int next_state(nstate, fornext)
int nstate, fornext;
int next_state(int nstate, int fornext)
{
next = fornext;
@ -304,7 +302,7 @@ int nstate, fornext;
}
void swallow()
void swallow(void)
{
int c;

View File

@ -615,9 +615,7 @@ char *pr, *name;
}
struct ether_addr *geteaddr(arg, buf)
char *arg;
struct ether_addr *buf;
struct ether_addr *geteaddr(char *arg, struct ether_addr *buf)
{
struct ether_addr *e;
@ -635,8 +633,7 @@ struct ether_addr *buf;
}
void *new_header(type)
int type;
void *new_header(int type)
{
aniphdr_t *aip, *oip = canip;
int sz = 0;
@ -676,7 +673,7 @@ int type;
}
void free_aniplist()
void free_aniplist(void)
{
aniphdr_t *aip, **aipp = &aniphead;
@ -688,8 +685,7 @@ void free_aniplist()
}
void inc_anipheaders(inc)
int inc;
void inc_anipheaders(int inc)
{
aniphdr_t *aip;
@ -703,15 +699,14 @@ int inc;
}
void new_data()
void new_data(void)
{
(void) new_header(-1);
canip->ah_len = 0;
}
void set_datalen(arg)
char **arg;
void set_datalen(char **arg)
{
int len;
@ -722,8 +717,7 @@ char **arg;
}
void set_data(arg)
char **arg;
void set_data(char **arg)
{
u_char *s = (u_char *)*arg, *t = (u_char *)canip->ah_data, c;
int len = 0, todo = 0, quote = 0, val = 0;
@ -793,8 +787,7 @@ char **arg;
}
void set_datafile(arg)
char **arg;
void set_datafile(char **arg)
{
struct stat sb;
char *file = *arg;
@ -826,7 +819,7 @@ char **arg;
}
void new_packet()
void new_packet(void)
{
static u_short id = 0;
@ -857,8 +850,7 @@ char **arg;
}
void set_ipv4src(arg)
char **arg;
void set_ipv4src(char **arg)
{
ip->ip_src = getipv4addr(*arg);
free(*arg);
@ -866,8 +858,7 @@ char **arg;
}
void set_ipv4dst(arg)
char **arg;
void set_ipv4dst(char **arg)
{
ip->ip_dst = getipv4addr(*arg);
free(*arg);
@ -875,8 +866,7 @@ char **arg;
}
void set_ipv4off(arg)
char **arg;
void set_ipv4off(char **arg)
{
ip->ip_off = htons(strtol(*arg, NULL, 0));
free(*arg);
@ -884,8 +874,7 @@ char **arg;
}
void set_ipv4v(arg)
char **arg;
void set_ipv4v(char **arg)
{
ip->ip_v = strtol(*arg, NULL, 0);
free(*arg);
@ -893,8 +882,7 @@ char **arg;
}
void set_ipv4hl(arg)
char **arg;
void set_ipv4hl(char **arg)
{
int newhl, inc;
@ -908,8 +896,7 @@ char **arg;
}
void set_ipv4ttl(arg)
char **arg;
void set_ipv4ttl(char **arg)
{
ip->ip_ttl = strtol(*arg, NULL, 0);
free(*arg);
@ -917,8 +904,7 @@ char **arg;
}
void set_ipv4tos(arg)
char **arg;
void set_ipv4tos(char **arg)
{
ip->ip_tos = strtol(*arg, NULL, 0);
free(*arg);
@ -926,8 +912,7 @@ char **arg;
}
void set_ipv4id(arg)
char **arg;
void set_ipv4id(char **arg)
{
ip->ip_id = htons(strtol(*arg, NULL, 0));
free(*arg);
@ -935,8 +920,7 @@ char **arg;
}
void set_ipv4sum(arg)
char **arg;
void set_ipv4sum(char **arg)
{
ip->ip_sum = strtol(*arg, NULL, 0);
free(*arg);
@ -944,8 +928,7 @@ char **arg;
}
void set_ipv4len(arg)
char **arg;
void set_ipv4len(char **arg)
{
int len;
@ -957,7 +940,7 @@ char **arg;
}
void new_tcpheader()
void new_tcpheader(void)
{
if ((ip->ip_p) && (ip->ip_p != IPPROTO_TCP)) {
@ -972,8 +955,7 @@ void new_tcpheader()
}
void set_tcpsport(arg)
char **arg;
void set_tcpsport(char **arg)
{
u_short *port;
char *pr;
@ -992,8 +974,7 @@ char **arg;
}
void set_tcpdport(arg)
char **arg;
void set_tcpdport(char **arg)
{
u_short *port;
char *pr;
@ -1012,8 +993,7 @@ char **arg;
}
void set_tcpseq(arg)
char **arg;
void set_tcpseq(char **arg)
{
tcp->th_seq = htonl(strtol(*arg, NULL, 0));
free(*arg);
@ -1021,8 +1001,7 @@ char **arg;
}
void set_tcpack(arg)
char **arg;
void set_tcpack(char **arg)
{
tcp->th_ack = htonl(strtol(*arg, NULL, 0));
free(*arg);
@ -1030,8 +1009,7 @@ char **arg;
}
void set_tcpoff(arg)
char **arg;
void set_tcpoff(char **arg)
{
int off;
@ -1043,8 +1021,7 @@ char **arg;
}
void set_tcpurp(arg)
char **arg;
void set_tcpurp(char **arg)
{
tcp->th_urp = htons(strtol(*arg, NULL, 0));
free(*arg);
@ -1052,8 +1029,7 @@ char **arg;
}
void set_tcpwin(arg)
char **arg;
void set_tcpwin(char **arg)
{
tcp->th_win = htons(strtol(*arg, NULL, 0));
free(*arg);
@ -1061,8 +1037,7 @@ char **arg;
}
void set_tcpsum(arg)
char **arg;
void set_tcpsum(char **arg)
{
tcp->th_sum = strtol(*arg, NULL, 0);
free(*arg);
@ -1070,8 +1045,7 @@ char **arg;
}
void set_tcpflags(arg)
char **arg;
void set_tcpflags(char **arg)
{
static char flags[] = "ASURPF";
static int flagv[] = { TH_ACK, TH_SYN, TH_URG, TH_RST, TH_PUSH,
@ -1093,9 +1067,7 @@ char **arg;
}
void set_tcpopt(state, arg)
int state;
char **arg;
void set_tcpopt(int state, char **arg)
{
u_char *s;
int val, len, val2, pad, optval;
@ -1173,7 +1145,7 @@ char **arg;
}
void end_tcpopt()
void end_tcpopt(void)
{
int pad;
char *s = (char *)tcp;
@ -1205,7 +1177,7 @@ void end_tcpopt()
}
void new_udpheader()
void new_udpheader(void)
{
if ((ip->ip_p) && (ip->ip_p != IPPROTO_UDP)) {
fprintf(stderr, "protocol %d specified with UDP!\n", ip->ip_p);
@ -1231,8 +1203,7 @@ char **arg;
}
void set_udpsum(arg)
char **arg;
void set_udpsum(char **arg)
{
udp->uh_sum = strtol(*arg, NULL, 0);
free(*arg);
@ -1240,7 +1211,7 @@ char **arg;
}
void prep_packet()
void prep_packet(void)
{
iface_t *ifp;
struct in_addr gwip;
@ -1265,7 +1236,7 @@ void prep_packet()
}
void packet_done()
void packet_done(void)
{
char outline[80];
int i, j, k;
@ -1321,7 +1292,7 @@ void packet_done()
}
void new_interface()
void new_interface(void)
{
cifp = (iface_t *)calloc(1, sizeof(iface_t));
*iftail = cifp;
@ -1330,7 +1301,7 @@ void new_interface()
}
void check_interface()
void check_interface(void)
{
if (!cifp->if_name || !*cifp->if_name)
fprintf(stderr, "No interface name given!\n");
@ -1340,23 +1311,20 @@ void check_interface()
}
void set_ifname(arg)
char **arg;
void set_ifname(char **arg)
{
cifp->if_name = *arg;
*arg = NULL;
}
void set_ifmtu(arg)
int arg;
void set_ifmtu(int arg)
{
cifp->if_MTU = arg;
}
void set_ifv4addr(arg)
char **arg;
void set_ifv4addr(char **arg)
{
cifp->if_addr = getipv4addr(*arg);
free(*arg);
@ -1364,8 +1332,7 @@ char **arg;
}
void set_ifeaddr(arg)
char **arg;
void set_ifeaddr(char **arg)
{
(void) geteaddr(*arg, &cifp->if_eaddr);
free(*arg);
@ -1373,7 +1340,7 @@ char **arg;
}
void new_arp()
void new_arp(void)
{
carp = (arp_t *)calloc(1, sizeof(arp_t));
*arptail = carp;
@ -1381,8 +1348,7 @@ void new_arp()
}
void set_arpeaddr(arg)
char **arg;
void set_arpeaddr(char **arg)
{
(void) geteaddr(*arg, &carp->arp_eaddr);
free(*arg);
@ -1390,8 +1356,7 @@ char **arg;
}
void set_arpv4addr(arg)
char **arg;
void set_arpv4addr(char **arg)
{
carp->arp_addr = getipv4addr(*arg);
free(*arg);
@ -1399,9 +1364,7 @@ char **arg;
}
int arp_getipv4(ip, addr)
char *ip;
char *addr;
int arp_getipv4(char *ip, char *addr)
{
arp_t *a;
@ -1414,15 +1377,14 @@ char *addr;
}
void reset_send()
void reset_send(void)
{
sending.snd_if = iflist;
sending.snd_gw = defrouter;
}
void set_sendif(arg)
char **arg;
void set_sendif(char **arg)
{
iface_t *ifp;
@ -1437,8 +1399,7 @@ char **arg;
}
void set_sendvia(arg)
char **arg;
void set_sendvia(char **arg)
{
sending.snd_gw = getipv4addr(*arg);
free(*arg);
@ -1446,8 +1407,7 @@ char **arg;
}
void set_defaultrouter(arg)
char **arg;
void set_defaultrouter(char **arg)
{
defrouter = getipv4addr(*arg);
free(*arg);
@ -1455,7 +1415,7 @@ char **arg;
}
void new_icmpheader()
void new_icmpheader(void)
{
if ((ip->ip_p) && (ip->ip_p != IPPROTO_ICMP)) {
fprintf(stderr, "protocol %d specified with ICMP!\n",
@ -1467,22 +1427,19 @@ void new_icmpheader()
}
void set_icmpcode(code)
int code;
void set_icmpcode(int code)
{
icmp->icmp_code = code;
}
void set_icmptype(type)
int type;
void set_icmptype(int type)
{
icmp->icmp_type = type;
}
void set_icmpcodetok(code)
char **code;
void set_icmpcodetok(char **code)
{
char *s;
int i;
@ -1499,8 +1456,7 @@ char **code;
}
void set_icmptypetok(type)
char **type;
void set_icmptypetok(char **type)
{
char *s;
int i, done = 0;
@ -1518,51 +1474,43 @@ char **type;
}
void set_icmpid(arg)
int arg;
void set_icmpid(int arg)
{
icmp->icmp_id = htons(arg);
}
void set_icmpseq(arg)
int arg;
void set_icmpseq(int arg)
{
icmp->icmp_seq = htons(arg);
}
void set_icmpotime(arg)
int arg;
void set_icmpotime(int arg)
{
icmp->icmp_otime = htonl(arg);
}
void set_icmprtime(arg)
int arg;
void set_icmprtime(int arg)
{
icmp->icmp_rtime = htonl(arg);
}
void set_icmpttime(arg)
int arg;
void set_icmpttime(int arg)
{
icmp->icmp_ttime = htonl(arg);
}
void set_icmpmtu(arg)
int arg;
void set_icmpmtu(int arg)
{
icmp->icmp_nextmtu = htons(arg);
}
void set_redir(redir, arg)
int redir;
char **arg;
void set_redir(int redir, char **arg)
{
icmp->icmp_code = redir;
icmp->icmp_gwaddr = getipv4addr(*arg);
@ -1571,22 +1519,19 @@ char **arg;
}
void set_icmppprob(num)
int num;
void set_icmppprob(int num)
{
icmp->icmp_pptr = num;
}
void new_ipv4opt()
void new_ipv4opt(void)
{
new_header(-2);
}
void add_ipopt(state, ptr)
int state;
void *ptr;
void add_ipopt(int state, void *ptr)
{
struct ipopt_names *io;
struct statetoopt *sto;
@ -1644,7 +1589,7 @@ void *ptr;
}
void end_ipopt()
void end_ipopt(void)
{
int pad;
char *s, *buf = (char *)ip;
@ -1679,15 +1624,14 @@ void end_ipopt()
}
void set_secclass(arg)
char **arg;
void set_secclass(char **arg)
{
sclass = *arg;
*arg = NULL;
}
void free_anipheader()
void free_anipheader(void)
{
aniphdr_t *aip;
@ -1702,7 +1646,7 @@ void free_anipheader()
}
void end_ipv4()
void end_ipv4(void)
{
aniphdr_t *aip;
@ -1717,7 +1661,7 @@ void end_ipv4()
}
void end_icmp()
void end_icmp(void)
{
aniphdr_t *aip;
@ -1730,7 +1674,7 @@ void end_icmp()
}
void end_udp()
void end_udp(void)
{
u_long sum;
aniphdr_t *aip;
@ -1751,7 +1695,7 @@ void end_udp()
}
void end_tcp()
void end_tcp(void)
{
u_long sum;
aniphdr_t *aip;
@ -1772,14 +1716,13 @@ void end_tcp()
}
void end_data()
void end_data(void)
{
free_anipheader();
}
void iplang(fp)
FILE *fp;
void iplang(FILE *fp)
{
yyin = fp;
@ -1790,10 +1733,7 @@ FILE *fp;
}
u_short c_chksum(buf, len, init)
u_short *buf;
u_int len;
u_long init;
u_short c_chksum(u_short *buf, u_int len, u_long init)
{
u_long sum = init;
int nwords = len >> 1;
@ -1806,9 +1746,7 @@ u_long init;
}
u_long p_chksum(buf,len)
u_short *buf;
u_int len;
u_long p_chksum(u_short *buf, u_int len)
{
u_long sum = 0;
int nwords = len >> 1;

View File

@ -300,10 +300,8 @@ static icmp_type_t icmptypes6[] = {
{ -2, NULL, 0, NULL }
};
static icmp_subtype_t *find_icmpsubtype(type, table, tablesz)
int type;
icmp_subtype_t *table;
size_t tablesz;
static icmp_subtype_t *
find_icmpsubtype(int type, icmp_subtype_t *table, size_t tablesz)
{
icmp_subtype_t *ist;
int i;
@ -325,10 +323,8 @@ static icmp_subtype_t *find_icmpsubtype(type, table, tablesz)
}
static icmp_type_t *find_icmptype(type, table, tablesz)
int type;
icmp_type_t *table;
size_t tablesz;
static icmp_type_t *
find_icmptype(int type, icmp_type_t *table, size_t tablesz)
{
icmp_type_t *it;
int i;
@ -350,15 +346,16 @@ static icmp_type_t *find_icmptype(type, table, tablesz)
}
static void handlehup(sig)
int sig;
static void
handlehup(int sig)
{
signal(SIGHUP, handlehup);
donehup = 1;
}
static void init_tabs()
static void
init_tabs(void)
{
struct protoent *p;
struct servent *s;
@ -438,8 +435,8 @@ static void init_tabs()
}
static char *getlocalproto(p)
u_int p;
static char *
getlocalproto(u_int p)
{
static char pnum[4];
char *s;
@ -454,9 +451,8 @@ static char *getlocalproto(p)
}
static int read_log(fd, lenp, buf, bufsize)
int fd, bufsize, *lenp;
char *buf;
static int
read_log(int fd, int *lenp, char *buf, int bufsize)
{
int nr;
@ -473,7 +469,8 @@ static int read_log(fd, lenp, buf, bufsize)
}
char *portlocalname(res, proto, port)
char *
portlocalname(res, proto, port)
int res;
char *proto;
u_int port;
@ -497,9 +494,8 @@ char *portlocalname(res, proto, port)
}
static char *icmpname(type, code)
u_int type;
u_int code;
static char *
icmpname(u_int type, u_int code)
{
static char name[80];
icmp_subtype_t *ist;
@ -528,9 +524,8 @@ static char *icmpname(type, code)
return name;
}
static char *icmpname6(type, code)
u_int type;
u_int code;
static char *
icmpname6(u_int type, u_int code)
{
static char name[80];
icmp_subtype_t *ist;
@ -560,11 +555,8 @@ static char *icmpname6(type, code)
}
void dumphex(log, dopts, buf, len)
FILE *log;
int dopts;
char *buf;
int len;
void
dumphex(FILE *log, int dopts, char *buf, int len)
{
char hline[80];
int i, j, k;
@ -624,8 +616,8 @@ void dumphex(log, dopts, buf, len)
}
static struct tm *get_tm(sec)
time_t sec;
static struct tm *
get_tm(time_t sec)
{
struct tm *tm;
time_t t;
@ -635,10 +627,8 @@ static struct tm *get_tm(sec)
return tm;
}
static void print_natlog(conf, buf, blen)
config_t *conf;
char *buf;
int blen;
static void
print_natlog(config_t *conf, char *buf, int blen)
{
static u_32_t seqnum = 0;
int res, i, len, family;
@ -824,10 +814,8 @@ static void print_natlog(conf, buf, blen)
}
static void print_statelog(conf, buf, blen)
config_t *conf;
char *buf;
int blen;
static void
print_statelog(config_t *conf, char *buf, int blen)
{
static u_32_t seqnum = 0;
int res, i, len, family;
@ -979,11 +967,8 @@ static void print_statelog(conf, buf, blen)
}
static void print_log(conf, log, buf, blen)
config_t *conf;
logsource_t *log;
char *buf;
int blen;
static void
print_log(config_t *conf, logsource_t *log, char *buf, int blen)
{
char *bp, *bpo;
iplog_t *ipl;
@ -1038,10 +1023,8 @@ static void print_log(conf, log, buf, blen)
}
static void print_ipflog(conf, buf, blen)
config_t *conf;
char *buf;
int blen;
static void
print_ipflog(config_t *conf, char *buf, int blen)
{
static u_32_t seqnum = 0;
int i, f, lvl, res, len, off, plen, ipoff, defaction;
@ -1435,8 +1418,8 @@ static void print_ipflog(conf, buf, blen)
}
static void usage(prog)
char *prog;
static void
usage(char *prog)
{
fprintf(stderr, "Usage: %s [ -abDFhnpstvxX ] [ -B <binary-logfile> ] [ -C <config-file> ]\n"
"\t[ -f <device> ] [ -L <facility> ] [ -N <device> ]\n"
@ -1446,8 +1429,8 @@ static void usage(prog)
}
static void write_pid(file)
char *file;
static void
write_pid(char *file)
{
FILE *fp = NULL;
int fd;
@ -1466,9 +1449,8 @@ static void write_pid(file)
}
static void flushlogs(file, log)
char *file;
FILE *log;
static void
flushlogs(char *file, FILE *log)
{
int fd, flushed = 0;
@ -1497,9 +1479,8 @@ static void flushlogs(file, log)
}
static void logopts(turnon, options)
int turnon;
char *options;
static void
logopts(int turnon, char *options)
{
int flags = 0;
char *s;
@ -1529,7 +1510,8 @@ static void logopts(turnon, options)
ipmonopts &= ~(flags);
}
static void initconfig(config_t *conf)
static void
initconfig(config_t *conf)
{
int i;
@ -1557,9 +1539,8 @@ static void initconfig(config_t *conf)
}
int main(argc, argv)
int argc;
char *argv[];
int
main(int argc, char *argv[])
{
int doread, c, make_daemon = 0;
char *prog;
@ -1741,7 +1722,8 @@ int main(argc, argv)
}
static void openlogs(config_t *conf)
static void
openlogs(config_t *conf)
{
logsource_t *l;
struct stat sb;
@ -1781,7 +1763,8 @@ static void openlogs(config_t *conf)
}
static int read_loginfo(config_t *conf)
static int
read_loginfo(config_t *conf)
{
iplog_t buf[DEFAULT_IPFLOGSIZE/sizeof(iplog_t)+1];
int n, tr, nr, i;

View File

@ -302,8 +302,7 @@ static int macflags[17][2] = {
};
static opt_t *
new_opt(type)
int type;
new_opt(int type)
{
opt_t *o;
@ -316,9 +315,7 @@ new_opt(type)
}
static void
build_action(olist, todo)
opt_t *olist;
ipmon_doing_t *todo;
build_action(opt_t *olist, ipmon_doing_t *todo)
{
ipmon_action_t *a;
opt_t *o;
@ -430,9 +427,7 @@ build_action(olist, todo)
int
check_action(buf, log, opts, lvl)
char *buf, *log;
int opts, lvl;
check_action(char *buf, char *log, int opts, int lvl)
{
ipmon_action_t *a;
struct timeval tv;
@ -630,8 +625,7 @@ check_action(buf, log, opts, lvl)
static void
free_action(a)
ipmon_action_t *a;
free_action(ipmon_action_t *a)
{
ipmon_doing_t *d;
@ -651,8 +645,7 @@ free_action(a)
int
load_config(file)
char *file;
load_config(char *file)
{
FILE *fp;
char *s;
@ -683,7 +676,7 @@ load_config(file)
void
unload_config()
unload_config(void)
{
ipmon_saver_int_t *sav, **imsip;
ipmon_saver_t *is;
@ -716,7 +709,7 @@ unload_config()
void
dump_config()
dump_config(void)
{
ipmon_action_t *a;
@ -729,8 +722,7 @@ dump_config()
static void
print_action(a)
ipmon_action_t *a;
print_action(ipmon_action_t *a)
{
ipmon_doing_t *d;
@ -752,8 +744,7 @@ print_action(a)
void *
add_doing(saver)
ipmon_saver_t *saver;
add_doing(ipmon_saver_t *saver)
{
ipmon_saver_int_t *it;
@ -771,8 +762,7 @@ add_doing(saver)
static int
find_doing(string)
char *string;
find_doing(char *string)
{
ipmon_saver_int_t *it;
@ -785,9 +775,7 @@ find_doing(string)
static ipmon_doing_t *
build_doing(target, options)
char *target;
char *options;
build_doing(char *target, char *options)
{
ipmon_saver_int_t *it;
char *strarray[2];
@ -844,8 +832,7 @@ build_doing(target, options)
static void
print_match(a)
ipmon_action_t *a;
print_match(ipmon_action_t *a)
{
char *coma = "";
@ -980,8 +967,7 @@ print_match(a)
static int
install_saver(name, path)
char *name, *path;
install_saver(char *name, char *path)
{
ipmon_saver_int_t *isi;
ipmon_saver_t *is;

View File

@ -80,17 +80,16 @@ int opts;
int nohdrfields = 0;
wordtab_t *nat_fields = NULL;
void usage(name)
char *name;
void
usage(char *name)
{
fprintf(stderr, "Usage: %s [-CFhlnrRsv] [-f filename]\n", name);
exit(1);
}
int main(argc, argv)
int argc;
char *argv[];
int
main(int argc, char *argv[])
{
int fd, c, mode, *natfilter;
char *file, *core, *kernel;
@ -234,9 +233,8 @@ int main(argc, argv)
* Read NAT statistic information in using a symbol table and memory file
* rather than doing ioctl's.
*/
void natstat_dead(nsp, kernel)
natstat_t *nsp;
char *kernel;
void
natstat_dead(natstat_t *nsp, char *kernel)
{
struct nlist nat_nlist[10] = {
{ "nat_table" }, /* 0 */
@ -286,8 +284,8 @@ void natstat_dead(nsp, kernel)
* Issue an ioctl to flush either the NAT rules table or the active mapping
* table or both.
*/
void flushtable(fd, opts, match)
int fd, opts, *match;
void
flushtable(int fd, int opts, int *match)
{
int n = 0;
@ -329,9 +327,8 @@ void flushtable(fd, opts, match)
/*
* Display NAT statistics.
*/
void dostats_dead(nsp, opts, filter)
natstat_t *nsp;
int opts, *filter;
void
dostats_dead(natstat_t *nsp, int opts, int *filter)
{
nat_t *np, nat;
ipnat_t ipn;
@ -395,10 +392,8 @@ void dostats_dead(nsp, opts, filter)
}
void dotable(nsp, fd, alive, which, side)
natstat_t *nsp;
int fd, alive, which;
char *side;
void
dotable(natstat_t *nsp, int fd, int alive, int which, char *side)
{
int sz, i, used, maxlen, minlen, totallen;
ipftable_t table;
@ -466,9 +461,8 @@ void dotable(nsp, fd, alive, which, side)
}
void dostats(fd, nsp, opts, alive, filter)
natstat_t *nsp;
int fd, opts, alive, *filter;
void
dostats(int fd, natstat_t *nsp, int opts, int alive, int *filter)
{
/*
* Show statistics ?
@ -521,9 +515,8 @@ void dostats(fd, nsp, opts, alive, filter)
/*
* Display NAT statistics.
*/
void dostats_live(fd, nsp, opts, filter)
natstat_t *nsp;
int fd, opts, *filter;
void
dostats_live(int fd, natstat_t *nsp, int opts, int *filter)
{
ipfgeniter_t iter;
char buffer[2000];
@ -616,8 +609,8 @@ void dostats_live(fd, nsp, opts, filter)
/*
* Display the active host mapping table.
*/
void showhostmap_dead(nsp)
natstat_t *nsp;
void
showhostmap_dead(natstat_t *nsp)
{
hostmap_t hm, *hmp, **maptable;
u_int hv;
@ -652,9 +645,8 @@ void showhostmap_dead(nsp)
/*
* Display the active host mapping table.
*/
void showhostmap_live(fd, nsp)
int fd;
natstat_t *nsp;
void
showhostmap_live(int fd, natstat_t *nsp)
{
ipfgeniter_t iter;
hostmap_t hm;
@ -685,9 +677,8 @@ void showhostmap_live(fd, nsp)
}
int nat_matcharray(nat, array)
nat_t *nat;
int *array;
int
nat_matcharray(nat_t *nat, int *array)
{
int i, n, *x, rv, p;
ipfexp_t *e;

View File

@ -1294,11 +1294,8 @@ static wordtab_t yywords[] = {
int
ipnat_parsefile(fd, addfunc, ioctlfunc, filename)
int fd;
addfunc_t addfunc;
ioctlfunc_t ioctlfunc;
char *filename;
ipnat_parsefile(int fd, addfunc_t addfunc, ioctlfunc_t ioctlfunc,
char *filename)
{
FILE *fp = NULL;
int rval;
@ -1337,11 +1334,8 @@ ipnat_parsefile(fd, addfunc, ioctlfunc, filename)
int
ipnat_parsesome(fd, addfunc, ioctlfunc, fp)
int fd;
addfunc_t addfunc;
ioctlfunc_t ioctlfunc;
FILE *fp;
ipnat_parsesome(int fd, addfunc_t addfunc, ioctlfunc_t ioctlfunc,
FILE *fp)
{
char *s;
int i;
@ -1373,7 +1367,7 @@ ipnat_parsesome(fd, addfunc, ioctlfunc, fp)
static void
newnatrule()
newnatrule(void)
{
ipnat_t *n;
@ -1402,8 +1396,7 @@ newnatrule()
static void
setnatproto(p)
int p;
setnatproto(int p)
{
nat->in_pr[0] = p;
nat->in_pr[1] = p;
@ -1466,10 +1459,7 @@ setnatproto(p)
int
ipnat_addrule(fd, ioctlfunc, ptr)
int fd;
ioctlfunc_t ioctlfunc;
void *ptr;
ipnat_addrule(int fd, ioctlfunc_t ioctlfunc, void *ptr)
{
ioctlcmd_t add, del;
ipfobj_t obj;
@ -1571,7 +1561,7 @@ setmapifnames()
static void
setrdrifnames()
setrdrifnames(void)
{
if ((suggest_port == 1) && (nat->in_flags & IPN_TCPUDP) == 0)
nat->in_flags |= IPN_TCPUDP;
@ -1586,8 +1576,7 @@ setrdrifnames()
static void
proxy_setconfig(proxy)
int proxy;
proxy_setconfig(int proxy)
{
if (proxy == IPNY_DNS) {
yysetfixeddict(dnswords);
@ -1596,15 +1585,14 @@ proxy_setconfig(proxy)
static void
proxy_unsetconfig()
proxy_unsetconfig(void)
{
yyresetdict();
}
static namelist_t *
proxy_dns_add_pass(prefix, name)
char *prefix, *name;
proxy_dns_add_pass(char *prefix, char *name)
{
namelist_t *n;
@ -1623,8 +1611,7 @@ proxy_dns_add_pass(prefix, name)
static namelist_t *
proxy_dns_add_block(prefix, name)
char *prefix, *name;
proxy_dns_add_block(char *prefix, char *name)
{
namelist_t *n;
@ -1644,10 +1631,7 @@ proxy_dns_add_block(prefix, name)
static void
proxy_addconfig(proxy, proto, conf, list)
char *proxy, *conf;
int proto;
namelist_t *list;
proxy_addconfig(char *proxy, int proto, char *conf, namelist_t *list)
{
proxyrule_t *pr;
@ -1664,10 +1648,7 @@ proxy_addconfig(proxy, proto, conf, list)
static void
proxy_loadrules(fd, ioctlfunc, rules)
int fd;
ioctlfunc_t ioctlfunc;
proxyrule_t *rules;
proxy_loadrules(int fd, ioctlfunc_t ioctlfunc, proxyrule_t *rules)
{
proxyrule_t *pr;
@ -1682,12 +1663,8 @@ proxy_loadrules(fd, ioctlfunc, rules)
static void
proxy_loadconfig(fd, ioctlfunc, proxy, proto, conf, list)
int fd;
ioctlfunc_t ioctlfunc;
char *proxy, *conf;
int proto;
namelist_t *list;
proxy_loadconfig(int fd, ioctlfunc_t ioctlfunc, char *proxy, int proto,
char *conf, namelist_t *list)
{
namelist_t *na;
ipfobj_t obj;
@ -1733,10 +1710,7 @@ proxy_loadconfig(fd, ioctlfunc, proxy, proto, conf, list)
static void
setifname(np, idx, name)
ipnat_t **np;
int idx;
char *name;
setifname(ipnat_t **np, int idx, char *name)
{
int pos;
@ -1748,9 +1722,7 @@ setifname(np, idx, name)
static int
addname(np, name)
ipnat_t **np;
char *name;
addname(ipnat_t **np, char *name)
{
ipnat_t *n;
int nlen;

View File

@ -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;

View File

@ -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)

View File

@ -197,9 +197,8 @@ static struct wordtab yywords[] = {
};
int cram(dst, src)
char *dst;
char *src;
int
cram(char *dst, char *src)
{
char c, *s, *t, *u;
int i, j, k;
@ -256,8 +255,8 @@ char *src;
}
void printent(isc)
ipscan_t *isc;
void
printent(ipscan_t *isc)
{
char buf[ISC_TLEN+1];
u_char *u;
@ -334,10 +333,8 @@ ipscan_t *isc;
}
void addtag(tstr, cp, sp, act)
char *tstr;
char **cp, **sp;
struct action *act;
void
addtag(char *tstr, char **cp, char **sp, struct action *act)
{
ipscan_t isc, *iscp;
@ -406,8 +403,8 @@ struct action *act;
}
char **makepair(s1, s2)
char *s1, *s2;
char **
makepair(char *s1, char *s2)
{
char **a;
@ -418,8 +415,8 @@ char *s1, *s2;
}
struct in_addr combine(a1, a2, a3, a4)
int a1, a2, a3, a4;
struct in_addr
combine(int a1, int a2, int a3, int a4)
{
struct in_addr in;
@ -436,8 +433,8 @@ int a1, a2, a3, a4;
}
struct in_addr gethostip(host)
char *host;
struct in_addr
gethostip(char *host)
{
struct hostent *hp;
struct in_addr in;
@ -452,8 +449,8 @@ char *host;
}
int getportnum(port)
char *port;
int
getportnum(char *port)
{
struct servent *s;
@ -464,7 +461,8 @@ char *port;
}
void showlist()
void
showlist(void)
{
ipscanstat_t ipsc, *ipscp = &ipsc;
ipscan_t isc;
@ -490,8 +488,8 @@ void showlist()
}
void usage(prog)
char *prog;
void
usage(char *prog)
{
fprintf(stderr, "Usage:\t%s [-dnrv] -f <filename>\n", prog);
fprintf(stderr, "\t%s [-dlv]\n", prog);
@ -499,9 +497,8 @@ char *prog;
}
int main(argc, argv)
int argc;
char *argv[];
int
main(int argc, char *argv[])
{
FILE *fp = NULL;
int c;

View File

@ -35,8 +35,7 @@
* its IP address in address
* (4 bytes)
*/
int resolve(host, address)
char *host, *address;
int resolve(char *host, char *address)
{
struct hostent *hp;
u_long add;
@ -57,8 +56,7 @@ int resolve(host, address)
}
int arp(addr, eaddr)
char *addr, *eaddr;
int arp(char *addr, char *eaddr)
{
int mib[6];
size_t needed;

View File

@ -34,8 +34,7 @@ static const char rcsid[] = "@(#)$Id$";
* its IP address in address
* (4 bytes)
*/
int resolve(host, address)
char *host, *address;
int resolve(char *host, char *address)
{
struct hostent *hp;
u_long add;

View File

@ -38,8 +38,7 @@ typedef unsigned long ulong;
void
dlinforeq(fd)
int fd;
dlinforeq(int fd)
{
dl_info_req_t info_req;
struct strbuf ctl;
@ -58,9 +57,7 @@ dlinforeq(fd)
}
void
dlinfoack(fd, bufp)
int fd;
char *bufp;
dlinfoack(int fd, char *bufp)
{
union DL_primitives *dlp;
struct strbuf ctl;
@ -87,9 +84,7 @@ dlinfoack(fd, bufp)
}
void
dlattachreq(fd, ppa)
int fd;
u_long ppa;
dlattachreq(int fd, u_long ppa)
{
dl_attach_req_t attach_req;
struct strbuf ctl;
@ -109,10 +104,7 @@ dlattachreq(fd, ppa)
}
void
dlenabmultireq(fd, addr, length)
int fd;
char *addr;
int length;
dlenabmultireq(int fd, char *addr, int length)
{
long buf[MAXDLBUF];
union DL_primitives *dlp;
@ -138,10 +130,7 @@ dlenabmultireq(fd, addr, length)
}
void
dldisabmultireq(fd, addr, length)
int fd;
char *addr;
int length;
dldisabmultireq(int fd, char *addr, int length)
{
long buf[MAXDLBUF];
union DL_primitives *dlp;
@ -167,9 +156,7 @@ dldisabmultireq(fd, addr, length)
}
void
dlpromisconreq(fd, level)
int fd;
u_long level;
dlpromisconreq(int fd, u_long level)
{
dl_promiscon_req_t promiscon_req;
struct strbuf ctl;
@ -190,9 +177,7 @@ dlpromisconreq(fd, level)
}
void
dlpromiscoff(fd, level)
int fd;
u_long level;
dlpromiscoff(int fd, u_long level)
{
dl_promiscoff_req_t promiscoff_req;
struct strbuf ctl;
@ -212,9 +197,7 @@ dlpromiscoff(fd, level)
}
void
dlphysaddrreq(fd, addrtype)
int fd;
u_long addrtype;
dlphysaddrreq(int fd, u_long addrtype)
{
dl_phys_addr_req_t phys_addr_req;
struct strbuf ctl;
@ -234,10 +217,7 @@ dlphysaddrreq(fd, addrtype)
}
void
dlsetphysaddrreq(fd, addr, length)
int fd;
char *addr;
int length;
dlsetphysaddrreq(int fd, char *addr, int length)
{
long buf[MAXDLBUF];
union DL_primitives *dlp;
@ -263,8 +243,7 @@ dlsetphysaddrreq(fd, addr, length)
}
void
dldetachreq(fd)
int fd;
dldetachreq(int fd)
{
dl_detach_req_t detach_req;
struct strbuf ctl;
@ -283,13 +262,8 @@ dldetachreq(fd)
}
void
dlbindreq(fd, sap, max_conind, service_mode, conn_mgmt, xidtest)
int fd;
u_long sap;
u_long max_conind;
u_long service_mode;
u_long conn_mgmt;
u_long xidtest;
dlbindreq(int fd, u_long sap, u_long max_conind, u_long service_mode,
u_long conn_mgmt, u_long xidtest)
{
dl_bind_req_t bind_req;
struct strbuf ctl;
@ -313,13 +287,8 @@ dlbindreq(fd, sap, max_conind, service_mode, conn_mgmt, xidtest)
}
void
dlunitdatareq(fd, addrp, addrlen, minpri, maxpri, datap, datalen)
int fd;
u_char *addrp;
int addrlen;
u_long minpri, maxpri;
u_char *datap;
int datalen;
dlunitdatareq(int fd, u_char *addrp, int addrlen, u_long minpri,
u_long maxpri, u_char *datap, int datalen)
{
long buf[MAXDLBUF];
union DL_primitives *dlp;
@ -348,8 +317,7 @@ dlunitdatareq(fd, addrp, addrlen, minpri, maxpri, datap, datalen)
}
void
dlunbindreq(fd)
int fd;
dlunbindreq(int fd)
{
dl_unbind_req_t unbind_req;
struct strbuf ctl;
@ -368,9 +336,7 @@ dlunbindreq(fd)
}
void
dlokack(fd, bufp)
int fd;
char *bufp;
dlokack(int fd, char *bufp)
{
union DL_primitives *dlp;
struct strbuf ctl;
@ -397,9 +363,7 @@ dlokack(fd, bufp)
}
void
dlerrorack(fd, bufp)
int fd;
char *bufp;
dlerrorack(int fd, char *bufp)
{
union DL_primitives *dlp;
struct strbuf ctl;
@ -426,9 +390,7 @@ dlerrorack(fd, bufp)
}
void
dlbindack(fd, bufp)
int fd;
char *bufp;
dlbindack(int fd, char *bufp)
{
union DL_primitives *dlp;
struct strbuf ctl;
@ -452,9 +414,7 @@ dlbindack(fd, bufp)
}
void
dlphysaddrack(fd, bufp)
int fd;
char *bufp;
dlphysaddrack(int fd, char *bufp)
{
union DL_primitives *dlp;
struct strbuf ctl;
@ -478,16 +438,13 @@ dlphysaddrack(fd, bufp)
}
void
sigalrm()
sigalrm(void)
{
(void) err("sigalrm: TIMEOUT");
}
strgetmsg(fd, ctlp, datap, flagsp, caller)
int fd;
struct strbuf *ctlp, *datap;
int *flagsp;
char *caller;
strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *flagsp,
char *caller)
{
int rc;
static char errmsg[80];
@ -535,9 +492,7 @@ strgetmsg(fd, ctlp, datap, flagsp, caller)
err("getmsg: control portion length < sizeof (long): %d", ctlp->len);
}
expecting(prim, dlp)
int prim;
union DL_primitives *dlp;
expecting(int prim, union DL_primitives *dlp)
{
if (dlp->dl_primitive != (u_long)prim) {
printdlprim(dlp);
@ -550,8 +505,7 @@ expecting(prim, dlp)
/*
* Print any DLPI msg in human readable format.
*/
printdlprim(dlp)
union DL_primitives *dlp;
printdlprim(union DL_primitives *dlp)
{
switch (dlp->dl_primitive) {
case DL_INFO_REQ:
@ -654,14 +608,12 @@ printdlprim(dlp)
}
/* ARGSUSED */
printdlinforeq(dlp)
union DL_primitives *dlp;
printdlinforeq(union DL_primitives *dlp)
{
(void) printf("DL_INFO_REQ\n");
}
printdlinfoack(dlp)
union DL_primitives *dlp;
printdlinfoack(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
u_char brdcst[MAXDLADDR];
@ -697,22 +649,20 @@ printdlinfoack(dlp)
(void) printf("brdcst_addr %s\n", brdcst);
}
printdlattachreq(dlp)
union DL_primitives *dlp;
printdlattachreq(union DL_primitives *dlp)
{
(void) printf("DL_ATTACH_REQ: ppa %d\n",
dlp->attach_req.dl_ppa);
}
printdlokack(dlp)
printdlokack(union DL_primitives* dlp)
union DL_primitives *dlp;
{
(void) printf("DL_OK_ACK: correct_primitive %s\n",
dlprim(dlp->ok_ack.dl_correct_primitive));
}
printdlerrorack(dlp)
union DL_primitives *dlp;
printdlerrorack(union DL_primitives *dlp)
{
(void) printf("DL_ERROR_ACK: error_primitive %s errno %s unix_errno %d: %s\n",
dlprim(dlp->error_ack.dl_error_primitive),
@ -721,8 +671,7 @@ printdlerrorack(dlp)
strerror(dlp->error_ack.dl_unix_errno));
}
printdlenabmultireq(dlp)
union DL_primitives *dlp;
printdlenabmultireq(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -735,8 +684,7 @@ printdlenabmultireq(dlp)
(void) printf("addr %s\n", addr);
}
printdldisabmultireq(dlp)
union DL_primitives *dlp;
printdldisabmultireq(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -749,29 +697,25 @@ printdldisabmultireq(dlp)
(void) printf("addr %s\n", addr);
}
printdlpromisconreq(dlp)
union DL_primitives *dlp;
printdlpromisconreq(union DL_primitives *dlp)
{
(void) printf("DL_PROMISCON_REQ: level %s\n",
dlpromisclevel(dlp->promiscon_req.dl_level));
}
printdlpromiscoffreq(dlp)
union DL_primitives *dlp;
printdlpromiscoffreq(union DL_primitives *dlp)
{
(void) printf("DL_PROMISCOFF_REQ: level %s\n",
dlpromisclevel(dlp->promiscoff_req.dl_level));
}
printdlphysaddrreq(dlp)
union DL_primitives *dlp;
printdlphysaddrreq(union DL_primitives *dlp)
{
(void) printf("DL_PHYS_ADDR_REQ: addr_type 0x%x\n",
dlp->physaddr_req.dl_addr_type);
}
printdlphysaddrack(dlp)
union DL_primitives *dlp;
printdlphysaddrack(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -784,8 +728,7 @@ printdlphysaddrack(dlp)
(void) printf("addr %s\n", addr);
}
printdlsetphysaddrreq(dlp)
union DL_primitives *dlp;
printdlsetphysaddrreq(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -799,14 +742,12 @@ printdlsetphysaddrreq(dlp)
}
/* ARGSUSED */
printdldetachreq(dlp)
union DL_primitives *dlp;
printdldetachreq(union DL_primitives *dlp)
{
(void) printf("DL_DETACH_REQ\n");
}
printdlbindreq(dlp)
union DL_primitives *dlp;
printdlbindreq(union DL_primitives *dlp)
{
(void) printf("DL_BIND_REQ: sap %d max_conind %d\n",
dlp->bind_req.dl_sap,
@ -817,8 +758,7 @@ printdlbindreq(dlp)
dlp->bind_req.dl_xidtest_flg);
}
printdlbindack(dlp)
union DL_primitives *dlp;
printdlbindack(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -836,14 +776,12 @@ printdlbindack(dlp)
}
/* ARGSUSED */
printdlunbindreq(dlp)
union DL_primitives *dlp;
printdlunbindreq(union DL_primitives *dlp)
{
(void) printf("DL_UNBIND_REQ\n");
}
printdlsubsbindreq(dlp)
union DL_primitives *dlp;
printdlsubsbindreq(union DL_primitives *dlp)
{
u_char sap[MAXDLADDR];
@ -856,8 +794,7 @@ printdlsubsbindreq(dlp)
(void) printf("sap %s\n", sap);
}
printdlsubsbindack(dlp)
union DL_primitives *dlp;
printdlsubsbindack(union DL_primitives *dlp)
{
u_char sap[MAXDLADDR];
@ -870,8 +807,7 @@ printdlsubsbindack(dlp)
(void) printf("sap %s\n", sap);
}
printdlsubsunbindreq(dlp)
union DL_primitives *dlp;
printdlsubsunbindreq(union DL_primitives *dlp)
{
u_char sap[MAXDLADDR];
@ -884,8 +820,7 @@ printdlsubsunbindreq(dlp)
(void) printf("sap %s\n", sap);
}
printdlunitdatareq(dlp)
union DL_primitives *dlp;
printdlunitdatareq(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -901,8 +836,7 @@ printdlunitdatareq(dlp)
(void) printf("addr %s\n", addr);
}
printdlunitdataind(dlp)
union DL_primitives *dlp;
printdlunitdataind(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
u_char src[MAXDLADDR];
@ -924,8 +858,7 @@ printdlunitdataind(dlp)
(void) printf("src %s\n", src);
}
printdluderrorind(dlp)
union DL_primitives *dlp;
printdluderrorind(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -941,8 +874,7 @@ printdluderrorind(dlp)
(void) printf("addr %s\n", addr);
}
printdltestreq(dlp)
union DL_primitives *dlp;
printdltestreq(union DL_primitives *dlp)
{
u_char addr[MAXDLADDR];
@ -956,8 +888,7 @@ printdltestreq(dlp)
(void) printf("dest_addr %s\n", addr);
}
printdltestind(dlp)
union DL_primitives *dlp;
printdltestind(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
u_char src[MAXDLADDR];
@ -978,8 +909,7 @@ printdltestind(dlp)
(void) printf("src_addr %s\n", src);
}
printdltestres(dlp)
union DL_primitives *dlp;
printdltestres(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
@ -993,8 +923,7 @@ printdltestres(dlp)
(void) printf("dest_addr %s\n", dest);
}
printdltestcon(dlp)
union DL_primitives *dlp;
printdltestcon(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
u_char src[MAXDLADDR];
@ -1015,8 +944,7 @@ printdltestcon(dlp)
(void) printf("src_addr %s\n", src);
}
printdlxidreq(dlp)
union DL_primitives *dlp;
printdlxidreq(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
@ -1030,8 +958,7 @@ printdlxidreq(dlp)
(void) printf("dest_addr %s\n", dest);
}
printdlxidind(dlp)
union DL_primitives *dlp;
printdlxidind(dlpunion DL_primitives *)
{
u_char dest[MAXDLADDR];
u_char src[MAXDLADDR];
@ -1052,8 +979,7 @@ printdlxidind(dlp)
(void) printf("src_addr %s\n", src);
}
printdlxidres(dlp)
union DL_primitives *dlp;
printdlxidres(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
@ -1067,8 +993,7 @@ printdlxidres(dlp)
(void) printf("dest_addr %s\n", dest);
}
printdlxidcon(dlp)
union DL_primitives *dlp;
printdlxidcon(union DL_primitives *dlp)
{
u_char dest[MAXDLADDR];
u_char src[MAXDLADDR];
@ -1089,8 +1014,7 @@ printdlxidcon(dlp)
(void) printf("src_addr %s\n", src);
}
printdludqosreq(dlp)
union DL_primitives *dlp;
printdludqosreq(union DL_primitives *dlp)
{
(void) printf("DL_UDQOS_REQ: qos_length %d qos_offset %d\n",
dlp->udqos_req.dl_qos_length,
@ -1100,10 +1024,7 @@ printdludqosreq(dlp)
/*
* Return string.
*/
addrtostring(addr, length, s)
u_char *addr;
u_long length;
u_char *s;
addrtostring(u_char *addr, u_long length, u_char *s)
{
int i;
@ -1118,9 +1039,7 @@ addrtostring(addr, length, s)
/*
* Return length
*/
stringtoaddr(sp, addr)
char *sp;
char *addr;
stringtoaddr(char *sp, char *addr)
{
int n = 0;
char *p;
@ -1142,8 +1061,7 @@ stringtoaddr(sp, addr)
static char
hexnibble(c)
char c;
hexnibble(char c)
{
static char hextab[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
@ -1154,8 +1072,7 @@ hexnibble(c)
}
char*
dlprim(prim)
u_long prim;
dlprim(u_long prim)
{
static char primbuf[80];
@ -1195,8 +1112,7 @@ dlprim(prim)
char*
dlstate(state)
u_long state;
dlstate(u_long state)
{
static char statebuf[80];
@ -1229,8 +1145,7 @@ dlstate(state)
}
char*
dlerrno(errno)
u_long errno;
dlerrno(u_long errno)
{
static char errnobuf[80];
@ -1271,8 +1186,7 @@ dlerrno(errno)
}
char*
dlpromisclevel(level)
u_long level;
dlpromisclevel(u_long level)
{
static char levelbuf[80];
@ -1287,8 +1201,7 @@ dlpromisclevel(level)
}
char*
dlservicemode(servicemode)
u_long servicemode;
dlservicemode(u_long servicemode)
{
static char servicemodebuf[80];
@ -1304,8 +1217,7 @@ dlservicemode(servicemode)
}
char*
dlstyle(style)
long style;
dlstyle(long style)
{
static char stylebuf[80];
@ -1319,8 +1231,7 @@ dlstyle(style)
}
char*
dlmactype(media)
u_long media;
dlmactype(u_long media)
{
static char mediabuf[80];
@ -1340,28 +1251,21 @@ dlmactype(media)
}
/*VARARGS1*/
err(fmt, a1, a2, a3, a4)
char *fmt;
char *a1, *a2, *a3, *a4;
err(char *fmt, char *a1, char *a2, char *a3, char *a4)
{
(void) fprintf(stderr, fmt, a1, a2, a3, a4);
(void) fprintf(stderr, "\n");
(void) exit(1);
}
syserr(s)
syserr(char *s)
char *s;
{
(void) perror(s);
exit(1);
}
strioctl(fd, cmd, timout, len, dp)
int fd;
int cmd;
int timout;
int len;
char *dp;
strioctl(int fd, int cmd, int timout, int len, char *dp)
{
struct strioctl sioc;
int rc;

View File

@ -31,9 +31,8 @@ static const char rcsid[] = "@(#)$Id$";
static char *ipbuf = NULL, *ethbuf = NULL;
u_short chksum(buf,len)
u_short *buf;
int len;
u_short
chksum(u_short *buf, int len)
{
u_long sum = 0;
int nwords = len >> 1;
@ -46,10 +45,8 @@ u_short chksum(buf,len)
}
int send_ether(nfd, buf, len, gwip)
int nfd, len;
char *buf;
struct in_addr gwip;
int
send_ether(int nfd, char *buf, int len, struct in_addr gwip)
{
static struct in_addr last_gw;
static char last_arp[6] = { 0, 0, 0, 0, 0, 0};
@ -81,11 +78,8 @@ int send_ether(nfd, buf, len, gwip)
/*
*/
int send_ip(nfd, mtu, ip, gwip, frag)
int nfd, mtu;
ip_t *ip;
struct in_addr gwip;
int frag;
int
send_ip(int nfd, int mtu, ip_t *ip, struct in_addr gwip, int frag)
{
static struct in_addr last_gw, local_ip;
static char local_arp[6] = { 0, 0, 0, 0, 0, 0};
@ -242,10 +236,8 @@ int send_ip(nfd, mtu, ip, gwip, frag)
/*
* send a tcp packet.
*/
int send_tcp(nfd, mtu, ip, gwip)
int nfd, mtu;
ip_t *ip;
struct in_addr gwip;
int
send_tcp(int nfd, int mtu, ip_t *ip, struct in_addr gwip)
{
static tcp_seq iss = 2;
tcphdr_t *t, *t2;
@ -295,10 +287,8 @@ int send_tcp(nfd, mtu, ip, gwip)
/*
* send a udp packet.
*/
int send_udp(nfd, mtu, ip, gwip)
int nfd, mtu;
ip_t *ip;
struct in_addr gwip;
int
send_udp(int nfd, int mtu, ip_t *ip, struct in_addr gwip)
{
struct tcpiphdr *ti;
int thlen;
@ -327,10 +317,8 @@ int send_udp(nfd, mtu, ip, gwip)
/*
* send an icmp packet.
*/
int send_icmp(nfd, mtu, ip, gwip)
int nfd, mtu;
ip_t *ip;
struct in_addr gwip;
int
send_icmp(int nfd, int mtu, ip_t *ip, in_addr gwip)
{
struct icmp *ic;
@ -343,7 +331,8 @@ int send_icmp(nfd, mtu, ip, gwip)
}
int send_packet(nfd, mtu, ip, gwip)
int
send_packet(int nfd, int mtu, ip_t *ip, struct in_addr gwip)
int nfd, mtu;
ip_t *ip;
struct in_addr gwip;

View File

@ -64,9 +64,8 @@ static void usage(prog)
}
int main(argc, argv)
int argc;
char **argv;
int
main(int argc, char **argv)
{
struct in_addr gwip;
struct ipread *ipr = NULL;

View File

@ -71,9 +71,8 @@ static void usage(prog)
}
static void do_icmp(ip, args)
ip_t *ip;
char *args;
static
void do_icmp(ip_t *ip, char *args)
{
struct icmp *ic;
char *s;
@ -122,11 +121,8 @@ static void do_icmp(ip, args)
}
int send_packets(dev, mtu, ip, gwip)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int
send_packets(char *dev, int mtu, ip_t *ip, struct in_addr gwip)
{
int wfd;
@ -168,9 +164,8 @@ udpcksum(ip_t *ip, struct udphdr *udp, int len)
udp->uh_sum = 0xffff;
}
int main(argc, argv)
int argc;
char **argv;
int
main(int argc, char **argv)
{
FILE *langfile = NULL;
struct in_addr gwip;

View File

@ -72,11 +72,8 @@ u_short ipseclevel(slevel)
}
int addipopt(op, io, len, class)
char *op;
struct ipopt_names *io;
int len;
char *class;
int
addipopt(char *op, struct ipopt_names *io, int len, char *class)
{
struct in_addr ipadr;
int olen = len, srr = 0;
@ -143,7 +140,8 @@ int addipopt(op, io, len, class)
}
u_32_t buildopts(cp, op, len)
u_32_t
buildopts(char *cp, char *op, int len)
char *cp, *op;
int len;
{

View File

@ -63,9 +63,8 @@ static void usage(prog)
}
int main(argc, argv)
int argc;
char **argv;
int
main(int argc, char **argv)
{
struct tcpiphdr *ti;
struct in_addr gwip;

View File

@ -95,12 +95,8 @@ typedef int boolean_t;
#endif
void ip_test1(dev, mtu, ip, gwip, ptest)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int ptest;
void
ip_test1(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest)
{
#ifdef USE_NANOSLEEP
struct timespec ts;
@ -542,12 +538,8 @@ void ip_test2(dev, mtu, ip, gwip, ptest)
/*
* test 3 (ICMP)
*/
void ip_test3(dev, mtu, ip, gwip, ptest)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int ptest;
void
ip_test3(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest)
{
static int ict1[10] = { 8, 9, 10, 13, 14, 15, 16, 17, 18, 0 };
static int ict2[8] = { 3, 9, 10, 13, 14, 17, 18, 0 };
@ -743,12 +735,8 @@ void ip_test3(dev, mtu, ip, gwip, ptest)
/* Perform test 4 (UDP) */
void ip_test4(dev, mtu, ip, gwip, ptest)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int ptest;
void
ip_test4(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest)
{
#ifdef USE_NANOSLEEP
struct timespec ts;
@ -908,12 +896,8 @@ void ip_test4(dev, mtu, ip, gwip, ptest)
/* Perform test 5 (TCP) */
void ip_test5(dev, mtu, ip, gwip, ptest)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int ptest;
void
ip_test5(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest)
{
#ifdef USE_NANOSLEEP
struct timespec ts;
@ -1256,12 +1240,8 @@ void ip_test5(dev, mtu, ip, gwip, ptest)
/* Perform test 6 (exhaust mbuf test) */
void ip_test6(dev, mtu, ip, gwip, ptest)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int ptest;
void
ip_test6(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest)
{
#ifdef USE_NANOSLEEP
struct timespec ts;
@ -1338,12 +1318,8 @@ void ip_test6(dev, mtu, ip, gwip, ptest)
static u_long tbuf[64];
void ip_test7(dev, mtu, ip, gwip, ptest)
char *dev;
int mtu;
ip_t *ip;
struct in_addr gwip;
int ptest;
void
ip_test7(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest)
{
ip_t *pip;
#ifdef USE_NANOSLEEP

View File

@ -33,8 +33,8 @@ extern int opts;
void dumppacket(ip_t *);
void dumppacket(ip)
ip_t *ip;
void
dumppacket(ip_t *ip)
{
tcphdr_t *t;
int i, j;
@ -63,12 +63,9 @@ void dumppacket(ip)
}
int ip_resend(dev, mtu, r, gwip, datain)
char *dev;
int mtu;
struct in_addr gwip;
struct ipread *r;
char *datain;
int
ip_resend(char *dev, int mtu, struct ipread *r, struct in_addr gwip,
char *datain)
{
ether_header_t *eh;
char dhost[6];

View File

@ -52,9 +52,8 @@ static u_char *buf = NULL;
static int bufsize = 0, timeout = 1;
int initdevice(device, tout)
char *device;
int tout;
int
initdevice(char *device, int tout)
{
struct bpf_version bv;
struct timeval to;
@ -136,9 +135,8 @@ int initdevice(device, tout)
/*
* output an IP packet onto a fd opened for /dev/bpf
*/
int sendip(fd, pkt, len)
int fd, len;
char *pkt;
int
sendip(int fd, char *pkt, int len)
{
if (write(fd, pkt, len) == -1)
{

View File

@ -52,9 +52,8 @@ static const char rcsid[] = "@(#)$Id$";
* Be careful to only include those defined in the flags option for the
* interface are included in the header size.
*/
int initdevice(device, tout)
char *device;
int tout;
int
initdevice(char *device, int tout)
{
char devname[16], *s, buf[256];
int i, fd;
@ -127,7 +126,8 @@ int initdevice(device, tout)
/*
* output an IP packet onto a fd opened for /dev/nit
*/
int sendip(fd, pkt, len)
int
sendip(int fd, char *pkt, int len)
int fd, len;
char *pkt;
{

View File

@ -57,9 +57,8 @@ static const char rcsid[] = "@(#)$Id$";
static int timeout;
int initdevice(device, tout)
char *device;
int tout;
int
initdevice(char *device, int tout)
{
struct strioctl si;
struct timeval to;
@ -114,7 +113,8 @@ int initdevice(device, tout)
/*
* output an IP packet onto a fd opened for /dev/nit
*/
int sendip(fd, pkt, len)
int
sendip(int fd, char *pkt, int len)
int fd, len;
char *pkt;
{

View File

@ -99,10 +99,8 @@ struct proc *proc;
static struct kinfo_proc *getproc(void);
int kmemcpy(buf, pos, n)
char *buf;
void *pos;
int n;
int
kmemcpy(char *buf, void *pos, int n)
{
static int kfd = -1;
off_t offset = (u_long)pos;
@ -130,7 +128,8 @@ struct nlist names[4] = {
{ NULL }
};
static struct kinfo_proc *getproc()
static struct
kinfo_proc *getproc(void)
{
static struct kinfo_proc kp;
pid_t pid = getpid();
@ -152,9 +151,8 @@ static struct kinfo_proc *getproc()
}
struct tcpcb *find_tcp(tfd, ti)
int tfd;
struct tcpiphdr *ti;
struct tcpcb *
find_tcp(int tfd, struct tcpiphdr *ti)
{
struct tcpcb *t;
struct inpcb *i;
@ -247,11 +245,8 @@ struct tcpcb *find_tcp(tfd, ti)
return NULL;
}
int do_socket(dev, mtu, ti, gwip)
char *dev;
int mtu;
struct tcpiphdr *ti;
struct in_addr gwip;
int
do_socket(char *dev, int mtu, struct tcpiphdr *ti, struct in_addr gwip)
{
struct sockaddr_in rsin, lsin;
struct tcpcb *t, tcb;

View File

@ -34,7 +34,8 @@ static char sirix[] = "@(#)sirix.c 1.0 10/9/97 (C)1997 Marc Boucher";
#endif
int initdevice(char *device, int tout)
int
initdevice(char *device, int tout)
{
struct sockaddr s;
struct ifreq ifr;

View File

@ -11,11 +11,8 @@
#include "ipf.h"
int addipopt(op, io, len, class)
char *op;
struct ipopt_names *io;
int len;
char *class;
int
addipopt(char *op, struct ipopt_names *io, int len, char *class)
{
int olen = len;
struct in_addr ipadr;

View File

@ -8,8 +8,7 @@
#include "ipf.h"
void
alist_free(hosts)
alist_t *hosts;
alist_free(alist_t *hosts)
{
alist_t *a, *next;

View File

@ -8,7 +8,8 @@
#include "ipf.h"
mb_t *allocmbt(size_t len)
mb_t *
allocmbt(size_t len)
{
mb_t *m;

View File

@ -8,8 +8,8 @@
#include "ipf.h"
void assigndefined(env)
char *env;
void
assigndefined(char *env)
{
char *s, *t;

View File

@ -10,9 +10,8 @@
#include "ipf.h"
int bcopywrap(from, to, size)
void *from, *to;
size_t size;
int
bcopywrap(void *from, void *to, size_t size)
{
bcopy((caddr_t)from, (caddr_t)to, size);
return 0;

View File

@ -11,9 +11,8 @@
#include "ipf.h"
void binprint(ptr, size)
void *ptr;
size_t size;
void
binprint(void *ptr, size_t size)
{
u_char *s;
int i, j;

View File

@ -11,9 +11,8 @@
#include "ipf.h"
u_32_t buildopts(cp, op, len)
char *cp, *op;
int len;
u_32_t
buildopts(char *cp, char *op, int len)
{
struct ipopt_names *io;
u_32_t msk = 0;

View File

@ -14,8 +14,8 @@
#include "ipf.h"
#include "netinet/ipl.h"
int checkrev(ipfname)
char *ipfname;
int
checkrev(char *ipfname)
{
static int vfd = -1;
struct friostat fio;

View File

@ -16,8 +16,8 @@
* consecutive 1's is different to that passed, return -1, else return #
* of bits.
*/
int count4bits(ip)
u_int ip;
int
count4bits(u_int ip)
{
int cnt = 0, i, j;
u_int ipn;

View File

@ -11,8 +11,8 @@
#include "ipf.h"
int count6bits(msk)
u_32_t *msk;
int
count6bits(u_32_t *msk)
{
int i = 0, k;
u_32_t j;

View File

@ -8,8 +8,8 @@
#include "ipf.h"
mb_t *dupmbt(orig)
mb_t *orig;
mb_t *
dupmbt(mb_t *orig)
{
mb_t *m;

View File

@ -74,8 +74,7 @@ table_t facs[] = {
* map a facility number to its name
*/
char *
fac_toname(facpri)
int facpri;
fac_toname(int facpri)
{
int i, j, fac;
@ -97,8 +96,7 @@ fac_toname(facpri)
* map a facility name to its number
*/
int
fac_findname(name)
char *name;
fac_findname(char *name)
{
int i;
@ -122,8 +120,7 @@ table_t pris[] = {
* map a facility name to its number
*/
int
pri_findname(name)
char *name;
pri_findname(char *name)
{
int i;
@ -138,8 +135,7 @@ pri_findname(name)
* map a priority number to its name
*/
char *
pri_toname(facpri)
int facpri;
pri_toname(int facpri)
{
int i, pri;

View File

@ -1,6 +1,7 @@
#include "ipf.h"
const char *familyname(int family)
const char *
familyname(int family)
{
if (family == AF_INET)
return "inet";

View File

@ -11,9 +11,8 @@
#include "ipf.h"
void fill6bits(bits, msk)
int bits;
u_int *msk;
void
fill6bits(int bits, u_int *msk)
{
if (bits == 0) {
msk[0] = 0;

View File

@ -9,9 +9,8 @@
#include "ipf.h"
wordtab_t *findword(words, name)
wordtab_t *words;
char *name;
wordtab_t *
findword(wordtab_t *words, char *name)
{
wordtab_t *w;

View File

@ -8,8 +8,8 @@
#include "ipf.h"
void freembt(m)
mb_t *m;
void
freembt(mb_t *m)
{
free(m);

View File

@ -1,8 +1,7 @@
#include "ipf.h"
int
ftov(version)
int version;
ftov(int version)
{
#ifdef USE_INET6
if (version == AF_INET6)

View File

@ -10,10 +10,8 @@
#include "ipf.h"
int gethost(family, name, hostp)
int family;
char *name;
i6addr_t *hostp;
int
gethost(int family, char *name, i6addr_t *hostp)
{
struct hostent *h;
struct netent *n;

View File

@ -7,9 +7,8 @@
*/
#include "ipf.h"
int geticmptype(family, name)
int family;
char *name;
int
geticmptype(int family, char *name)
{
icmptype_t *i;

View File

@ -16,8 +16,8 @@
* Given a pointer to an interface in the kernel, return a pointer to a
* string which is the interface name.
*/
char *getifname(ptr)
struct ifnet *ptr;
char *
getifname(struct ifnet *ptr)
{
#if SOLARIS
# include <sys/mutex.h>

View File

@ -19,8 +19,7 @@ static const char rcsid[] = "@(#)$Id$";
* Get a nat filter type given its kernel address.
*/
char *
getnattype(nat)
nat_t *nat;
getnattype(nat_t *nat)
{
static char unknownbuf[20];
char *which;

View File

@ -11,10 +11,8 @@
#include "ipf.h"
#include <ctype.h>
int getport(fr, name, port, proto)
frentry_t *fr;
char *name, *proto;
u_short *port;
int
getport(frentry_t *fr, char *name, u_short *port, char *proto)
{
struct protoent *p;
struct servent *s;

View File

@ -11,9 +11,8 @@
#include <ctype.h>
#include "ipf.h"
int getportproto(name, proto)
char *name;
int proto;
int
getportproto(char *name, int proto)
{
struct servent *s;
struct protoent *p;

View File

@ -11,8 +11,10 @@
#include "ipf.h"
#include <ctype.h>
int getproto(name)
char *name;
int getproto(char *name);
int
getproto(char *name)
{
struct protoent *p;
char *s;

View File

@ -10,8 +10,8 @@
#include "ipf.h"
char *getsumd(sum)
u_32_t sum;
char *
getsumd(u_32_t sum)
{
static char sumdbuf[17];

View File

@ -7,8 +7,8 @@
*/
#include "ipf.h"
char *icmptypename(family, type)
int family, type;
char *
icmptypename(int family, int type)
{
icmptype_t *i;

View File

@ -92,9 +92,7 @@ int inet_aton(const char *, struct in_addr *);
* cannot distinguish between failure and a local broadcast address.
*/
int
inet_aton(cp, addr)
register const char *cp;
struct in_addr *addr;
inet_aton(register const char *cp, struct in_addr *addr)
{
register u_long val;
register int base, n;
@ -192,8 +190,7 @@ inet_aton(cp, addr)
* The value returned is in network order.
*/
#if 0
inet_addr(cp)
const char *cp;
inet_addr(const char *cp)
{
struct in_addr val;

View File

@ -520,8 +520,7 @@ log" },
static ipf_error_entry_t *
find_error(errnum)
int errnum;
find_error(int errnum)
{
ipf_error_entry_t *ie;
@ -544,9 +543,7 @@ find_error(errnum)
}
char *
ipf_geterror(fd, func)
int fd;
ioctlfunc_t *func;
ipf_geterror(int fd, ioctlfunc_t *func)
{
static char text[80];
ipf_error_entry_t *ie;
@ -566,8 +563,7 @@ ipf_geterror(fd, func)
char *
ipf_strerror(errnum)
int errnum;
ipf_strerror(int errnum)
{
static char text[80];
ipf_error_entry_t *ie;

View File

@ -12,10 +12,7 @@
#include "netinet/ipl.h"
#include <sys/ioctl.h>
void ipf_dotuning(fd, tuneargs, iocfn)
int fd;
char *tuneargs;
ioctlfunc_t iocfn;
void ipf_dotuning(int fd, char *tuneargs, ioctlfunc_t iocfn)
{
ipfobj_t obj;
ipftune_t tu;

View File

@ -3,9 +3,7 @@
#include "ipf.h"
void
ipf_perror(err, string)
int err;
char *string;
ipf_perror(int err, char *string)
{
if (err == 0)
fprintf(stderr, "%s\n", string);
@ -14,10 +12,7 @@ ipf_perror(err, string)
}
int
ipf_perror_fd(fd, iocfunc, string)
int fd;
ioctlfunc_t iocfunc;
char *string;
ipf_perror_fd( int fd, ioctlfunc_t iocfunc, char *string)
{
int save;
int realerr;
@ -34,9 +29,7 @@ ipf_perror_fd(fd, iocfunc, string)
}
void
ipferror(fd, msg)
int fd;
char *msg;
ipferror(int fd, char *msg)
{
if (fd >= 0) {
ipf_perror_fd(fd, ioctl, msg);

View File

@ -27,8 +27,8 @@ struct ipread iphex = { hex_open, hex_close, hex_readip, 0 };
static FILE *tfp = NULL;
static int tfd = -1;
static int hex_open(fname)
char *fname;
static int
hex_open(char *fname)
{
if (tfp && tfd != -1) {
rewind(tfp);
@ -47,7 +47,8 @@ static int hex_open(fname)
}
static int hex_close()
static int
hex_close(void)
{
int cfd = tfd;
@ -56,10 +57,8 @@ static int hex_close()
}
static int hex_readip(mb, ifn, dir)
mb_t *mb;
char **ifn;
int *dir;
static int
hex_readip(mb_t *mb, char **ifn, int *dir)
{
register char *s, *t, *u;
char line[513];
@ -153,8 +152,8 @@ static int hex_readip(mb, ifn, dir)
}
static char *readhex(src, dst)
register char *src, *dst;
static char
*readhex(register char *src, register char *dst)
{
int state = 0;
char c;

View File

@ -67,8 +67,8 @@ struct ipread pcap = { ipcap_open, ipcap_close, ipcap_readip, 0 };
#define SWAPSHORT(y) \
( (((y)&0xff)<<8) | (((y)&0xff00)>>8) )
static void iswap_hdr(p)
fileheader_t *p;
static void
iswap_hdr(fileheader_t *p)
{
p->major = SWAPSHORT(p->major);
p->minor = SWAPSHORT(p->minor);
@ -78,8 +78,8 @@ static void iswap_hdr(p)
p->type = SWAPLONG(p->type);
}
static int ipcap_open(fname)
char *fname;
static int
ipcap_open(char *fname)
{
fileheader_t ph;
int fd, i;
@ -124,7 +124,8 @@ static int ipcap_open(fname)
}
static int ipcap_close()
static int
ipcap_close(void)
{
return close(pfd);
}
@ -134,8 +135,8 @@ static int ipcap_close()
* read in the header (and validate) which should be the first record
* in a pcap file.
*/
static int ipcap_read_rec(rec)
packetheader_t *rec;
static int
ipcap_read_rec(packetheader_t *rec)
{
int n, p, i;
@ -170,9 +171,8 @@ static int ipcap_read_rec(rec)
* read an entire pcap packet record. only the data part is copied into
* the available buffer, with the number of bytes copied returned.
*/
static int ipcap_read(buf, cnt)
char *buf;
int cnt;
static int
ipcap_read(char *buf, int cnt)
{
packetheader_t rec;
static char *bufp = NULL;
@ -199,10 +199,8 @@ static int ipcap_read(buf, cnt)
/*
* return only an IP packet read into buf
*/
static int ipcap_readip(mb, ifn, dir)
mb_t *mb;
char **ifn;
int *dir;
static int
ipcap_readip(mb_t *mb, char **ifn, int *dir)
{
static char *bufp = NULL;
packetheader_t rec;

View File

@ -44,9 +44,8 @@ int parseipv6(char **, ip6_t *, char **, int *);
* returns an ip address as a long var as a result of either a DNS lookup or
* straight inet_addr() call
*/
static u_32_t tx_hostnum(host, resolved)
char *host;
int *resolved;
static u_32_t
tx_hostnum(char *host, int *resolved)
{
i6addr_t ipa;
@ -69,8 +68,8 @@ static u_32_t tx_hostnum(host, resolved)
* find the port number given by the name, either from getservbyname() or
* straight atoi()
*/
static u_short tx_portnum(name)
char *name;
static u_short
tx_portnum(char *name)
{
struct servent *sp;
@ -84,8 +83,8 @@ static u_short tx_portnum(name)
}
static int text_open(fname)
char *fname;
static int
text_open(char *fname)
{
if (tfp && tfd != -1) {
rewind(tfp);
@ -104,7 +103,8 @@ static int text_open(fname)
}
static int text_close()
static int
text_close(void)
{
int cfd = tfd;
@ -113,10 +113,8 @@ static int text_close()
}
static int text_readip(mb, ifn, dir)
mb_t *mb;
char **ifn;
int *dir;
static int
text_readip(mb_t *mb, char **ifn, int *dir)
{
register char *s;
char line[513];
@ -159,11 +157,8 @@ static int text_readip(mb, ifn, dir)
return -1;
}
static int parseline(line, ip, ifn, out)
char *line;
ip_t *ip;
char **ifn;
int *out;
static int
parseline(char *line, ip_t *ip, char **ifn, int *out)
{
tcphdr_t th, *tcp = &th;
struct icmp icmp, *ic = &icmp;
@ -337,11 +332,8 @@ static int parseline(line, ip, ifn, out)
#ifdef USE_INET6
int parseipv6(cpp, ip6, ifn, out)
char **cpp;
ip6_t *ip6;
char **ifn;
int *out;
int
parseipv6(char **cpp, ip6_t *ip6, char **ifn, int *out)
{
tcphdr_t th, *tcp = &th;
struct icmp6_hdr icmp, *ic6 = &icmp;

View File

@ -24,8 +24,8 @@ struct ipopt_names secclass[] = {
};
u_char seclevel(slevel)
char *slevel;
u_char
seclevel(char *slevel)
{
struct ipopt_names *so;
@ -44,8 +44,8 @@ u_char seclevel(slevel)
}
u_char secbit(class)
int class;
u_char
secbit(int class)
{
struct ipopt_names *so;

View File

@ -40,8 +40,8 @@ static const char rcsid[] = "@(#)$Id$";
static kvm_t *kvm_f = NULL;
int openkmem(kern, core)
char *kern, *core;
int
openkmem(char *kern, char *core)
{
kvm_f = kvm_open(kern, core, NULL, O_RDONLY, NULL);
if (kvm_f == NULL)
@ -52,10 +52,8 @@ int openkmem(kern, core)
return kvm_f != NULL;
}
int kmemcpy(buf, pos, n)
register char *buf;
long pos;
register int n;
int
kmemcpy(register char *buf, long pos, register int n)
{
register int r;
@ -82,10 +80,8 @@ int kmemcpy(buf, pos, n)
return 0;
}
int kstrncpy(buf, pos, n)
register char *buf;
long pos;
register int n;
int
kstrncpy(register char *buf, long pos, register int n)
{
register int r;

View File

@ -11,9 +11,8 @@
#include "ipf.h"
#include "kmem.h"
int kmemcpywrap(from, to, size)
void *from, *to;
size_t size;
int
kmemcpywrap(void *from, void *to, size_t size)
{
int ret;

View File

@ -13,9 +13,8 @@
#include <fcntl.h>
#include <sys/ioctl.h>
char *kvatoname(func, iocfunc)
ipfunc_t func;
ioctlfunc_t iocfunc;
char *
kvatoname(ipfunc_t func, ioctlfunc_t iocfunc)
{
static char funcname[40];
ipfunc_resolve_t res;

View File

@ -14,10 +14,7 @@
int
load_dstlist(dst, iocfunc, nodes)
ippool_dst_t *dst;
ioctlfunc_t iocfunc;
ipf_dstnode_t *nodes;
load_dstlist(ippool_dst_t *dst, ioctlfunc_t iocfunc, ipf_dstnode_t *nodes)
{
iplookupop_t op;
ipf_dstnode_t *a;

View File

@ -14,11 +14,8 @@
int
load_dstlistnode(role, name, node, iocfunc)
int role;
char *name;
ipf_dstnode_t *node;
ioctlfunc_t iocfunc;
load_dstlistnode(int role, char *name, ipf_dstnode_t *node,
ioctlfunc_t iocfunc)
{
iplookupop_t op;
frdest_t *dst;

View File

@ -16,10 +16,7 @@
int
load_hash(iphp, list, iocfunc)
iphtable_t *iphp;
iphtent_t *list;
ioctlfunc_t iocfunc;
load_hash(iphtable_t *iphp, iphtent_t *list, ioctlfunc_t iocfunc)
{
iplookupop_t op;
iphtable_t iph;

View File

@ -16,12 +16,8 @@
int
load_hashnode(unit, name, node, ttl, iocfunc)
int unit;
char *name;
iphtent_t *node;
int ttl;
ioctlfunc_t iocfunc;
load_hashnode(int unit, char *name, iphtent_t *node, int ttl,
ioctlfunc_t iocfunc)
{
iplookupop_t op;
iphtent_t ipe;

View File

@ -16,9 +16,7 @@
int
load_pool(plp, iocfunc)
ip_pool_t *plp;
ioctlfunc_t iocfunc;
load_pool(ip_pool_t *plp, ioctlfunc_t iocfunc)
{
iplookupop_t op;
ip_pool_node_t *a;

View File

@ -16,12 +16,8 @@
int
load_poolnode(role, name, node, ttl, iocfunc)
int role;
char *name;
ip_pool_node_t *node;
int ttl;
ioctlfunc_t iocfunc;
load_poolnode(int role, char *name, ip_pool_node_t *node, int ttl,
ioctlfunc_t iocfunc)
{
ip_pool_node_t pn;
iplookupop_t op;

View File

@ -9,9 +9,7 @@
#include "ipf.h"
void
mb_hexdump(m, fp)
mb_t *m;
FILE *fp;
mb_hexdump(mb_t *m, FILE *fp)
{
u_char *s;
int len;

View File

@ -8,8 +8,7 @@
#include "ipf.h"
size_t msgdsize(orig)
mb_t *orig;
size_t msgdsize(mb_t *orig)
{
size_t sz = 0;
mb_t *m;

View File

@ -17,10 +17,7 @@ static FILE *mutex_file = NULL;
static int initcount = 0;
void
eMmutex_enter(mtx, file, line)
eMmutex_t *mtx;
char *file;
int line;
eMmutex_enter(eMmutex_t *mtx, char *file, int line)
{
if (mutex_debug & 2)
fprintf(mutex_file, "%s:%d:eMmutex_enter(%s)\n", file, line,
@ -42,10 +39,7 @@ eMmutex_enter(mtx, file, line)
void
eMmutex_exit(mtx, file, line)
eMmutex_t *mtx;
char *file;
int line;
eMmutex_exit(eMmutex_t *mtx, char *file, int line)
{
if (mutex_debug & 2)
fprintf(mutex_file, "%s:%d:eMmutex_exit(%s)\n", file, line,
@ -67,11 +61,7 @@ eMmutex_exit(mtx, file, line)
void
eMmutex_init(mtx, who, file, line)
eMmutex_t *mtx;
char *who;
char *file;
int line;
eMmutex_init(eMmutex_t *mtx, char *who, char *file, int line)
{
if (mutex_file == NULL && mutex_debug)
mutex_file = fopen("ipf_mutex_log", "w");
@ -123,7 +113,7 @@ eMmutex_destroy(mtx, file, line)
void
ipf_mutex_clean()
ipf_mutex_clean(void)
{
if (initcount != 0) {
if (mutex_file)

View File

@ -13,9 +13,8 @@
#include <sys/ioctl.h>
#include <fcntl.h>
ipfunc_t nametokva(name, iocfunc)
char *name;
ioctlfunc_t iocfunc;
ipfunc_t
nametokva(char *name, ioctlfunc_t iocfunc)
{
ipfunc_resolve_t res;
int fd;

View File

@ -11,8 +11,8 @@ static const char rcsid[] = "@(#)$Id$";
#include "ipf.h"
void nat_setgroupmap(n)
ipnat_t *n;
void
nat_setgroupmap(ipnat_t *n)
{
if (n->in_nsrcmsk == n->in_osrcmsk)
n->in_ippip = 1;

View File

@ -10,9 +10,8 @@
#include "ipf.h"
int ntomask(family, nbits, ap)
int family, nbits;
u_32_t *ap;
int
ntomask(int family, int nbits, u_32_t *ap)
{
u_32_t mask;

View File

@ -11,10 +11,8 @@
#include "ipf.h"
u_32_t optname(cp, sp, linenum)
char ***cp;
u_short *sp;
int linenum;
u_32_t
optname(char ***cp, u_short *sp, int linenum)
{
struct ipopt_names *io, *so;
u_long msk = 0;

View File

@ -10,9 +10,8 @@
#include "ipf.h"
void optprint(sec, optmsk, optbits)
u_short *sec;
u_long optmsk, optbits;
void
optprint(u_short *sec, u_long optmsk, u_long optbits)
{
u_short secmsk = sec[0], secbits = sec[1];
struct ipopt_names *io, *so;

View File

@ -12,9 +12,8 @@
#ifdef USE_INET6
void optprintv6(sec, optmsk, optbits)
u_short *sec;
u_long optmsk, optbits;
void
optprintv6(u_short *sec, u_long optmsk, u_long optbits)
{
u_short secmsk = sec[0], secbits = sec[1];
struct ipopt_names *io;

View File

@ -10,8 +10,8 @@
#include "ipf.h"
u_32_t getoptbyname(optname)
char *optname;
u_32_t
getoptbyname(char *optname)
{
struct ipopt_names *io;
@ -22,8 +22,8 @@ u_32_t getoptbyname(optname)
}
u_32_t getoptbyvalue(optval)
int optval;
u_32_t
getoptbyvalue(int optval)
{
struct ipopt_names *io;

View File

@ -3,9 +3,7 @@
extern int nohdrfields;
wordtab_t *parsefields(table, arg)
wordtab_t *table;
char *arg;
wordtab_t *parsefields(wordtab_t *table, char *arg)
{
wordtab_t *f, *fields;
char *s, *t;

View File

@ -32,9 +32,7 @@ static ipfopentry_t opwords[17] = {
int *
parseipfexpr(line, errorptr)
char *line;
char **errorptr;
parseipfexpr(char *line, char **errorptr)
{
int not, items, asize, *oplist, osize, i;
char *temp, *arg, *s, *t, *ops, *error;

View File

@ -12,10 +12,7 @@ Microsoft Corp MICROSOFT19 (NET-198-136-97-0-1) 198.137.97.0 - 198.137.97.255
Microsoft Corp SAVV-S233053-6 (NET-206-79-74-32-1) 206.79.74.32 - 206.79.74.47
*/
int
parsewhoisline(line, addrp, maskp)
char *line;
addrfamily_t *addrp;
addrfamily_t *maskp;
parsewhoisline(char *line, addrfamily_t *addrp, addrfamily_t *maskp)
{
struct in_addr a1, a2;
char *src = line;

View File

@ -16,7 +16,7 @@ static int poolfd = -1;
int
pool_open()
pool_open(void)
{
if ((opts & OPT_DONTOPEN) != 0)
@ -38,7 +38,7 @@ pool_ioctl(iocfunc, cmd, ptr)
void
pool_close()
pool_close(void)
{
if (poolfd != -1) {
close(poolfd);
@ -47,7 +47,7 @@ pool_close()
}
int
pool_fd()
pool_fd(void)
{
return poolfd;
}

View File

@ -8,9 +8,7 @@
#include "ipf.h"
int prependmbt(fin, m)
fr_info_t *fin;
mb_t *m;
int prependmbt( fr_info_t *fin, mb_t *m)
{
m->mb_next = *fin->fin_mp;
*fin->fin_mp = m;

View File

@ -12,11 +12,7 @@
void
print_toif(family, tag, base, fdp)
int family;
char *tag;
char *base;
frdest_t *fdp;
print_toif(int family, char *tag, char *base, frdest_t *fdp)
{
switch (fdp->fd_type)
{

View File

@ -15,10 +15,7 @@ static const char rcsid[] = "@(#)$Id: printactiveaddr.c,v 1.3.2.2 2012/07/22 08:
void
printactiveaddress(v, fmt, addr, ifname)
int v;
char *fmt, *ifname;
i6addr_t *addr;
printactiveaddress(int v, char *fmt, i6addr_t *addr, char *ifname)
{
switch (v)
{

View File

@ -17,10 +17,7 @@ static const char rcsid[] = "@(#)$Id$";
void
printactivenat(nat, opts, ticks)
nat_t *nat;
int opts;
u_long ticks;
printactivenat(nat_t *nat, int opts, u_long ticks)
{
PRINTF("%s", getnattype(nat));

View File

@ -9,10 +9,8 @@
#include "ipf.h"
void
printaddr(family, type, base, ifidx, addr, mask)
int family, type, ifidx;
char *base;
u_32_t *addr, *mask;
printaddr(int family, int type, char *base, int ifidx, u_32_t *addr,
u_32_t *mask)
{
char *suffix;

View File

@ -18,9 +18,7 @@ static const char rcsid[] = "@(#)$Id$";
void
printaps(aps, opts, proto)
ap_session_t *aps;
int opts, proto;
printaps(ap_session_t *aps, int opts, int proto)
{
ipsec_pxy_t ipsec;
ap_session_t ap;

View File

@ -14,9 +14,7 @@
void
printbuf(buf, len, zend)
char *buf;
int len, zend;
printbuf(char *buf, int len, int zend)
{
char *s;
int c;

View File

@ -14,12 +14,8 @@
* the size may be larger than just sizeof().
*/
ippool_dst_t *
printdstl_live(d, fd, name, opts, fields)
ippool_dst_t *d;
int fd;
char *name;
int opts;
wordtab_t *fields;
printdstl_live( ippool_dst_t *d, int fd, char *name, int opts,
wordtab_t *fields)
{
ipf_dstnode_t *entry, *zero;
ipflookupiter_t iter;

View File

@ -8,13 +8,8 @@
ippool_dst_t *
printdstlist(pp, copyfunc, name, opts, nodes, fields)
ippool_dst_t *pp;
copyfunc_t copyfunc;
char *name;
int opts;
ipf_dstnode_t *nodes;
wordtab_t *fields;
printdstlist( ippool_dst_t *pp, copyfunc_t copyfunc, char *name, int opts,
ipf_dstnode_t *nodes, wordtab_t *fields)
{
ipf_dstnode_t *node;
ippool_dst_t dst;

View File

@ -9,9 +9,7 @@
void
printdstlistdata(pool, opts)
ippool_dst_t *pool;
int opts;
printdstlistdata( ippool_dst_t *pool, int opts)
{
if ((opts & OPT_DEBUG) == 0) {

View File

@ -8,11 +8,8 @@
ipf_dstnode_t *
printdstlistnode(inp, copyfunc, opts, fields)
ipf_dstnode_t *inp;
copyfunc_t copyfunc;
int opts;
wordtab_t *fields;
printdstlistnode(ipf_dstnode_t *inp, copyfunc_t copyfunc, int opts,
wordtab_t *fields)
{
ipf_dstnode_t node, *np;
int i;

Some files were not shown because too many files have changed in this diff Show More