diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -420,9 +420,7 @@ /* for ipf_pr_short() for more details. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_short6(fin, xmin) - fr_info_t *fin; - int xmin; +ipf_pr_short6(fr_info_t *fin, int xmin) { if (fin->fin_dlen < xmin) @@ -442,8 +440,7 @@ /* of that possibility arising. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_ipv6hdr(fin) - fr_info_t *fin; +ipf_pr_ipv6hdr(fr_info_t *fin) { ip6_t *ip6 = (ip6_t *)fin->fin_ip; int p, go = 1, i, hdrcount; @@ -614,9 +611,7 @@ /* flag to indicate its presence. */ /* ------------------------------------------------------------------------ */ static INLINE struct ip6_ext * -ipf_pr_ipv6exthdr(fin, multiple, proto) - fr_info_t *fin; - int multiple, proto; +ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) { ipf_main_softc_t *softc = fin->fin_main_soft; struct ip6_ext *hdr; @@ -693,8 +688,7 @@ /* This is function checks pending hop by hop options extension header */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_hopopts6(fin) - fr_info_t *fin; +ipf_pr_hopopts6(fr_info_t *fin) { struct ip6_ext *hdr; @@ -714,8 +708,7 @@ /* This is function checks the IPv6 mobility extension header */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_mobility6(fin) - fr_info_t *fin; +ipf_pr_mobility6(fr_info_t *fin) { struct ip6_ext *hdr; @@ -735,8 +728,7 @@ /* This is function checks pending routing extension header */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_routing6(fin) - fr_info_t *fin; +ipf_pr_routing6(fr_info_t *fin) { struct ip6_routing *hdr; @@ -799,8 +791,7 @@ /* and no packet is allowed to overlay that where offset = 0. */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_fragment6(fin) - fr_info_t *fin; +ipf_pr_fragment6(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; struct ip6_frag *frag; @@ -858,8 +849,7 @@ /* This is function checks pending destination options extension header */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_dstopts6(fin) - fr_info_t *fin; +ipf_pr_dstopts6(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; struct ip6_ext *hdr; @@ -883,8 +873,7 @@ /* for an ICMPv6 packet. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_icmp6(fin) - fr_info_t *fin; +ipf_pr_icmp6(fr_info_t *fin) { int minicmpsz = sizeof(struct icmp6_hdr); struct icmp6_hdr *icmp6; @@ -971,8 +960,7 @@ /* Is not expected to be called for fragmented packets. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_udp6(fin) - fr_info_t *fin; +ipf_pr_udp6(fr_info_t *fin) { if (ipf_pr_udpcommon(fin) == 0) { @@ -995,8 +983,7 @@ /* Is not expected to be called for fragmented packets. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_tcp6(fin) - fr_info_t *fin; +ipf_pr_tcp6(fr_info_t *fin) { if (ipf_pr_tcpcommon(fin) == 0) { @@ -1022,8 +1009,7 @@ /* simple packet header. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_esp6(fin) - fr_info_t *fin; +ipf_pr_esp6(fr_info_t *fin) { if ((fin->fin_off == 0) && (ipf_pr_pullup(fin, 8) == -1)) { @@ -1046,8 +1032,7 @@ /* header being present and no authentication data (null algorithm used.) */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_ah6(fin) - fr_info_t *fin; +ipf_pr_ah6(fr_info_t *fin) { authhdr_t *ah; @@ -1079,8 +1064,7 @@ /* Analyse the packet for GRE properties. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_gre6(fin) - fr_info_t *fin; +ipf_pr_gre6(fr_info_t *fin) { grehdr_t *gre; @@ -1117,9 +1101,7 @@ /* - fin_ip) to what is passed through. */ /* ------------------------------------------------------------------------ */ int -ipf_pr_pullup(fin, plen) - fr_info_t *fin; - int plen; +ipf_pr_pullup(fr_info_t *fin, int plen) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -1166,9 +1148,7 @@ /* entire layer 4 header must be present (min). */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_short(fin, xmin) - fr_info_t *fin; - int xmin; +ipf_pr_short(fr_info_t *fin, int xmin) { if (fin->fin_off == 0) { @@ -1194,8 +1174,7 @@ /* XXX - other ICMP sanity checks? */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_icmp(fin) - fr_info_t *fin; +ipf_pr_icmp(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; int minicmpsz = sizeof(struct icmp); @@ -1314,8 +1293,7 @@ /* valid and mark the packet as bad if not. */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_tcpcommon(fin) - fr_info_t *fin; +ipf_pr_tcpcommon(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; int flags, tlen; @@ -1491,8 +1469,7 @@ /* with IPFILTER_CKSUM, check to see if the UDP checksum is valid. */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_udpcommon(fin) - fr_info_t *fin; +ipf_pr_udpcommon(fr_info_t *fin) { udphdr_t *udp; @@ -1526,8 +1503,7 @@ /* Analyse the packet for IPv4/TCP properties. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_tcp(fin) - fr_info_t *fin; +ipf_pr_tcp(fr_info_t *fin) { ipf_pr_short(fin, sizeof(tcphdr_t)); @@ -1546,8 +1522,7 @@ /* Analyse the packet for IPv4/UDP properties. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_udp(fin) - fr_info_t *fin; +ipf_pr_udp(fr_info_t *fin) { ipf_pr_short(fin, sizeof(udphdr_t)); @@ -1569,8 +1544,7 @@ /* simple packet header. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_esp(fin) - fr_info_t *fin; +ipf_pr_esp(fr_info_t *fin) { if (fin->fin_off == 0) { @@ -1594,8 +1568,7 @@ /* header being present and no authentication data (null algorithm used.) */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_pr_ah(fin) - fr_info_t *fin; +ipf_pr_ah(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; authhdr_t *ah; @@ -1643,8 +1616,7 @@ /* Analyse the packet for GRE properties. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_gre(fin) - fr_info_t *fin; +ipf_pr_gre(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; grehdr_t *gre; @@ -1677,8 +1649,7 @@ /* Check all options present and flag their presence if any exist. */ /* ------------------------------------------------------------------------ */ static INLINE void -ipf_pr_ipv4hdr(fin) - fr_info_t *fin; +ipf_pr_ipv4hdr(fr_info_t *fin) { u_short optmsk = 0, secmsk = 0, auth = 0; int hlen, ol, mv, p, i; @@ -1884,8 +1855,7 @@ /* */ /* ------------------------------------------------------------------------ */ static u_32_t -ipf_checkripso(s) - u_char *s; +ipf_checkripso(u_char *s) { const struct optlist *sp; u_short secmsk = 0, auth = 0; @@ -1929,10 +1899,7 @@ /* end nodes. */ /* ------------------------------------------------------------------------ */ static u_32_t -ipf_checkcipso(fin, s, ol) - fr_info_t *fin; - u_char *s; - int ol; +ipf_checkcipso(fr_info_t *fin, u_char *s, int ol) { ipf_main_softc_t *softc = fin->fin_main_soft; fr_ip_t *fi; @@ -2031,10 +1998,7 @@ /* this function will be called with either an IPv4 or IPv6 packet. */ /* ------------------------------------------------------------------------ */ int -ipf_makefrip(hlen, ip, fin) - int hlen; - ip_t *ip; - fr_info_t *fin; +ipf_makefrip(int hlen, ip_t *ip, fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; int v; @@ -2079,9 +2043,7 @@ /* structure with compare information stored in it. */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_portcheck(frp, pop) - frpcmp_t *frp; - u_32_t pop; +ipf_portcheck(frpcmp_t *frp, u_32_t pop) { int err = 1; u_32_t po; @@ -2146,9 +2108,7 @@ /* structure containing information that we want to match against. */ /* ------------------------------------------------------------------------ */ int -ipf_tcpudpchk(fi, ft) - fr_ip_t *fi; - frtuc_t *ft; +ipf_tcpudpchk(fr_ip_t *fi, frtuc_t *ft) { int err = 1; @@ -2203,10 +2163,7 @@ /* this function. */ /* ------------------------------------------------------------------------ */ static INLINE int -ipf_check_ipf(fin, fr, portcmp) - fr_info_t *fin; - frentry_t *fr; - int portcmp; +ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) { u_32_t *ld, *lm, *lip; fripf_t *fri; @@ -2383,9 +2340,7 @@ /* or can't easily change, the kernel source code to . */ /* ------------------------------------------------------------------------ */ int -ipf_scanlist(fin, pass) - fr_info_t *fin; - u_32_t pass; +ipf_scanlist(fr_info_t *fin, u_32_t pass) { ipf_main_softc_t *softc = fin->fin_main_soft; int rulen, portcmp, off, skip; @@ -2638,9 +2593,7 @@ /* functions called from the IPFilter "mainline" in ipf_check(). */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_acctpkt(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_acctpkt(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; char group[FR_GROUPLEN]; @@ -2681,9 +2634,7 @@ /* rule - except logging. */ /* ------------------------------------------------------------------------ */ static frentry_t * -ipf_firewall(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_firewall(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; frentry_t *fr; @@ -2804,19 +2755,12 @@ /* by "mp" changed to a new buffer. */ /* ------------------------------------------------------------------------ */ int -ipf_check(ctx, ip, hlen, ifp, out +ipf_check(void *ctx, ip_t *ip, int hlen, struct ifnet *ifp, int out #if defined(_KERNEL) && SOLARIS - , qif, mp) - void *qif; + , void* qif, mb_t **mp) #else - , mp) + , mb_t **mp) #endif - mb_t **mp; - ip_t *ip; - int hlen; - struct ifnet *ifp; - int out; - void *ctx; { /* * The above really sucks, but short of writing a diff @@ -3290,9 +3234,7 @@ /* logged. Adjust statistics based on its success or not. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_dolog(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_dolog(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; u_32_t pass; @@ -3351,9 +3293,7 @@ /* N.B.: addr should be 16bit aligned. */ /* ------------------------------------------------------------------------ */ u_short -ipf_cksum(addr, len) - u_short *addr; - int len; +ipf_cksum(u_short *addr, int len) { u_32_t sum = 0; @@ -3391,11 +3331,7 @@ /* Expects ip_len and ip_off to be in network byte order when called. */ /* ------------------------------------------------------------------------ */ u_short -fr_cksum(fin, ip, l4proto, l4hdr) - fr_info_t *fin; - ip_t *ip; - int l4proto; - void *l4hdr; +fr_cksum(fr_info_t *fin, ip_t *ip, int l4proto, void *l4hdr) { u_short *sp, slen, sumsave, *csump; u_int sum, sum2; @@ -3490,12 +3426,8 @@ /* Search amongst the defined groups for a particular group number. */ /* ------------------------------------------------------------------------ */ frgroup_t * -ipf_findgroup(softc, group, unit, set, fgpp) - ipf_main_softc_t *softc; - char *group; - minor_t unit; - int set; - frgroup_t ***fgpp; +ipf_findgroup(ipf_main_softc_t *softc, char *group, minor_t unit, int set, + frgroup_t ***fgpp) { frgroup_t *fg, **fgp; @@ -3533,13 +3465,8 @@ /* count to it. */ /* ------------------------------------------------------------------------ */ frgroup_t * -ipf_group_add(softc, group, head, flags, unit, set) - ipf_main_softc_t *softc; - char *group; - void *head; - u_32_t flags; - minor_t unit; - int set; +ipf_group_add(ipf_main_softc_t *softc, char *group, void *head, u_32_t flags, + minor_t unit, int set) { frgroup_t *fg, **fgp; u_32_t gflags; @@ -3594,10 +3521,7 @@ /* purpose of knowing when the head rule is being deleted. */ /* ------------------------------------------------------------------------ */ void -ipf_group_del(softc, group, fr) - ipf_main_softc_t *softc; - frgroup_t *group; - frentry_t *fr; +ipf_group_del(ipf_main_softc_t *softc, frgroup_t *group, frentry_t *fr) { if (group->fg_head == fr) @@ -3617,8 +3541,7 @@ /* Remove the group from the list of groups and free it. */ /* ------------------------------------------------------------------------ */ static void -ipf_group_free(group) - frgroup_t *group; +ipf_group_free(frgroup_t *group) { frgroup_t **gp; @@ -3641,9 +3564,7 @@ /* Remove all of the rules that currently are listed under the given group. */ /* ------------------------------------------------------------------------ */ static int -ipf_group_flush(softc, group) - ipf_main_softc_t *softc; - frgroup_t *group; +ipf_group_flush(ipf_main_softc_t *softc, frgroup_t *group) { int gone = 0; @@ -3666,11 +3587,7 @@ /* group # g doesn't exist or there are less than n rules in the group. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_getrulen(softc, unit, group, n) - ipf_main_softc_t *softc; - int unit; - char *group; - u_32_t n; +ipf_getrulen(ipf_main_softc_t *softc, int unit, char *group, u_32_t n) { frentry_t *fr; frgroup_t *fg; @@ -3704,10 +3621,7 @@ /* NOTE: Rules not loaded from user space cannot be flushed. */ /* ------------------------------------------------------------------------ */ static int -ipf_flushlist(softc, nfreedp, listp) - ipf_main_softc_t *softc; - int *nfreedp; - frentry_t **listp; +ipf_flushlist(ipf_main_softc_t *softc, int *nfreedp, frentry_t **listp) { int freed = 0; frentry_t *fp; @@ -3758,10 +3672,7 @@ /* and IPv6) as defined by the value of flags. */ /* ------------------------------------------------------------------------ */ int -ipf_flush(softc, unit, flags) - ipf_main_softc_t *softc; - minor_t unit; - int flags; +ipf_flush(ipf_main_softc_t *softc, minor_t unit, int flags) { int flushed = 0, set; @@ -3811,10 +3722,7 @@ /* removed from the group then it is necessary to start again. */ /* ------------------------------------------------------------------------ */ static int -ipf_flush_groups(softc, grhead, flags) - ipf_main_softc_t *softc; - frgroup_t **grhead; - int flags; +ipf_flush_groups(ipf_main_softc_t *softc, frgroup_t **grhead, int flags) { frentry_t *fr, **frp; frgroup_t *fg, **fgp; @@ -3861,10 +3769,7 @@ /* slen bytes. */ /* ------------------------------------------------------------------------ */ char * -memstr(src, dst, slen, dlen) - const char *src; - char *dst; - size_t slen, dlen; +memstr(const char *src, char *dst, size_t slen, size_t dlen) { char *s = NULL; @@ -3891,9 +3796,7 @@ /* where we are inserting to skip to the right place given the change. */ /* ------------------------------------------------------------------------ */ void -ipf_fixskip(listp, rp, addremove) - frentry_t **listp, *rp; - int addremove; +ipf_fixskip(frentry_t **listp, frentry_t *rp, int addremove) { int rules, rn; frentry_t *fp; @@ -3923,8 +3826,7 @@ /* of bits. */ /* ------------------------------------------------------------------------ */ int -count4bits(ip) - u_32_t ip; +count4bits(u_32_t ip) { u_32_t ipn; int cnt = 0, i, j; @@ -3957,8 +3859,7 @@ /* ------------------------------------------------------------------------ */ # ifdef USE_INET6 int -count6bits(msk) - u_32_t *msk; +count6bits(u_32_t *msk) { int i = 0, k; u_32_t j; @@ -3994,10 +3895,7 @@ /* that need to be dropped before returning with an error. */ /* ------------------------------------------------------------------------ */ static int -ipf_synclist(softc, fr, ifp) - ipf_main_softc_t *softc; - frentry_t *fr; - void *ifp; +ipf_synclist(ipf_main_softc_t *softc, frentry_t *fr, void *ifp) { frentry_t *frt, *start = fr; frdest_t *fdp; @@ -4111,9 +4009,7 @@ /* needs to be changed/updated. */ /* ------------------------------------------------------------------------ */ int -ipf_sync(softc, ifp) - ipf_main_softc_t *softc; - void *ifp; +ipf_sync(ipf_main_softc_t *softc, void *ifp) { int i; @@ -4160,10 +4056,7 @@ /* NB: src - pointer to user space pointer, dst - kernel space pointer */ /* ------------------------------------------------------------------------ */ int -copyinptr(softc, src, dst, size) - ipf_main_softc_t *softc; - void *src, *dst; - size_t size; +copyinptr(ipf_main_softc_t *softc, void *src, void *dst, size_t size) { caddr_t ca; int error; @@ -4196,10 +4089,7 @@ /* NB: src - kernel space pointer, dst - pointer to user space pointer. */ /* ------------------------------------------------------------------------ */ int -copyoutptr(softc, src, dst, size) - ipf_main_softc_t *softc; - void *src, *dst; - size_t size; +copyoutptr(ipf_main_softc_t *softc, void *src, void *dst, size_t size) { caddr_t ca; int error; @@ -4224,9 +4114,7 @@ /* in *lockp. */ /* ------------------------------------------------------------------------ */ int -ipf_lock(data, lockp) - caddr_t data; - int *lockp; +ipf_lock(caddr_t data, int *lockp) { int arg, err; @@ -4257,10 +4145,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ static void -ipf_getstat(softc, fiop, rev) - ipf_main_softc_t *softc; - friostat_t *fiop; - int rev; +ipf_getstat(ipf_main_softc_t *softc, friostat_t *fiop, int rev) { int i; @@ -4376,11 +4261,7 @@ /* else return 0 for no match. */ /* ------------------------------------------------------------------------ */ int -ipf_matchicmpqueryreply(v, ic, icmp, rev) - int v; - icmpinfo_t *ic; - icmphdr_t *icmp; - int rev; +ipf_matchicmpqueryreply(int v, icmpinfo_t *ic, icmphdr_t *icmp, int rev) { int ictype; @@ -4513,12 +4394,8 @@ /* then make sure they are created and initialised before exiting. */ /* ------------------------------------------------------------------------ */ int -frrequest(softc, unit, req, data, set, makecopy) - ipf_main_softc_t *softc; - int unit; - ioctlcmd_t req; - int set, makecopy; - caddr_t data; +frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, + int set, int makecopy) { int error = 0, in, family, need_free = 0; enum { OP_ADD, /* add rule */ @@ -5215,10 +5092,7 @@ /* must use that as the guide for whether or not it can be freed. */ /* ------------------------------------------------------------------------ */ static void -ipf_rule_delete(softc, f, unit, set) - ipf_main_softc_t *softc; - frentry_t *f; - int unit, set; +ipf_rule_delete(ipf_main_softc_t *softc, frentry_t *f, int unit, int set) { /* @@ -5257,10 +5131,7 @@ /* expiration interval checks. */ /* ------------------------------------------------------------------------ */ static void -ipf_rule_expire_insert(softc, f, set) - ipf_main_softc_t *softc; - frentry_t *f; - int set; +ipf_rule_expire_insert(ipf_main_softc_t *softc, frentry_t *f, int set) { frentry_t *fr; @@ -5312,11 +5183,8 @@ /* packet matching quicker. */ /* ------------------------------------------------------------------------ */ static void * -ipf_findlookup(softc, unit, fr, addrp, maskp) - ipf_main_softc_t *softc; - int unit; - frentry_t *fr; - i6addr_t *addrp, *maskp; +ipf_findlookup(ipf_main_softc_t *softc, int unit, frentry_t *fr, + i6addr_t *addrp, i6addr_t *maskp) { void *ptr = NULL; @@ -5354,9 +5222,7 @@ /* an init function to be called now the rule has been loaded. */ /* ------------------------------------------------------------------------ */ static int -ipf_funcinit(softc, fr) - ipf_main_softc_t *softc; - frentry_t *fr; +ipf_funcinit(ipf_main_softc_t *softc, frentry_t *fr) { ipfunc_resolve_t *ft; int err; @@ -5386,9 +5252,7 @@ /* called for ealier. */ /* ------------------------------------------------------------------------ */ static void -ipf_funcfini(softc, fr) - ipf_main_softc_t *softc; - frentry_t *fr; +ipf_funcfini(ipf_main_softc_t *softc, frentry_t *fr) { ipfunc_resolve_t *ft; @@ -5409,8 +5273,7 @@ /* Look for a function in the table of known functions. */ /* ------------------------------------------------------------------------ */ static ipfunc_t -ipf_findfunc(funcptr) - ipfunc_t funcptr; +ipf_findfunc(ipfunc_t funcptr) { ipfunc_resolve_t *ft; @@ -5432,9 +5295,7 @@ /* so that the entire, complete, structure can be copied back to user space.*/ /* ------------------------------------------------------------------------ */ int -ipf_resolvefunc(softc, data) - ipf_main_softc_t *softc; - void *data; +ipf_resolvefunc(ipf_main_softc_t *softc, void *data) { ipfunc_resolve_t res, *ft; int error; @@ -5482,10 +5343,8 @@ * ppsratecheck(): packets (or events) per second limitation. */ int -ppsratecheck(lasttime, curpps, maxpps) - struct timeval *lasttime; - int *curpps; - int maxpps; /* maximum pps allowed */ +ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps) + /* maxpps: maximum pps allowed */ { struct timeval tv, delta; int rv; @@ -5534,9 +5393,7 @@ /* free it and any associated storage space being used by it. */ /* ------------------------------------------------------------------------ */ int -ipf_derefrule(softc, frp) - ipf_main_softc_t *softc; - frentry_t **frp; +ipf_derefrule(ipf_main_softc_t *softc, frentry_t **frp) { frentry_t *fr; frdest_t *fdp; @@ -5604,9 +5461,7 @@ /* fr_ptr is later used by ipf_srcgrpmap and ipf_dstgrpmap. */ /* ------------------------------------------------------------------------ */ static int -ipf_grpmapinit(softc, fr) - ipf_main_softc_t *softc; - frentry_t *fr; +ipf_grpmapinit(ipf_main_softc_t *softc, frentry_t *fr) { char name[FR_GROUPLEN]; iphtable_t *iph; @@ -5637,9 +5492,7 @@ /* be called to undo what ipf_grpmapinit caused to be done. */ /* ------------------------------------------------------------------------ */ static int -ipf_grpmapfini(softc, fr) - ipf_main_softc_t *softc; - frentry_t *fr; +ipf_grpmapfini(ipf_main_softc_t *softc, frentry_t *fr) { iphtable_t *iph; iph = fr->fr_ptr; @@ -5660,9 +5513,7 @@ /* the packet. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_srcgrpmap(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_srcgrpmap(fr_info_t *fin, u_32_t *passp) { frgroup_t *fg; void *rval; @@ -5690,9 +5541,7 @@ /* rules against the packet. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_dstgrpmap(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_dstgrpmap(fr_info_t *fin, u_32_t *passp) { frgroup_t *fg; void *rval; @@ -5738,10 +5587,7 @@ /* held (exclusively) in the domain that encompases 'parent'. */ /* ------------------------------------------------------------------------ */ ipftq_t * -ipf_addtimeoutqueue(softc, parent, seconds) - ipf_main_softc_t *softc; - ipftq_t **parent; - u_int seconds; +ipf_addtimeoutqueue(ipf_main_softc_t *softc, ipftq_t **parent, u_int seconds) { ipftq_t *ifq; u_int period; @@ -5797,8 +5643,7 @@ /* this function is called. */ /* ------------------------------------------------------------------------ */ int -ipf_deletetimeoutqueue(ifq) - ipftq_t *ifq; +ipf_deletetimeoutqueue(ipftq_t *ifq) { ifq->ifq_ref--; @@ -5824,9 +5669,7 @@ /* tidy up after this is done. */ /* ------------------------------------------------------------------------ */ void -ipf_freetimeoutqueue(softc, ifq) - ipf_main_softc_t *softc; - ipftq_t *ifq; +ipf_freetimeoutqueue(ipf_main_softc_t *softc, ipftq_t *ifq) { if (((ifq->ifq_flags & IFQF_DELETE) == 0) || (ifq->ifq_ref != 0) || @@ -5863,8 +5706,7 @@ /* the correct lock(s) may not be held that would make it safe to do so. */ /* ------------------------------------------------------------------------ */ void -ipf_deletequeueentry(tqe) - ipftqent_t *tqe; +ipf_deletequeueentry(ipftqent_t *tqe) { ipftq_t *ifq; @@ -5898,8 +5740,7 @@ /* Move a queue entry to the front of the queue, if it isn't already there. */ /* ------------------------------------------------------------------------ */ void -ipf_queuefront(tqe) - ipftqent_t *tqe; +ipf_queuefront(ipftqent_t *tqe) { ipftq_t *ifq; @@ -5935,9 +5776,7 @@ /* touched the structure. */ /* ------------------------------------------------------------------------ */ void -ipf_queueback(ticks, tqe) - u_long ticks; - ipftqent_t *tqe; +ipf_queueback(u_long ticks, ipftqent_t *tqe) { ipftq_t *ifq; @@ -5980,11 +5819,7 @@ /* touched the structure. */ /* ------------------------------------------------------------------------ */ void -ipf_queueappend(ticks, tqe, ifq, parent) - u_long ticks; - ipftqent_t *tqe; - ipftq_t *ifq; - void *parent; +ipf_queueappend(u_long ticks, ipftqent_t *tqe, ipftq_t *ifq, void *parent) { MUTEX_ENTER(&ifq->ifq_lock); @@ -6013,10 +5848,7 @@ /* to move queue, the return. */ /* ------------------------------------------------------------------------ */ void -ipf_movequeue(ticks, tqe, oifq, nifq) - u_long ticks; - ipftqent_t *tqe; - ipftq_t *oifq, *nifq; +ipf_movequeue(u_long ticks, ipftqent_t *tqe, ipftq_t *oifq, ipftq_t *nifq) { /* @@ -6099,8 +5931,7 @@ /* has no match in the cache, return an error. */ /* ------------------------------------------------------------------------ */ static int -ipf_updateipid(fin) - fr_info_t *fin; +ipf_updateipid(fr_info_t *fin) { u_short id, ido, sums; u_32_t sumd, sum; @@ -6147,9 +5978,7 @@ /* as a NULL pointer then return a pointer to a static array. */ /* ------------------------------------------------------------------------ */ char * -ipf_getifname(ifp, buffer) - struct ifnet *ifp; - char *buffer; +ipf_getifname(struct ifnet *ifp, char *buffer) { static char namebuf[LIFNAMSIZ]; # if SOLARIS || defined(__FreeBSD__) @@ -6196,11 +6025,8 @@ /* etc. */ /* ------------------------------------------------------------------------ */ int -ipf_ioctlswitch(softc, unit, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - int unit, mode, uid; - ioctlcmd_t cmd; - void *data, *ctx; +ipf_ioctlswitch(ipf_main_softc_t *softc, int unit, void *data, ioctlcmd_t cmd, + int mode, int uid, void *ctx) { int error = 0; @@ -6342,12 +6168,8 @@ /* the caller what version of ipfilter the ioctl program was written to. */ /* ------------------------------------------------------------------------ */ int -ipf_inobj(softc, data, objp, ptr, type) - ipf_main_softc_t *softc; - void *data; - ipfobj_t *objp; - void *ptr; - int type; +ipf_inobj(ipf_main_softc_t *softc, void *data, ipfobj_t *objp, void *ptr, + int type) { ipfobj_t obj; int error; @@ -6417,11 +6239,7 @@ /* not possible nor required in ipf_inobj(). */ /* ------------------------------------------------------------------------ */ int -ipf_inobjsz(softc, data, ptr, type, sz) - ipf_main_softc_t *softc; - void *data; - void *ptr; - int type, sz; +ipf_inobjsz(ipf_main_softc_t *softc, void *data, void *ptr, int type, int sz) { ipfobj_t obj; int error; @@ -6480,11 +6298,7 @@ /* not possible nor required in ipf_outobj(). */ /* ------------------------------------------------------------------------ */ int -ipf_outobjsz(softc, data, ptr, type, sz) - ipf_main_softc_t *softc; - void *data; - void *ptr; - int type, sz; +ipf_outobjsz(ipf_main_softc_t *softc, void *data, void *ptr, int type, int sz) { ipfobj_t obj; int error; @@ -6540,11 +6354,7 @@ /* it backward compatible at the ABI for user land. */ /* ------------------------------------------------------------------------ */ int -ipf_outobj(softc, data, ptr, type) - ipf_main_softc_t *softc; - void *data; - void *ptr; - int type; +ipf_outobj(ipf_main_softc_t *softc, void *data, void *ptr, int type) { ipfobj_t obj; int error; @@ -6607,10 +6417,7 @@ /* itself. */ /* ------------------------------------------------------------------------ */ int -ipf_outobjk(softc, obj, ptr) - ipf_main_softc_t *softc; - ipfobj_t *obj; - void *ptr; +ipf_outobjk(ipf_main_softc_t *softc, ipfobj_t *obj, void *ptr) { int type = obj->ipfo_type; int error; @@ -6660,8 +6467,7 @@ /* ipf_checkv6sum() for each platform. */ /* ------------------------------------------------------------------------ */ INLINE int -ipf_checkl4sum(fin) - fr_info_t *fin; +ipf_checkl4sum(fr_info_t *fin) { u_short sum, hdrsum, *csump; udphdr_t *udp; @@ -6765,10 +6571,8 @@ /* value. */ /* ------------------------------------------------------------------------ */ int -ipf_ifpfillv4addr(atype, sin, mask, inp, inpmask) - int atype; - struct sockaddr_in *sin, *mask; - struct in_addr *inp, *inpmask; +ipf_ifpfillv4addr(int atype, struct sockaddr_in *sin, struct sockaddr_in *mask, + struct in_addr *inp, struct in_addr *inpmask) { if (inpmask != NULL && atype != FRI_NETMASKED) inpmask->s_addr = 0xffffffff; @@ -6805,10 +6609,8 @@ /* value. */ /* ------------------------------------------------------------------------ */ int -ipf_ifpfillv6addr(atype, sin, mask, inp, inpmask) - int atype; - struct sockaddr_in6 *sin, *mask; - i6addr_t *inp, *inpmask; +ipf_ifpfillv6addr(int atype, struct sockaddr_in6 *sin, + struct sockaddr_in6 *mask, i6addr_t *inp, i6addr_t *inpmask) { i6addr_t *src, *and; @@ -6861,8 +6663,7 @@ /* as non-NULL pointers. */ /* ------------------------------------------------------------------------ */ int -ipf_matchtag(tag1, tag2) - ipftag_t *tag1, *tag2; +ipf_matchtag(ipftag_t *tag1, ipftag_t *tag2) { if (tag1 == tag2) return 1; @@ -6888,8 +6689,7 @@ /* If this call returns a failure then the buffers have also been freed. */ /* ------------------------------------------------------------------------ */ int -ipf_coalesce(fin) - fr_info_t *fin; +ipf_coalesce(fr_info_t *fin) { if ((fin->fin_flx & FI_COALESCE) != 0) @@ -6951,9 +6751,7 @@ /* the next one to be found may be returned inside next. */ /* ------------------------------------------------------------------------ */ static ipftuneable_t * -ipf_tune_findbycookie(ptop, cookie, next) - ipftuneable_t **ptop; - void *cookie, **next; +ipf_tune_findbycookie(ipftuneable_t **ptop, void *cookie, void **next) { ipftuneable_t *ta, **tap; @@ -6999,9 +6797,7 @@ /* to the matching structure. */ /* ------------------------------------------------------------------------ */ static ipftuneable_t * -ipf_tune_findbyname(top, name) - ipftuneable_t *top; - const char *name; +ipf_tune_findbyname(ipftuneable_t *top, const char *name) { ipftuneable_t *ta; @@ -7027,9 +6823,7 @@ /* the array has been reached. */ /* ------------------------------------------------------------------------ */ int -ipf_tune_add_array(softc, newtune) - ipf_main_softc_t *softc; - ipftuneable_t *newtune; +ipf_tune_add_array(ipf_main_softc_t *softc, ipftuneable_t *newtune) { ipftuneable_t *nt, *dt; int error = 0; @@ -7062,9 +6856,7 @@ /* a failure. */ /* ------------------------------------------------------------------------ */ int -ipf_tune_array_link(softc, array) - ipf_main_softc_t *softc; - ipftuneable_t *array; +ipf_tune_array_link(ipf_main_softc_t *softc, ipftuneable_t *array) { ipftuneable_t *t, **p; @@ -7097,9 +6889,7 @@ /* */ /* ------------------------------------------------------------------------ */ int -ipf_tune_array_unlink(softc, array) - ipf_main_softc_t *softc; - ipftuneable_t *array; +ipf_tune_array_unlink(ipf_main_softc_t *softc, ipftuneable_t *array) { ipftuneable_t *t, **p; @@ -7137,10 +6927,7 @@ /* ipftp_void that points to the stored value. */ /* ------------------------------------------------------------------------ */ ipftuneable_t * -ipf_tune_array_copy(base, size, template) - void *base; - size_t size; - ipftuneable_t *template; +ipf_tune_array_copy(void *base, size_t size, ipftuneable_t *template) { ipftuneable_t *copy; int i; @@ -7171,9 +6958,7 @@ /* owner of the object is not expected to ever change "ipft_next". */ /* ------------------------------------------------------------------------ */ int -ipf_tune_add(softc, newtune) - ipf_main_softc_t *softc; - ipftuneable_t *newtune; +ipf_tune_add(ipf_main_softc_t *softc, ipftuneable_t *newtune) { ipftuneable_t *ta, **tap; @@ -7203,9 +6988,7 @@ /* structure is no longer part of it. */ /* ------------------------------------------------------------------------ */ int -ipf_tune_del(softc, oldtune) - ipf_main_softc_t *softc; - ipftuneable_t *oldtune; +ipf_tune_del(ipf_main_softc_t *softc, ipftuneable_t *oldtune) { ipftuneable_t *ta, **tap; int error = 0; @@ -7239,9 +7022,7 @@ /* the array. */ /* ------------------------------------------------------------------------ */ int -ipf_tune_del_array(softc, oldtune) - ipf_main_softc_t *softc; - ipftuneable_t *oldtune; +ipf_tune_del_array(ipf_main_softc_t *softc, ipftuneable_t *oldtune) { ipftuneable_t *ot; int error = 0; @@ -7271,10 +7052,7 @@ /* each responsible for handling their own values being too big. */ /* ------------------------------------------------------------------------ */ int -ipf_ipftune(softc, cmd, data) - ipf_main_softc_t *softc; - ioctlcmd_t cmd; - void *data; +ipf_ipftune(ipf_main_softc_t *softc, ioctlcmd_t cmd, void *data) { ipftuneable_t *ta; ipftune_t tu; @@ -7451,9 +7229,7 @@ /* the copyout may result in paging (ie network activity.) */ /* ------------------------------------------------------------------------ */ int -ipf_zerostats(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_zerostats(ipf_main_softc_t *softc, caddr_t data) { friostat_t fio; ipfobj_t obj; @@ -7490,11 +7266,7 @@ /* indicate there is no information at all in the structure. */ /* ------------------------------------------------------------------------ */ int -ipf_resolvedest(softc, base, fdp, v) - ipf_main_softc_t *softc; - char *base; - frdest_t *fdp; - int v; +ipf_resolvedest(ipf_main_softc_t *softc, char *base, frdest_t *fdp, int v) { int errval = 0; void *ifp; @@ -7537,10 +7309,7 @@ /* for both IPv4 and IPv6 on the same physical NIC. */ /* ------------------------------------------------------------------------ */ void * -ipf_resolvenic(softc, name, v) - ipf_main_softc_t *softc; - char *name; - int v; +ipf_resolvenic(ipf_main_softc_t *softc, char *name, int v) { void *nic; @@ -7568,8 +7337,7 @@ /* have been held for too long and need to be freed up. */ /* ------------------------------------------------------------------------ */ void -ipf_token_expire(softc) - ipf_main_softc_t *softc; +ipf_token_expire(ipf_main_softc_t *softc) { ipftoken_t *it; @@ -7596,8 +7364,7 @@ /* by code that is only entitled to drop it once. */ /* ------------------------------------------------------------------------ */ static void -ipf_token_flush(softc) - ipf_main_softc_t *softc; +ipf_token_flush(ipf_main_softc_t *softc) { ipftoken_t *it, *next; @@ -7626,10 +7393,7 @@ /* lead to a token to be deleted. */ /* ------------------------------------------------------------------------ */ int -ipf_token_del(softc, type, uid, ptr) - ipf_main_softc_t *softc; - int type, uid; - void *ptr; +ipf_token_del(ipf_main_softc_t *softc, int type, int uid, void *ptr) { ipftoken_t *it; int error; @@ -7661,8 +7425,7 @@ /* Mark a token as being ineligable for being found with ipf_token_find. */ /* ------------------------------------------------------------------------ */ void -ipf_token_mark_complete(token) - ipftoken_t *token; +ipf_token_mark_complete(ipftoken_t *token) { if (token->ipt_complete == 0) token->ipt_complete = 1; @@ -7683,10 +7446,7 @@ /* currently active tokens. */ /* ------------------------------------------------------------------------ */ ipftoken_t * -ipf_token_find(softc, type, uid, ptr) - ipf_main_softc_t *softc; - int type, uid; - void *ptr; +ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) { ipftoken_t *it, *new; @@ -7752,9 +7512,7 @@ /* but the tail does due to the linked list implementation. */ /* ------------------------------------------------------------------------ */ static void -ipf_token_unlink(softc, token) - ipf_main_softc_t *softc; - ipftoken_t *token; +ipf_token_unlink(ipf_main_softc_t *softc, ipftoken_t *token) { if (softc->ipf_token_tail == &token->ipt_next) @@ -7780,9 +7538,7 @@ /* possible to free the token data structure. */ /* ------------------------------------------------------------------------ */ int -ipf_token_deref(softc, token) - ipf_main_softc_t *softc; - ipftoken_t *token; +ipf_token_deref(ipf_main_softc_t *softc, ipftoken_t *token) { void *data, **datap; @@ -7847,11 +7603,8 @@ /* output rules that are returned, never both. */ /* ------------------------------------------------------------------------ */ static frentry_t * -ipf_nextrule(softc, active, unit, fr, out) - ipf_main_softc_t *softc; - int active, unit; - frentry_t *fr; - int out; +ipf_nextrule(ipf_main_softc_t *softc, int active, int unit, frentry_t *fr, + int out) { frentry_t *next; frgroup_t *fg; @@ -7899,10 +7652,7 @@ /* if we used an existing rule to get here, decrease its reference count. */ /* ------------------------------------------------------------------------ */ int -ipf_getnextrule(softc, t, ptr) - ipf_main_softc_t *softc; - ipftoken_t *t; - void *ptr; +ipf_getnextrule(ipf_main_softc_t *softc, ipftoken_t *t, void *ptr) { frentry_t *fr, *next, zero; ipfruleiter_t it; @@ -8045,10 +7795,7 @@ /* the process doing the ioctl and use that to ask for the next rule. */ /* ------------------------------------------------------------------------ */ static int -ipf_frruleiter(softc, data, uid, ctx) - ipf_main_softc_t *softc; - void *data, *ctx; - int uid; +ipf_frruleiter(ipf_main_softc_t *softc, void *data, int uid, void *ctx) { ipftoken_t *token; ipfruleiter_t it; @@ -8084,10 +7831,7 @@ /* the ipfgeniter_t structure at itp. */ /* ------------------------------------------------------------------------ */ static int -ipf_geniter(softc, token, itp) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; +ipf_geniter(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp) { int error; @@ -8117,10 +7861,7 @@ /* Handle the SIOCGENITER ioctl for the ipfilter device. The primary role */ /* ------------------------------------------------------------------------ */ int -ipf_genericiter(softc, data, uid, ctx) - ipf_main_softc_t *softc; - void *data, *ctx; - int uid; +ipf_genericiter(ipf_main_softc_t *softc, void *data, int uid, void *ctx) { ipftoken_t *token; ipfgeniter_t iter; @@ -8160,12 +7901,8 @@ /* to the /dev/ipl device. */ /* ------------------------------------------------------------------------ */ int -ipf_ipf_ioctl(softc, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - caddr_t data; - ioctlcmd_t cmd; - int mode, uid; - void *ctx; +ipf_ipf_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, int mode, + int uid, void *ctx) { friostat_t fio; int error, tmp; @@ -8459,10 +8196,7 @@ /* rules belonging to the head group this rule specifies. */ /* ------------------------------------------------------------------------ */ u_32_t -ipf_decaps(fin, pass, l5proto) - fr_info_t *fin; - u_32_t pass; - int l5proto; +ipf_decaps(fr_info_t *fin, u_32_t pass, int l5proto) { fr_info_t fin2, *fino = NULL; int elen, hlen, nh; @@ -8662,11 +8396,8 @@ /* of a successful call is the caller required to free up the malloc area. */ /* ------------------------------------------------------------------------ */ int -ipf_matcharray_load(softc, data, objp, arrayptr) - ipf_main_softc_t *softc; - caddr_t data; - ipfobj_t *objp; - int **arrayptr; +ipf_matcharray_load(ipf_main_softc_t *softc, caddr_t data, ipfobj_t *objp, + int **arrayptr) { int arraysize, *array, error; @@ -8725,8 +8456,7 @@ /* correctness, only that all of the sizes are correctly within limits. */ /* ------------------------------------------------------------------------ */ int -ipf_matcharray_verify(array, arraysize) - int *array, arraysize; +ipf_matcharray_verify(int *array, int arraysize) { int i, nelem, maxidx; ipfexp_t *e; @@ -8787,9 +8517,7 @@ /* all of the commands in it. */ /* ------------------------------------------------------------------------ */ static int -ipf_fr_matcharray(fin, array) - fr_info_t *fin; - int *array; +ipf_fr_matcharray(fr_info_t *fin, int *array) { int i, n, *x, rv, p; ipfexp_t *e; @@ -8982,12 +8710,8 @@ /* low water mark is reached. */ /* ------------------------------------------------------------------------ */ int -ipf_queueflush(softc, deletefn, ipfqs, userqs, activep, size, low) - ipf_main_softc_t *softc; - ipftq_delete_fn_t deletefn; - ipftq_t *ipfqs, *userqs; - u_int *activep; - int size, low; +ipf_queueflush(ipf_main_softc_t *softc, ipftq_delete_fn_t deletefn, + ipftq_t *ipfqs, ipftq_t *userqs, u_int *activep, int size, int low) { u_long interval, istart, iend; ipftq_t *ifq, *ifqnext; @@ -9097,11 +8821,8 @@ /* the network interface represented by ifp. */ /* ------------------------------------------------------------------------ */ int -ipf_deliverlocal(softc, ipversion, ifp, ipaddr) - ipf_main_softc_t *softc; - int ipversion; - void *ifp; - i6addr_t *ipaddr; +ipf_deliverlocal(ipf_main_softc_t *softc, int ipversion, void *ifp, + i6addr_t *ipaddr) { i6addr_t addr; int islocal = 0; @@ -9137,10 +8858,8 @@ /* state and NAT code, telling them to update their timeout queues. */ /* ------------------------------------------------------------------------ */ static int -ipf_settimeout(softc, t, p) - struct ipf_main_softc_s *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, + ipftuneval_t *p) { /* @@ -9171,9 +8890,7 @@ /* could take a relatively long time to work through them all. */ /* ------------------------------------------------------------------------ */ void -ipf_apply_timeout(head, seconds) - ipftq_t *head; - u_int seconds; +ipf_apply_timeout(ipftq_t *head, u_int seconds) { u_int oldtimeout, newtimeout; ipftqent_t *tqe; @@ -9205,10 +8922,7 @@ /* ipf_apply_timeout(). */ /* ------------------------------------------------------------------------ */ int -ipf_settimeout_tcp(t, p, tab) - ipftuneable_t *t; - ipftuneval_t *p; - ipftq_t *tab; +ipf_settimeout_tcp(ipftuneable_t *t, ipftuneval_t *p, ipftq_t *tab) { if (!strcmp(t->ipft_name, "tcp_idle_timeout") || !strcmp(t->ipft_name, "tcp_established")) { @@ -9264,8 +8978,7 @@ /* the timeout values, allowing them to be changed before init(). */ /* ------------------------------------------------------------------------ */ void * -ipf_main_soft_create(arg) - void *arg; +ipf_main_soft_create(void *arg) { ipf_main_softc_t *softc; @@ -9348,8 +9061,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ int -ipf_main_soft_init(softc) - ipf_main_softc_t *softc; +ipf_main_soft_init(ipf_main_softc_t *softc) { return 0; } @@ -9368,8 +9080,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ void -ipf_main_soft_destroy(softc) - ipf_main_softc_t *softc; +ipf_main_soft_destroy(ipf_main_softc_t *softc) { RW_DESTROY(&softc->ipf_frag); @@ -9400,8 +9111,7 @@ /* the only dynamic part of the mainline. */ /* ------------------------------------------------------------------------ */ int -ipf_main_soft_fini(softc) - ipf_main_softc_t *softc; +ipf_main_soft_fini(ipf_main_softc_t *softc) { (void) ipf_flush(softc, IPL_LOGIPF, FR_INQUE|FR_OUTQUE|FR_INACTIVE); (void) ipf_flush(softc, IPL_LOGIPF, FR_INQUE|FR_OUTQUE); @@ -9422,7 +9132,7 @@ /* arrays that get used by the state/NAT code. */ /* ------------------------------------------------------------------------ */ int -ipf_main_load() +ipf_main_load(void) { int i; @@ -9458,7 +9168,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_main_unload() +ipf_main_unload(void) { return 0; } @@ -9473,7 +9183,7 @@ /* function for each in an order that won't lead to a crash :) */ /* ------------------------------------------------------------------------ */ int -ipf_load_all() +ipf_load_all(void) { if (ipf_main_load() == -1) return -1; @@ -9506,7 +9216,7 @@ /* function for each in an order that won't lead to a crash :) */ /* ------------------------------------------------------------------------ */ int -ipf_unload_all() +ipf_unload_all(void) { if (ipf_proxy_main_unload() == -1) return -1; @@ -9539,8 +9249,7 @@ /* function for each in an order that won't lead to a crash :) */ /* ------------------------------------------------------------------------ */ ipf_main_softc_t * -ipf_create_all(arg) - void *arg; +ipf_create_all(void *arg) { ipf_main_softc_t *softc; @@ -9614,8 +9323,7 @@ /* checking of return values. */ /* ------------------------------------------------------------------------ */ void -ipf_destroy_all(softc) - ipf_main_softc_t *softc; +ipf_destroy_all(ipf_main_softc_t *softc) { if (softc->ipf_state_soft != NULL) { @@ -9673,8 +9381,7 @@ /* function for each in an order that won't lead to a crash :) */ /* ------------------------------------------------------------------------ */ int -ipf_init_all(softc) - ipf_main_softc_t *softc; +ipf_init_all(ipf_main_softc_t *softc) { if (ipf_main_soft_init(softc) == -1) @@ -9719,8 +9426,7 @@ /* function for each in an order that won't lead to a crash :) */ /* ------------------------------------------------------------------------ */ int -ipf_fini_all(softc) - ipf_main_softc_t *softc; +ipf_fini_all(ipf_main_softc_t *softc) { ipf_token_flush(softc); @@ -9769,8 +9475,7 @@ /* loaded in. */ /* ------------------------------------------------------------------------ */ void -ipf_rule_expire(softc) - ipf_main_softc_t *softc; +ipf_rule_expire(ipf_main_softc_t *softc) { frentry_t *fr; @@ -9831,8 +9536,7 @@ /* for /48's, etc. */ /* ------------------------------------------------------------------------ */ static int -ipf_ht_node_cmp(k1, k2) - struct host_node_s *k1, *k2; +ipf_ht_node_cmp(struct host_node_s *k1, struct host_node_s *k2) { int i; @@ -9875,11 +9579,8 @@ /* have to be wary of that and not allow 32-128 to happen. */ /* ------------------------------------------------------------------------ */ static void -ipf_ht_node_make_key(htp, key, family, addr) - host_track_t *htp; - host_node_t *key; - int family; - i6addr_t *addr; +ipf_ht_node_make_key(host_track_t *htp, host_node_t *key, int family, + i6addr_t *addr) { key->hn_addr.adf_family = family; if (family == AF_INET) { @@ -9946,11 +9647,8 @@ /* tree or a matching node exists and we're able to bump up its activity. */ /* ------------------------------------------------------------------------ */ int -ipf_ht_node_add(softc, htp, family, addr) - ipf_main_softc_t *softc; - host_track_t *htp; - int family; - i6addr_t *addr; +ipf_ht_node_add(ipf_main_softc_t *softc, host_track_t *htp, int family, + i6addr_t *addr) { host_node_t *h; host_node_t k; @@ -10007,10 +9705,7 @@ /* one. If that count reaches 0, it is time to free it all up. */ /* ------------------------------------------------------------------------ */ int -ipf_ht_node_del(htp, family, addr) - host_track_t *htp; - int family; - i6addr_t *addr; +ipf_ht_node_del(host_track_t *htp, int family, i6addr_t *addr) { host_node_t *h; host_node_t k; @@ -10041,8 +9736,7 @@ /* Initialise the host tracking structure to be ready for use above. */ /* ------------------------------------------------------------------------ */ void -ipf_rb_ht_init(head) - host_track_t *head; +ipf_rb_ht_init(host_track_t *head) { RBI_INIT(ipf_rb, &head->ht_root); } @@ -10057,9 +9751,7 @@ /* Free an actual host_node_t structure. */ /* ------------------------------------------------------------------------ */ void -ipf_rb_ht_freenode(node, arg) - host_node_t *node; - void *arg; +ipf_rb_ht_freenode(host_node_t *node, void *arg) { KFREE(node); } @@ -10074,8 +9766,7 @@ /* and free'ing each one. */ /* ------------------------------------------------------------------------ */ void -ipf_rb_ht_flush(head) - host_track_t *head; +ipf_rb_ht_flush(host_track_t *head) { RBI_WALK(ipf_rb, &head->ht_root, ipf_rb_ht_freenode, NULL); } @@ -10090,8 +9781,7 @@ /* expectation of this being called twice per second. */ /* ------------------------------------------------------------------------ */ void -ipf_slowtimer(softc) - ipf_main_softc_t *softc; +ipf_slowtimer(ipf_main_softc_t *softc) { ipf_token_expire(softc); @@ -10119,9 +9809,7 @@ /* a given netmask. */ /* ------------------------------------------------------------------------ */ void -ipf_inet_mask_add(bits, mtab) - int bits; - ipf_v4_masktab_t *mtab; +ipf_inet_mask_add(int bits, ipf_v4_masktab_t *mtab) { u_32_t mask; int i, j; @@ -10157,9 +9845,7 @@ /* netmasks stored inside of mtab. */ /* ------------------------------------------------------------------------ */ void -ipf_inet_mask_del(bits, mtab) - int bits; - ipf_v4_masktab_t *mtab; +ipf_inet_mask_del(int bits, ipf_v4_masktab_t *mtab) { u_32_t mask; int i, j; @@ -10196,10 +9882,7 @@ /* a given netmask. */ /* ------------------------------------------------------------------------ */ void -ipf_inet6_mask_add(bits, mask, mtab) - int bits; - i6addr_t *mask; - ipf_v6_masktab_t *mtab; +ipf_inet6_mask_add(int bits, i6addr_t *mask, ipf_v6_masktab_t *mtab) { i6addr_t zero; int i, j; @@ -10239,10 +9922,7 @@ /* netmasks stored inside of mtab. */ /* ------------------------------------------------------------------------ */ void -ipf_inet6_mask_del(bits, mask, mtab) - int bits; - i6addr_t *mask; - ipf_v6_masktab_t *mtab; +ipf_inet6_mask_del(int bits, i6addr_t *mask, ipf_v6_masktab_t *mtab) { i6addr_t zero; int i, j; diff --git a/sys/netpfil/ipfilter/netinet/ip_auth.c b/sys/netpfil/ipfilter/netinet/ip_auth.c --- a/sys/netpfil/ipfilter/netinet/ip_auth.c +++ b/sys/netpfil/ipfilter/netinet/ip_auth.c @@ -133,7 +133,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_auth_main_load() +ipf_auth_main_load(void) { return 0; } @@ -148,7 +148,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_auth_main_unload() +ipf_auth_main_unload(void) { return 0; } @@ -163,8 +163,7 @@ /* and initialise some fields to their defaults. */ /* ------------------------------------------------------------------------ */ void * -ipf_auth_soft_create(softc) - ipf_main_softc_t *softc; +ipf_auth_soft_create(ipf_main_softc_t *softc) { ipf_auth_softc_t *softa; @@ -196,9 +195,7 @@ /* rules. */ /* ------------------------------------------------------------------------ */ int -ipf_auth_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_auth_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_auth_softc_t *softa = arg; @@ -232,9 +229,7 @@ /* is free'd by _destroy(). */ /* ------------------------------------------------------------------------ */ int -ipf_auth_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_auth_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_auth_softc_t *softa = arg; frauthent_t *fae, **faep; @@ -292,9 +287,7 @@ /* Undo what was done in _create() - i.e. free the soft context data. */ /* ------------------------------------------------------------------------ */ void -ipf_auth_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_auth_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_auth_softc_t *softa = arg; @@ -316,9 +309,7 @@ /* */ /* ------------------------------------------------------------------------ */ void -ipf_auth_setlock(arg, tmp) - void *arg; - int tmp; +ipf_auth_setlock(void *arg, int tmp) { ipf_auth_softc_t *softa = arg; @@ -337,9 +328,7 @@ /* will end up returning FR_AUTH) then return FR_BLOCK instead. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_auth_check(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_auth_check(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_auth_softc_t *softa = softc->ipf_auth_soft; @@ -460,9 +449,7 @@ /* waiting to hear about these events. */ /* ------------------------------------------------------------------------ */ int -ipf_auth_new(m, fin) - mb_t *m; - fr_info_t *fin; +ipf_auth_new(mb_t *m, fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_auth_softc_t *softa = softc->ipf_auth_soft; @@ -552,12 +539,8 @@ /* in IPFilter - ie ioctls called on an open fd for /dev/ipf_auth */ /* ------------------------------------------------------------------------ */ int -ipf_auth_ioctl(softc, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - caddr_t data; - ioctlcmd_t cmd; - int mode, uid; - void *ctx; +ipf_auth_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, + int mode, int uid, void *ctx) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; int error = 0, i; @@ -655,8 +638,7 @@ /* this being called twice per second. */ /* ------------------------------------------------------------------------ */ void -ipf_auth_expire(softc) - ipf_main_softc_t *softc; +ipf_auth_expire(ipf_main_softc_t *softc) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; frauthent_t *fae, **faep; @@ -725,10 +707,8 @@ /* */ /* ------------------------------------------------------------------------ */ int -ipf_auth_precmd(softc, cmd, fr, frptr) - ipf_main_softc_t *softc; - ioctlcmd_t cmd; - frentry_t *fr, **frptr; +ipf_auth_precmd(ipf_main_softc_t *softc, ioctlcmd_t cmd, frentry_t *fr, + frentry_t **frptr) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; frauthent_t *fae, **faep; @@ -810,8 +790,7 @@ /* into these data structures. */ /* ------------------------------------------------------------------------ */ static int -ipf_auth_flush(arg) - void *arg; +ipf_auth_flush(void *arg) { ipf_auth_softc_t *softa = arg; int i, num_flushed; @@ -856,8 +835,7 @@ /* queue. */ /* ------------------------------------------------------------------------ */ int -ipf_auth_waiting(softc) - ipf_main_softc_t *softc; +ipf_auth_waiting(ipf_main_softc_t *softc) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; @@ -877,11 +855,8 @@ /* Stomping over various fields with new information will not harm anything */ /* ------------------------------------------------------------------------ */ static int -ipf_auth_geniter(softc, token, itp, objp) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; - ipfobj_t *objp; +ipf_auth_geniter(ipf_main_softc_t *softc, ipftoken_t *token, + ipfgeniter_t *itp, ipfobj_t *objp) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; frauthent_t *fae, *next, zero; @@ -944,9 +919,7 @@ /* held. */ /* ------------------------------------------------------------------------ */ static void -ipf_auth_deref_unlocked(softa, faep) - ipf_auth_softc_t *softa; - frauthent_t **faep; +ipf_auth_deref_unlocked(ipf_auth_softc_t *softa, frauthent_t **faep) { WRITE_ENTER(&softa->ipf_authlk); ipf_auth_deref(faep); @@ -965,8 +938,7 @@ /* the reference count on the structure by 1. If it reaches 0, free it up. */ /* ------------------------------------------------------------------------ */ static void -ipf_auth_deref(faep) - frauthent_t **faep; +ipf_auth_deref(frauthent_t **faep) { frauthent_t *fae; @@ -992,10 +964,7 @@ /* to sleep. */ /* ------------------------------------------------------------------------ */ static int -ipf_auth_wait(softc, softa, data) - ipf_main_softc_t *softc; - ipf_auth_softc_t *softa; - char *data; +ipf_auth_wait(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) { frauth_t auth, *au = &auth; int error, len, i; @@ -1108,10 +1077,7 @@ /* form of flags, the same as those used in each rule. */ /* ------------------------------------------------------------------------ */ static int -ipf_auth_reply(softc, softa, data) - ipf_main_softc_t *softc; - ipf_auth_softc_t *softa; - char *data; +ipf_auth_reply(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) { frauth_t auth, *au = &auth, *fra; fr_info_t fin; @@ -1222,10 +1188,7 @@ u_32_t -ipf_auth_pre_scanlist(softc, fin, pass) - ipf_main_softc_t *softc; - fr_info_t *fin; - u_32_t pass; +ipf_auth_pre_scanlist(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; @@ -1237,8 +1200,7 @@ frentry_t ** -ipf_auth_rulehead(softc) - ipf_main_softc_t *softc; +ipf_auth_rulehead(ipf_main_softc_t *softc) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; diff --git a/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c b/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c @@ -58,8 +58,7 @@ void * -ipf_p_dns_soft_create(softc) - ipf_main_softc_t *softc; +ipf_p_dns_soft_create(ipf_main_softc_t *softc) { ipf_dns_softc_t *softd; @@ -75,9 +74,7 @@ void -ipf_p_dns_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_p_dns_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_dns_softc_t *softd = arg; ipf_dns_filter_t *idns; @@ -96,10 +93,7 @@ int -ipf_p_dns_ctl(softc, arg, ctl) - ipf_main_softc_t *softc; - void *arg; - ap_ctl_t *ctl; +ipf_p_dns_ctl(ipf_main_softc_t *softc, void *arg, ap_ctl_t *ctl) { ipf_dns_softc_t *softd = arg; ipf_dns_filter_t *tmp, *idns, **idnsp; @@ -174,11 +168,7 @@ /* ARGSUSED */ int -ipf_p_dns_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_dns_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { dnsinfo_t *di; int dlen; @@ -215,9 +205,7 @@ /* ARGSUSED */ void -ipf_p_dns_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_dns_del(ipf_main_softc_t *softc, ap_session_t *aps) { #ifdef USE_MUTEXES dnsinfo_t *di = aps->aps_data; @@ -234,10 +222,7 @@ * Tries to match the base string (in our ACL) with the query from a packet. */ int -ipf_p_dns_match_names(idns, query, qlen) - ipf_dns_filter_t *idns; - char *query; - int qlen; +ipf_p_dns_match_names(ipf_dns_filter_t *idns, char *query, int qlen) { int blen; char *base; @@ -270,12 +255,8 @@ int -ipf_p_dns_get_name(softd, start, len, buffer, buflen) - ipf_dns_softc_t *softd; - char *start; - int len; - char *buffer; - int buflen; +ipf_p_dns_get_name(ipf_dns_softc_t *softd, char *start, int len, + char *buffer, int buflen) { char *s, *t, clen; int slen, blen; @@ -314,9 +295,7 @@ int -ipf_p_dns_allow_query(softd, dnsi) - ipf_dns_softc_t *softd; - dnsinfo_t *dnsi; +ipf_p_dns_allow_query(ipf_dns_softc_t *softd, dnsinfo_t *dnsi) { ipf_dns_filter_t *idns; int len; @@ -332,11 +311,7 @@ /* ARGSUSED */ int -ipf_p_dns_inout(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_dns_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_dns_softc_t *softd = arg; ipf_dns_hdr_t *dns; @@ -383,10 +358,7 @@ /* ARGSUSED */ int -ipf_p_dns_match(fin, aps, nat) - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_dns_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) { dnsinfo_t *di = aps->aps_data; ipf_dns_hdr_t *dnh; diff --git a/sys/netpfil/ipfilter/netinet/ip_dstlist.c b/sys/netpfil/ipfilter/netinet/ip_dstlist.c --- a/sys/netpfil/ipfilter/netinet/ip_dstlist.c +++ b/sys/netpfil/ipfilter/netinet/ip_dstlist.c @@ -142,8 +142,7 @@ /* soft context used with destination lists. */ /* ------------------------------------------------------------------------ */ static void * -ipf_dstlist_soft_create(softc) - ipf_main_softc_t *softc; +ipf_dstlist_soft_create(ipf_main_softc_t *softc) { ipf_dstl_softc_t *softd; int i; @@ -172,9 +171,7 @@ /* soft context is free it! */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_dstlist_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_dstl_softc_t *softd = arg; @@ -191,9 +188,7 @@ /* There is currently no soft context for destination list management. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_dstlist_soft_init(ipf_main_softc_t *softc, void *arg) { return 0; } @@ -208,9 +203,7 @@ /* There is currently no soft context for destination list management. */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_dstlist_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_dstl_softc_t *softd = arg; int i; @@ -243,11 +236,8 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ static int -ipf_dstlist_addr_find(softc, arg1, arg2, arg3, arg4) - ipf_main_softc_t *softc; - void *arg1, *arg3; - int arg2; - u_int arg4; +ipf_dstlist_addr_find(ipf_main_softc_t *softc, void *arg1, int arg2, + void *arg3, u_int arg4) { return -1; } @@ -265,10 +255,7 @@ /* which they are to be used with and their name. */ /* ------------------------------------------------------------------------ */ static size_t -ipf_dstlist_flush(softc, arg, fop) - ipf_main_softc_t *softc; - void *arg; - iplookupflush_t *fop; +ipf_dstlist_flush(ipf_main_softc_t *softc, void *arg, iplookupflush_t *fop) { ipf_dstl_softc_t *softd = arg; ippool_dst_t *node, *next; @@ -307,11 +294,8 @@ /* to. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_iter_deref(softc, arg, otype, unit, data) - ipf_main_softc_t *softc; - void *arg; - int otype, unit; - void *data; +ipf_dstlist_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, + int unit, void *data) { if (data == NULL) { IPFERROR(120001); @@ -351,11 +335,8 @@ /* iterates through the list of destination lists or nodes. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_iter_next(softc, arg, token, iter) - ipf_main_softc_t *softc; - void *arg; - ipftoken_t *token; - ipflookupiter_t *iter; +ipf_dstlist_iter_next(ipf_main_softc_t *softc, void *arg, + ipftoken_t *token, ipflookupiter_t *iter) { ipf_dstnode_t zn, *nextnode = NULL, *node = NULL; ippool_dst_t zero, *next = NULL, *dsttab = NULL; @@ -477,11 +458,8 @@ /* imposed - 128. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_node_add(softc, arg, op, uid) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; - int uid; +ipf_dstlist_node_add(ipf_main_softc_t *softc, void *arg, + iplookupop_t *op, int uid) { ipf_dstl_softc_t *softd = arg; ipf_dstnode_t *node, **nodes; @@ -609,9 +587,7 @@ /* statistics. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_node_deref(arg, node) - void *arg; - ipf_dstnode_t *node; +ipf_dstlist_node_deref(void *arg, ipf_dstnode_t *node) { ipf_dstl_softc_t *softd = arg; int ref; @@ -646,11 +622,8 @@ /* it is necessary to allocate some memory locally, to complete this op. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_node_del(softc, arg, op, uid) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; - int uid; +ipf_dstlist_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, + int uid) { ipf_dstl_softc_t *softd = arg; ipf_dstnode_t *node; @@ -722,10 +695,8 @@ /* it is likely the array will again reach that size. */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_node_free(softd, d, node) - ipf_dstl_softc_t *softd; - ippool_dst_t *d; - ipf_dstnode_t *node; +ipf_dstlist_node_free(ipf_dstl_softc_t *softd, ippool_dst_t *d, + ipf_dstnode_t *node) { int i; @@ -769,10 +740,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ static int -ipf_dstlist_stats_get(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_dstlist_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { ipf_dstl_softc_t *softd = arg; ipf_dstl_stat_t stats; @@ -825,10 +793,7 @@ /* they are just kept in a simple linked list. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_table_add(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_dstlist_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { ipf_dstl_softc_t *softd = arg; ippool_dst_t user, *d, *new; @@ -883,10 +848,7 @@ /* references to it, the caller isn't told. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_table_del(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_dstlist_table_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { ippool_dst_t *d; @@ -922,10 +884,8 @@ /* it will become a detached. */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_table_remove(softc, softd, d) - ipf_main_softc_t *softc; - ipf_dstl_softc_t *softd; - ippool_dst_t *d; +ipf_dstlist_table_remove(ipf_main_softc_t *softc, ipf_dstl_softc_t *softd, + ippool_dst_t *d) { if (softd->tails[d->ipld_unit + 1] == &d->ipld_next) @@ -959,9 +919,7 @@ /* the destination list. */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_table_free(softd, d) - ipf_dstl_softc_t *softd; - ippool_dst_t *d; +ipf_dstlist_table_free(ipf_dstl_softc_t *softd, ippool_dst_t *d) { MUTEX_DESTROY(&d->ipld_lock); @@ -989,10 +947,7 @@ /* it if 0 has been reached. */ /* ------------------------------------------------------------------------ */ static int -ipf_dstlist_table_deref(softc, arg, table) - ipf_main_softc_t *softc; - void *arg; - void *table; +ipf_dstlist_table_deref(ipf_main_softc_t *softc, void *arg, void *table) { ippool_dst_t *d = table; @@ -1015,9 +970,7 @@ /* Free all of the destination nodes attached to the given table. */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_table_clearnodes(softd, dst) - ipf_dstl_softc_t *softd; - ippool_dst_t *dst; +ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *softd, ippool_dst_t *dst) { ipf_dstnode_t *node; @@ -1041,10 +994,7 @@ /* is passed in. */ /* ------------------------------------------------------------------------ */ static void * -ipf_dstlist_table_find(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_dstlist_table_find(void *arg, int unit, char *name) { ipf_dstl_softc_t *softd = arg; ippool_dst_t *d; @@ -1072,10 +1022,7 @@ /* store the pointer to it somewhere else. */ /* ------------------------------------------------------------------------ */ static void * -ipf_dstlist_select_ref(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_dstlist_select_ref(void *arg, int unit, char *name) { ippool_dst_t *d; @@ -1116,9 +1063,7 @@ /* nor is the algorithm conducive to searching. */ /* ------------------------------------------------------------------------ */ static ipf_dstnode_t * -ipf_dstlist_select(fin, d) - fr_info_t *fin; - ippool_dst_t *d; +ipf_dstlist_select(fr_info_t *fin, ippool_dst_t *d) { ipf_dstnode_t *node, *sel; int connects; @@ -1239,11 +1184,8 @@ /* kept on the node. */ /* ------------------------------------------------------------------------ */ int -ipf_dstlist_select_node(fin, group, addr, pfdp) - fr_info_t *fin; - void *group; - u_32_t *addr; - frdest_t *pfdp; +ipf_dstlist_select_node(fr_info_t *fin, void *group, u_32_t *addr, + frdest_t *pfdp) { #ifdef USE_MUTEXES ipf_main_softc_t *softc = fin->fin_main_soft; @@ -1296,9 +1238,7 @@ /* There are currently no objects to expire in destination lists. */ /* ------------------------------------------------------------------------ */ static void -ipf_dstlist_expire(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_dstlist_expire(ipf_main_softc_t *softc, void *arg) { return; } @@ -1315,9 +1255,7 @@ /* in a destination list. */ /* ------------------------------------------------------------------------ */ void -ipf_dstlist_sync(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_dstlist_sync(ipf_main_softc_t *softc, void *arg) { ipf_dstl_softc_t *softd = arg; ipf_dstnode_t *node; diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -115,9 +115,7 @@ static void ipf_ifevent(void *arg, struct ifnet *ifp); -static void ipf_ifevent(arg, ifp) - void *arg; - struct ifnet *ifp; +static void ipf_ifevent(void *arg, struct ifnet *ifp) { CURVNET_SET(ifp->if_vnet); @@ -158,8 +156,7 @@ } # endif #if defined(IPFILTER_LKM) -int ipf_identify(s) - char *s; +int ipf_identify(char *s) { if (strcmp(s, "ipl") == 0) return 1; @@ -169,8 +166,7 @@ static void -ipf_timer_func(arg) - void *arg; +ipf_timer_func(void *arg) { ipf_main_softc_t *softc = arg; SPL_INT(s); @@ -196,8 +192,7 @@ int -ipfattach(softc) - ipf_main_softc_t *softc; +ipfattach(ipf_main_softc_t *softc) { #ifdef USE_SPL int s; @@ -238,8 +233,7 @@ * stream. */ int -ipfdetach(softc) - ipf_main_softc_t *softc; +ipfdetach(ipf_main_softc_t *softc) { #ifdef USE_SPL int s; @@ -271,14 +265,10 @@ * Filter ioctl interface. */ int -ipfioctl(dev, cmd, data, mode, p) - struct thread *p; +ipfioctl(struct cdev *dev, ioctlcmd_t cmd, caddr_t data, + int mode, struct thread *p) #define p_cred td_ucred #define p_uid td_ucred->cr_ruid - struct cdev *dev; - ioctlcmd_t cmd; - caddr_t data; - int mode; { int error = 0, unit = 0; SPL_INT(s); @@ -334,8 +324,7 @@ * requires a large amount of setting up and isn't any more efficient. */ int -ipf_send_reset(fin) - fr_info_t *fin; +ipf_send_reset(fr_info_t *fin) { struct tcphdr *tcp, *tcp2; int tlen = 0, hlen; @@ -432,9 +421,7 @@ * ip_len must be in network byte order when called. */ static int -ipf_send_ip(fin, m) - fr_info_t *fin; - mb_t *m; +ipf_send_ip(fr_info_t *fin, mb_t *m) { fr_info_t fnew; ip_t *ip, *oip; @@ -496,10 +483,7 @@ int -ipf_send_icmp_err(type, fin, dst) - int type; - fr_info_t *fin; - int dst; +ipf_send_icmp_err(int type, fr_info_t *fin, int dst) { int err, hlen, xtra, iclen, ohlen, avail, code; struct in_addr dst4; @@ -680,10 +664,7 @@ * mpp - pointer to the mbuf pointer that is the start of the mbuf chain */ int -ipf_fastroute(m0, mpp, fin, fdp) - mb_t *m0, **mpp; - fr_info_t *fin; - frdest_t *fdp; +ipf_fastroute(mb_t *m0, mb_t **mpp, fr_info_t *fin, frdest_t *fdp) { register struct ip *ip, *mhip; register struct mbuf *m = *mpp; @@ -953,11 +934,8 @@ * return the first IP Address associated with an interface */ int -ipf_ifpaddr(softc, v, atype, ifptr, inp, inpmask) - ipf_main_softc_t *softc; - int v, atype; - void *ifptr; - i6addr_t *inp, *inpmask; +ipf_ifpaddr(ipf_main_softc_t *softc, int v, int atype, void *ifptr, + i6addr_t *inp, i6addr_t *inpmask) { #ifdef USE_INET6 struct in6_addr *ia6 = NULL; @@ -1035,8 +1013,7 @@ INLINE int -ipf_checkv4sum(fin) - fr_info_t *fin; +ipf_checkv4sum(fr_info_t *fin) { #ifdef CSUM_DATA_VALID int manual = 0; @@ -1135,8 +1112,7 @@ #ifdef USE_INET6 INLINE int -ipf_checkv6sum(fin) - fr_info_t *fin; +ipf_checkv6sum(fr_info_t *fin) { if ((fin->fin_flx & FI_NOCKSUM) != 0) { DT(ipf_checkv6sum_fi_nocksum); @@ -1164,8 +1140,7 @@ size_t -mbufchainlen(m0) - struct mbuf *m0; +mbufchainlen(struct mbuf *m0) { size_t len; @@ -1199,10 +1174,7 @@ /* of buffers that starts at *fin->fin_mp. */ /* ------------------------------------------------------------------------ */ void * -ipf_pullup(xmin, fin, len) - mb_t *xmin; - fr_info_t *fin; - int len; +ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) { int dpoff, ipoff; mb_t *m = xmin; @@ -1300,9 +1272,7 @@ int -ipf_inject(fin, m) - fr_info_t *fin; - mb_t *m; +ipf_inject(fr_info_t *fin, mb_t *m) { struct epoch_tracker et; int error = 0; @@ -1412,17 +1382,14 @@ u_32_t -ipf_random() +ipf_random(void) { return arc4random(); } u_int -ipf_pcksum(fin, hlen, sum) - fr_info_t *fin; - int hlen; - u_int sum; +ipf_pcksum(fr_info_t *fin, int hlen, u_int sum) { struct mbuf *m; u_int sum2; @@ -1448,11 +1415,7 @@ #ifdef USE_INET6 u_int -ipf_pcksum6(m, ip6, off, len) - struct mbuf *m; - ip6_t *ip6; - u_int32_t off; - u_int32_t len; +ipf_pcksum6(struct mbuf *m, ip6_t *ip6, u_int32_t off, u_int32_t len) { #ifdef _KERNEL int sum; diff --git a/sys/netpfil/ipfilter/netinet/ip_frag.c b/sys/netpfil/ipfilter/netinet/ip_frag.c --- a/sys/netpfil/ipfilter/netinet/ip_frag.c +++ b/sys/netpfil/ipfilter/netinet/ip_frag.c @@ -129,7 +129,7 @@ /* use it. */ /* ------------------------------------------------------------------------ */ int -ipf_frag_main_load() +ipf_frag_main_load(void) { bzero((char *)&ipfr_block, sizeof(ipfr_block)); ipfr_block.fr_flags = FR_BLOCK|FR_QUICK; @@ -148,7 +148,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_frag_main_unload() +ipf_frag_main_unload(void) { return 0; } @@ -163,8 +163,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ void * -ipf_frag_soft_create(softc) - ipf_main_softc_t *softc; +ipf_frag_soft_create(ipf_main_softc_t *softc) { ipf_frag_softc_t *softf; @@ -210,9 +209,7 @@ /* Initialise the hash tables for the fragment cache lookups. */ /* ------------------------------------------------------------------------ */ void -ipf_frag_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_frag_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_frag_softc_t *softf = arg; @@ -240,9 +237,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ int -ipf_frag_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_frag_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_frag_softc_t *softf = arg; @@ -284,9 +279,7 @@ /* Free all memory allocated whilst running and from initialisation. */ /* ------------------------------------------------------------------------ */ int -ipf_frag_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_frag_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_frag_softc_t *softf = arg; @@ -326,9 +319,7 @@ /* Stub function that allows for external manipulation of ipfr_lock */ /* ------------------------------------------------------------------------ */ void -ipf_frag_setlock(arg, tmp) - void *arg; - int tmp; +ipf_frag_setlock(void *arg, int tmp) { ipf_frag_softc_t *softf = arg; @@ -344,8 +335,7 @@ /* Updates ipfr_stats with current information and returns a pointer to it */ /* ------------------------------------------------------------------------ */ ipfrstat_t * -ipf_frag_stats(arg) - void *arg; +ipf_frag_stats(void *arg) { ipf_frag_softc_t *softf = arg; @@ -369,19 +359,12 @@ /* If it fails, no lock is held on return. */ /* ------------------------------------------------------------------------ */ static ipfr_t * -ipfr_frag_new(softc, softf, fin, pass, table +ipfr_frag_new(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, + fr_info_t *fin, u_32_t pass, ipfr_t *table[] #ifdef USE_MUTEXES -, lock +, ipfrwlock_t *lock #endif ) - ipf_main_softc_t *softc; - ipf_frag_softc_t *softf; - fr_info_t *fin; - u_32_t pass; - ipfr_t *table[]; -#ifdef USE_MUTEXES - ipfrwlock_t *lock; -#endif { ipfr_t *fra, frag, *fran; u_int idx, off; @@ -519,10 +502,7 @@ /* Add a new entry to the fragment cache table based on the current packet */ /* ------------------------------------------------------------------------ */ int -ipf_frag_new(softc, fin, pass) - ipf_main_softc_t *softc; - u_32_t pass; - fr_info_t *fin; +ipf_frag_new(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; ipfr_t *fra; @@ -556,11 +536,8 @@ /* the NAT structure for this "session". */ /* ------------------------------------------------------------------------ */ int -ipf_frag_natnew(softc, fin, pass, nat) - ipf_main_softc_t *softc; - fr_info_t *fin; - u_32_t pass; - nat_t *nat; +ipf_frag_natnew(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass, + nat_t *nat) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; ipfr_t *fra; @@ -598,9 +575,7 @@ /* pointer, the new IP ID value. */ /* ------------------------------------------------------------------------ */ int -ipf_frag_ipidnew(fin, ipid) - fr_info_t *fin; - u_32_t ipid; +ipf_frag_ipidnew(fr_info_t *fin, u_32_t ipid) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -640,18 +615,12 @@ /* If it fails, no lock is held on return. */ /* ------------------------------------------------------------------------ */ static ipfr_t * -ipf_frag_lookup(softc, softf, fin, table +ipf_frag_lookup(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, + fr_info_t *fin, ipfr_t *table[] #ifdef USE_MUTEXES -, lock +, ipfrwlock_t *lock #endif ) - ipf_main_softc_t *softc; - ipf_frag_softc_t *softf; - fr_info_t *fin; - ipfr_t *table[]; -#ifdef USE_MUTEXES - ipfrwlock_t *lock; -#endif { ipfr_t *f, frag; u_int idx; @@ -813,8 +782,7 @@ /* Functional interface for NAT lookups of the NAT fragment cache */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_frag_natknown(fin) - fr_info_t *fin; +ipf_frag_natknown(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -854,8 +822,7 @@ /* Functional interface for IP ID lookups of the IP ID fragment cache */ /* ------------------------------------------------------------------------ */ u_32_t -ipf_frag_ipidknown(fin) - fr_info_t *fin; +ipf_frag_ipidknown(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -892,9 +859,7 @@ /* that if FR_LOGFIRST is set, reset FR_LOG. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_frag_known(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_frag_known(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -952,9 +917,7 @@ /* pointer is found to match ptr, reset it to NULL. */ /* ------------------------------------------------------------------------ */ void -ipf_frag_natforget(softc, ptr) - ipf_main_softc_t *softc; - void *ptr; +ipf_frag_natforget(ipf_main_softc_t *softc, void *ptr) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; ipfr_t *fr; @@ -980,9 +943,7 @@ /* result of decreasing the reference count. */ /* ------------------------------------------------------------------------ */ static void -ipf_frag_delete(softc, fra, tail) - ipf_main_softc_t *softc; - ipfr_t *fra, ***tail; +ipf_frag_delete(ipf_main_softc_t *softc, ipfr_t *fra, ipfr_t ***tail) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -1014,9 +975,7 @@ /* Free up a fragment cache entry and bump relevent statistics. */ /* ------------------------------------------------------------------------ */ static void -ipf_frag_free(softf, fra) - ipf_frag_softc_t *softf; - ipfr_t *fra; +ipf_frag_free(ipf_frag_softc_t *softf, ipfr_t *fra) { KFREE(fra); FBUMP(ifs_expire); @@ -1033,8 +992,7 @@ /* fragment state stuff first and then the NAT-fragment table. */ /* ------------------------------------------------------------------------ */ void -ipf_frag_clear(softc) - ipf_main_softc_t *softc; +ipf_frag_clear(ipf_main_softc_t *softc) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; ipfr_t *fra; @@ -1073,8 +1031,7 @@ /* Expire entries in the fragment cache table that have been there too long */ /* ------------------------------------------------------------------------ */ void -ipf_frag_expire(softc) - ipf_main_softc_t *softc; +ipf_frag_expire(ipf_main_softc_t *softc) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; ipfr_t **fp, *fra; @@ -1149,10 +1106,8 @@ /* filter rules. The hard work is done by the more generic ipf_frag_next. */ /* ------------------------------------------------------------------------ */ int -ipf_frag_pkt_next(softc, token, itp) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; +ipf_frag_pkt_next(ipf_main_softc_t *softc, ipftoken_t *token, + ipfgeniter_t *itp) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -1176,10 +1131,8 @@ /* NAT. The hard work is done by the more generic ipf_frag_next. */ /* ------------------------------------------------------------------------ */ int -ipf_frag_nat_next(softc, token, itp) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; +ipf_frag_nat_next(ipf_main_softc_t *softc, ipftoken_t *token, + ipfgeniter_t *itp) { ipf_frag_softc_t *softf = softc->ipf_frag_soft; @@ -1208,18 +1161,12 @@ /* fragment cache - hence the reason for passing in top and lock. */ /* ------------------------------------------------------------------------ */ static int -ipf_frag_next(softc, token, itp, top +ipf_frag_next(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, + ipfr_t **top #ifdef USE_MUTEXES -, lock +, ipfrwlock_t *lock #endif ) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; - ipfr_t **top; -#ifdef USE_MUTEXES - ipfrwlock_t *lock; -#endif { ipfr_t *frag, *next, zero; int error = 0; @@ -1281,9 +1228,7 @@ /* fragment cache entry used by filter rules. */ /* ------------------------------------------------------------------------ */ void -ipf_frag_pkt_deref(softc, data) - ipf_main_softc_t *softc; - void *data; +ipf_frag_pkt_deref(ipf_main_softc_t *softc, void *data) { ipfr_t **frp = data; @@ -1307,9 +1252,7 @@ /* fragment cache entry used by NAT table entries. */ /* ------------------------------------------------------------------------ */ void -ipf_frag_nat_deref(softc, data) - ipf_main_softc_t *softc; - void *data; +ipf_frag_nat_deref(ipf_main_softc_t *softc, void *data) { ipfr_t **frp = data; @@ -1335,16 +1278,11 @@ /* to use the pointer it is dropping the reference to. */ /* ------------------------------------------------------------------------ */ static void -ipf_frag_deref(arg, frp +ipf_frag_deref(void *arg, ipfr_t **frp #ifdef USE_MUTEXES -, lock +, ipfrwlock_t *lock #endif ) - void *arg; - ipfr_t **frp; -#ifdef USE_MUTEXES - ipfrwlock_t *lock; -#endif { ipf_frag_softc_t *softf = arg; ipfr_t *fra; diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -148,7 +148,7 @@ void -ipf_p_ftp_main_load() +ipf_p_ftp_main_load(void) { bzero((char *)&ftppxyfr, sizeof(ftppxyfr)); ftppxyfr.fr_ref = 1; @@ -160,7 +160,7 @@ void -ipf_p_ftp_main_unload() +ipf_p_ftp_main_unload(void) { if (ipf_p_ftp_proxy_init == 1) { @@ -174,8 +174,7 @@ * Initialize local structures. */ void * -ipf_p_ftp_soft_create(softc) - ipf_main_softc_t *softc; +ipf_p_ftp_soft_create(ipf_main_softc_t *softc) { ipf_ftp_softc_t *softf; @@ -208,9 +207,7 @@ void -ipf_p_ftp_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_p_ftp_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_ftp_softc_t *softf = arg; @@ -225,11 +222,7 @@ int -ipf_p_ftp_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ftpinfo_t *ftp; ftpside_t *f; @@ -286,13 +279,8 @@ int -ipf_p_ftp_port(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { char newbuf[IPF_FTPBUFSZ], *s; u_int a1, a2, a3, a4; @@ -443,13 +431,8 @@ int -ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, nport, inc) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen, nport, inc; +ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen, int nport, int inc) { tcphdr_t tcph, *tcp2 = &tcph; ipf_main_softc_t *softc; @@ -608,13 +591,8 @@ int -ipf_p_ftp_client(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - nat_t *nat; - ftpinfo_t *ftp; - ip_t *ip; - int dlen; +ipf_p_ftp_client(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, + nat_t *nat, ftpinfo_t *ftp, int dlen) { char *rptr, *wptr, cmd[6], c; ftpside_t *f; @@ -692,13 +670,8 @@ int -ipf_p_ftp_pasv(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { u_int a1, a2, a3, a4, data_ip; char newbuf[IPF_FTPBUFSZ]; @@ -836,15 +809,8 @@ } int -ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, port, newmsg, s) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - u_int port; - char *newmsg; - char *s; +ipf_p_ftp_pasvreply(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, + nat_t *nat, ftpinfo_t *ftp, u_int port, char *newmsg, char *s) { int inc, off, nflags; tcphdr_t *tcp, tcph, *tcp2; @@ -981,13 +947,8 @@ int -ipf_p_ftp_server(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_server(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { char *rptr, *wptr; ftpside_t *f; @@ -1070,11 +1031,8 @@ * being the correct syntax for the FTP protocol. */ int -ipf_p_ftp_client_valid(softf, ftps, buf, len) - ipf_ftp_softc_t *softf; - ftpside_t *ftps; - char *buf; - size_t len; +ipf_p_ftp_client_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, + size_t len) { register char *s, c, pc; register size_t i = len; @@ -1154,11 +1112,8 @@ int -ipf_p_ftp_server_valid(softf, ftps, buf, len) - ipf_ftp_softc_t *softf; - ftpside_t *ftps; - char *buf; - size_t len; +ipf_p_ftp_server_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, + size_t len) { register char *s, c, pc; register size_t i = len; @@ -1240,12 +1195,8 @@ int -ipf_p_ftp_valid(softf, ftp, side, buf, len) - ipf_ftp_softc_t *softf; - ftpinfo_t *ftp; - int side; - char *buf; - size_t len; +ipf_p_ftp_valid(ipf_ftp_softc_t *softf, ftpinfo_t *ftp, int side, char *buf, + size_t len) { ftpside_t *ftps; @@ -1267,12 +1218,8 @@ * rv == 1 for outbound processing. */ int -ipf_p_ftp_process(softf, fin, nat, ftp, rv) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - nat_t *nat; - ftpinfo_t *ftp; - int rv; +ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, + ftpinfo_t *ftp, int rv) { int mlen, len, off, inc, i, sel, sel2, ok, ackoff, seqoff, retry; char *rptr, *wptr, *s; @@ -1604,11 +1551,7 @@ int -ipf_p_ftp_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_ftp_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_ftp_softc_t *softf = arg; ftpinfo_t *ftp; @@ -1627,11 +1570,7 @@ int -ipf_p_ftp_in(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_ftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_ftp_softc_t *softf = arg; ftpinfo_t *ftp; @@ -1656,8 +1595,7 @@ * LSB. */ u_short -ipf_p_ftp_atoi(ptr) - char **ptr; +ipf_p_ftp_atoi(char **ptr) { register char *s = *ptr, c; register u_char i = 0, j = 0; @@ -1682,13 +1620,8 @@ int -ipf_p_ftp_eprt(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_eprt(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { ftpside_t *f; @@ -1724,13 +1657,8 @@ int -ipf_p_ftp_eprt4(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { int a1, a2, a3, a4, port, olen, nlen, inc, off; char newbuf[IPF_FTPBUFSZ]; @@ -1874,13 +1802,8 @@ int -ipf_p_ftp_epsv(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_epsv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { char newbuf[IPF_FTPBUFSZ]; u_short ap = 0; @@ -1947,13 +1870,8 @@ #ifdef USE_INET6 int -ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen) - ipf_ftp_softc_t *softf; - fr_info_t *fin; - ip_t *ip; - nat_t *nat; - ftpinfo_t *ftp; - int dlen; +ipf_p_ftp_eprt6(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, + ftpinfo_t *ftp, int dlen) { int port, olen, nlen, inc, off, left, i; char newbuf[IPF_FTPBUFSZ]; diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -134,8 +134,7 @@ /* Initialise the routing table data structures where required. */ /* ------------------------------------------------------------------------ */ static void * -ipf_htable_soft_create(softc) - ipf_main_softc_t *softc; +ipf_htable_soft_create(ipf_main_softc_t *softc) { ipf_htable_softc_t *softh; @@ -161,9 +160,7 @@ /* up the pool context too. */ /* ------------------------------------------------------------------------ */ static void -ipf_htable_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_htable_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_htable_softc_t *softh = arg; @@ -204,9 +201,7 @@ /* used to delete the pools one by one to ensure they're properly freed up. */ /* ------------------------------------------------------------------------ */ static void -ipf_htable_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_htable_soft_fini(ipf_main_softc_t *softc, void *arg) { iplookupflush_t fop; @@ -230,10 +225,7 @@ /* structure used to export statistics. */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_stats_get(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_htable_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { ipf_htable_softc_t *softh = arg; iphtstat_t stats; @@ -269,10 +261,7 @@ /* Create a new hash table using the template passed. */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_create(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { ipf_htable_softc_t *softh = arg; iphtable_t htab, *iph, *oiph; @@ -381,10 +370,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_table_del(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_htable_table_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { return ipf_htable_destroy(softc, arg, op->iplo_unit, op->iplo_name); } @@ -403,11 +389,7 @@ /* can be removed. */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_destroy(softc, arg, unit, name) - ipf_main_softc_t *softc; - void *arg; - int unit; - char *name; +ipf_htable_destroy(ipf_main_softc_t *softc, void *arg, int unit, char *name) { iphtable_t *iph; @@ -445,10 +427,7 @@ /* each one, one by one. */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_clear(softc, arg, iph) - ipf_main_softc_t *softc; - void *arg; - iphtable_t *iph; +ipf_htable_clear(ipf_main_softc_t *softc, void *arg, iphtable_t *iph) { iphtent_t *ipe; @@ -467,9 +446,7 @@ /* */ /* ------------------------------------------------------------------------ */ static void -ipf_htable_free(arg, iph) - void *arg; - iphtable_t *iph; +ipf_htable_free(void *arg, iphtable_t *iph) { ipf_htable_softc_t *softh = arg; @@ -498,10 +475,7 @@ /* the while loop in ipf_htable_flush() functions properly. */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_remove(softc, arg, iph) - ipf_main_softc_t *softc; - void *arg; - iphtable_t *iph; +ipf_htable_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph) { if (ipf_htable_clear(softc, arg, iph) != 0) @@ -528,11 +502,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_node_del(softc, arg, op, uid) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; - int uid; +ipf_htable_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, + int uid) { iphtable_t *iph; iphtent_t hte, *ent; @@ -581,10 +552,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_table_add(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_htable_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { int err; @@ -610,11 +578,8 @@ /* Delete an entry from a hash table. */ /* ------------------------------------------------------------------------ */ static int -ipf_htent_remove(softc, arg, iph, ipe) - ipf_main_softc_t *softc; - void *arg; - iphtable_t *iph; - iphtent_t *ipe; +ipf_htent_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, + iphtent_t *ipe) { if (iph->iph_tail == &ipe->ipe_next) @@ -667,9 +632,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_deref(softc, arg, object) - ipf_main_softc_t *softc; - void *arg, *object; +ipf_htable_deref(ipf_main_softc_t *softc, void *arg, void *object) { ipf_htable_softc_t *softh = arg; iphtable_t *iph = object; @@ -693,9 +656,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htent_deref(arg, ipe) - void *arg; - iphtent_t *ipe; +ipf_htent_deref(void *arg, iphtent_t *ipe) { ipf_htable_softc_t *softh = arg; @@ -717,10 +678,7 @@ /* */ /* ------------------------------------------------------------------------ */ static void * -ipf_htable_exists(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_htable_exists(void *arg, int unit, char *name) { ipf_htable_softc_t *softh = arg; iphtable_t *iph; @@ -759,10 +717,7 @@ /* */ /* ------------------------------------------------------------------------ */ static void * -ipf_htable_select_add_ref(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_htable_select_add_ref(void *arg, int unit, char *name) { iphtable_t *iph; @@ -784,10 +739,7 @@ /* This function is exposed becaues it is used in the group-map feature. */ /* ------------------------------------------------------------------------ */ iphtable_t * -ipf_htable_find(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_htable_find(void *arg, int unit, char *name) { iphtable_t *iph; @@ -808,10 +760,7 @@ /* */ /* ------------------------------------------------------------------------ */ static size_t -ipf_htable_flush(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupflush_t *op; +ipf_htable_flush(ipf_main_softc_t *softc, void *arg, iplookupflush_t *op) { ipf_htable_softc_t *softh = arg; iphtable_t *iph; @@ -846,11 +795,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_node_add(softc, arg, op, uid) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; - int uid; +ipf_htable_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, + int uid) { iphtable_t *iph; iphtent_t hte; @@ -896,11 +842,8 @@ /* Add an entry to a hash table. */ /* ------------------------------------------------------------------------ */ static int -ipf_htent_insert(softc, arg, iph, ipeo) - ipf_main_softc_t *softc; - void *arg; - iphtable_t *iph; - iphtent_t *ipeo; +ipf_htent_insert(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, + iphtent_t *ipeo) { ipf_htable_softc_t *softh = arg; iphtent_t *ipe; @@ -1032,9 +975,7 @@ /* is time to call this function, so it is just more convenient. */ /* ------------------------------------------------------------------------ */ static iphtent_t * -ipf_htent_find(iph, ipeo) - iphtable_t *iph; - iphtent_t *ipeo; +ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) { iphtent_t ipe, *ent; u_int hv; @@ -1092,9 +1033,7 @@ /* This function is exposed becaues it is used in the group-map feature. */ /* ------------------------------------------------------------------------ */ void * -ipf_iphmfindgroup(softc, tptr, aptr) - ipf_main_softc_t *softc; - void *tptr, *aptr; +ipf_iphmfindgroup(ipf_main_softc_t *softc, void *tptr, void *aptr) { struct in_addr *addr; iphtable_t *iph; @@ -1127,11 +1066,8 @@ /* Search the hash table for a given address and return a search result. */ /* ------------------------------------------------------------------------ */ static int -ipf_iphmfindip(softc, tptr, ipversion, aptr, bytes) - ipf_main_softc_t *softc; - void *tptr, *aptr; - int ipversion; - u_int bytes; +ipf_iphmfindip(ipf_main_softc_t *softc, void *tptr, int ipversion, void *aptr, + u_int bytes) { struct in_addr *addr; iphtable_t *iph; @@ -1175,9 +1111,7 @@ /* */ /* ------------------------------------------------------------------------ */ static iphtent_t * -ipf_iphmfind(iph, addr) - iphtable_t *iph; - struct in_addr *addr; +ipf_iphmfind(iphtable_t *iph, struct in_addr *addr) { u_32_t msk, ips; iphtent_t *ipe; @@ -1217,11 +1151,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_iter_next(softc, arg, token, ilp) - ipf_main_softc_t *softc; - void *arg; - ipftoken_t *token; - ipflookupiter_t *ilp; +ipf_htable_iter_next(ipf_main_softc_t *softc, void *arg, ipftoken_t *token, + ipflookupiter_t *ilp) { ipf_htable_softc_t *softh = arg; iphtent_t *node, zn, *nextnode; @@ -1342,12 +1273,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_iter_deref(softc, arg, otype, unit, data) - ipf_main_softc_t *softc; - void *arg; - int otype; - int unit; - void *data; +ipf_htable_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, int unit, + void *data) { if (data == NULL) @@ -1382,9 +1309,7 @@ /* */ /* ------------------------------------------------------------------------ */ static iphtent_t * -ipf_iphmfind6(iph, addr) - iphtable_t *iph; - i6addr_t *addr; +ipf_iphmfind6(iphtable_t *iph, i6addr_t *addr) { i6addr_t *msk, ips; iphtent_t *ipe; @@ -1419,9 +1344,7 @@ static void -ipf_htable_expire(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_htable_expire(ipf_main_softc_t *softc, void *arg) { ipf_htable_softc_t *softh = arg; iphtent_t *n; @@ -1441,9 +1364,7 @@ /* */ /* ------------------------------------------------------------------------ */ void -ipf_htable_dump(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_htable_dump(ipf_main_softc_t *softc, void *arg) { ipf_htable_softc_t *softh = arg; iphtable_t *iph; diff --git a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c @@ -41,8 +41,7 @@ * IPSec application proxy initialization. */ void * -ipf_p_ipsec_soft_create(softc) - ipf_main_softc_t *softc; +ipf_p_ipsec_soft_create(ipf_main_softc_t *softc) { ipf_ipsec_softc_t *softi; @@ -62,9 +61,7 @@ int -ipf_p_ipsec_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_p_ipsec_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_ipsec_softc_t *softi = arg; @@ -88,9 +85,7 @@ void -ipf_p_ipsec_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_p_ipsec_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_ipsec_softc_t *softi = arg; @@ -111,9 +106,7 @@ void -ipf_p_ipsec_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_p_ipsec_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_ipsec_softc_t *softi = arg; @@ -130,11 +123,7 @@ * Setup for a new IPSEC proxy. */ int -ipf_p_ipsec_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_ipsec_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_ipsec_softc_t *softi = arg; ipf_main_softc_t *softc = fin->fin_main_soft; @@ -266,11 +255,7 @@ * we can. If they have disappeared, recreate them. */ int -ipf_p_ipsec_inout(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_ipsec_softc_t *softi = arg; ipf_main_softc_t *softc = fin->fin_main_soft; @@ -356,10 +341,7 @@ * UDP/TCP port numbers). */ int -ipf_p_ipsec_match(fin, aps, nat) - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipsec_pxy_t *ipsec; u_32_t cookies[4]; @@ -401,9 +383,7 @@ * clean up after ourselves. */ void -ipf_p_ipsec_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_ipsec_del(ipf_main_softc_t *softc, ap_session_t *aps) { ipsec_pxy_t *ipsec; diff --git a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c @@ -28,7 +28,7 @@ * Initialize local structures. */ void -ipf_p_irc_main_load() +ipf_p_irc_main_load(void) { bzero((char *)&ircnatfr, sizeof(ircnatfr)); ircnatfr.fr_ref = 1; @@ -39,7 +39,7 @@ void -ipf_p_irc_main_unload() +ipf_p_irc_main_unload(void) { if (irc_proxy_init == 1) { MUTEX_DESTROY(&ircnatfr.fr_lock); @@ -65,10 +65,7 @@ int -ipf_p_irc_complete(ircp, buf, len) - ircinfo_t *ircp; - char *buf; - size_t len; +ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) { register char *s, c; register size_t i; @@ -224,11 +221,7 @@ int -ipf_p_irc_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ircinfo_t *irc; @@ -250,9 +243,7 @@ int -ipf_p_irc_send(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_p_irc_send(fr_info_t *fin, nat_t *nat) { char ctcpbuf[IPF_IRCBUFSZ], newbuf[IPF_IRCBUFSZ]; tcphdr_t *tcp, tcph, *tcp2 = &tcph; @@ -431,11 +422,7 @@ int -ipf_p_irc_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { aps = aps; /* LINT */ return ipf_p_irc_send(fin, nat); diff --git a/sys/netpfil/ipfilter/netinet/ip_log.c b/sys/netpfil/ipfilter/netinet/ip_log.c --- a/sys/netpfil/ipfilter/netinet/ip_log.c +++ b/sys/netpfil/ipfilter/netinet/ip_log.c @@ -163,14 +163,14 @@ int -ipf_log_main_load() +ipf_log_main_load(void) { return 0; } int -ipf_log_main_unload() +ipf_log_main_unload(void) { return 0; } @@ -184,8 +184,7 @@ /* secret for use in calculating the "last log checksum". */ /* ------------------------------------------------------------------------ */ void * -ipf_log_soft_create(softc) - ipf_main_softc_t *softc; +ipf_log_soft_create(ipf_main_softc_t *softc) { ipf_log_softc_t *softl; int i; @@ -230,9 +229,7 @@ /* secret for use in calculating the "last log checksum". */ /* ------------------------------------------------------------------------ */ int -ipf_log_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_log_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_log_softc_t *softl = arg; int i; @@ -263,9 +260,7 @@ /* Clean up any log data that has accumulated without being read. */ /* ------------------------------------------------------------------------ */ int -ipf_log_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_log_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_log_softc_t *softl = arg; int i; @@ -312,9 +307,7 @@ /* any threads active in the reading code path or the logging code path. */ /* ------------------------------------------------------------------------ */ void -ipf_log_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_log_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_log_softc_t *softl = arg; int i; @@ -349,9 +342,7 @@ /* requested. */ /* ------------------------------------------------------------------------ */ int -ipf_log_pkt(fin, flags) - fr_info_t *fin; - u_int flags; +ipf_log_pkt(fr_info_t *fin, u_int flags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_log_softc_t *softl = softc->ipf_log_soft; @@ -526,13 +517,8 @@ /* from the log device. */ /* ------------------------------------------------------------------------ */ int -ipf_log_items(softc, unit, fin, items, itemsz, types, cnt) - ipf_main_softc_t *softc; - int unit; - fr_info_t *fin; - void **items; - size_t *itemsz; - int *types, cnt; +ipf_log_items(ipf_main_softc_t *softc, int unit, fr_info_t *fin, void **items, + size_t *itemsz, int *types, int cnt) { ipf_log_softc_t *softl = softc->ipf_log_soft; caddr_t buf, ptr; @@ -660,10 +646,7 @@ /* there is none present. Asynchronous I/O is not implemented. */ /* ------------------------------------------------------------------------ */ int -ipf_log_read(softc, unit, uio) - ipf_main_softc_t *softc; - minor_t unit; - struct uio *uio; +ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) { ipf_log_softc_t *softl = softc->ipf_log_soft; size_t dlen; @@ -785,9 +768,7 @@ /* Deletes all queued up log records for a given output device. */ /* ------------------------------------------------------------------------ */ int -ipf_log_clear(softc, unit) - ipf_main_softc_t *softc; - minor_t unit; +ipf_log_clear(ipf_main_softc_t *softc, minor_t unit) { ipf_log_softc_t *softl = softc->ipf_log_soft; iplog_t *ipl; @@ -821,9 +802,7 @@ /* current buffer for the selected ipf device. */ /* ------------------------------------------------------------------------ */ int -ipf_log_canread(softc, unit) - ipf_main_softc_t *softc; - int unit; +ipf_log_canread(ipf_main_softc_t *softc, int unit) { ipf_log_softc_t *softl = softc->ipf_log_soft; @@ -841,9 +820,7 @@ /* selected ipf device. */ /* ------------------------------------------------------------------------ */ int -ipf_log_bytesused(softc, unit) - ipf_main_softc_t *softc; - int unit; +ipf_log_bytesused(ipf_main_softc_t *softc, int unit) { ipf_log_softc_t *softl = softc->ipf_log_soft; @@ -864,9 +841,7 @@ /* for the selected ipf device. */ /* ------------------------------------------------------------------------ */ u_long -ipf_log_failures(softc, unit) - ipf_main_softc_t *softc; - int unit; +ipf_log_failures(ipf_main_softc_t *softc, int unit) { ipf_log_softc_t *softl = softc->ipf_log_soft; @@ -887,9 +862,7 @@ /* selected ipf device. */ /* ------------------------------------------------------------------------ */ u_long -ipf_log_logok(softc, unit) - ipf_main_softc_t *softc; - int unit; +ipf_log_logok(ipf_main_softc_t *softc, int unit) { ipf_log_softc_t *softl = softc->ipf_log_soft; diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -96,8 +96,7 @@ /* Initialise all of the subcomponents of the lookup infrstructure. */ /* ------------------------------------------------------------------------ */ void * -ipf_lookup_soft_create(softc) - ipf_main_softc_t *softc; +ipf_lookup_soft_create(ipf_main_softc_t *softc) { ipf_lookup_softc_t *softl; ipf_lookup_t **l; @@ -130,9 +129,7 @@ /* Initialise all of the subcomponents of the lookup infrstructure. */ /* ------------------------------------------------------------------------ */ int -ipf_lookup_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_lookup_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_lookup_softc_t *softl = (ipf_lookup_softc_t *)arg; int err = 0; @@ -157,9 +154,7 @@ /* Call the fini function in each backend to cleanup all allocated data. */ /* ------------------------------------------------------------------------ */ int -ipf_lookup_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_lookup_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_lookup_softc_t *softl = (ipf_lookup_softc_t *)arg; int i; @@ -183,8 +178,7 @@ /* allowing them to delete any lifetime limited data. */ /* ------------------------------------------------------------------------ */ void -ipf_lookup_expire(softc) - ipf_main_softc_t *softc; +ipf_lookup_expire(ipf_main_softc_t *softc) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; int i; @@ -207,9 +201,7 @@ /* ipf_lookup_init() can be called again, safely. */ /* ------------------------------------------------------------------------ */ void -ipf_lookup_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_lookup_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_lookup_softc_t *softl = (ipf_lookup_softc_t *)arg; int i; @@ -241,12 +233,8 @@ /* command. */ /* ------------------------------------------------------------------------ */ int -ipf_lookup_ioctl(softc, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - caddr_t data; - ioctlcmd_t cmd; - int mode, uid; - void *ctx; +ipf_lookup_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, + int mode, int uid, void *ctx) { int err; SPL_INT(s); @@ -325,10 +313,7 @@ /* add a node to it. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_addnode(softc, data, uid) - ipf_main_softc_t *softc; - caddr_t data; - int uid; +ipf_lookup_addnode(ipf_main_softc_t *softc, caddr_t data, int uid) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; iplookupop_t op; @@ -378,10 +363,7 @@ /* in and then deleting the entry that gets found. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_delnode(softc, data, uid) - ipf_main_softc_t *softc; - caddr_t data; - int uid; +ipf_lookup_delnode(ipf_main_softc_t *softc, caddr_t data, int uid) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; iplookupop_t op; @@ -429,9 +411,7 @@ /* for this one. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_addtable(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_lookup_addtable(ipf_main_softc_t *softc, caddr_t data) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; iplookupop_t op; @@ -492,9 +472,7 @@ /* calls the relevant function to do the cleanup. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_deltable(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_lookup_deltable(ipf_main_softc_t *softc, caddr_t data) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; iplookupop_t op; @@ -541,9 +519,7 @@ /* Copy statistical information from inside the kernel back to user space. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_stats(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_lookup_stats(ipf_main_softc_t *softc, caddr_t data) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; iplookupop_t op; @@ -591,9 +567,7 @@ /* entry in the hash table/pool or want to remove all groups from those. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_flush(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_lookup_flush(ipf_main_softc_t *softc, caddr_t data) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; int err, unit, num, type, i; @@ -651,10 +625,7 @@ /* type of object being passed into it. */ /* ------------------------------------------------------------------------ */ void -ipf_lookup_deref(softc, type, ptr) - ipf_main_softc_t *softc; - int type; - void *ptr; +ipf_lookup_deref(ipf_main_softc_t *softc, int type, void *ptr) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; int i; @@ -686,11 +657,7 @@ /* Decodes ioctl request to step through either hash tables or pools. */ /* ------------------------------------------------------------------------ */ static int -ipf_lookup_iterate(softc, data, uid, ctx) - ipf_main_softc_t *softc; - void *data; - int uid; - void *ctx; +ipf_lookup_iterate(ipf_main_softc_t *softc, void *data, int uid, void *ctx) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; ipflookupiter_t iter; @@ -757,10 +724,7 @@ /* go on from pool types to hash types as part of the "get next".) */ /* ------------------------------------------------------------------------ */ void -ipf_lookup_iterderef(softc, type, data) - ipf_main_softc_t *softc; - u_32_t type; - void *data; +ipf_lookup_iterderef(ipf_main_softc_t *softc, u_32_t type, void *data) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; struct iplookupiterkey *lkey; @@ -802,11 +766,7 @@ /* which the token was being used. */ /* ------------------------------------------------------------------------ */ int -ipf_lookup_deltok(softc, data, uid, ctx) - ipf_main_softc_t *softc; - void *data; - int uid; - void *ctx; +ipf_lookup_deltok(ipf_main_softc_t *softc, void *data, int uid, void *ctx) { int error, key; SPL_INT(s); @@ -836,12 +796,8 @@ /* or not the "table" number exists. */ /* ------------------------------------------------------------------------ */ void * -ipf_lookup_res_num(softc, unit, type, number, funcptr) - ipf_main_softc_t *softc; - int unit; - u_int type; - u_int number; - lookupfunc_t *funcptr; +ipf_lookup_res_num(ipf_main_softc_t *softc, int unit, u_int type, u_int number, + lookupfunc_t *funcptr) { char name[FR_GROUPLEN]; @@ -867,12 +823,8 @@ /* or not the "table" number exists. */ /* ------------------------------------------------------------------------ */ void * -ipf_lookup_res_name(softc, unit, type, name, funcptr) - ipf_main_softc_t *softc; - int unit; - u_int type; - char *name; - lookupfunc_t *funcptr; +ipf_lookup_res_name(ipf_main_softc_t *softc, int unit, u_int type, char *name, + lookupfunc_t *funcptr) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; ipf_lookup_t **l; @@ -916,10 +868,7 @@ /* only the hash table backend. */ /* ------------------------------------------------------------------------ */ void * -ipf_lookup_find_htable(softc, unit, name) - ipf_main_softc_t *softc; - int unit; - char *name; +ipf_lookup_find_htable(ipf_main_softc_t *softc, int unit, char *name) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; ipf_lookup_t **l; @@ -951,9 +900,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ void -ipf_lookup_sync(softc, ifp) - ipf_main_softc_t *softc; - void *ifp; +ipf_lookup_sync(ipf_main_softc_t *softc, void *ifp) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; ipf_lookup_t **l; @@ -971,9 +918,7 @@ #ifndef _KERNEL void -ipf_lookup_dump(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_lookup_dump(ipf_main_softc_t *softc, void *arg) { ipf_lookup_softc_t *softl = softc->ipf_lookup_soft; ipf_lookup_t **l; diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -264,7 +264,7 @@ /* rule that is used with blocking packets. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_main_load() +ipf_nat_main_load(void) { return 0; @@ -280,7 +280,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_main_unload() +ipf_nat_main_unload(void) { return 0; } @@ -296,8 +296,7 @@ /* that sizes can be changed before we get under way. */ /* ------------------------------------------------------------------------ */ void * -ipf_nat_soft_create(softc) - ipf_main_softc_t *softc; +ipf_nat_soft_create(ipf_main_softc_t *softc) { ipf_nat_softc_t *softn; @@ -357,9 +356,7 @@ /* */ /* ------------------------------------------------------------------------ */ void -ipf_nat_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_nat_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_nat_softc_t *softn = arg; @@ -381,9 +378,7 @@ /* Initialise all of the NAT locks, tables and other structures. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_nat_softc_t *softn = arg; ipftq_t *tq; @@ -528,9 +523,7 @@ /* Free all memory used by NAT structures allocated at runtime. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_nat_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_nat_softc_t *softn = arg; ipftq_t *ifq, *ifqnext; @@ -615,9 +608,7 @@ /* Set the "lock status" of NAT to the value in tmp. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_setlock(arg, tmp) - void *arg; - int tmp; +ipf_nat_setlock(void *arg, int tmp) { ipf_nat_softc_t *softn = arg; @@ -635,9 +626,7 @@ /* use by redirect rules. */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_addrdr(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat_addrdr(ipf_nat_softc_t *softn, ipnat_t *n) { ipnat_t **np; u_32_t j; @@ -677,9 +666,7 @@ /* redirect rules. */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_addmap(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat_addmap(ipf_nat_softc_t *softn, ipnat_t *n) { ipnat_t **np; u_32_t j; @@ -717,9 +704,7 @@ /* Removes a redirect rule from the hash table of redirect rules. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_delrdr(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat_delrdr(ipf_nat_softc_t *softn, ipnat_t *n) { if (n->in_odstatype == FRI_NORMAL) { int k = count4bits(n->in_odstmsk); @@ -742,9 +727,7 @@ /* Removes a NAT map rule from the hash table of NAT map rules. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_delmap(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat_delmap(ipf_nat_softc_t *softn, ipnat_t *n) { if (n->in_osrcatype == FRI_NORMAL) { int k = count4bits(n->in_osrcmsk); @@ -774,13 +757,8 @@ /* create a new entry if a non-NULL NAT rule pointer has been supplied. */ /* ------------------------------------------------------------------------ */ static struct hostmap * -ipf_nat_hostmap(softn, np, src, dst, map, port) - ipf_nat_softc_t *softn; - ipnat_t *np; - struct in_addr src; - struct in_addr dst; - struct in_addr map; - u_32_t port; +ipf_nat_hostmap(ipf_nat_softc_t *softn, ipnat_t *np, struct in_addr src, + struct in_addr dst, struct in_addr map, u_32_t port) { hostmap_t *hm; u_int hv, rhv; @@ -845,9 +823,7 @@ /* reaches zero then remove it and free it. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_hostmapdel(softc, hmp) - ipf_main_softc_t *softc; - struct hostmap **hmp; +ipf_nat_hostmapdel(ipf_main_softc_t *softc, struct hostmap **hmp) { struct hostmap *hm; @@ -878,10 +854,7 @@ /* Adjusts the 16bit checksum by "n" for packets going out. */ /* ------------------------------------------------------------------------ */ void -ipf_fix_outcksum(cksum, sp, n, partial) - int cksum; - u_short *sp; - u_32_t n, partial; +ipf_fix_outcksum(int cksum, u_short *sp, u_32_t n, u_32_t partial) { u_short sumshort; u_32_t sum1; @@ -919,10 +892,7 @@ /* Adjusts the 16bit checksum by "n" for packets going in. */ /* ------------------------------------------------------------------------ */ void -ipf_fix_incksum(cksum, sp, n, partial) - int cksum; - u_short *sp; - u_32_t n, partial; +ipf_fix_incksum(int cksum, u_short *sp, u_32_t n, u_32_t partial) { u_short sumshort; u_32_t sum1; @@ -970,9 +940,7 @@ /* kernel on the data section. */ /* ------------------------------------------------------------------------ */ void -ipf_fix_datacksum(sp, n) - u_short *sp; - u_32_t n; +ipf_fix_datacksum(u_short *sp, u_32_t n) { u_short sumshort; u_32_t sum1; @@ -1003,12 +971,8 @@ /* Processes an ioctl call made to operate on the IP Filter NAT device. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_ioctl(softc, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - ioctlcmd_t cmd; - caddr_t data; - int mode, uid; - void *ctx; +ipf_nat_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, + int mode, int uid, void *ctx) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; int error = 0, ret, arg, getlock; @@ -1439,11 +1403,8 @@ /* NAT rule table(s). */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_siocaddnat(softc, softn, n, getlock) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - ipnat_t *n; - int getlock; +ipf_nat_siocaddnat(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, ipnat_t *n, + int getlock) { int error = 0; @@ -1546,10 +1507,8 @@ /* Initialise all of the NAT address structures in a NAT rule. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_ruleaddrinit(softc, softn, n) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat_ruleaddrinit(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, + ipnat_t *n) { int idx, error; @@ -1617,9 +1576,7 @@ /* NAT rule table(s). */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_resolverule(softc, n) - ipf_main_softc_t *softc; - ipnat_t *n; +ipf_nat_resolverule(ipf_main_softc_t *softc, ipnat_t *n) { char *base; @@ -1666,11 +1623,8 @@ /* NAT rule table(s). */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_siocdelnat(softc, softn, n, getlock) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - ipnat_t *n; - int getlock; +ipf_nat_siocdelnat(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, ipnat_t *n, + int getlock) { if (getlock) { WRITE_ENTER(&softc->ipf_nat); @@ -1699,10 +1653,7 @@ /* structure is copied back to the user. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_getsz(softc, data, getlock) - ipf_main_softc_t *softc; - caddr_t data; - int getlock; +ipf_nat_getsz(ipf_main_softc_t *softc, caddr_t data, int getlock) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; ap_session_t *aps; @@ -1793,10 +1744,7 @@ /* proxy is also copied, as to is the NAT rule which was responsible for it */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_getent(softc, data, getlock) - ipf_main_softc_t *softc; - caddr_t data; - int getlock; +ipf_nat_getent(ipf_main_softc_t *softc, caddr_t data, int getlock) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; int error, outsize; @@ -1928,10 +1876,7 @@ /* firewall rule data structures, if pointers to them indicate so. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_putent(softc, data, getlock) - ipf_main_softc_t *softc; - caddr_t data; - int getlock; +ipf_nat_putent(ipf_main_softc_t *softc, caddr_t data, int getlock) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; nat_save_t ipn, *ipnn; @@ -2273,10 +2218,7 @@ /* enabled then generate a NAT log record for this event. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_delete(softc, nat, logtype) - ipf_main_softc_t *softc; - struct nat *nat; - int logtype; +ipf_nat_delete(ipf_main_softc_t *softc, struct nat *nat, int logtype) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; int madeorphan = 0, bkt, removed = 0; @@ -2449,9 +2391,7 @@ * nat_flushtable - clear the NAT table of all mapping entries. */ static int -ipf_nat_flushtable(softc, softn) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; +ipf_nat_flushtable(ipf_main_softc_t *softc, ipf_nat_softc_t *softn) { nat_t *nat; int j = 0; @@ -2489,9 +2429,7 @@ /* clear out the tables used for hashed NAT rule lookups. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_clearlist(softc, softn) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; +ipf_nat_clearlist(ipf_main_softc_t *softc, ipf_nat_softc_t *softn) { ipnat_t *n; int i = 0; @@ -2533,11 +2471,8 @@ /* hit, on the order of O(N^2). */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_delrule(softc, softn, np, purge) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - ipnat_t *np; - int purge; +ipf_nat_delrule(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, ipnat_t *np, + int purge) { if (np->in_pnext != NULL) { @@ -2607,10 +2542,7 @@ /* to the new IP address for the translation. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_newmap(fin, nat, ni) - fr_info_t *fin; - nat_t *nat; - natinfo_t *ni; +ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -2874,10 +2806,7 @@ /* to the new IP address for the translation. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_newrdr(fin, nat, ni) - fr_info_t *fin; - nat_t *nat; - natinfo_t *ni; +ipf_nat_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3088,12 +3017,8 @@ /* as it can result in memory being corrupted. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_add(fin, np, natsave, flags, direction) - fr_info_t *fin; - ipnat_t *np; - nat_t **natsave; - u_int flags; - int direction; +ipf_nat_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, + int direction) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3288,9 +3213,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ static int -ipf_nat_finalise(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_nat_finalise(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3404,10 +3327,7 @@ /* list of active NAT entries. Adjust global counters when complete. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_insert(softc, softn, nat) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - nat_t *nat; +ipf_nat_insert(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, nat_t *nat) { u_int hv0, hv1; u_int sp, dp; @@ -3512,10 +3432,8 @@ /* Handle the insertion of a NAT entry into the table/list. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_hashtab_add(softc, softn, nat) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - nat_t *nat; +ipf_nat_hashtab_add(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, + nat_t *nat) { nat_t **natp; u_int hv0; @@ -3611,9 +3529,7 @@ /* the required length. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_icmperrorlookup(fin, dir) - fr_info_t *fin; - int dir; +ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3768,10 +3684,7 @@ /* a NAT'd ICMP packet gets correctly recognised. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_icmperror(fin, nflags, dir) - fr_info_t *fin; - u_int *nflags; - int dir; +ipf_nat_icmperror(fr_info_t *fin, u_int *nflags, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -4075,10 +3988,8 @@ /* the packet is of said protocol */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_inlookup(fin, flags, p, src, mapdst) - fr_info_t *fin; - u_int flags, p; - struct in_addr src , mapdst; +ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, + struct in_addr src , struct in_addr mapdst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -4315,9 +4226,7 @@ /* want to include hashing on port numbers. */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_tabmove(softn, nat) - ipf_nat_softc_t *softn; - nat_t *nat; +ipf_nat_tabmove(ipf_nat_softc_t *softn, nat_t *nat) { u_int hv0, hv1, rhv0, rhv1; natstat_t *nsp; @@ -4410,10 +4319,8 @@ /* the packet is of said protocol */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_outlookup(fin, flags, p, src, dst) - fr_info_t *fin; - u_int flags, p; - struct in_addr src , dst; +ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, + struct in_addr src , struct in_addr dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -4645,8 +4552,7 @@ /* nl_out* = destination information (translated) */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_lookupredir(np) - natlookup_t *np; +ipf_nat_lookupredir(natlookup_t *np) { fr_info_t fi; nat_t *nat; @@ -4717,9 +4623,7 @@ /* loop inside ipf_nat_checkin() and lay it out properly in its own function. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_match(fin, np) - fr_info_t *fin; - ipnat_t *np; +ipf_nat_match(fr_info_t *fin, ipnat_t *np) { ipf_main_softc_t *softc = fin->fin_main_soft; frtuc_t *ft; @@ -4781,9 +4685,7 @@ /* already be set. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_update(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_nat_update(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -4843,9 +4745,7 @@ /* packet header(s) as required. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_checkout(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) { ipnat_t *np = NULL, *npnext; struct ifnet *ifp, *sifp; @@ -5067,11 +4967,7 @@ /* Translate a packet coming "out" on an interface. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_out(fin, nat, natadd, nflags) - fr_info_t *fin; - nat_t *nat; - int natadd; - u_32_t nflags; +ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -5342,9 +5238,7 @@ /* packet header(s) as required. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_checkin(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_nat_checkin(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc; ipf_nat_softc_t *softn; @@ -5562,11 +5456,7 @@ /* Translate a packet coming "in" on an interface. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_in(fin, nat, natadd, nflags) - fr_info_t *fin; - nat_t *nat; - int natadd; - u_32_t nflags; +ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -5796,10 +5686,7 @@ /* TCP down to a specific value, then do it from here. */ /* ------------------------------------------------------------------------ */ u_short * -ipf_nat_proto(fin, nat, nflags) - fr_info_t *fin; - nat_t *nat; - u_int nflags; +ipf_nat_proto(fr_info_t *fin, nat_t *nat, u_int nflags) { icmphdr_t *icmp; u_short *csump; @@ -5876,8 +5763,7 @@ /* expired. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_expire(softc) - ipf_main_softc_t *softc; +ipf_nat_expire(ipf_main_softc_t *softc) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; ipftq_t *ifq, *ifqnext; @@ -5935,9 +5821,7 @@ /* which need to have their translated address updated. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_sync(softc, ifp) - ipf_main_softc_t *softc; - void *ifp; +ipf_nat_sync(ipf_main_softc_t *softc, void *ifp) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; @@ -6092,8 +5976,7 @@ /* not. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_icmpquerytype(icmptype) - int icmptype; +ipf_nat_icmpquerytype(int icmptype) { /* @@ -6135,11 +6018,8 @@ /* Creates a NAT log entry. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_log(softc, softn, nat, action) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - struct nat *nat; - u_int action; +ipf_nat_log(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, struct nat *nat, + u_int action) { #ifdef IPFILTER_LOG struct ipnat *np; @@ -6211,9 +6091,7 @@ /* be released and the rule itself free'd. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_rule_deref(softc, inp) - ipf_main_softc_t *softc; - ipnat_t **inp; +ipf_nat_rule_deref(ipf_main_softc_t *softc, ipnat_t **inp) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; ipnat_t *n; @@ -6285,9 +6163,7 @@ /* called from a NAT flush ioctl with a deref happening because of a packet.*/ /* ------------------------------------------------------------------------ */ void -ipf_nat_deref(softc, natp) - ipf_main_softc_t *softc; - nat_t **natp; +ipf_nat_deref(ipf_main_softc_t *softc, nat_t **natp) { nat_t *nat; @@ -6320,9 +6196,7 @@ /* Create a "duplcate" state table entry from the master. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat_clone(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_nat_clone(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -6405,9 +6279,7 @@ /* wildcard flags should be used. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_wildok(nat, sport, dport, flags, dir) - nat_t *nat; - int sport, dport, flags, dir; +ipf_nat_wildok(nat_t *nat, int sport, int dport, int flags, int dir) { /* * When called by dir is set to @@ -6469,11 +6341,7 @@ /* the MSS. */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_mssclamp(tcp, maxmss, fin, csump) - tcphdr_t *tcp; - u_32_t maxmss; - fr_info_t *fin; - u_short *csump; +ipf_nat_mssclamp(tcphdr_t *tcp, u_32_t maxmss, fr_info_t *fin, u_short *csump) { u_char *cp, *ep, opt; int hlen, advance; @@ -6534,10 +6402,7 @@ /* determining which queue it should be placed on. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_setqueue(softc, softn, nat) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - nat_t *nat; +ipf_nat_setqueue(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, nat_t *nat) { ipftq_t *oifq, *nifq; int rev = nat->nat_rev; @@ -6591,11 +6456,8 @@ /* in the list to look at is put back in the ipftoken struture. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_getnext(softc, t, itp, objp) - ipf_main_softc_t *softc; - ipftoken_t *t; - ipfgeniter_t *itp; - ipfobj_t *objp; +ipf_nat_getnext(ipf_main_softc_t *softc, ipftoken_t *t, ipfgeniter_t *itp, + ipfobj_t *objp) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; hostmap_t *hm, *nexthm = NULL, zerohm; @@ -6742,10 +6604,7 @@ /* for the last 30 minutes to at worst 30 seconds idle. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_extraflush(softc, softn, which) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - int which; +ipf_nat_extraflush(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, int which) { nat_t *nat, **natp; ipftqent_t *tqn; @@ -6900,9 +6759,7 @@ /* we translate that to mean it always succeeds in deleting something. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_flush_entry(softc, entry) - ipf_main_softc_t *softc; - void *entry; +ipf_nat_flush_entry(ipf_main_softc_t *softc, void *entry) { ipf_nat_delete(softc, entry, NL_FLUSH); return 0; @@ -6923,11 +6780,8 @@ /* NAT mappings and the NAT fragment cache. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_iterator(softc, token, itp, obj) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; - ipfobj_t *obj; +ipf_nat_iterator(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, + ipfobj_t *obj) { int error; @@ -6971,9 +6825,7 @@ /* by nat_me) is no longer interested in it. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_setpending(softc, nat) - ipf_main_softc_t *softc; - nat_t *nat; +ipf_nat_setpending(ipf_main_softc_t *softc, nat_t *nat) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; ipftq_t *oifq; @@ -7014,10 +6866,7 @@ /* This is done to try and exhaustively use the translation space available.*/ /* ------------------------------------------------------------------------ */ static int -ipf_nat_newrewrite(fin, nat, nai) - fr_info_t *fin; - nat_t *nat; - natinfo_t *nai; +ipf_nat_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) { int src_search = 1; int dst_search = 1; @@ -7241,10 +7090,7 @@ /* for a unique mapping, however, a complimentary duplicate check is made. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_newdivert(fin, nat, nai) - fr_info_t *fin; - nat_t *nat; - natinfo_t *nai; +ipf_nat_newdivert(fr_info_t *fin, nat_t *nat, natinfo_t *nai) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -7327,9 +7173,7 @@ /* here because it is expected that divert will be used for localhost. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_builddivertmp(softn, np) - ipf_nat_softc_t *softn; - ipnat_t *np; +ipf_nat_builddivertmp(ipf_nat_softc_t *softn, ipnat_t *np) { udphdr_t *uh; size_t len; @@ -7396,9 +7240,7 @@ /* need to back a backup copy of "fin" - expensive. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_decap(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_nat_decap(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -7503,10 +7345,7 @@ /* possible uses of "na" will result in a new address. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_nextaddr(fin, na, old, dst) - fr_info_t *fin; - nat_addr_t *na; - u_32_t *old, *dst; +ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -7612,12 +7451,8 @@ /* come out of ipf_nat_nextaddr() will be. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_nextaddrinit(softc, base, na, initial, ifp) - ipf_main_softc_t *softc; - char *base; - nat_addr_t *na; - int initial; - void *ifp; +ipf_nat_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, + int initial, void *ifp) { switch (na->na_atype) @@ -7701,10 +7536,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_matchflush(softc, softn, data) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - caddr_t data; +ipf_nat_matchflush(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, + caddr_t data) { int *array, flushed, error; nat_t *nat, *natnext; @@ -7741,10 +7574,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_matcharray(nat, array, ticks) - nat_t *nat; - int *array; - u_long ticks; +ipf_nat_matcharray(nat_t *nat, int *array, u_long ticks) { int i, n, *x, e, p; @@ -7937,10 +7767,7 @@ /* At present the only table it deals with is the hash bucket statistics. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_gettable(softc, softn, data) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - char *data; +ipf_nat_gettable(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, char *data) { ipftable_t table; int error; @@ -7986,10 +7813,8 @@ /* Apply the timeout change to the NAT timeout queues. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_settimeout(softc, t, p) - struct ipf_main_softc_s *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_nat_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, + ipftuneval_t *p) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -8028,10 +7853,7 @@ /* and an outbound one. Each NAT entry goes into each table once. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_rehash(softc, t, p) - ipf_main_softc_t *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_nat_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; nat_t **newtab[2], *nat, **natp; @@ -8215,10 +8037,8 @@ /* affect one of these two tables. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_rehash_rules(softc, t, p) - ipf_main_softc_t *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_nat_rehash_rules(ipf_main_softc_t *softc, ipftuneable_t *t, + ipftuneval_t *p) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; ipnat_t **newtab, *np, ***old, **npp; @@ -8302,10 +8122,8 @@ /* all of the active IP# translations currently in place. */ /* ------------------------------------------------------------------------ */ int -ipf_nat_hostmap_rehash(softc, t, p) - ipf_main_softc_t *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_nat_hostmap_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, + ipftuneval_t *p) { ipf_nat_softc_t *softn = softc->ipf_nat_soft; hostmap_t *hm, **newtab; @@ -8355,9 +8173,7 @@ /* */ /* ------------------------------------------------------------------------ */ ipftq_t * -ipf_nat_add_tq(softc, ttl) - ipf_main_softc_t *softc; - int ttl; +ipf_nat_add_tq(ipf_main_softc_t *softc, int ttl) { ipf_nat_softc_t *softs = softc->ipf_nat_soft; @@ -8378,8 +8194,7 @@ /* traffic patterns. */ /* ------------------------------------------------------------------------ */ void -ipf_nat_uncreate(fin) - fr_info_t *fin; +ipf_nat_uncreate(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -8433,8 +8248,7 @@ /* this function should simply care if the result is zero or not. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_cmp_rules(n1, n2) - ipnat_t *n1, *n2; +ipf_nat_cmp_rules(ipnat_t *n1, ipnat_t *n2) { if (n1->in_size != n2->in_size) return 1; @@ -8487,10 +8301,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_nat_rule_init(softc, softn, n) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat_rule_init(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, + ipnat_t *n) { int error = 0; @@ -8558,9 +8370,7 @@ /* actually use them after the ioctl processing has finished. */ /* ------------------------------------------------------------------------ */ static void -ipf_nat_rule_fini(softc, n) - ipf_main_softc_t *softc; - ipnat_t *n; +ipf_nat_rule_fini(ipf_main_softc_t *softc, ipnat_t *n) { if (n->in_odst.na_atype == FRI_LOOKUP && n->in_odst.na_ptr != NULL) ipf_lookup_deref(softc, n->in_odst.na_type, n->in_odst.na_ptr); diff --git a/sys/netpfil/ipfilter/netinet/ip_nat6.c b/sys/netpfil/ipfilter/netinet/ip_nat6.c --- a/sys/netpfil/ipfilter/netinet/ip_nat6.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat6.c @@ -149,10 +149,8 @@ /* IPv6 specific actions can also be taken care of here. */ /* ------------------------------------------------------------------------ */ int -ipf_nat6_ruleaddrinit(softc, softn, n) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat6_ruleaddrinit(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, + ipnat_t *n) { int idx, error; @@ -207,9 +205,7 @@ /* use by redirect rules. */ /* ------------------------------------------------------------------------ */ void -ipf_nat6_addrdr(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat6_addrdr(ipf_nat_softc_t *softn, ipnat_t *n) { i6addr_t *mask; ipnat_t **np; @@ -256,9 +252,7 @@ /* redirect rules. */ /* ------------------------------------------------------------------------ */ void -ipf_nat6_addmap(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat6_addmap(ipf_nat_softc_t *softn, ipnat_t *n) { i6addr_t *mask; ipnat_t **np; @@ -297,9 +291,7 @@ /* Removes a NAT rdr rule from the hash table of NAT rdr rules. */ /* ------------------------------------------------------------------------ */ void -ipf_nat6_delrdr(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat6_delrdr(ipf_nat_softc_t *softn, ipnat_t *n) { i6addr_t *mask; int k; @@ -331,9 +323,7 @@ /* Removes a NAT map rule from the hash table of NAT map rules. */ /* ------------------------------------------------------------------------ */ void -ipf_nat6_delmap(softn, n) - ipf_nat_softc_t *softn; - ipnat_t *n; +ipf_nat6_delmap(ipf_nat_softc_t *softn, ipnat_t *n) { i6addr_t *mask; int k; @@ -369,11 +359,8 @@ /* create a new entry if a non-NULL NAT rule pointer has been supplied. */ /* ------------------------------------------------------------------------ */ static struct hostmap * -ipf_nat6_hostmap(softn, np, src, dst, map, port) - ipf_nat_softc_t *softn; - ipnat_t *np; - i6addr_t *src, *dst, *map; - u_32_t port; +ipf_nat6_hostmap(ipf_nat_softc_t *softn, ipnat_t *np, + i6addr_t *src, i6addr_t *dst, i6addr_t *map, u_32_t port) { hostmap_t *hm; u_int hv; @@ -453,10 +440,7 @@ /* to the new IP address for the translation. */ /* ------------------------------------------------------------------------ */ int -ipf_nat6_newmap(fin, nat, ni) - fr_info_t *fin; - nat_t *nat; - natinfo_t *ni; +ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -734,10 +718,7 @@ /* to the new IP address for the translation. */ /* ------------------------------------------------------------------------ */ int -ipf_nat6_newrdr(fin, nat, ni) - fr_info_t *fin; - nat_t *nat; - natinfo_t *ni; +ipf_nat6_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -949,12 +930,8 @@ /* as it can result in memory being corrupted. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat6_add(fin, np, natsave, flags, direction) - fr_info_t *fin; - ipnat_t *np; - nat_t **natsave; - u_int flags; - int direction; +ipf_nat6_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, + int direction) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -1150,9 +1127,7 @@ /* ------------------------------------------------------------------------ */ /*ARGSUSED*/ int -ipf_nat6_finalise(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -1271,10 +1246,7 @@ /* list of active NAT entries. Adjust global counters when complete. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_insert(softc, softn, nat) - ipf_main_softc_t *softc; - ipf_nat_softc_t *softn; - nat_t *nat; +ipf_nat6_insert(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, nat_t *nat) { u_int hv1, hv2; u_32_t sp, dp; @@ -1382,9 +1354,7 @@ /* the required length. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat6_icmperrorlookup(fin, dir) - fr_info_t *fin; - int dir; +ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -1528,8 +1498,7 @@ /* result = ip1 - ip2 */ u_32_t -ipf_nat6_ip6subtract(ip1, ip2) - i6addr_t *ip1, *ip2; +ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) { i6addr_t l1, l2, d; u_short *s1, *s2, *ds; @@ -1580,10 +1549,7 @@ /* a NAT'd ICMP packet gets correctly recognised. */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat6_icmperror(fin, nflags, dir) - fr_info_t *fin; - u_int *nflags; - int dir; +ipf_nat6_icmperror(fr_info_t *fin, u_int *nflags, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -1900,10 +1866,8 @@ /* the packet is of said protocol */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat6_inlookup(fin, flags, p, src, mapdst) - fr_info_t *fin; - u_int flags, p; - struct in6_addr *src , *mapdst; +ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, + struct in6_addr *src , struct in6_addr *mapdst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -2134,9 +2098,7 @@ /* want to include hashing on port numbers. */ /* ------------------------------------------------------------------------ */ static void -ipf_nat6_tabmove(softn, nat) - ipf_nat_softc_t *softn; - nat_t *nat; +ipf_nat6_tabmove(ipf_nat_softc_t *softn, nat_t *nat) { nat_t **natp; u_int hv0, hv1; @@ -2227,10 +2189,8 @@ /* the packet is of said protocol */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat6_outlookup(fin, flags, p, src, dst) - fr_info_t *fin; - u_int flags, p; - struct in6_addr *src , *dst; +ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, + struct in6_addr *src, struct in6_addr *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -2464,8 +2424,7 @@ /* nl_out* = destination information (translated) */ /* ------------------------------------------------------------------------ */ nat_t * -ipf_nat6_lookupredir(np) - natlookup_t *np; +ipf_nat6_lookupredir(natlookup_t *np) { fr_info_t fi; nat_t *nat; @@ -2540,9 +2499,7 @@ /* function. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_match(fin, np) - fr_info_t *fin; - ipnat_t *np; +ipf_nat6_match(fr_info_t *fin, ipnat_t *np) { frtuc_t *ft; int match; @@ -2608,9 +2565,7 @@ /* packet header(s) as required. */ /* ------------------------------------------------------------------------ */ int -ipf_nat6_checkout(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -2808,11 +2763,7 @@ /* Translate a packet coming "out" on an interface. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_out(fin, nat, natadd, nflags) - fr_info_t *fin; - nat_t *nat; - int natadd; - u_32_t nflags; +ipf_nat6_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3008,9 +2959,7 @@ /* packet header(s) as required. */ /* ------------------------------------------------------------------------ */ int -ipf_nat6_checkin(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3207,11 +3156,7 @@ /* Translate a packet coming "in" on an interface. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_in(fin, nat, natadd, nflags) - fr_info_t *fin; - nat_t *nat; - int natadd; - u_32_t nflags; +ipf_nat6_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3412,10 +3357,7 @@ /* This is done to try and exhaustively use the translation space available.*/ /* ------------------------------------------------------------------------ */ int -ipf_nat6_newrewrite(fin, nat, nai) - fr_info_t *fin; - nat_t *nat; - natinfo_t *nai; +ipf_nat6_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) { int src_search = 1; int dst_search = 1; @@ -3641,10 +3583,7 @@ /* for a unique mapping, however, a complimentary duplicate check is made. */ /* ------------------------------------------------------------------------ */ int -ipf_nat6_newdivert(fin, nat, nai) - fr_info_t *fin; - nat_t *nat; - natinfo_t *nai; +ipf_nat6_newdivert(fr_info_t *fin, nat_t *nat, natinfo_t *nai) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3718,9 +3657,7 @@ /* here because it is expected that divert will be used for localhost. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_builddivertmp(softn, np) - ipf_nat_softc_t *softn; - ipnat_t *np; +ipf_nat6_builddivertmp(ipf_nat_softc_t *softn, ipnat_t *np) { udphdr_t *uh; size_t len; @@ -3781,9 +3718,7 @@ /* need to back a backup copy of "fin" - expensive. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_decap(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_nat6_decap(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3864,10 +3799,7 @@ /* possible uses of "na" will result in a new address. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_nextaddr(fin, na, old, dst) - fr_info_t *fin; - nat_addr_t *na; - i6addr_t *old, *dst; +ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; @@ -3972,12 +3904,8 @@ /* come out of ipf_nat6_nextaddr() will be. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_nextaddrinit(softc, base, na, initial, ifp) - ipf_main_softc_t *softc; - char *base; - nat_addr_t *na; - int initial; - void *ifp; +ipf_nat6_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, + int initial, void *ifp) { switch (na->na_atype) { @@ -4059,8 +3987,7 @@ /* not. */ /* ------------------------------------------------------------------------ */ static int -ipf_nat6_icmpquerytype(icmptype) - int icmptype; +ipf_nat6_icmpquerytype(int icmptype) { /* diff --git a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c @@ -46,7 +46,7 @@ * Initialize local structures. */ void -ipf_p_netbios_main_load() +ipf_p_netbios_main_load(void) { bzero((char *)&netbiosfr, sizeof(netbiosfr)); netbiosfr.fr_ref = 1; @@ -57,7 +57,7 @@ void -ipf_p_netbios_main_unload() +ipf_p_netbios_main_unload(void) { if (netbios_proxy_init == 1) { MUTEX_DESTROY(&netbiosfr.fr_lock); @@ -67,11 +67,7 @@ int -ipf_p_netbios_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { char dgmbuf[6]; int off, dlen; diff --git a/sys/netpfil/ipfilter/netinet/ip_pool.c b/sys/netpfil/ipfilter/netinet/ip_pool.c --- a/sys/netpfil/ipfilter/netinet/ip_pool.c +++ b/sys/netpfil/ipfilter/netinet/ip_pool.c @@ -133,9 +133,7 @@ void treeprint(ip_pool_t *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { ip_pool_node_t node; addrfamily_t a, b; @@ -235,8 +233,7 @@ void -treeprint(ipo) - ip_pool_t *ipo; +treeprint(ip_pool_t *ipo) { ip_pool_node_t *c; @@ -257,8 +254,7 @@ /* Initialise the routing table data structures where required. */ /* ------------------------------------------------------------------------ */ static void * -ipf_pool_soft_create(softc) - ipf_main_softc_t *softc; +ipf_pool_soft_create(ipf_main_softc_t *softc) { ipf_pool_softc_t *softp; @@ -290,9 +286,7 @@ /* Initialise the routing table data structures where required. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_pool_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_pool_softc_t *softp = arg; @@ -314,9 +308,7 @@ /* used to delete the pools one by one to ensure they're properly freed up. */ /* ------------------------------------------------------------------------ */ static void -ipf_pool_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_pool_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_pool_softc_t *softp = arg; ip_pool_t *p, *q; @@ -343,9 +335,7 @@ /* up the pool context too. */ /* ------------------------------------------------------------------------ */ static void -ipf_pool_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_pool_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_pool_softc_t *softp = arg; @@ -367,11 +357,8 @@ /* the address prior to calling for the pair to be added. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_node_add(softc, arg, op, uid) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; - int uid; +ipf_pool_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, + int uid) { ip_pool_node_t node, *m; ip_pool_t *p; @@ -462,11 +449,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_node_del(softc, arg, op, uid) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; - int uid; +ipf_pool_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, + int uid) { ip_pool_node_t node, *m; ip_pool_t *p; @@ -538,10 +522,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_table_add(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_pool_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { int err; @@ -566,10 +547,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_table_del(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_pool_table_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { return ipf_pool_destroy(softc, arg, op->iplo_unit, op->iplo_name); } @@ -586,10 +564,7 @@ /* pointers as appropriate for later use. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_stats_get(softc, arg, op) - ipf_main_softc_t *softc; - void *arg; - iplookupop_t *op; +ipf_pool_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { ipf_pool_softc_t *softp = arg; ipf_pool_stat_t stats; @@ -638,10 +613,7 @@ /* device, indicated by the unit number. */ /* ------------------------------------------------------------------------ */ static void * -ipf_pool_exists(softp, unit, name) - ipf_pool_softc_t *softp; - int unit; - char *name; +ipf_pool_exists(ipf_pool_softc_t *softp, int unit, char *name) { ip_pool_t *p; int i; @@ -680,10 +652,7 @@ /* pretend it does not exist. */ /* ------------------------------------------------------------------------ */ static void * -ipf_pool_find(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_pool_find(void *arg, int unit, char *name) { ipf_pool_softc_t *softp = arg; ip_pool_t *p; @@ -705,10 +674,7 @@ /* */ /* ------------------------------------------------------------------------ */ static void * -ipf_pool_select_add_ref(arg, unit, name) - void *arg; - int unit; - char *name; +ipf_pool_select_add_ref(void *arg, int unit, char *name) { ip_pool_t *p; @@ -734,10 +700,8 @@ /* ------------------------------------------------------------------------ */ extern void printhostmask(int, u_32_t *, u_32_t *); static ip_pool_node_t * -ipf_pool_findeq(softp, ipo, addr, mask) - ipf_pool_softc_t *softp; - ip_pool_t *ipo; - addrfamily_t *addr, *mask; +ipf_pool_findeq(ipf_pool_softc_t *softp, ip_pool_t *ipo, addrfamily_t *addr, + addrfamily_t *mask) { ipf_rdx_node_t *n; @@ -758,12 +722,8 @@ /* Search the pool for a given address and return a search result. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_search(softc, tptr, ipversion, dptr, bytes) - ipf_main_softc_t *softc; - void *tptr; - int ipversion; - void *dptr; - u_int bytes; +ipf_pool_search(ipf_main_softc_t *softc, void *tptr, int ipversion, void *dptr, + u_int bytes) { ipf_rdx_node_t *rn; ip_pool_node_t *m; @@ -825,11 +785,8 @@ /* in (addr, mask, info) shold all be stored in the node. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_insert_node(softc, softp, ipo, node) - ipf_main_softc_t *softc; - ipf_pool_softc_t *softp; - ip_pool_t *ipo; - struct ip_pool_node *node; +ipf_pool_insert_node(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, + ip_pool_t *ipo, struct ip_pool_node *node) { ipf_rdx_node_t *rn; ip_pool_node_t *x; @@ -940,10 +897,8 @@ /* and now want to repopulate it with "new" data. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_create(softc, softp, op) - ipf_main_softc_t *softc; - ipf_pool_softc_t *softp; - iplookupop_t *op; +ipf_pool_create(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, + iplookupop_t *op) { char name[FR_GROUPLEN]; int poolnum, unit; @@ -1028,11 +983,8 @@ /* Remove a node from the pool given by ipo. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_remove_node(softc, softp, ipo, ipe) - ipf_main_softc_t *softc; - ipf_pool_softc_t *softp; - ip_pool_t *ipo; - ip_pool_node_t *ipe; +ipf_pool_remove_node(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, + ip_pool_t *ipo, ip_pool_node_t *ipe) { void *ptr; @@ -1079,11 +1031,8 @@ /* assertion that one of the two (ipf_poolrw,ipf_global) is held. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_destroy(softc, softp, unit, name) - ipf_main_softc_t *softc; - ipf_pool_softc_t *softp; - int unit; - char *name; +ipf_pool_destroy(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, + int unit, char *name) { ip_pool_t *ipo; @@ -1120,10 +1069,7 @@ /* assertion that one of the two (ipf_poolrw,ipf_global) is held. */ /* ------------------------------------------------------------------------ */ static size_t -ipf_pool_flush(softc, arg, fp) - ipf_main_softc_t *softc; - void *arg; - iplookupflush_t *fp; +ipf_pool_flush(ipf_main_softc_t *softc, void *arg, iplookupflush_t *fp) { ipf_pool_softc_t *softp = arg; int i, num = 0, unit, err; @@ -1161,10 +1107,7 @@ /* assertion that one of the two (ipf_poolrw,ipf_global) is held. */ /* ------------------------------------------------------------------------ */ static void -ipf_pool_free(softc, softp, ipo) - ipf_main_softc_t *softc; - ipf_pool_softc_t *softp; - ip_pool_t *ipo; +ipf_pool_free(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, ip_pool_t *ipo) { ipf_pool_clearnodes(softc, softp, ipo); @@ -1190,10 +1133,8 @@ /* Deletes all nodes stored in a pool structure. */ /* ------------------------------------------------------------------------ */ static void -ipf_pool_clearnodes(softc, softp, ipo) - ipf_main_softc_t *softc; - ipf_pool_softc_t *softp; - ip_pool_t *ipo; +ipf_pool_clearnodes(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, + ip_pool_t *ipo) { ip_pool_node_t *n, **next; @@ -1216,9 +1157,7 @@ /* we arrive at zero known references, free it. */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_deref(softc, arg, pool) - ipf_main_softc_t *softc; - void *arg, *pool; +ipf_pool_deref(ipf_main_softc_t *softc, void *arg, void *pool) { ip_pool_t *ipo = pool; @@ -1245,9 +1184,7 @@ /* it all up and adjust the stats accordingly. */ /* ------------------------------------------------------------------------ */ static void -ipf_pool_node_deref(softp, ipn) - ipf_pool_softc_t *softp; - ip_pool_node_t *ipn; +ipf_pool_node_deref(ipf_pool_softc_t *softp, ip_pool_node_t *ipn) { ipn->ipn_ref--; @@ -1269,11 +1206,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_iter_next(softc, arg, token, ilp) - ipf_main_softc_t *softc; - void *arg; - ipftoken_t *token; - ipflookupiter_t *ilp; +ipf_pool_iter_next(ipf_main_softc_t *softc, void *arg, ipftoken_t *token, + ipflookupiter_t *ilp) { ipf_pool_softc_t *softp = arg; ip_pool_node_t *node, zn, *nextnode; @@ -1393,12 +1327,8 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_pool_iter_deref(softc, arg, otype, unit, data) - ipf_main_softc_t *softc; - void *arg; - int otype; - int unit; - void *data; +ipf_pool_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, int unit, + void *data) { ipf_pool_softc_t *softp = arg; @@ -1435,9 +1365,7 @@ /* nodes to the address pool. */ /* ------------------------------------------------------------------------ */ static void -ipf_pool_expire(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_pool_expire(ipf_main_softc_t *softc, void *arg) { ipf_pool_softc_t *softp = arg; ip_pool_node_t *n; diff --git a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c @@ -78,7 +78,7 @@ * PPTP application proxy initialization. */ void -ipf_p_pptp_main_load() +ipf_p_pptp_main_load(void) { bzero((char *)&pptpfr, sizeof(pptpfr)); pptpfr.fr_ref = 1; @@ -91,7 +91,7 @@ void -ipf_p_pptp_main_unload() +ipf_p_pptp_main_unload(void) { if (pptp_proxy_init == 1) { MUTEX_DESTROY(&pptpfr.fr_lock); @@ -107,11 +107,7 @@ * optimised into puts statements on FreeBSD (this doesn't exist in the kernel) */ int -ipf_p_pptp_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_pptp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { pptp_pxy_t *pptp; ipnat_t *ipn; @@ -191,10 +187,7 @@ void -ipf_p_pptp_donatstate(fin, nat, pptp) - fr_info_t *fin; - nat_t *nat; - pptp_pxy_t *pptp; +ipf_p_pptp_donatstate(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp) { ipf_main_softc_t *softc = fin->fin_main_soft; fr_info_t fi; @@ -279,11 +272,7 @@ * parsing function. */ int -ipf_p_pptp_nextmessage(fin, nat, pptp, rev) - fr_info_t *fin; - nat_t *nat; - pptp_pxy_t *pptp; - int rev; +ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) { static const char *funcname = "ipf_p_pptp_nextmessage"; pptp_side_t *pptps; @@ -404,11 +393,8 @@ * handle a complete PPTP message */ int -ipf_p_pptp_message(fin, nat, pptp, pptps) - fr_info_t *fin; - nat_t *nat; - pptp_pxy_t *pptp; - pptp_side_t *pptps; +ipf_p_pptp_message(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, + pptp_side_t *pptps) { pptp_hdr_t *hdr = (pptp_hdr_t *)pptps->pptps_buffer; @@ -429,11 +415,8 @@ * handle a complete PPTP control message */ int -ipf_p_pptp_mctl(fin, nat, pptp, pptps) - fr_info_t *fin; - nat_t *nat; - pptp_pxy_t *pptp; - pptp_side_t *pptps; +ipf_p_pptp_mctl(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, + pptp_side_t *pptps) { u_short *buffer = (u_short *)(pptps->pptps_buffer); pptp_side_t *pptpo; @@ -518,11 +501,7 @@ * we can. If they have disappeared, recreate them. */ int -ipf_p_pptp_inout(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_pptp_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { pptp_pxy_t *pptp; tcphdr_t *tcp; @@ -552,9 +531,7 @@ * clean up after ourselves. */ void -ipf_p_pptp_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_pptp_del(ipf_main_softc_t *softc, ap_session_t *aps) { pptp_pxy_t *pptp; diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c --- a/sys/netpfil/ipfilter/netinet/ip_proxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c @@ -251,7 +251,7 @@ /* Call the initialise routine for all the compiled in kernel proxies. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_main_load() +ipf_proxy_main_load(void) { aproxy_t *ap; @@ -272,7 +272,7 @@ /* Call the finialise routine for all the compiled in kernel proxies. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_main_unload() +ipf_proxy_main_unload(void) { aproxy_t *ap; @@ -295,8 +295,7 @@ /* Build the structure to hold all of the run time data to support proxies. */ /* ------------------------------------------------------------------------ */ void * -ipf_proxy_soft_create(softc) - ipf_main_softc_t *softc; +ipf_proxy_soft_create(ipf_main_softc_t *softc) { ipf_proxy_softc_t *softp; aproxy_t *last; @@ -367,9 +366,7 @@ /* a pointer to that copy. */ /* ------------------------------------------------------------------------ */ static aproxy_t * -ipf_proxy_create_clone(softc, orig) - ipf_main_softc_t *softc; - aproxy_t *orig; +ipf_proxy_create_clone(ipf_main_softc_t *softc, aproxy_t *orig) { aproxy_t *apn; @@ -407,9 +404,7 @@ /* local setup prior to actual use. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_proxy_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_proxy_softc_t *softp; aproxy_t *ap; @@ -450,9 +445,7 @@ /* called and suring all of the proxies have similarly been instructed. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_proxy_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_proxy_softc_t *softp = arg; aproxy_t *ap; @@ -483,9 +476,7 @@ /* Free up all of the local data structures allocated during creation. */ /* ------------------------------------------------------------------------ */ void -ipf_proxy_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_proxy_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_proxy_softc_t *softp = arg; aproxy_t *ap; @@ -518,9 +509,7 @@ /* a flush or a clear. */ /* ------------------------------------------------------------------------ */ void -ipf_proxy_flush(arg, how) - void *arg; - int how; +ipf_proxy_flush(void *arg, int how) { ipf_proxy_softc_t *softp = arg; aproxy_t *ap; @@ -552,9 +541,7 @@ /* collection compiled in and dynamically added. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_add(arg, ap) - void *arg; - aproxy_t *ap; +ipf_proxy_add(void *arg, aproxy_t *ap) { ipf_proxy_softc_t *softp = arg; @@ -599,10 +586,7 @@ /* control function. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_ctl(softc, arg, ctl) - ipf_main_softc_t *softc; - void *arg; - ap_ctl_t *ctl; +ipf_proxy_ctl(ipf_main_softc_t *softc, void *arg, ap_ctl_t *ctl) { ipf_proxy_softc_t *softp = arg; aproxy_t *a; @@ -641,8 +625,7 @@ /* if it cannot be matched. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_del(ap) - aproxy_t *ap; +ipf_proxy_del(aproxy_t *ap) { aproxy_t *a, **app; @@ -674,10 +657,7 @@ /* rule even if the rule is still active. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_ok(fin, tcp, np) - fr_info_t *fin; - tcphdr_t *tcp; - ipnat_t *np; +ipf_proxy_ok(fr_info_t *fin, tcphdr_t *tcp, ipnat_t *np) { aproxy_t *apr = np->in_apr; u_short dport = np->in_odport; @@ -702,12 +682,8 @@ /* */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_ioctl(softc, data, cmd, mode, ctx) - ipf_main_softc_t *softc; - caddr_t data; - ioctlcmd_t cmd; - int mode; - void *ctx; +ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, + int mode, void *ctx) { ap_ctl_t ctl; caddr_t ptr; @@ -769,9 +745,7 @@ /* matching is not because they need to work with data, not just headers. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_match(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_proxy_match(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_proxy_softc_t *softp = softc->ipf_proxy_soft; @@ -823,9 +797,7 @@ /* returning. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_new(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_proxy_new(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_proxy_softc_t *softp = softc->ipf_proxy_soft; @@ -896,9 +868,7 @@ /* check causes FI_BAD to be set. */ /* ------------------------------------------------------------------------ */ int -ipf_proxy_check(fin, nat) - fr_info_t *fin; - nat_t *nat; +ipf_proxy_check(fr_info_t *fin, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_proxy_softc_t *softp = softc->ipf_proxy_soft; @@ -1063,10 +1033,7 @@ /* Search for a proxy by the protocol being used and by its name. */ /* ------------------------------------------------------------------------ */ aproxy_t * -ipf_proxy_lookup(arg, pr, name) - void *arg; - u_int pr; - char *name; +ipf_proxy_lookup(void *arg, u_int pr, char *name) { ipf_proxy_softc_t *softp = arg; aproxy_t *ap; @@ -1095,8 +1062,7 @@ /* Drop the reference counter associated with the proxy. */ /* ------------------------------------------------------------------------ */ void -ipf_proxy_deref(ap) - aproxy_t *ap; +ipf_proxy_deref(aproxy_t *ap) { ap->apr_ref--; } @@ -1113,9 +1079,7 @@ /* session. */ /* ------------------------------------------------------------------------ */ void -ipf_proxy_free(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_proxy_free(ipf_main_softc_t *softc, ap_session_t *aps) { ipf_proxy_softc_t *softp = softc->ipf_proxy_soft; ap_session_t *a, **ap; @@ -1154,11 +1118,7 @@ /* and the new string being a different length to the old. */ /* ------------------------------------------------------------------------ */ static int -ipf_proxy_fixseqack(fin, ip, aps, inc) - fr_info_t *fin; - ip_t *ip; - ap_session_t *aps; - int inc; +ipf_proxy_fixseqack(fr_info_t *fin, ip_t *ip, ap_session_t *aps, int inc) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_proxy_softc_t *softp = softc->ipf_proxy_soft; @@ -1317,8 +1277,7 @@ /* data connections with the PORT and EPRT commands. */ /* ------------------------------------------------------------------------ */ ipnat_t * -ipf_proxy_rule_rev(nat) - nat_t *nat; +ipf_proxy_rule_rev(nat_t *nat) { ipnat_t *old; ipnat_t *ipn; @@ -1405,8 +1364,7 @@ /* used to support PORT/EPRT, this function supports PASV/EPSV. */ /* ------------------------------------------------------------------------ */ ipnat_t * -ipf_proxy_rule_fwd(nat) - nat_t *nat; +ipf_proxy_rule_fwd(nat_t *nat) { ipnat_t *old; ipnat_t *ipn; diff --git a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c @@ -26,7 +26,7 @@ * Real Audio application proxy initialization. */ void -ipf_p_raudio_main_load() +ipf_p_raudio_main_load(void) { bzero((char *)&raudiofr, sizeof(raudiofr)); raudiofr.fr_ref = 1; @@ -37,7 +37,7 @@ void -ipf_p_raudio_main_unload() +ipf_p_raudio_main_unload(void) { if (raudio_proxy_init == 1) { MUTEX_DESTROY(&raudiofr.fr_lock); @@ -50,11 +50,7 @@ * Setup for a new proxy to handle Real Audio. */ int -ipf_p_raudio_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { raudio_t *rap; @@ -77,11 +73,7 @@ int -ipf_p_raudio_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { raudio_t *rap = aps->aps_data; unsigned char membuf[512 + 1], *s; @@ -181,11 +173,7 @@ int -ipf_p_raudio_in(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { unsigned char membuf[IPF_MAXPORTLEN + 1], *s; tcphdr_t *tcp, tcph, *tcp2 = &tcph; diff --git a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c @@ -41,7 +41,7 @@ * RCMD application proxy initialization. */ void -ipf_p_rcmd_main_load() +ipf_p_rcmd_main_load(void) { bzero((char *)&rcmdfr, sizeof(rcmdfr)); rcmdfr.fr_ref = 1; @@ -52,7 +52,7 @@ void -ipf_p_rcmd_main_unload() +ipf_p_rcmd_main_unload(void) { if (rcmd_proxy_init == 1) { MUTEX_DESTROY(&rcmdfr.fr_lock); @@ -65,11 +65,7 @@ * Setup for a new RCMD proxy. */ int -ipf_p_rcmd_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { tcphdr_t *tcp = (tcphdr_t *)fin->fin_dp; rcmdinfo_t *rc; @@ -108,9 +104,7 @@ void -ipf_p_rcmd_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_rcmd_del(ipf_main_softc_t *softc, ap_session_t *aps) { rcmdinfo_t *rci; @@ -126,8 +120,7 @@ * ipf_rcmd_atoi - implement a simple version of atoi */ u_short -ipf_rcmd_atoi(ptr) - char *ptr; +ipf_rcmd_atoi(char *ptr) { register char *s = ptr, c; register u_short i = 0; @@ -141,10 +134,7 @@ int -ipf_p_rcmd_portmsg(fin, aps, nat) - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rcmd_portmsg(fr_info_t *fin, ap_session_t *aps, nat_t *nat) { tcphdr_t *tcp, tcph, *tcp2 = &tcph; int off, dlen, nflags, direction; @@ -327,11 +317,7 @@ int -ipf_p_rcmd_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rcmd_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { if (nat->nat_dir == NAT_OUTBOUND) return ipf_p_rcmd_portmsg(fin, aps, nat); @@ -340,11 +326,7 @@ int -ipf_p_rcmd_in(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rcmd_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { if (nat->nat_dir == NAT_INBOUND) return ipf_p_rcmd_portmsg(fin, aps, nat); diff --git a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c @@ -107,7 +107,7 @@ /* Initialize the filter rule entry and session limiter. */ /* -------------------------------------------------------------------- */ void -ipf_p_rpcb_main_load() +ipf_p_rpcb_main_load(void) { V_rpcbcnt = 0; @@ -126,7 +126,7 @@ /* Destroy rpcbfr's mutex to avoid a lock leak. */ /* -------------------------------------------------------------------- */ void -ipf_p_rpcb_main_unload() +ipf_p_rpcb_main_unload(void) { if (rpcb_proxy_init == 1) { MUTEX_DESTROY(&rpcbfr.fr_lock); @@ -144,11 +144,7 @@ /* Allocate resources for per-session proxy structures. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { rpcb_session_t *rs; @@ -177,9 +173,7 @@ /* Free up a session's list of RPCB requests. */ /* -------------------------------------------------------------------- */ void -ipf_p_rpcb_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_rpcb_del(ipf_main_softc_t *softc, ap_session_t *aps) { rpcb_session_t *rs; rs = (rpcb_session_t *)aps->aps_data; @@ -204,11 +198,7 @@ /* for decoding. Also pass packet off for a rewrite if necessary. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_in(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rpcb_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { rpc_msg_t rpcmsg, *rm; rpcb_session_t *rs; @@ -276,11 +266,7 @@ /* allow direct communication between RPC client and server. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { rpc_msg_t rpcmsg, *rm; rpcb_session_t *rs; @@ -379,8 +365,7 @@ /* Simply flushes the list of outstanding transactions, if any. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_flush(rs) - rpcb_session_t *rs; +ipf_p_rpcb_flush(rpcb_session_t *rs) { rpcb_xact_t *r1, *r2; @@ -413,11 +398,8 @@ /* is enough room in rs_buf for the basic RPC message "preamble". */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_decodereq(fin, nat, rs, rm) - fr_info_t *fin; - nat_t *nat; - rpcb_session_t *rs; - rpc_msg_t *rm; +ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, + rpc_msg_t *rm) { rpcb_args_t *ra; u_32_t xdr, *p; @@ -532,10 +514,7 @@ /* it. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_skipauth(rm, auth, buf) - rpc_msg_t *rm; - xdr_auth_t *auth; - u_32_t **buf; +ipf_p_rpcb_skipauth(rpc_msg_t *rm, xdr_auth_t *auth, u_32_t **buf) { u_32_t *p, xdr; @@ -571,9 +550,7 @@ /* rx(I) - pointer to RPCB transaction structure */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_insert(rs, rx) - rpcb_session_t *rs; - rpcb_xact_t *rx; +ipf_p_rpcb_insert(rpcb_session_t *rs, rpcb_xact_t *rx) { rpcb_xact_t *rxp; @@ -618,10 +595,7 @@ /* within only the context of TCP/UDP over IP networks. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_xdrrpcb(rm, p, ra) - rpc_msg_t *rm; - u_32_t *p; - rpcb_args_t *ra; +ipf_p_rpcb_xdrrpcb(rpc_msg_t *rm, u_32_t *p, rpcb_args_t *ra) { if (!RPCB_BUF_GEQ(rm, p, 20)) return(-1); @@ -655,10 +629,7 @@ /* Decode the IP address / port at p and record them in xu. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_getuaddr(rm, xu, p) - rpc_msg_t *rm; - xdr_uaddr_t *xu; - u_32_t **p; +ipf_p_rpcb_getuaddr(rpc_msg_t *rm, xdr_uaddr_t *xu, u_32_t **p) { char *c, *i, *b, *pp; u_int d, dd, l, t; @@ -742,8 +713,7 @@ /* Simple version of atoi(3) ripped from ip_rcmd_pxy.c. */ /* -------------------------------------------------------------------- */ static u_int -ipf_p_rpcb_atoi(ptr) - char *ptr; +ipf_p_rpcb_atoi(char *ptr) { register char *s = ptr, c; register u_int i = 0; @@ -769,12 +739,8 @@ /* with the latter. (This is exclusive to protocol versions 3 & 4). */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_modreq(fin, nat, rm, m, off) - fr_info_t *fin; - nat_t *nat; - rpc_msg_t *rm; - mb_t *m; - u_int off; +ipf_p_rpcb_modreq(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m, + u_int off) { u_int len, xlen, pos, bogo; rpcb_args_t *ra; @@ -852,12 +818,8 @@ /* is enough room in rs_buf for the basic RPC message "preamble". */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_decoderep(fin, nat, rs, rm, rxp) - fr_info_t *fin; - nat_t *nat; - rpcb_session_t *rs; - rpc_msg_t *rm; - rpcb_xact_t **rxp; +ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, + rpc_msg_t *rm, rpcb_xact_t **rxp) { rpcb_listp_t *rl; rpcb_entry_t *re; @@ -1035,9 +997,7 @@ /* xid(I) - XID to look for */ /* -------------------------------------------------------------------- */ static rpcb_xact_t * -ipf_p_rpcb_lookup(rs, xid) - rpcb_session_t *rs; - u_32_t xid; +ipf_p_rpcb_lookup(rpcb_session_t *rs, u_32_t xid) { rpcb_xact_t *rx; @@ -1063,9 +1023,7 @@ /* Free the RPCB transaction record rx from the chain of entries. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_deref(rs, rx) - rpcb_session_t *rs; - rpcb_xact_t *rx; +ipf_p_rpcb_deref(rpcb_session_t *rs, rpcb_xact_t *rx) { rs = rs; /* LINT */ @@ -1096,10 +1054,7 @@ /* Decode netid/proto stored at p and record its numeric value. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_getproto(rm, xp, p) - rpc_msg_t *rm; - xdr_proto_t *xp; - u_32_t **p; +ipf_p_rpcb_getproto(rpc_msg_t *rm, xdr_proto_t *xp, u_32_t **p) { u_int len; @@ -1143,11 +1098,7 @@ /* attempt between RPC client and server. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_getnat(fin, nat, proto, port) - fr_info_t *fin; - nat_t *nat; - u_int proto; - u_int port; +ipf_p_rpcb_getnat(fr_info_t *fin, nat_t *nat, u_int proto, u_int port) { ipf_main_softc_t *softc = fin->fin_main_soft; ipnat_t *ipn, ipnat; @@ -1303,12 +1254,8 @@ /* lengths as necessary. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_modv3(fin, nat, rm, m, off) - fr_info_t *fin; - nat_t *nat; - rpc_msg_t *rm; - mb_t *m; - u_int off; +ipf_p_rpcb_modv3(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m, + u_int off) { u_int len, xlen, pos, bogo; rpc_resp_t *rr; @@ -1365,12 +1312,8 @@ /* Write new rpcb_entry list, adjusting lengths as necessary. */ /* -------------------------------------------------------------------- */ static int -ipf_p_rpcb_modv4(fin, nat, rm, m, off) - fr_info_t *fin; - nat_t *nat; - rpc_msg_t *rm; - mb_t *m; - u_int off; +ipf_p_rpcb_modv4(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m, + u_int off) { u_int len, xlen, pos, bogo; rpcb_listp_t *rl; @@ -1447,9 +1390,7 @@ /* header fields. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_fixlen(fin, len) - fr_info_t *fin; - int len; +ipf_p_rpcb_fixlen(fr_info_t *fin, int len) { udphdr_t *udp; diff --git a/sys/netpfil/ipfilter/netinet/ip_rules.c b/sys/netpfil/ipfilter/netinet/ip_rules.c --- a/sys/netpfil/ipfilter/netinet/ip_rules.c +++ b/sys/netpfil/ipfilter/netinet/ip_rules.c @@ -104,7 +104,7 @@ } static frentry_t ipfrule_out_; -int ipfrule_add_out_() +int ipfrule_add_out_(void) { int i, j, err = 0, max; frentry_t *fp; @@ -141,7 +141,7 @@ } -int ipfrule_remove_out_() +int ipfrule_remove_out_(void) { int err = 0, i; frentry_t *fp; @@ -173,7 +173,7 @@ } static frentry_t ipfrule_in_; -int ipfrule_add_in_() +int ipfrule_add_in_(void) { int i, j, err = 0, max; frentry_t *fp; @@ -210,7 +210,7 @@ } -int ipfrule_remove_in_() +int ipfrule_remove_in_(void) { int err = 0, i; frentry_t *fp; @@ -241,7 +241,7 @@ return err; } -int ipfrule_add() +int ipfrule_add(void) { int err; @@ -255,7 +255,7 @@ } -int ipfrule_remove() +int ipfrule_remove(void) { int err; diff --git a/sys/netpfil/ipfilter/netinet/ip_scan.c b/sys/netpfil/ipfilter/netinet/ip_scan.c --- a/sys/netpfil/ipfilter/netinet/ip_scan.c +++ b/sys/netpfil/ipfilter/netinet/ip_scan.c @@ -80,7 +80,7 @@ int -ipf_scan_init() +ipf_scan_init(void) { RWLOCK_INIT(&ipf_scan_rwlock, "ip scan rwlock"); ipf_scan_inited = 1; @@ -99,8 +99,7 @@ int -ipf_scan_add(data) - caddr_t data; +ipf_scan_add(caddr_t data) { ipscan_t *i, *isc; int err; @@ -150,8 +149,7 @@ int -ipf_scan_remove(data) - caddr_t data; +ipf_scan_remove(caddr_t data) { ipscan_t isc, *i; int err; @@ -191,8 +189,7 @@ struct ipscan * -ipf_scan_lookup(tag) - char *tag; +ipf_scan_lookup(char *tag) { ipscan_t *i; @@ -204,8 +201,7 @@ int -ipf_scan_attachfr(fr) - struct frentry *fr; +ipf_scan_attachfr(struct frentry *fr) { ipscan_t *i; @@ -227,8 +223,7 @@ int -ipf_scan_attachis(is) - struct ipstate *is; +ipf_scan_attachis(struct ipstate *is) { frentry_t *fr; ipscan_t *i; @@ -256,8 +251,7 @@ int -ipf_scan_detachfr(fr) - struct frentry *fr; +ipf_scan_detachfr(struct frentry *fr) { ipscan_t *i; @@ -290,10 +284,7 @@ * 'string' compare for scanning */ int -ipf_scan_matchstr(sp, str, n) - sinfo_t *sp; - char *str; - int n; +ipf_scan_matchstr(sinfo_t *sp, char *str, int n) { char *s, *t, *up; int i = n; @@ -325,10 +316,7 @@ * 1 if just client */ int -ipf_scan_matchisc(isc, is, cl, sl, maxm) - ipscan_t *isc; - ipstate_t *is; - int cl, sl, maxm[2]; +ipf_scan_matchisc(ipscan_t *isc, ipstate_t *is, int cl, int sl, int maxm[2]) { int i, j, k, n, ret = 0, flags; @@ -393,8 +381,7 @@ int -ipf_scan_match(is) - ipstate_t *is; +ipf_scan_match(ipstate_t *is) { int i, j, k, n, cl, sl, maxm[2]; ipscan_t *isc, *lm; @@ -521,9 +508,7 @@ * check if a packet matches what we're scanning for */ int -ipf_scan_packet(fin, is) - fr_info_t *fin; - ipstate_t *is; +ipf_scan_packet(fr_info_t *fin, ipstate_t *is) { int i, j, rv, dlen, off, thoff; u_32_t seq, s0; @@ -581,11 +566,7 @@ int -ipf_scan_ioctl(data, cmd, mode, uid, ctx) - caddr_t data; - ioctlcmd_t cmd; - int mode, uid; - void *ctx; +ipf_scan_ioctl(caddr_t data, ioctlcmd_t cmd, int mode, int uid, void *ctx) { ipscanstat_t ipscs; int err = 0; diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -196,7 +196,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_state_main_load() +ipf_state_main_load(void) { return 0; } @@ -211,7 +211,7 @@ /* other functions is obvious. */ /* ------------------------------------------------------------------------ */ int -ipf_state_main_unload() +ipf_state_main_unload(void) { return 0; } @@ -226,8 +226,7 @@ /* of tunables and other default settings. */ /* ------------------------------------------------------------------------ */ void * -ipf_state_soft_create(softc) - ipf_main_softc_t *softc; +ipf_state_soft_create(ipf_main_softc_t *softc) { ipf_state_softc_t *softs; @@ -279,9 +278,7 @@ /* free the soft context structure itself. */ /* ------------------------------------------------------------------------ */ void -ipf_state_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_state_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_state_softc_t *softs = arg; @@ -337,9 +334,7 @@ /* reply queue has a shorter timeout than the query) */ /* ------------------------------------------------------------------------ */ int -ipf_state_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_state_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_state_softc_t *softs = arg; int i; @@ -422,9 +417,7 @@ /* IPFilter can be unloaded or re-initialised. */ /* ------------------------------------------------------------------------ */ int -ipf_state_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_state_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_state_softc_t *softs = arg; ipftq_t *ifq, *ifqnext; @@ -494,9 +487,7 @@ /* Stub function that allows for external manipulation of ipf_state_lock */ /* ------------------------------------------------------------------------ */ void -ipf_state_setlock(arg, tmp) - void *arg; - int tmp; +ipf_state_setlock(void *arg, int tmp) { ipf_state_softc_t *softs = arg; @@ -513,8 +504,7 @@ /* a pointer to it. */ /* ------------------------------------------------------------------------ */ static ips_stat_t * -ipf_state_stats(softc) - ipf_main_softc_t *softc; +ipf_state_stats(ipf_main_softc_t *softc) { ipf_state_softc_t *softs = softc->ipf_state_soft; ips_stat_t *issp = &softs->ipf_state_stats; @@ -545,9 +535,7 @@ /* the IP addresses and other protocol specific information. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_remove(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_state_remove(ipf_main_softc_t *softc, caddr_t data) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipstate_t *sp, st; @@ -591,12 +579,8 @@ /* Processes an ioctl call made to operate on the IP Filter state device. */ /* ------------------------------------------------------------------------ */ int -ipf_state_ioctl(softc, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - caddr_t data; - ioctlcmd_t cmd; - int mode, uid; - void *ctx; +ipf_state_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, + int mode, int uid, void *ctx) { ipf_state_softc_t *softs = softc->ipf_state_soft; int arg, ret, error = 0; @@ -848,10 +832,8 @@ /* state entries, the retrieval fails. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_getent(softc, softs, data) - ipf_main_softc_t *softc; - ipf_state_softc_t *softs; - caddr_t data; +ipf_state_getent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, + caddr_t data) { ipstate_t *is, *isn; ipstate_save_t ips; @@ -913,10 +895,8 @@ /* output. */ /* ------------------------------------------------------------------------ */ int -ipf_state_putent(softc, softs, data) - ipf_main_softc_t *softc; - ipf_state_softc_t *softs; - caddr_t data; +ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, + caddr_t data) { ipstate_t *is, *isn; ipstate_save_t ips; @@ -1063,10 +1043,7 @@ /* Exits with is_lock initialised and held - *EVEN IF ERROR*. */ /* ------------------------------------------------------------------------ */ int -ipf_state_insert(softc, is, rev) - ipf_main_softc_t *softc; - ipstate_t *is; - int rev; +ipf_state_insert(ipf_main_softc_t *softc, ipstate_t *is, int rev) { ipf_state_softc_t *softs = softc->ipf_state_soft; frentry_t *fr; @@ -1160,8 +1137,7 @@ /* even there is only reverse match */ /* ------------------------------------------------------------------------ */ static int -ipf_state_matchipv4addrs(is1, is2) - ipstate_t *is1, *is2; +ipf_state_matchipv4addrs(ipstate_t *is1, ipstate_t *is2) { int rv; @@ -1189,8 +1165,7 @@ /* even there is only reverse match */ /* ------------------------------------------------------------------------ */ static int -ipf_state_matchipv6addrs(is1, is2) - ipstate_t *is1, *is2; +ipf_state_matchipv6addrs(ipstate_t *is1, ipstate_t *is2) { int rv; @@ -1234,8 +1209,7 @@ /* identical arguments (i.e. ipf_matchaddress(is1, is1) would return 2 */ /* ------------------------------------------------------------------------ */ static int -ipf_state_matchaddresses(is1, is2) - ipstate_t *is1, *is2; +ipf_state_matchaddresses(ipstate_t *is1, ipstate_t *is2) { int rv; @@ -1258,8 +1232,7 @@ /* performs the same match for isps members as for addresses */ /* ------------------------------------------------------------------------ */ static int -ipf_state_matchports(ppairs1, ppairs2) - udpinfo_t *ppairs1, *ppairs2; +ipf_state_matchports(udpinfo_t *ppairs1, udpinfo_t *ppairs2) { int rv; @@ -1284,8 +1257,7 @@ /* performs the same match for isps members as for addresses */ /* ------------------------------------------------------------------------ */ static int -ipf_state_matchisps(is1, is2) - ipstate_t *is1, *is2; +ipf_state_matchisps(ipstate_t *is1, ipstate_t *is2) { int rv; @@ -1329,8 +1301,7 @@ /* */ /* ------------------------------------------------------------------------ */ static int -ipf_state_match(is1, is2) - ipstate_t *is1, *is2; +ipf_state_match(ipstate_t *is1, ipstate_t *is2) { int rv; int amatch; @@ -1370,11 +1341,8 @@ /* when they are deleted. */ /* ------------------------------------------------------------------------ */ int -ipf_state_add(softc, fin, stsave, flags) - ipf_main_softc_t *softc; - fr_info_t *fin; - ipstate_t **stsave; - u_int flags; +ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, + u_int flags) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipstate_t *is, ips; @@ -1894,11 +1862,8 @@ /* present. Record details about those that we recogise. */ /* ------------------------------------------------------------------------ */ static int -ipf_tcpoptions(softs, fin, tcp, td) - ipf_state_softc_t *softs; - fr_info_t *fin; - tcphdr_t *tcp; - tcpdata_t *td; +ipf_tcpoptions(ipf_state_softc_t *softs, fr_info_t *fin, tcphdr_t *tcp, + tcpdata_t *td) { int off, mlen, ol, i, len, retval; char buf[64], *s, opt; @@ -2001,12 +1966,8 @@ /* for a SYN or a RST or FIN which indicate time to close up shop. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_tcp(softc, softs, fin, tcp, is) - ipf_main_softc_t *softc; - ipf_state_softc_t *softs; - fr_info_t *fin; - tcphdr_t *tcp; - ipstate_t *is; +ipf_state_tcp(ipf_main_softc_t *softc, ipf_state_softc_t *softs, + fr_info_t *fin, tcphdr_t *tcp, ipstate_t *is) { tcpdata_t *fdata, *tdata; int source, ret, flags; @@ -2118,9 +2079,7 @@ /* one ready. */ /* ------------------------------------------------------------------------ */ static void -ipf_checknewisn(fin, is) - fr_info_t *fin; - ipstate_t *is; +ipf_checknewisn(fr_info_t *fin, ipstate_t *is) { u_32_t sumd, old, new; tcphdr_t *tcp; @@ -2155,11 +2114,8 @@ /* are within the window space behind the current sequence # as well. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_tcpinwindow(fin, fdata, tdata, tcp, flags) - fr_info_t *fin; - tcpdata_t *fdata, *tdata; - tcphdr_t *tcp; - int flags; +ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, + tcphdr_t *tcp, int flags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -2341,10 +2297,7 @@ /* Create a "duplcate" state table entry from the master. */ /* ------------------------------------------------------------------------ */ static ipstate_t * -ipf_state_clone(fin, tcp, is) - fr_info_t *fin; - tcphdr_t *tcp; - ipstate_t *is; +ipf_state_clone(fr_info_t *fin, tcphdr_t *tcp, ipstate_t *is) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -2434,12 +2387,8 @@ /* still 0 after the test. no match. */ /* ------------------------------------------------------------------------ */ static ipstate_t * -ipf_matchsrcdst(fin, is, src, dst, tcp, cmask) - fr_info_t *fin; - ipstate_t *is; - i6addr_t *src, *dst; - tcphdr_t *tcp; - u_32_t cmask; +ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, + tcphdr_t *tcp, u_32_t cmask) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -2673,8 +2622,7 @@ /* If we return non-null then a read-lock on ipf_state is held. */ /* ------------------------------------------------------------------------ */ static ipstate_t * -ipf_checkicmpmatchingstate(fin) - fr_info_t *fin; +ipf_checkicmpmatchingstate(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -2896,10 +2844,7 @@ /* packet. This code isn't specific to either IPv4 or IPv6. */ /* ------------------------------------------------------------------------ */ static int -ipf_allowstateicmp(fin, is, src) - fr_info_t *fin; - ipstate_t *is; - i6addr_t *src; +ipf_allowstateicmp(fr_info_t *fin, ipstate_t *is, i6addr_t *src) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -2967,10 +2912,7 @@ /* Move a state entry from one position in the hash table to another. */ /* ------------------------------------------------------------------------ */ static void -ipf_ipsmove(softs, is, hv) - ipf_state_softc_t *softs; - ipstate_t *is; - u_int hv; +ipf_ipsmove(ipf_state_softc_t *softs, ipstate_t *is, u_int hv) { ipstate_t **isp; u_int hvm; @@ -3026,10 +2968,7 @@ /* If we return non-null then a read-lock on ipf_state is held. */ /* ------------------------------------------------------------------------ */ ipstate_t * -ipf_state_lookup(fin, tcp, ifqp) - fr_info_t *fin; - tcphdr_t *tcp; - ipftq_t **ifqp; +ipf_state_lookup(fr_info_t *fin, tcphdr_t *tcp, ipftq_t **ifqp) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -3309,9 +3248,7 @@ /* Check if a packet is associated with an entry in the state table. */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_state_check(fin, passp) - fr_info_t *fin; - u_32_t *passp; +ipf_state_check(fr_info_t *fin, u_32_t *passp) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -3470,9 +3407,7 @@ /* TCP checksum to match that change. */ /* ------------------------------------------------------------------------ */ static void -ipf_fixoutisn(fin, is) - fr_info_t *fin; - ipstate_t *is; +ipf_fixoutisn(fr_info_t *fin, ipstate_t *is) { tcphdr_t *tcp; int rev; @@ -3509,9 +3444,7 @@ /* TCP checksum to match that change. */ /* ------------------------------------------------------------------------ */ static void -ipf_fixinisn(fin, is) - fr_info_t *fin; - ipstate_t *is; +ipf_fixinisn(fr_info_t *fin, ipstate_t *is) { tcphdr_t *tcp; int rev; @@ -3552,9 +3485,7 @@ /* existing, matching, uses of it. */ /* ------------------------------------------------------------------------ */ void -ipf_state_sync(softc, ifp) - ipf_main_softc_t *softc; - void *ifp; +ipf_state_sync(ipf_main_softc_t *softc, void *ifp) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipstate_t *is; @@ -3598,10 +3529,7 @@ /* global counters as required. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_del(softc, is, why) - ipf_main_softc_t *softc; - ipstate_t *is; - int why; +ipf_state_del(ipf_main_softc_t *softc, ipstate_t *is, int why) { ipf_state_softc_t *softs = softc->ipf_state_soft; int orphan = 1; @@ -3740,8 +3668,7 @@ /* expired then neither will any under it. */ /* ------------------------------------------------------------------------ */ void -ipf_state_expire(softc) - ipf_main_softc_t *softc; +ipf_state_expire(ipf_main_softc_t *softc) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipftq_t *ifq, *ifqnext; @@ -3812,9 +3739,7 @@ /* for the last 30 minutes to at worst 30 seconds idle. */ /* ------------------------------------------------------------------------ */ int -ipf_state_flush(softc, which, proto) - ipf_main_softc_t *softc; - int which, proto; +ipf_state_flush(ipf_main_softc_t *softc, int which, int proto) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipftqent_t *tqe, *tqn; @@ -3978,9 +3903,7 @@ /* the ipf_queueflush() function. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_flush_entry(softc, entry) - ipf_main_softc_t *softc; - void *entry; +ipf_state_flush_entry(ipf_main_softc_t *softc, void *entry) { return ipf_state_del(softc, entry, ISL_FLUSH); } @@ -4037,11 +3960,7 @@ /* Locking: it is assumed that the parent of the tqe structure is locked. */ /* ------------------------------------------------------------------------ */ int -ipf_tcp_age(tqe, fin, tqtab, flags, ok) - ipftqent_t *tqe; - fr_info_t *fin; - ipftq_t *tqtab; - int flags, ok; +ipf_tcp_age(ipftqent_t *tqe, fr_info_t *fin, ipftq_t *tqtab, int flags, int ok) { ipf_main_softc_t *softc = fin->fin_main_soft; int dlen, ostate, nstate, rval, dir; @@ -4378,10 +4297,7 @@ /* protocol specific information. */ /* ------------------------------------------------------------------------ */ void -ipf_state_log(softc, is, type) - ipf_main_softc_t *softc; - struct ipstate *is; - u_int type; +ipf_state_log(ipf_main_softc_t *softc, struct ipstate *is, u_int type) { #ifdef IPFILTER_LOG struct ipslog ipsl; @@ -4448,8 +4364,7 @@ /* the ICMPv6 packet, look for a matching state table entry. */ /* ------------------------------------------------------------------------ */ static ipstate_t * -ipf_checkicmp6matchingstate(fin) - fr_info_t *fin; +ipf_checkicmp6matchingstate(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -4683,8 +4598,7 @@ /* of timeout queues for TCP. */ /* ------------------------------------------------------------------------ */ void -ipf_sttab_destroy(tqp) - ipftq_t *tqp; +ipf_sttab_destroy(ipftq_t *tqp) { int i; @@ -4726,9 +4640,7 @@ /* dir == 1 : a packet from dest to source */ /* ------------------------------------------------------------------------ */ void -ipf_state_deref(softc, isp) - ipf_main_softc_t *softc; - ipstate_t **isp; +ipf_state_deref(ipf_main_softc_t *softc, ipstate_t **isp) { ipstate_t *is = *isp; @@ -4767,10 +4679,7 @@ /* determining which queue it should be placed on. */ /* ------------------------------------------------------------------------ */ void -ipf_state_setqueue(softc, is, rev) - ipf_main_softc_t *softc; - ipstate_t *is; - int rev; +ipf_state_setqueue(ipf_main_softc_t *softc, ipstate_t *is, int rev) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipftq_t *oifq, *nifq; @@ -4839,11 +4748,8 @@ /* walks through the list of entries in the state table list (softs->ipf_state_list.) */ /* ------------------------------------------------------------------------ */ static int -ipf_state_iter(softc, token, itp, obj) - ipf_main_softc_t *softc; - ipftoken_t *token; - ipfgeniter_t *itp; - ipfobj_t *obj; +ipf_state_iter(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, + ipfobj_t *obj) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipstate_t *is, *next, zero; @@ -4922,10 +4828,8 @@ /* At present the only table it deals with is the hash bucket statistics. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_gettable(softc, softs, data) - ipf_main_softc_t *softc; - ipf_state_softc_t *softs; - char *data; +ipf_state_gettable(ipf_main_softc_t *softc, ipf_state_softc_t *softs, + char *data) { ipftable_t table; int error; @@ -4961,9 +4865,7 @@ /* because of locking issues but we want to delete them ASAP, anyway. */ /* ------------------------------------------------------------------------ */ void -ipf_state_setpending(softc, is) - ipf_main_softc_t *softc; - ipstate_t *is; +ipf_state_setpending(ipf_main_softc_t *softc, ipstate_t *is) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipftq_t *oifq; @@ -4997,9 +4899,7 @@ /* properties in the array loaded. */ /* ------------------------------------------------------------------------ */ int -ipf_state_matchflush(softc, data) - ipf_main_softc_t *softc; - caddr_t data; +ipf_state_matchflush(ipf_main_softc_t *softc, caddr_t data) { ipf_state_softc_t *softs = softc->ipf_state_soft; int *array, flushed, error; @@ -5041,10 +4941,7 @@ /* to indicate whether or not the matching was successful. */ /* ------------------------------------------------------------------------ */ static int -ipf_state_matcharray(state, array, ticks) - ipstate_t *state; - int *array; - u_long ticks; +ipf_state_matcharray(ipstate_t *state, int *array, u_long ticks) { int i, n, *x, rv, p; ipfexp_t *e; @@ -5203,10 +5100,8 @@ /* that queue so that all of the items on it are updated accordingly. */ /* ------------------------------------------------------------------------ */ int -ipf_state_settimeout(softc, t, p) - struct ipf_main_softc_s *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_state_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, + ipftuneval_t *p) { ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -5255,10 +5150,7 @@ /* up the bucketlength for it as we go along. */ /* ------------------------------------------------------------------------ */ int -ipf_state_rehash(softc, t, p) - ipf_main_softc_t *softc; - ipftuneable_t *t; - ipftuneval_t *p; +ipf_state_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipstate_t **newtab, *is; @@ -5364,9 +5256,7 @@ /* used internally for stateful filtering. */ /* ------------------------------------------------------------------------ */ ipftq_t * -ipf_state_add_tq(softc, ttl) - ipf_main_softc_t *softc; - int ttl; +ipf_state_add_tq(ipf_main_softc_t *softc, int ttl) { ipf_state_softc_t *softs = softc->ipf_state_soft; @@ -5379,9 +5269,7 @@ * Display the built up state table rules and mapping entries. */ void -ipf_state_dump(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_state_dump(ipf_main_softc_t *softc, void *arg) { ipf_state_softc_t *softs = arg; ipstate_t *ips; diff --git a/sys/netpfil/ipfilter/netinet/ip_sync.c b/sys/netpfil/ipfilter/netinet/ip_sync.c --- a/sys/netpfil/ipfilter/netinet/ip_sync.c +++ b/sys/netpfil/ipfilter/netinet/ip_sync.c @@ -140,8 +140,7 @@ void * -ipf_sync_soft_create(softc) - ipf_main_softc_t *softc; +ipf_sync_soft_create(ipf_main_softc_t *softc) { ipf_sync_softc_t *softs; @@ -172,9 +171,7 @@ /* any data structures, as required. */ /* ------------------------------------------------------------------------ */ int -ipf_sync_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_sync_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_sync_softc_t *softs = arg; @@ -239,9 +236,7 @@ /* with the synchronisation tables. */ /* ------------------------------------------------------------------------ */ int -ipf_sync_soft_fini(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_sync_soft_fini(ipf_main_softc_t *softc, void *arg) { ipf_sync_softc_t *softs = arg; @@ -286,9 +281,7 @@ } void -ipf_sync_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_sync_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_sync_softc_t *softs = arg; @@ -307,9 +300,7 @@ /* need to be used at both ends by the host in their native byte order. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_tcporder(way, td) - int way; - tcpdata_t *td; +ipf_sync_tcporder(int way, tcpdata_t *td) { if (way) { td->td_maxwin = htons(td->td_maxwin); @@ -333,9 +324,7 @@ /* used at both ends by the host in their native byte order. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_natorder(way, n) - int way; - nat_t *n; +ipf_sync_natorder(int way, nat_t *n) { if (way) { n->nat_age = htonl(n->nat_age); @@ -363,9 +352,7 @@ /* be used at both ends by the host in their native byte order. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_storder(way, ips) - int way; - ipstate_t *ips; +ipf_sync_storder(int way, ipstate_t *ips) { ipf_sync_tcporder(way, &ips->is_tcp.ts_data[0]); ipf_sync_tcporder(way, &ips->is_tcp.ts_data[1]); @@ -422,9 +409,7 @@ /* structures in the state/NAT tables. */ /* ------------------------------------------------------------------------ */ int -ipf_sync_write(softc, uio) - ipf_main_softc_t *softc; - struct uio *uio; +ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synchdr_t sh; @@ -571,9 +556,7 @@ /* put to sleep, pending a wakeup from the "lower half" of this code. */ /* ------------------------------------------------------------------------ */ int -ipf_sync_read(softc, uio) - ipf_main_softc_t *softc; - struct uio *uio; +ipf_sync_read(ipf_main_softc_t *softc, struct uio *uio) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; syncupdent_t *su; @@ -656,10 +639,7 @@ /* structures being timed out correctly. */ /* ------------------------------------------------------------------------ */ static int -ipf_sync_state(softc, sp, data) - ipf_main_softc_t *softc; - synchdr_t *sp; - void *data; +ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synctcp_update_t su; @@ -826,9 +806,7 @@ /* Deletes an object from the synclist. */ /* ------------------------------------------------------------------------ */ static void -ipf_sync_del(softs, sl) - ipf_sync_softc_t *softs; - synclist_t *sl; +ipf_sync_del(ipf_sync_softc_t *softs, synclist_t *sl) { *sl->sl_pnext = sl->sl_next; if (sl->sl_next != NULL) @@ -846,9 +824,7 @@ /* Deletes an object from the synclist state table and free's its memory. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_del_state(arg, sl) - void *arg; - synclist_t *sl; +ipf_sync_del_state(void *arg, synclist_t *sl) { ipf_sync_softc_t *softs = arg; @@ -867,9 +843,7 @@ /* Deletes an object from the synclist nat table and free's its memory. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_del_nat(arg, sl) - void *arg; - synclist_t *sl; +ipf_sync_del_nat(void *arg, synclist_t *sl) { ipf_sync_softc_t *softs = arg; @@ -893,10 +867,7 @@ /* structures being timed out correctly. */ /* ------------------------------------------------------------------------ */ static int -ipf_sync_nat(softc, sp, data) - ipf_main_softc_t *softc; - synchdr_t *sp; - void *data; +ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; syncupdent_t su; @@ -996,11 +967,7 @@ /* waiting to be processed. */ /* ------------------------------------------------------------------------ */ synclist_t * -ipf_sync_new(softc, tab, fin, ptr) - ipf_main_softc_t *softc; - int tab; - fr_info_t *fin; - void *ptr; +ipf_sync_new(ipf_main_softc_t *softc, int tab, fr_info_t *fin, void *ptr) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synclist_t *sl, *ss; @@ -1131,11 +1098,8 @@ /* process to read. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_update(softc, tab, fin, sl) - ipf_main_softc_t *softc; - int tab; - fr_info_t *fin; - synclist_t *sl; +ipf_sync_update(ipf_main_softc_t *softc, int tab, fr_info_t *fin, + synclist_t *sl) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synctcp_update_t *st; @@ -1217,10 +1181,7 @@ /* during this cleanup. */ /* ------------------------------------------------------------------------ */ static int -ipf_sync_flush_table(softs, tabsize, table) - ipf_sync_softc_t *softs; - int tabsize; - synclist_t **table; +ipf_sync_flush_table(ipf_sync_softc_t *softs, int tabsize, synclist_t **table) { synclist_t *sl; int i, items; @@ -1264,12 +1225,8 @@ /* EINVAL on all occasions. */ /* ------------------------------------------------------------------------ */ int -ipf_sync_ioctl(softc, data, cmd, mode, uid, ctx) - ipf_main_softc_t *softc; - caddr_t data; - ioctlcmd_t cmd; - int mode, uid; - void *ctx; +ipf_sync_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, + int mode, int uid, void *ctx) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; int error, i; @@ -1345,8 +1302,7 @@ /* there is data waiting to be read from the /dev/ipsync device. */ /* ------------------------------------------------------------------------ */ int -ipf_sync_canread(arg) - void *arg; +ipf_sync_canread(void *arg) { ipf_sync_softc_t *softs = arg; return !((softs->sl_tail == softs->sl_idx) && @@ -1364,8 +1320,7 @@ /* XXX Maybe this should return false if the sync table is full? */ /* ------------------------------------------------------------------------ */ int -ipf_sync_canwrite(arg) - void *arg; +ipf_sync_canwrite(void *arg) { return 1; } @@ -1390,8 +1345,7 @@ /* mark for this counter.) */ /* ------------------------------------------------------------------------ */ static void -ipf_sync_wakeup(softc) - ipf_main_softc_t *softc; +ipf_sync_wakeup(ipf_main_softc_t *softc) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; @@ -1417,8 +1371,7 @@ /* Deliver a poll wakeup and reset counters for two of the three heuristics */ /* ------------------------------------------------------------------------ */ static void -ipf_sync_poll_wakeup(softc) - ipf_main_softc_t *softc; +ipf_sync_poll_wakeup(ipf_main_softc_t *softc) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; @@ -1448,8 +1401,7 @@ /* three heuristics above *IF* there are events waiting. */ /* ------------------------------------------------------------------------ */ void -ipf_sync_expire(softc) - ipf_main_softc_t *softc; +ipf_sync_expire(ipf_main_softc_t *softc) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; diff --git a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c --- a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c @@ -60,7 +60,7 @@ * TFTP application proxy initialization. */ void -ipf_p_tftp_main_load() +ipf_p_tftp_main_load(void) { bzero((char *)&tftpfr, sizeof(tftpfr)); @@ -72,7 +72,7 @@ void -ipf_p_tftp_main_unload() +ipf_p_tftp_main_unload(void) { if (tftp_proxy_init == 1) { @@ -83,8 +83,7 @@ void * -ipf_p_tftp_soft_create(softc) - ipf_main_softc_t *softc; +ipf_p_tftp_soft_create(ipf_main_softc_t *softc) { ipf_tftp_softc_t *softt; @@ -113,9 +112,7 @@ void -ipf_p_tftp_soft_destroy(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_p_tftp_soft_destroy(ipf_main_softc_t *softc, void *arg) { ipf_tftp_softc_t *softt = arg; @@ -130,11 +127,7 @@ int -ipf_p_tftp_out(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_tftp_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_tftp_softc_t *softt = arg; @@ -146,11 +139,7 @@ int -ipf_p_tftp_in(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_tftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_tftp_softc_t *softt = arg; @@ -162,11 +151,7 @@ int -ipf_p_tftp_new(arg, fin, aps, nat) - void *arg; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { udphdr_t *udp; tftpinfo_t *ti; @@ -262,9 +247,7 @@ void -ipf_p_tftp_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_tftp_del(ipf_main_softc_t *softc, ap_session_t *aps) { tftpinfo_t *tftp; @@ -280,10 +263,7 @@ * Setup for a new TFTP proxy. */ int -ipf_p_tftp_backchannel(fin, aps, nat) - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_tftp_backchannel(fr_info_t *fin, ap_session_t *aps, nat_t *nat) { ipf_main_softc_t *softc = fin->fin_main_soft; #ifdef USE_MUTEXES @@ -419,11 +399,8 @@ int -ipf_p_tftp_client(softt, fin, aps, nat) - ipf_tftp_softc_t *softt; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_tftp_client(ipf_tftp_softc_t *softt, fr_info_t *fin, ap_session_t *aps, + nat_t *nat) { u_char *msg, *s, *t; tftpinfo_t *ti; @@ -469,11 +446,8 @@ int -ipf_p_tftp_server(softt, fin, aps, nat) - ipf_tftp_softc_t *softt; - fr_info_t *fin; - ap_session_t *aps; - nat_t *nat; +ipf_p_tftp_server(ipf_tftp_softc_t *softt, fr_info_t *fin, ap_session_t *aps, + nat_t *nat) { tftpinfo_t *ti; u_short opcode; diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -246,7 +246,7 @@ vnet_ipf_init, NULL); static int -ipf_modload() +ipf_modload(void) { char *c, *str; int i, j, error; @@ -305,7 +305,7 @@ vnet_ipf_uninit, NULL); static int -ipf_modunload() +ipf_modunload(void) { int error, i; @@ -473,17 +473,12 @@ /* * routines below for saving IP headers to buffer */ -static int ipfopen(dev, flags +static int #ifdef __FreeBSD__ -, devtype, p) - int devtype; - struct thread *p; - struct cdev *dev; +ipfopen(struct cdev *dev, int flags, int devtype, struct thread *p) #else -) - dev_t dev; +ipfopen(dev_t dev, int flags) #endif - int flags; { int unit = GET_MINOR(dev); int error; @@ -513,17 +508,12 @@ } -static int ipfclose(dev, flags +static int #ifdef __FreeBSD__ -, devtype, p) - int devtype; - struct thread *p; - struct cdev *dev; +ipfclose(struct cdev *dev, int flags, int devtype, struct thread *p) #else -) - dev_t dev; +ipfclose(dev_t dev, int flags) #endif - int flags; { int unit = GET_MINOR(dev); diff --git a/sys/netpfil/ipfilter/netinet/radix_ipf.c b/sys/netpfil/ipfilter/netinet/radix_ipf.c --- a/sys/netpfil/ipfilter/netinet/radix_ipf.c +++ b/sys/netpfil/ipfilter/netinet/radix_ipf.c @@ -61,9 +61,7 @@ /* as the guide for which bit is the most significant bit. */ /* ------------------------------------------------------------------------ */ static int -count_mask_bits(mask, lastp) - addrfamily_t *mask; - u_32_t **lastp; +count_mask_bits(addrfamily_t *mask, u_32_t **lastp) { u_32_t *mp = (u_32_t *)&mask->adf_addr; u_32_t m; @@ -98,9 +96,7 @@ /* the middle are not handled by this implementation. */ /* ------------------------------------------------------------------------ */ static void -buildnodes(addr, mask, nodes) - addrfamily_t *addr, *mask; - ipf_rdx_node_t nodes[2]; +buildnodes(addrfamily_t *addr, addrfamily_t *mask, ipf_rdx_node_t nodes[2]) { u_32_t maskbits; u_32_t lastmask; @@ -147,9 +143,7 @@ /* match for the address given by "addr". */ /* ------------------------------------------------------------------------ */ static ipf_rdx_node_t * -ipf_rx_find_addr(tree, addr) - ipf_rdx_node_t *tree; - u_32_t *addr; +ipf_rx_find_addr(ipf_rdx_node_t *tree, u_32_t *addr) { ipf_rdx_node_t *cur; @@ -178,9 +172,7 @@ /* them are considered to be part of the tree of data being stored. */ /* ------------------------------------------------------------------------ */ static ipf_rdx_node_t * -ipf_rx_match(head, addr) - ipf_rdx_head_t *head; - addrfamily_t *addr; +ipf_rx_match(ipf_rdx_head_t *head, addrfamily_t *addr) { ipf_rdx_mask_t *masknode; ipf_rdx_node_t *prev; @@ -249,9 +241,7 @@ /* is to see if a given key is in the tree, not to see if a route exists. */ /* ------------------------------------------------------------------------ */ ipf_rdx_node_t * -ipf_rx_lookup(head, addr, mask) - ipf_rdx_head_t *head; - addrfamily_t *addr, *mask; +ipf_rx_lookup(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) { ipf_rdx_node_t *found; ipf_rdx_node_t *node; @@ -298,9 +288,7 @@ /* netmask is at the top of the list. */ /* ------------------------------------------------------------------------ */ static void -ipf_rx_attach_mask(node, mask) - ipf_rdx_node_t *node; - ipf_rdx_mask_t *mask; +ipf_rx_attach_mask(ipf_rdx_node_t *node, ipf_rdx_mask_t *mask) { ipf_rdx_mask_t **pm; ipf_rdx_mask_t *m; @@ -328,10 +316,7 @@ /* by the netmask. */ /* ------------------------------------------------------------------------ */ static ipf_rdx_node_t * -ipf_rx_insert(head, nodes, dup) - ipf_rdx_head_t *head; - ipf_rdx_node_t nodes[2]; - int *dup; +ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t *nodes, int *dup) { ipf_rdx_mask_t **pmask; ipf_rdx_node_t *node; @@ -508,10 +493,8 @@ /* where the data to be inserted is a duplicate. */ /* ------------------------------------------------------------------------ */ ipf_rdx_node_t * -ipf_rx_addroute(head, addr, mask, nodes) - ipf_rdx_head_t *head; - addrfamily_t *addr, *mask; - ipf_rdx_node_t *nodes; +ipf_rx_addroute(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask, + ipf_rdx_node_t *nodes) { ipf_rdx_node_t *node; ipf_rdx_node_t *prev; @@ -581,9 +564,7 @@ /* of duplicate keys. */ /* ------------------------------------------------------------------------ */ ipf_rdx_node_t * -ipf_rx_delete(head, addr, mask) - ipf_rdx_head_t *head; - addrfamily_t *addr, *mask; +ipf_rx_delete(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) { ipf_rdx_mask_t **pmask; ipf_rdx_node_t *parent; @@ -763,10 +744,7 @@ /* in the validity of the data found at either the left or right child. */ /* ------------------------------------------------------------------------ */ void -ipf_rx_walktree(head, walker, arg) - ipf_rdx_head_t *head; - radix_walk_func_t walker; - void *arg; +ipf_rx_walktree(ipf_rdx_head_t *head, radix_walk_func_t walker, void *arg) { ipf_rdx_node_t *next; ipf_rdx_node_t *node = head->root; @@ -810,9 +788,7 @@ /* the zeroes and ones data rather than have one per head. */ /* ------------------------------------------------------------------------ */ int -ipf_rx_inithead(softr, headp) - radix_softc_t *softr; - ipf_rdx_head_t **headp; +ipf_rx_inithead(radix_softc_t *softr, ipf_rdx_head_t **headp) { ipf_rdx_head_t *ptr; ipf_rdx_node_t *node; @@ -866,8 +842,7 @@ /* this function, it is expected that the tree will have been emptied. */ /* ------------------------------------------------------------------------ */ void -ipf_rx_freehead(head) - ipf_rdx_head_t *head; +ipf_rx_freehead(ipf_rdx_head_t *head) { KFREE(head); } @@ -879,7 +854,7 @@ /* */ /* ------------------------------------------------------------------------ */ void * -ipf_rx_create() +ipf_rx_create(void) { radix_softc_t *softr; @@ -905,8 +880,7 @@ /* */ /* ------------------------------------------------------------------------ */ int -ipf_rx_init(ctx) - void *ctx; +ipf_rx_init(void *ctx) { radix_softc_t *softr = ctx; @@ -923,8 +897,7 @@ /* */ /* ------------------------------------------------------------------------ */ void -ipf_rx_destroy(ctx) - void *ctx; +ipf_rx_destroy(void *ctx) { radix_softc_t *softr = ctx; @@ -1031,9 +1004,7 @@ static void -ipf_rx_freenode(node, arg) - ipf_rdx_node_t *node; - void *arg; +ipf_rx_freenode(ipf_rdx_node_t *node, void *arg) { ipf_rdx_head_t *head = arg; ipf_rdx_node_t *rv; @@ -1048,8 +1019,7 @@ const char * -addrname(ap) - addrfamily_t *ap; +addrname(addrfamily_t *ap) { static char name[80]; const char *txt; @@ -1062,9 +1032,7 @@ void -fill6bits(bits, msk) - int bits; - u_int *msk; +fill6bits(int bits, u_int *msk) { if (bits == 0) { msk[0] = 0; @@ -1100,9 +1068,7 @@ void -setaddr(afp, str) - addrfamily_t *afp; - char *str; +setaddr(addrfamily_t *afp, char *str) { bzero((char *)afp, sizeof(*afp)); @@ -1119,9 +1085,7 @@ void -setmask(afp, str) - addrfamily_t *afp; - char *str; +setmask(addrfamily_t *afp, char *str) { if (strchr(str, '.') != NULL) { afp->adf_addr.in4.s_addr = inet_addr(str); @@ -1137,9 +1101,7 @@ void -nodeprinter(node, arg) - ipf_rdx_node_t *node; - void *arg; +nodeprinter(ipf_rdx_node_t *node, void *arg) { myst_t *stp = (myst_t *)node; @@ -1156,8 +1118,7 @@ void -printnode(stp) - myst_t *stp; +printnode(myst_t *stp) { ipf_rdx_node_t *node = &stp->nodes[0]; @@ -1209,8 +1170,7 @@ void -printroots(rnh) - ipf_rdx_head_t *rnh; +printroots(ipf_rdx_head_t *rnh) { printf("Root.0.%s b %3d p %-9.9s l %-9.9s r %-9.9s\n", GNAME(&rnh->nodes[0]), @@ -1307,8 +1267,7 @@ void -dumptree(rnh) - ipf_rdx_head_t *rnh; +dumptree(ipf_rdx_head_t *rnh) { myst_t *stp; @@ -1321,10 +1280,7 @@ void -test_addr(rnh, pref, addr, limit) - ipf_rdx_head_t *rnh; - int pref, limit; - addrfamily_t *addr; +test_addr(ipf_rdx_head_t *rnh, int pref, addrfamily_t *addr, int limit) { static int extras[14] = { 0, -1, 1, 3, 5, 8, 9, 15, 16, 19, 255, 256, 65535, 65536 @@ -1362,9 +1318,7 @@ void -delete_addr(rnh, item) - ipf_rdx_head_t *rnh; - int item; +delete_addr(ipf_rdx_head_t *rnh, int item) { ipf_rdx_node_t *rn; addrfamily_t mask; @@ -1406,9 +1360,7 @@ void -add_addr(rnh, n, item) - ipf_rdx_head_t *rnh; - int n, item; +add_addr(ipf_rdx_head_t *rnh, int n, int item) { ipf_rdx_node_t *rn; myst_t *stp; @@ -1496,8 +1448,7 @@ void -random_add(rnh) - ipf_rdx_head_t *rnh; +random_add(ipf_rdx_head_t *rnh) { int *order; int nitems; @@ -1515,8 +1466,7 @@ void -random_delete(rnh) - ipf_rdx_head_t *rnh; +random_delete(ipf_rdx_head_t *rnh) { int *order; int nitems;