From nobody Mon Feb 07 13:55:52 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A60F219B06F5; Mon, 7 Feb 2022 13:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JsnjP01MZz51Mx; Mon, 7 Feb 2022 13:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644242153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BprTz8hoRxFmOCB8QIGgAhqyY+zpdvJdftrr8AlmWQ=; b=fLk+mGKR3KQDEoXWvxmC5+jiibzpPtNRG9NtuD5XR2l18PwXk8lvIJN6Z8dKJzOnWjLzq3 FArFnMxd1FSEYqHs08T1/E2ld9hKlC2ZXmHVEmx7PofwHmxHbzQedDTR/qhDYifhf0xtKE mTJygEUpm34T45vhdcszXAZiYl5OhATUpTd1PyO67Ah8O2yiQtHYaqn9r9Nuu7W5neCzM5 qUvV5JJcRTRwVVMhMsjDArZKzCRZOefS4l5nOoXbadmfliqAssec1xHS0JUmMqgNLm7f2A EZWHZXmgUPOH9jnu2YtgKb/78Ubrfwxc8de5MCDW1RgNsGIdMBQ8xso8XM/WTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C0992694B; Mon, 7 Feb 2022 13:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 217DtqST085142; Mon, 7 Feb 2022 13:55:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 217DtqHw085141; Mon, 7 Feb 2022 13:55:52 GMT (envelope-from git) Date: Mon, 7 Feb 2022 13:55:52 GMT Message-Id: <202202071355.217DtqHw085141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 4e8d52e7d72e - stable/12 - ipflter: ANSIfy kernel function declarations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4e8d52e7d72eae8f445ea2b4c5f6f8a85cd04495 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644242153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BprTz8hoRxFmOCB8QIGgAhqyY+zpdvJdftrr8AlmWQ=; b=ZGN61gxjvF9uzlKBAN3ncCIfDJmH0tiNSyfdZCcf548ysIWtVt+aRSmTeETJlR2NhmLCkI J7b0lQM1oKxec3TNFvSyRjuqCxe9ahyU0vrs5bp0w3uYhCvRdk5ddv9HFzK2qcYN+yVNLf hIFHOS1YYMeFO52fh4qeqTnHWoalkr6X7dSoHB/p35T6iA/5UzRSVHX1Osa0e8/4ldrgGA P9cG5+OL2ogMU5M03ek6eAzCBTNvcEMy65MgrkLmVKi8I4tJ60PeySM15URj88koEJIEW8 0llZZFMIZbeQQJuAYpLBVXkyPu5sM6Cux813xJzlDsHd+Rxbku0t9izF3B/zBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644242153; a=rsa-sha256; cv=none; b=BBxTiBCUH5NvfbFrd4vRnblEtY8A4bpFD5GKm/yaRM+q2ClwKHIEPm69w09nrVfKB4jHzp 4I3FU48Lq/gCd8bEAiu5PiWlYNOTehY8Ovb+w5Kof0TYdUFsyWKQXx/um1GuFeg0yaajO+ 1QWeSyBmTKkq8N3sNNfS+Zz5sACTPlwAkGu9Zi5RPZBqUUh3jFH5g/4JcH4UH3kn6hS5TI CS5pYe1nWKcYWutGbRVdYkKIvYO5SVsUVJZUU6maW4ukw79oJMmBH0LHYoANfxD4/baA0e nowOAZYQazEwOP6G8piHtcsCeqrD6rnYcxeHvk68eYlUeKwCqpCvwRAxQUiEtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4e8d52e7d72eae8f445ea2b4c5f6f8a85cd04495 commit 4e8d52e7d72eae8f445ea2b4c5f6f8a85cd04495 Author: Cy Schubert AuthorDate: 2021-12-20 16:43:49 +0000 Commit: Cy Schubert CommitDate: 2022-02-07 13:55:11 +0000 ipflter: ANSIfy kernel function declarations Convert ipfilter kernel function declarations from K&R to ANSI. This syncs our function declarations with NetBSD hg commit 75edcd7552a0 (apply our changes). Though not copied from NetBSD, this change was partially inspired by NetBSD's work and inspired by style(9). Reviewed by: glebius (for #network) Differential Revision: https://reviews.freebsd.org/D33595 (cherry picked from commit 064a5a95649d05ac084bcf2612cbac5575d76358) --- sys/netpfil/ipfilter/netinet/fil.c | 664 +++++++------------------- sys/netpfil/ipfilter/netinet/ip_auth.c | 86 +--- sys/netpfil/ipfilter/netinet/ip_dns_pxy.c | 50 +- sys/netpfil/ipfilter/netinet/ip_dstlist.c | 128 ++--- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 79 +-- sys/netpfil/ipfilter/netinet/ip_frag.c | 136 ++---- sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c | 154 ++---- sys/netpfil/ipfilter/netinet/ip_htable.c | 153 ++---- sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c | 36 +- sys/netpfil/ipfilter/netinet/ip_irc_pxy.c | 25 +- sys/netpfil/ipfilter/netinet/ip_log.c | 57 +-- sys/netpfil/ipfilter/netinet/ip_lookup.c | 103 +--- sys/netpfil/ipfilter/netinet/ip_nat.c | 388 ++++----------- sys/netpfil/ipfilter/netinet/ip_nat6.c | 145 ++---- sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c | 10 +- sys/netpfil/ipfilter/netinet/ip_pool.c | 150 ++---- sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c | 45 +- sys/netpfil/ipfilter/netinet/ip_proxy.c | 88 +--- sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c | 22 +- sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c | 34 +- sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c | 113 ++--- sys/netpfil/ipfilter/netinet/ip_rules.c | 12 +- sys/netpfil/ipfilter/netinet/ip_scan.c | 43 +- sys/netpfil/ipfilter/netinet/ip_state.c | 240 +++------- sys/netpfil/ipfilter/netinet/ip_sync.c | 98 +--- sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c | 52 +- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 26 +- sys/netpfil/ipfilter/netinet/radix_ipf.c | 110 ++--- 28 files changed, 833 insertions(+), 2414 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 9addc0f4e00f..51200315b58c 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -420,9 +420,7 @@ static INLINE struct ip6_ext *ipf_pr_ipv6exthdr(fr_info_t *, int, int); /* 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 @@ ipf_pr_short6(fin, xmin) /* 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 @@ ipf_pr_ipv6hdr(fin) /* 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 @@ ipf_pr_ipv6exthdr(fin, multiple, proto) /* 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 @@ ipf_pr_hopopts6(fin) /* 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 @@ ipf_pr_mobility6(fin) /* 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 @@ ipf_pr_routing6(fin) /* 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 @@ ipf_pr_fragment6(fin) /* 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 @@ ipf_pr_dstopts6(fin) /* 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 @@ ipf_pr_icmp6(fin) /* 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 @@ ipf_pr_udp6(fin) /* 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 @@ ipf_pr_tcp6(fin) /* 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 @@ ipf_pr_esp6(fin) /* 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 @@ ipf_pr_ah6(fin) /* 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 @@ ipf_pr_gre6(fin) /* - 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 @@ ipf_pr_pullup(fin, plen) /* 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 @@ ipf_pr_short(fin, xmin) /* 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 @@ ipf_pr_icmp(fin) /* 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 @@ ipf_pr_tcpcommon(fin) /* 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 @@ ipf_pr_udpcommon(fin) /* 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 @@ ipf_pr_tcp(fin) /* 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 @@ ipf_pr_udp(fin) /* 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 @@ ipf_pr_esp(fin) /* 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 @@ ipf_pr_ah(fin) /* 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 @@ ipf_pr_gre(fin) /* 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 @@ ipf_pr_ipv4hdr(fin) /* */ /* ------------------------------------------------------------------------ */ 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 @@ ipf_checkripso(s) /* 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 @@ ipf_checkcipso(fin, s, ol) /* 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 @@ ipf_makefrip(hlen, ip, fin) /* 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 @@ ipf_portcheck(frp, pop) /* 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 @@ ipf_tcpudpchk(fi, ft) /* 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 @@ ipf_check_ipf(fin, fr, portcmp) /* 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 @@ ipf_scanlist(fin, pass) /* 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 @@ ipf_acctpkt(fin, passp) /* 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 @@ ipf_firewall(fin, passp) /* 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 @@ finished: /* 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 @@ logit: /* 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 @@ ipf_cksum(addr, len) /* 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 @@ fr_cksum(fin, ip, l4proto, l4hdr) /* 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 @@ ipf_findgroup(softc, group, unit, set, fgpp) /* 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 @@ ipf_group_add(softc, group, head, flags, unit, set) /* 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 @@ ipf_group_del(softc, group, fr) /* 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 @@ ipf_group_free(group) /* 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 @@ ipf_group_flush(softc, group) /* 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 @@ ipf_getrulen(softc, unit, group, n) /* 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 @@ ipf_flushlist(softc, nfreedp, listp) /* 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 @@ ipf_flush(softc, unit, flags) /* 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 @@ ipf_flush_groups(softc, grhead, flags) /* 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 @@ memstr(src, dst, slen, dlen) /* 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 @@ ipf_fixskip(listp, rp, addremove) /* 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 @@ count4bits(ip) /* ------------------------------------------------------------------------ */ # 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 @@ count6bits(msk) /* 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 @@ unwind: /* 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 @@ ipf_sync(softc, ifp) /* 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 @@ copyinptr(softc, src, dst, size) /* 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 @@ copyoutptr(softc, src, dst, size) /* 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 @@ ipf_lock(data, lockp) /* ------------------------------------------------------------------------ */ /*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 @@ int icmpreplytype4[ICMP_MAXTYPE + 1]; /* 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 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) /* 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 @@ donenolock: /* 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 @@ ipf_rule_delete(softc, f, unit, set) /* 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 @@ ipf_rule_expire_insert(softc, f, set) /* 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 @@ ipf_findlookup(softc, unit, fr, addrp, maskp) /* 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 @@ ipf_funcinit(softc, fr) /* 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 @@ ipf_funcfini(softc, fr) /* 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 @@ ipf_findfunc(funcptr) /* 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 @@ ipf_resolvefunc(softc, data) * 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 @@ ppsratecheck(lasttime, curpps, maxpps) /* 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 @@ ipf_derefrule(softc, frp) /* 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 @@ ipf_grpmapinit(softc, fr) /* 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 @@ ipf_grpmapfini(softc, fr) /* 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 @@ ipf_srcgrpmap(fin, passp) /* 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 @@ ipf_dstgrpmap(fin, passp) /* 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 @@ ipf_addtimeoutqueue(softc, parent, seconds) /* this function is called. */ /* ------------------------------------------------------------------------ */ int -ipf_deletetimeoutqueue(ifq) - ipftq_t *ifq; +ipf_deletetimeoutqueue(ipftq_t *ifq) { ifq->ifq_ref--; @@ -5824,9 +5669,7 @@ ipf_deletetimeoutqueue(ifq) /* 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 @@ ipf_freetimeoutqueue(softc, ifq) /* 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 @@ ipf_deletequeueentry(tqe) /* 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 @@ ipf_queuefront(tqe) /* 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 @@ ipf_queueback(ticks, tqe) /* 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 @@ ipf_queueappend(ticks, tqe, ifq, parent) /* 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 @@ ipf_movequeue(ticks, tqe, oifq, nifq) /* 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 @@ ipf_updateipid(fin) /* 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 @@ ipf_getifname(ifp, buffer) /* etc. */ /* ------------------------------------------------------------------------ */ int -ipf_ioctlswitch(softc, unit, data, cmd, mode, uid, ctx) *** 7352 LINES SKIPPED ***