From owner-freebsd-net Sun Aug 12 0:56:56 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id AB86F37B403 for ; Sun, 12 Aug 2001 00:55:57 -0700 (PDT) (envelope-from julian@elischer.org) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA95437 for ; Sun, 12 Aug 2001 00:49:33 -0700 (PDT) Message-ID: <3B76330E.86A0B689@elischer.org> Date: Sun, 12 Aug 2001 00:41:02 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: net@freebsd.org Subject: IPV6/KAME/protosw integration cleanup Content-Type: multipart/mixed; boundary="------------8E304995AC7CC80311DE7C03" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------8E304995AC7CC80311DE7C03 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit When KAME was added the mesh was less that perfect but there was so much to be done that some shortcuts needed to be taken. now that time has passed some of these can be cleaned up. 1/ Merging ipprotosw.h and protosw.h 2/ removal of all varargs stuff from the kernel (this revealing the mismatched prototypes they were hiding) removal of lotso warnings from the KAME stuff. here is a set of patches: Notes: the change of 'proto' on output from int to protonum_t was to catch any 'wrong' usage of that tempting integer argument and can be left out of what's commtted. the function in6_pcbnotify() takes const arguments on the 4th argument in severalplaces, however if you try make this argument a const, you discover that, while error messages are reduced elsewhere, the function actually can modify the contents of what that argument is pointing to, thus consts could be modified.. either the arguments need to be copied at those call points or the function fixed.. Either way there are still Far too many warming messages coming out of the IPV6 code. this is a first pass. As a rsult of it, netinet/ipprotosw.h can be removed. I'd really like it if the KAME guys would use these as a base to FIX some of the interface hacks they needed to do to get KAME in.. Julian -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v --------------8E304995AC7CC80311DE7C03 Content-Type: text/plain; charset=iso-8859-2; name="protosw.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="protosw.diff" ? i386/conf/LINT Index: contrib/ipfilter/netinet/mlfk_ipl.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/ipfilter/netinet/mlfk_ipl.c,v retrieving revision 1.9 diff -u -r1.9 mlfk_ipl.c --- contrib/ipfilter/netinet/mlfk_ipl.c 2001/03/26 12:41:18 1.9 +++ contrib/ipfilter/netinet/mlfk_ipl.c 2001/08/12 07:31:48 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include Index: kern/uipc_mbuf.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_mbuf.c,v retrieving revision 1.86 diff -u -r1.86 uipc_mbuf.c --- kern/uipc_mbuf.c 2001/06/22 06:34:59 1.86 +++ kern/uipc_mbuf.c 2001/08/12 07:31:57 @@ -303,7 +303,7 @@ * continuing for "len" bytes, into the indicated buffer. */ void -m_copydata(struct mbuf *m, int off, int len, caddr_t cp) +m_copydata(const struct mbuf *m, int off, int len, caddr_t cp) { unsigned count; Index: net/if_faith.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_faith.c,v retrieving revision 1.6 diff -u -r1.6 if_faith.c --- net/if_faith.c 2001/07/05 14:42:54 1.6 +++ net/if_faith.c 2001/08/12 07:31:59 @@ -58,6 +58,7 @@ #include #include #include +#include #include #include Index: net/if_gif.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_gif.c,v retrieving revision 1.12 diff -u -r1.12 if_gif.c --- net/if_gif.c 2001/07/02 21:02:05 1.12 +++ net/if_gif.c 2001/08/12 07:31:59 @@ -62,7 +62,6 @@ #include #include #include -#include #endif /* INET */ #ifdef INET6 @@ -101,7 +100,7 @@ #ifdef INET extern struct domain inetdomain; -struct ipprotosw in_gif_protosw = +struct protosw in_gif_protosw = { SOCK_RAW, &inetdomain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, in_gif_input, rip_output, 0, rip_ctloutput, 0, @@ -110,7 +109,7 @@ }; #endif #ifdef INET6 -extern struct domain6 inet6domain; +extern struct domain inet6domain; struct ip6protosw in6_gif_protosw = { SOCK_RAW, &inet6domain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, in6_gif_input, rip6_output, 0, rip6_ctloutput, @@ -321,7 +320,7 @@ } /* LINTED const cast */ - m_copydata((struct mbuf *)m, 0, sizeof(ip), (caddr_t)&ip); + m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); switch (ip.ip_v) { #ifdef INET @@ -571,6 +570,9 @@ &(((struct if_laddrreq *)data)->addr); dst = (struct sockaddr *) &(((struct if_laddrreq *)data)->dstaddr); + break; + default: + panic("gif_ioctl"); } /* sa_family must be equal */ Index: net/if_stf.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_stf.c,v retrieving revision 1.9 diff -u -r1.9 if_stf.c --- net/if_stf.c 2001/07/02 21:02:05 1.9 +++ net/if_stf.c 2001/08/12 07:31:59 @@ -98,7 +98,6 @@ #include #include #include -#include #include #include @@ -134,7 +133,7 @@ static int ip_stf_ttl = 40; extern struct domain inetdomain; -struct ipprotosw in_stf_protosw = +struct protosw in_stf_protosw = { SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, in_stf_input, rip_output, 0, rip_ctloutput, 0, @@ -247,7 +246,7 @@ return 0; /* LINTED const cast */ - m_copydata((struct mbuf *)m, 0, sizeof(ip), (caddr_t)&ip); + m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); if (ip.ip_v != 4) return 0; @@ -531,14 +530,11 @@ } void -#if __STDC__ -in_stf_input(struct mbuf *m, ...) -#else -in_stf_input(m, va_alist) +in_stf_input(m, off, proto) struct mbuf *m; -#endif + int off; + protonum_t proto; { - int off, proto; struct stf_softc *sc; struct ip *ip; struct ip6_hdr *ip6; @@ -546,12 +542,6 @@ int len, isr; struct ifqueue *ifq = NULL; struct ifnet *ifp; - va_list ap; - - va_start(ap, m); - off = va_arg(ap, int); - proto = va_arg(ap, int); - va_end(ap); if (proto != IPPROTO_IPV6) { m_freem(m); Index: net/if_stf.h =================================================================== RCS file: /home/ncvs/src/sys/net/if_stf.h,v retrieving revision 1.1 diff -u -r1.1 if_stf.h --- net/if_stf.h 2000/07/04 16:35:04 1.1 +++ net/if_stf.h 2001/08/12 07:31:59 @@ -33,6 +33,6 @@ #ifndef _NET_IF_STF_H_ #define _NET_IF_STF_H_ -void in_stf_input __P((struct mbuf *, ...)); +pr_input_t in_stf_input; #endif /* _NET_IF_STF_H_ */ Index: net/net_osdep.h =================================================================== RCS file: /home/ncvs/src/sys/net/net_osdep.h,v retrieving revision 1.5 diff -u -r1.5 net_osdep.h --- net/net_osdep.h 2001/06/11 12:38:58 1.5 +++ net/net_osdep.h 2001/08/12 07:31:59 @@ -195,6 +195,7 @@ * - protosw for IPv4 (sys/netinet) * FreeBSD4: struct ipprotosw in netinet/ipprotosw.h * others: struct protosw in sys/protosw.h + * (including FreeBSD5) * * - protosw in general. * NetBSD 1.5 has extra member for ipfilter (netbsd-current dropped Index: net/raw_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/net/raw_usrreq.c,v retrieving revision 1.19 diff -u -r1.19 raw_usrreq.c --- net/raw_usrreq.c 2000/10/29 16:06:43 1.19 +++ net/raw_usrreq.c 2001/08/12 07:31:59 @@ -249,15 +249,14 @@ error = EISCONN; goto release; } - rp->rcb_faddr = nam; } else if (rp->rcb_faddr == 0) { error = ENOTCONN; goto release; + } else { + nam = rp->rcb_faddr; } - error = (*so->so_proto->pr_output)(m, so); + error = (*so->so_proto->pr_output)(m, so, nam); m = NULL; - if (nam) - rp->rcb_faddr = 0; release: if (m != NULL) m_freem(m); Index: net/rtsock.c =================================================================== RCS file: /home/ncvs/src/sys/net/rtsock.c,v retrieving revision 1.55 diff -u -r1.55 rtsock.c --- net/rtsock.c 2001/08/02 19:56:29 1.55 +++ net/rtsock.c 2001/08/12 07:32:01 @@ -73,7 +73,7 @@ static int rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *)); static int sysctl_dumpentry __P((struct radix_node *rn, void *vw)); static int sysctl_iflist __P((int af, struct walkarg *w)); -static int route_output __P((struct mbuf *, struct socket *)); +static pr_output_t route_output; static void rt_setmetrics __P((u_long, struct rt_metrics *, struct rt_metrics *)); /* Sleazy use of local variables throughout file, warning!!!! */ @@ -264,18 +264,34 @@ } static struct pr_usrreqs route_usrreqs = { - rts_abort, pru_accept_notsupp, rts_attach, rts_bind, rts_connect, - pru_connect2_notsupp, pru_control_notsupp, rts_detach, rts_disconnect, - pru_listen_notsupp, rts_peeraddr, pru_rcvd_notsupp, pru_rcvoob_notsupp, - rts_send, pru_sense_null, rts_shutdown, rts_sockaddr, - sosend, soreceive, sopoll + rts_abort, + pru_accept_notsupp, + rts_attach, + rts_bind, + rts_connect, + pru_connect2_notsupp, + pru_control_notsupp, + rts_detach, + rts_disconnect, + pru_listen_notsupp, + rts_peeraddr, + pru_rcvd_notsupp, + pru_rcvoob_notsupp, + rts_send, + pru_sense_null, + rts_shutdown, + rts_sockaddr, + sosend, + soreceive, + sopoll }; /*ARGSUSED*/ static int -route_output(m, so) +route_output(m, so, addr) register struct mbuf *m; struct socket *so; + struct sockaddr *addr; { register struct rt_msghdr *rtm = 0; register struct rtentry *rt = 0; Index: netinet/igmp.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/igmp.c,v retrieving revision 1.31 diff -u -r1.31 igmp.c --- netinet/igmp.c 2001/06/23 17:17:58 1.31 +++ netinet/igmp.c 2001/08/12 07:32:03 @@ -150,7 +150,8 @@ void igmp_input(m, off, proto) register struct mbuf *m; - int off, proto; + int off; + protonum_t proto; { register int iphlen = off; register struct igmp *igmp; Index: netinet/igmp_var.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/igmp_var.h,v retrieving revision 1.17 diff -u -r1.17 igmp_var.h --- netinet/igmp_var.h 1999/12/29 04:40:59 1.17 +++ netinet/igmp_var.h 2001/08/12 07:32:03 @@ -85,12 +85,13 @@ */ #define IGMP_AGE_THRESHOLD 540 -void igmp_init __P((void)); -void igmp_input __P((struct mbuf *, int, int)); +pr_init_t igmp_init; +pr_input_t igmp_input; +pr_fasttimo_t igmp_fasttimo; +pr_slowtimo_t igmp_slowtimo; + void igmp_joingroup __P((struct in_multi *)); void igmp_leavegroup __P((struct in_multi *)); -void igmp_fasttimo __P((void)); -void igmp_slowtimo __P((void)); SYSCTL_DECL(_net_inet_igmp); Index: netinet/in.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/in.c,v retrieving revision 1.55 diff -u -r1.55 in.c --- netinet/in.c 2001/08/04 17:10:13 1.55 +++ netinet/in.c 2001/08/12 07:32:04 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include Index: netinet/in_gif.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/in_gif.c,v retrieving revision 1.11 diff -u -r1.11 in_gif.c --- netinet/in_gif.c 2001/07/02 21:02:07 1.11 +++ netinet/in_gif.c 2001/08/12 07:32:04 @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -205,7 +206,7 @@ in_gif_input(m, off, proto) struct mbuf *m; int off; - int proto; + protonum_t proto; { struct ifnet *gifp = NULL; struct ip *ip; @@ -298,7 +299,7 @@ dst = (struct sockaddr_in *)sc->gif_pdst; /* LINTED const cast */ - m_copydata((struct mbuf *)m, 0, sizeof(ip), (caddr_t)&ip); + m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); /* check for address match */ addrmatch = 0; Index: netinet/in_gif.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/in_gif.h,v retrieving revision 1.5 diff -u -r1.5 in_gif.h --- netinet/in_gif.h 2001/07/02 21:02:07 1.5 +++ netinet/in_gif.h 2001/08/12 07:32:05 @@ -37,7 +37,7 @@ extern int ip_gif_ttl; -void in_gif_input __P((struct mbuf *, int off, int proto)); +pr_input_t in_gif_input; int in_gif_output __P((struct ifnet *, int, struct mbuf *, struct rtentry *)); int gif_encapcheck4 __P((const struct mbuf *, int, int, void *)); Index: netinet/in_proto.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/in_proto.c,v retrieving revision 1.57 diff -u -r1.57 in_proto.c --- netinet/in_proto.c 2001/07/02 21:02:07 1.57 +++ netinet/in_proto.c 2001/08/12 07:32:05 @@ -63,8 +63,6 @@ #include #include -#include - /* * TCP/IP protocol family: IP, ICMP, UDP, TCP. */ @@ -90,7 +88,7 @@ extern struct domain inetdomain; static struct pr_usrreqs nousrreqs; -struct ipprotosw inetsw[] = { +struct protosw inetsw[] = { { 0, &inetdomain, 0, 0, 0, 0, 0, 0, 0, Index: netinet/in_rmx.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/in_rmx.c,v retrieving revision 1.40 diff -u -r1.40 in_rmx.c --- netinet/in_rmx.c 2001/05/11 14:37:34 1.40 +++ netinet/in_rmx.c 2001/08/12 07:32:06 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include Index: netinet/ip_divert.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_divert.c,v retrieving revision 1.50 diff -u -r1.50 ip_divert.c --- netinet/ip_divert.c 2001/07/26 19:19:48 1.50 +++ netinet/ip_divert.c 2001/08/12 07:32:07 @@ -128,7 +128,7 @@ * with that protocol number to enter the system from the outside. */ void -div_input(struct mbuf *m, int off, int proto) +div_input(struct mbuf *m, int off, protonum_t proto) { ipstat.ips_noproto++; m_freem(m); Index: netinet/ip_dummynet.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_dummynet.c,v retrieving revision 1.39 diff -u -r1.39 ip_dummynet.c --- netinet/ip_dummynet.c 2001/02/10 00:10:18 1.39 +++ netinet/ip_dummynet.c 2001/08/12 07:32:10 @@ -63,6 +63,7 @@ #include /* XXX */ #include #include +#include #include #include #include Index: netinet/ip_encap.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_encap.c,v retrieving revision 1.5 diff -u -r1.5 ip_encap.c --- netinet/ip_encap.c 2001/07/25 20:15:49 1.5 +++ netinet/ip_encap.c 2001/08/12 07:32:10 @@ -77,7 +77,6 @@ #include #include #include -#include #ifdef INET6 #include @@ -127,27 +126,17 @@ #ifdef INET void -#if __STDC__ -encap4_input(struct mbuf *m, ...) -#else -encap4_input(m, va_alist) +encap4_input(m, off, proto) struct mbuf *m; - va_dcl -#endif + int off; + protonum_t proto; { - int off, proto; struct ip *ip; struct sockaddr_in s, d; - const struct ipprotosw *psw; + const struct protosw *psw; struct encaptab *ep, *match; - va_list ap; int prio, matchprio; - va_start(ap, m); - off = va_arg(ap, int); - proto = va_arg(ap, int); - va_end(ap); - ip = mtod(m, struct ip *); bzero(&s, sizeof(s)); @@ -205,7 +194,7 @@ if (match) { /* found a match, "match" has the best one */ - psw = (const struct ipprotosw *)match->psw; + psw = (const struct protosw *)match->psw; if (psw && psw->pr_input) { encap_fillarg(m, match); (*psw->pr_input)(m, off, proto); Index: netinet/ip_encap.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_encap.h,v retrieving revision 1.1 diff -u -r1.1 ip_encap.h --- netinet/ip_encap.h 2000/07/04 16:35:05 1.1 +++ netinet/ip_encap.h 2001/08/12 07:32:10 @@ -48,9 +48,10 @@ void *arg; /* passed via m->m_pkthdr.aux */ }; -void encap_init __P((void)); -void encap4_input __P((struct mbuf *, ...)); -int encap6_input __P((struct mbuf **, int *, int)); +pr_init_t encap_init; +pr_input_t encap4_input; +pr_input6_t encap6_input; + const struct encaptab *encap_attach __P((int, int, const struct sockaddr *, const struct sockaddr *, const struct sockaddr *, const struct sockaddr *, const struct protosw *, void *)); Index: netinet/ip_fw.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_fw.c,v retrieving revision 1.165 diff -u -r1.165 ip_fw.c --- netinet/ip_fw.c 2001/07/02 15:50:31 1.165 +++ netinet/ip_fw.c 2001/08/12 07:32:14 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include Index: netinet/ip_icmp.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_icmp.c,v retrieving revision 1.58 diff -u -r1.58 ip_icmp.c --- netinet/ip_icmp.c 2001/06/23 17:17:58 1.58 +++ netinet/ip_icmp.c 2001/08/12 07:32:15 @@ -232,7 +232,8 @@ void icmp_input(m, off, proto) register struct mbuf *m; - int off, proto; + int off; + protonum_t proto; { int hlen = off; register struct icmp *icp; Index: netinet/ip_icmp.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_icmp.h,v retrieving revision 1.16 diff -u -r1.16 ip_icmp.h --- netinet/ip_icmp.h 1999/12/29 04:41:01 1.16 +++ netinet/ip_icmp.h 2001/08/12 07:32:16 @@ -186,7 +186,7 @@ #ifdef _KERNEL void icmp_error __P((struct mbuf *, int, int, n_long, struct ifnet *)); -void icmp_input __P((struct mbuf *, int, int)); +pr_input_t icmp_input; #endif #endif Index: netinet/ip_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v retrieving revision 1.174 diff -u -r1.174 ip_input.c --- netinet/ip_input.c 2001/06/23 17:17:58 1.174 +++ netinet/ip_input.c 2001/08/12 07:32:19 @@ -75,8 +75,6 @@ #include #include -#include - #include #include @@ -153,7 +151,7 @@ #endif extern struct domain inetdomain; -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; static int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddrhead in_ifaddrhead; /* first inet address */ @@ -236,17 +234,17 @@ void ip_init() { - register struct ipprotosw *pr; + register struct protosw *pr; register int i; TAILQ_INIT(&in_ifaddrhead); - pr = (struct ipprotosw *)pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); + pr = (struct protosw *)pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); if (pr == 0) panic("ip_init"); for (i = 0; i < IPPROTO_MAX; i++) ip_protox[i] = pr - inetsw; - for (pr = (struct ipprotosw *)inetdomain.dom_protosw; - pr < (struct ipprotosw *)inetdomain.dom_protoswNPROTOSW; pr++) + for (pr = (struct protosw *)inetdomain.dom_protosw; + pr < (struct protosw *)inetdomain.dom_protoswNPROTOSW; pr++) if (pr->pr_domain->dom_family == PF_INET && pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW) ip_protox[pr->pr_protocol] = pr - inetsw; Index: netinet/ip_mroute.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_mroute.c,v retrieving revision 1.64 diff -u -r1.64 ip_mroute.c --- netinet/ip_mroute.c 2001/07/25 20:15:49 1.64 +++ netinet/ip_mroute.c 2001/08/12 07:32:22 @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -111,7 +110,7 @@ rsvp_input(m, off, proto) /* XXX must fixup manually */ struct mbuf *m; int off; - int proto; + protonum_t proto; { /* Can still get packets with rsvp_on = 0 if there is a local member * of the group to which the RSVP packet is addressed. But in this @@ -132,7 +131,7 @@ m_freem(m); } -void ipip_input(struct mbuf *m, int off, int proto) { /* XXX must fixup manually */ +void ipip_input(struct mbuf *m, int off, protonum_t proto) { /* XXX must fixup manually */ rip_input(m, off, proto); } @@ -708,7 +707,7 @@ * claimed). */ static void -mroute_encap_input(struct mbuf *m, int off, int proto) +mroute_encap_input(struct mbuf *m, int off, protonum_t proto) { struct ip *ip = mtod(m, struct ip *); int hlen = ip->ip_hl << 2; @@ -732,7 +731,7 @@ } extern struct domain inetdomain; -static struct ipprotosw mroute_encap_protosw = +static struct protosw mroute_encap_protosw = { SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, mroute_encap_input, 0, 0, rip_ctloutput, 0, @@ -2111,7 +2110,7 @@ rsvp_input(m, off, proto) struct mbuf *m; int off; - int proto; + protonum_t proto; { int vifi; register struct ip *ip = mtod(m, struct ip *); Index: netinet/ip_var.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_var.h,v retrieving revision 1.57 diff -u -r1.57 ip_var.h --- netinet/ip_var.h 2001/06/11 18:41:57 1.57 +++ netinet/ip_var.h 2001/08/12 07:32:22 @@ -154,19 +154,21 @@ extern int (*legal_vif_num) __P((int)); extern u_long (*ip_mcast_src) __P((int)); extern int rsvp_on; + extern struct pr_usrreqs rip_usrreqs; + +pr_ctloutput_t ip_ctloutput; +pr_drain_t ip_drain; +pr_init_t ip_init; +pr_slowtimo_t ip_slowtimo; -int ip_ctloutput __P((struct socket *, struct sockopt *sopt)); -void ip_drain __P((void)); void ip_freemoptions __P((struct ip_moptions *)); -void ip_init __P((void)); extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *, struct ip_moptions *)); int ip_output __P((struct mbuf *, struct mbuf *, struct route *, int, struct ip_moptions *)); void ip_savecontrol __P((struct inpcb *, struct mbuf **, struct ip *, struct mbuf *)); -void ip_slowtimo __P((void)); struct mbuf * ip_srcroute __P((void)); void ip_stripoptions __P((struct mbuf *, struct mbuf *)); @@ -174,13 +176,13 @@ u_int16_t ip_randomid __P((void)); #endif -int rip_ctloutput __P((struct socket *, struct sockopt *)); -void rip_ctlinput __P((int, struct sockaddr *, void *)); -void rip_init __P((void)); -void rip_input __P((struct mbuf *, int, int)); -int rip_output __P((struct mbuf *, struct socket *, u_long)); -void ipip_input __P((struct mbuf *, int, int)); -void rsvp_input __P((struct mbuf *, int, int)); +pr_ctloutput_t rip_ctloutput; +pr_ctlinput_t rip_ctlinput; +pr_init_t rip_init; +pr_input_t rip_input; +pr_output_t rip_output; +pr_input_t ipip_input; +pr_input_t rsvp_input; int ip_rsvp_init __P((struct socket *)); int ip_rsvp_done __P((void)); int ip_rsvp_vif_init __P((struct socket *, struct sockopt *)); @@ -188,8 +190,8 @@ void ip_rsvp_force_done __P((struct socket *)); #ifdef IPDIVERT -void div_init __P((void)); -void div_input __P((struct mbuf *, int, int)); +pr_init_t div_init; +pr_input_t div_input; void divert_packet __P((struct mbuf *, int, int)); extern struct pr_usrreqs div_usrreqs; extern u_int16_t ip_divert_cookie; Index: netinet/raw_ip.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/raw_ip.c,v retrieving revision 1.80 diff -u -r1.80 raw_ip.c --- netinet/raw_ip.c 2001/07/26 19:19:48 1.80 +++ netinet/raw_ip.c 2001/08/12 07:32:23 @@ -114,7 +114,8 @@ void rip_input(m, off, proto) struct mbuf *m; - int off, proto; + int off; + protonum_t proto; { register struct ip *ip = mtod(m, struct ip *); register struct inpcb *inp; @@ -196,10 +197,10 @@ * Tack on options user may have setup with control call. */ int -rip_output(m, so, dst) +rip_output(m, so, nam) struct mbuf *m; struct socket *so; - u_long dst; + struct sockaddr *nam; { register struct ip *ip; register struct inpcb *inp = sotoinpcb(so); @@ -214,6 +215,10 @@ m_freem(m); return(EMSGSIZE); } + if (nam == NULL) { + m_freem(m); + return ENOTCONN; + } M_PREPEND(m, sizeof(struct ip), M_TRYWAIT); ip = mtod(m, struct ip *); ip->ip_tos = inp->inp_ip_tos; @@ -221,7 +226,8 @@ ip->ip_p = inp->inp_ip_p; ip->ip_len = m->m_pkthdr.len; ip->ip_src = inp->inp_laddr; - ip->ip_dst.s_addr = dst; + ip->ip_dst.s_addr + = ((struct sockaddr_in *)nam)->sin_addr.s_addr; ip->ip_ttl = inp->inp_ip_ttl; } else { if (m->m_pkthdr.len > IP_MAXPACKET) { @@ -566,22 +572,26 @@ struct mbuf *control, struct proc *p) { struct inpcb *inp = sotoinpcb(so); - register u_long dst; + struct sockaddr_in dst_addr; + if (so->so_state & SS_ISCONNECTED) { if (nam) { m_freem(m); return EISCONN; } - dst = inp->inp_faddr.s_addr; + dst_addr.sin_len = sizeof(dst_addr); + dst_addr.sin_family = AF_INET; + dst_addr.sin_port = 0; + dst_addr.sin_addr.s_addr = inp->inp_faddr.s_addr; + nam = (struct sockaddr *)&dst_addr; } else { if (nam == NULL) { m_freem(m); return ENOTCONN; } - dst = ((struct sockaddr_in *)nam)->sin_addr.s_addr; } - return rip_output(m, so, dst); + return rip_output(m, so, nam); } static int Index: netinet/tcp_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_input.c,v retrieving revision 1.136 diff -u -r1.136 tcp_input.c --- netinet/tcp_input.c 2001/07/08 02:20:46 1.136 +++ netinet/tcp_input.c 2001/08/12 07:32:28 @@ -331,7 +331,8 @@ void tcp_input(m, off0, proto) register struct mbuf *m; - int off0, proto; + int off0; + protonum_t proto; { register struct tcphdr *th; register struct ip *ip = NULL; Index: netinet/tcp_subr.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_subr.c,v retrieving revision 1.112 diff -u -r1.112 tcp_subr.c --- netinet/tcp_subr.c 2001/07/27 00:04:39 1.112 +++ netinet/tcp_subr.c 2001/08/12 07:32:30 @@ -1107,8 +1107,8 @@ (struct sockaddr *)ip6cp->ip6c_src, th.th_sport, cmd, notify); } else - in6_pcbnotify(&tcb, sa, 0, (struct sockaddr *)sa6_src, - 0, cmd, notify); + in6_pcbnotify(&tcb, sa, 0, (struct sockaddr *)sa6_src, 0, + cmd, notify); } #endif /* INET6 */ Index: netinet/tcp_var.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_var.h,v retrieving revision 1.70 diff -u -r1.70 tcp_var.h --- netinet/tcp_var.h 2001/07/08 02:20:47 1.70 +++ netinet/tcp_var.h 2001/08/12 07:32:31 @@ -372,19 +372,21 @@ extern int ss_fltsz; extern int ss_fltsz_local; +pr_ctlinput_t tcp_ctlinput; +pr_ctloutput_t tcp_ctloutput; +pr_fasttimo_t tcp_fasttimo; +pr_slowtimo_t tcp_slowtimo; +pr_init_t tcp_init; +pr_drain_t tcp_drain; +pr_input_t tcp_input; + void tcp_canceltimers __P((struct tcpcb *)); struct tcpcb * tcp_close __P((struct tcpcb *)); -void tcp_ctlinput __P((int, struct sockaddr *, void *)); -int tcp_ctloutput __P((struct socket *, struct sockopt *)); struct tcpcb * tcp_drop __P((struct tcpcb *, int)); -void tcp_drain __P((void)); -void tcp_fasttimo __P((void)); struct rmxp_tao * tcp_gettaocache __P((struct inpcb *)); -void tcp_init __P((void)); -void tcp_input __P((struct mbuf *, int, int)); void tcp_mss __P((struct tcpcb *, int)); int tcp_mssopt __P((struct tcpcb *)); void tcp_drop_syn_sent __P((struct inpcb *, int)); @@ -398,7 +400,6 @@ struct rtentry * tcp_rtlookup __P((struct inpcb *)); void tcp_setpersist __P((struct tcpcb *)); -void tcp_slowtimo __P((void)); struct tcptemp * tcp_maketemplate __P((struct tcpcb *)); void tcp_fillheaders __P((struct tcpcb *, void *, void *)); Index: netinet/udp_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/udp_usrreq.c,v retrieving revision 1.93 diff -u -r1.93 udp_usrreq.c --- netinet/udp_usrreq.c 2001/07/26 19:19:48 1.93 +++ netinet/udp_usrreq.c 2001/08/12 07:32:33 @@ -151,7 +151,8 @@ void udp_input(m, off, proto) register struct mbuf *m; - int off, proto; + int off; + protonum_t proto; { int iphlen = off; register struct ip *ip; Index: netinet/udp_var.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/udp_var.h,v retrieving revision 1.23 diff -u -r1.23 udp_var.h --- netinet/udp_var.h 2001/02/18 07:10:03 1.23 +++ netinet/udp_var.h 2001/08/12 07:32:33 @@ -103,9 +103,9 @@ extern struct udpstat udpstat; extern int log_in_vain; -void udp_ctlinput __P((int, struct sockaddr *, void *)); -void udp_init __P((void)); -void udp_input __P((struct mbuf *, int, int)); +pr_ctlinput_t udp_ctlinput; +pr_init_t udp_init; +pr_input_t udp_input; void udp_notify __P((struct inpcb *inp, int errno)); int udp_shutdown __P((struct socket *so)); Index: netinet6/ah.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ah.h,v retrieving revision 1.5 diff -u -r1.5 ah.h --- netinet6/ah.h 2001/06/11 12:39:03 1.5 +++ netinet6/ah.h 2001/08/12 07:32:33 @@ -79,13 +79,14 @@ #define AH_MAXSUMSIZE 16 +extern pr_input_t ah4_input; extern const struct ah_algorithm *ah_algorithm_lookup __P((int)); + /* cksum routines */ extern int ah_hdrlen __P((struct secasvar *)); extern size_t ah_hdrsiz __P((struct ipsecrequest *)); -extern void ah4_input __P((struct mbuf *, ...)); extern int ah4_output __P((struct mbuf *, struct ipsecrequest *)); extern int ah4_calccksum __P((struct mbuf *, caddr_t, size_t, const struct ah_algorithm *, struct secasvar *)); Index: netinet6/ah_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ah_input.c,v retrieving revision 1.7 diff -u -r1.7 ah_input.c --- netinet6/ah_input.c 2001/06/11 12:39:04 1.7 +++ netinet6/ah_input.c 2001/08/12 07:32:35 @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -94,17 +95,13 @@ #define IPLEN_FLIPPED #ifdef INET -#include -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; void -#if __STDC__ -ah4_input(struct mbuf *m, ...) -#else -ah4_input(m, va_alist) +ah4_input(m, off, proto) struct mbuf *m; - va_dcl -#endif + int off; + protonum_t proto; { struct ip *ip; struct ah *ah; @@ -116,15 +113,8 @@ struct secasvar *sav = NULL; u_int16_t nxt; size_t hlen; - int off, proto; - va_list ap; size_t stripsiz = 0; - va_start(ap, m); - off = va_arg(ap, int); - proto = va_arg(ap, int); - va_end(ap); - #ifndef PULLDOWN_TEST if (m->m_len < off + sizeof(struct newah)) { m = m_pullup(m, off + sizeof(struct newah)); @@ -999,6 +989,7 @@ } else { m = NULL; ip6 = NULL; + off = 0; } if (ip6) { Index: netinet6/esp.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/esp.h,v retrieving revision 1.4 diff -u -r1.4 esp.h --- netinet6/esp.h 2001/06/11 12:39:04 1.4 +++ netinet6/esp.h 2001/08/12 07:32:35 @@ -97,8 +97,8 @@ extern int esp_max_ivlen __P((void)); /* crypt routines */ +extern pr_input_t esp4_input; extern int esp4_output __P((struct mbuf *, struct ipsecrequest *)); -extern void esp4_input __P((struct mbuf *, ...)); extern size_t esp_hdrsiz __P((struct ipsecrequest *)); extern int esp_schedule __P((const struct esp_algorithm *, struct secasvar *)); Index: netinet6/esp_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/esp_input.c,v retrieving revision 1.7 diff -u -r1.7 esp_input.c --- netinet6/esp_input.c 2001/06/11 12:39:05 1.7 +++ netinet6/esp_input.c 2001/08/12 07:32:37 @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #ifdef INET6 @@ -97,17 +98,13 @@ ? sizeof(struct newesp) : sizeof(struct esp)) #ifdef INET -#include -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; void -#if __STDC__ -esp4_input(struct mbuf *m, ...) -#else -esp4_input(m, va_alist) +esp4_input(m, off, proto) struct mbuf *m; - va_dcl -#endif + int off; + protonum_t proto; { struct ip *ip; struct esp *esp; @@ -120,13 +117,6 @@ int ivlen; size_t hlen; size_t esplen; - va_list ap; - int off, proto; - - va_start(ap, m); - off = va_arg(ap, int); - proto = va_arg(ap, int); - va_end(ap); /* sanity check for alignment. */ if (off % 4 != 0 || m->m_pkthdr.len % 4 != 0) { @@ -924,6 +914,7 @@ } else { m = NULL; ip6 = NULL; + off = 0; } if (ip6) { Index: netinet6/esp_rijndael.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/esp_rijndael.c,v retrieving revision 1.1 diff -u -r1.1 esp_rijndael.c --- netinet6/esp_rijndael.c 2001/06/11 12:39:05 1.1 +++ netinet6/esp_rijndael.c 2001/08/12 07:32:37 @@ -35,6 +35,7 @@ #include #include +#include #include #include Index: netinet6/in6.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6.c,v retrieving revision 1.15 diff -u -r1.15 in6.c --- netinet6/in6.c 2001/08/03 19:10:31 1.15 +++ netinet6/in6.c 2001/08/12 07:32:41 @@ -79,6 +79,7 @@ #include #include #include +#include #include #include @@ -1789,8 +1790,8 @@ static char ip6buf[8][48]; int i; char *cp; - u_short *a = (u_short *)addr; - u_char *d; + const u_short *a = (const u_short *)addr; + const u_char *d; int dcolon = 0; ip6round = (ip6round + 1) & 7; @@ -1819,7 +1820,7 @@ a++; continue; } - d = (u_char *)a; + d = (const u_char *)a; *cp++ = digits[*d >> 4]; *cp++ = digits[*d++ & 0xf]; *cp++ = digits[*d >> 4]; Index: netinet6/in6_gif.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_gif.c,v retrieving revision 1.5 diff -u -r1.5 in6_gif.c --- netinet6/in6_gif.c 2001/06/11 12:39:05 1.5 +++ netinet6/in6_gif.c 2001/08/12 07:32:41 @@ -41,7 +41,7 @@ #include #include #include - +#include #include #include @@ -302,7 +302,7 @@ dst = (struct sockaddr_in6 *)sc->gif_pdst; /* LINTED const cast */ - m_copydata((struct mbuf *)m, 0, sizeof(ip6), (caddr_t)&ip6); + m_copydata(m, 0, sizeof(ip6), (caddr_t)&ip6); /* check for address match */ addrmatch = 0; Index: netinet6/in6_ifattach.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_ifattach.c,v retrieving revision 1.7 diff -u -r1.7 in6_ifattach.c --- netinet6/in6_ifattach.c 2001/08/04 17:10:13 1.7 +++ netinet6/in6_ifattach.c 2001/08/12 07:32:43 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include Index: netinet6/in6_pcb.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_pcb.c,v retrieving revision 1.16 diff -u -r1.16 in6_pcb.c --- netinet6/in6_pcb.c 2001/08/04 17:10:14 1.16 +++ netinet6/in6_pcb.c 2001/08/12 07:32:45 @@ -765,7 +765,8 @@ void in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, notify) struct inpcbhead *head; - struct sockaddr *dst, *src; + struct sockaddr *dst; + const struct sockaddr *src; u_int fport_arg, lport_arg; int cmd; void (*notify) __P((struct inpcb *, int)); Index: netinet6/in6_pcb.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_pcb.h,v retrieving revision 1.5 diff -u -r1.5 in6_pcb.h --- netinet6/in6_pcb.h 2001/08/04 17:10:14 1.5 +++ netinet6/in6_pcb.h 2001/08/12 07:32:45 @@ -91,7 +91,7 @@ struct in6_addr *, u_int, struct in6_addr *, u_int, int, struct ifnet *)); void in6_pcbnotify __P((struct inpcbhead *, struct sockaddr *, - u_int, struct sockaddr *, u_int, int, + u_int, const struct sockaddr *, u_int, int, void (*)(struct inpcb *, int))); void in6_rtchange __P((struct inpcb *, int)); int in6_setpeeraddr __P((struct socket *so, struct sockaddr **nam)); Index: netinet6/in6_prefix.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_prefix.c,v retrieving revision 1.7 diff -u -r1.7 in6_prefix.c --- netinet6/in6_prefix.c 2001/06/11 12:39:05 1.7 +++ netinet6/in6_prefix.c 2001/08/12 07:32:47 @@ -74,6 +74,7 @@ #include #include #include +#include #include Index: netinet6/in6_rmx.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_rmx.c,v retrieving revision 1.4 diff -u -r1.4 in6_rmx.c --- netinet6/in6_rmx.c 2001/06/11 12:39:05 1.4 +++ netinet6/in6_rmx.c 2001/08/12 07:32:48 @@ -82,6 +82,7 @@ #include #include #include +#include #include #include Index: netinet6/ip6_fw.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ip6_fw.c,v retrieving revision 1.13 diff -u -r1.13 ip6_fw.c --- netinet6/ip6_fw.c 2001/06/28 05:18:31 1.13 +++ netinet6/ip6_fw.c 2001/08/12 07:32:50 @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include Index: netinet6/ip6_var.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ip6_var.h,v retrieving revision 1.7 diff -u -r1.7 ip6_var.h --- netinet6/ip6_var.h 2001/06/11 12:39:05 1.7 +++ netinet6/ip6_var.h 2001/08/12 07:32:51 @@ -332,23 +332,22 @@ struct ip6_pktopts *ip6_copypktopts __P((struct ip6_pktopts *, int)); int ip6_optlen __P((struct inpcb *)); -int route6_input __P((struct mbuf **, int *, int)); +pr_input6_t route6_input; -void frag6_init __P((void)); -int frag6_input __P((struct mbuf **, int *, int)); -void frag6_slowtimo __P((void)); -void frag6_drain __P((void)); +pr_init_t frag6_init; +pr_input6_t frag6_input; +pr_slowtimo_t frag6_slowtimo; +pr_drain_t frag6_drain; -void rip6_init __P((void)); -int rip6_input __P((struct mbuf **mp, int *offp, int proto)); -void rip6_ctlinput __P((int, struct sockaddr *, void *)); -int rip6_ctloutput __P((struct socket *so, struct sockopt *sopt)); -int rip6_output __P((struct mbuf *, ...)); -int rip6_usrreq __P((struct socket *, - int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *)); +pr_init_t rip6_init; +pr_input6_t rip6_input; +pr_ctlinput_t rip6_ctlinput; +pr_ctloutput_t rip6_ctloutput; +pr_output_t rip6_output; +pr_usrreq_t rip6_usrreq; +pr_input6_t dest6_input; +pr_input6_t none_input; -int dest6_input __P((struct mbuf **, int *, int)); -int none_input __P((struct mbuf **, int *, int)); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_VAR_H_ */ Index: netinet6/ip6protosw.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ip6protosw.h,v retrieving revision 1.6 diff -u -r1.6 ip6protosw.h --- netinet6/ip6protosw.h 2001/06/11 12:39:05 1.6 +++ netinet6/ip6protosw.h 2001/08/12 07:32:51 @@ -128,30 +128,20 @@ short pr_flags; /* see below */ /* protocol-protocol hooks */ - int (*pr_input) /* input to protocol (from below) */ - __P((struct mbuf **, int *, int)); - int (*pr_output) /* output to protocol (from above) */ - __P((struct mbuf *, ...)); - void (*pr_ctlinput) /* control input (from below) */ - __P((int, struct sockaddr *, void *)); - int (*pr_ctloutput) /* control output (from above) */ - __P((struct socket *, struct sockopt *)); + pr_input6_t *pr_input; /* input to protocol (from below) */ + pr_output_t *pr_output; /* output to protocol (from above) */ + pr_ctlinput_t *pr_ctlinput; /* control input (from below) */ + pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* user-protocol hook */ - int (*pr_usrreq) /* user request: see list below */ - __P((struct socket *, int, struct mbuf *, - struct mbuf *, struct mbuf *, struct proc *)); + pr_usrreq_t *pr_usrreq; /* user request: see list below */ /* utility hooks */ - void (*pr_init) /* initialization hook */ - __P((void)); + pr_init_t *pr_init; + pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ + pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ + pr_drain_t *pr_drain; /* flush any excess space possible */ - void (*pr_fasttimo) /* fast timeout (200ms) */ - __P((void)); - void (*pr_slowtimo) /* slow timeout (500ms) */ - __P((void)); - void (*pr_drain) /* flush any excess space possible */ - __P((void)); struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */ struct pfil_head pr_pfh; }; Index: netinet6/ipcomp.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ipcomp.h,v retrieving revision 1.2 diff -u -r1.2 ipcomp.h --- netinet6/ipcomp.h 2001/06/11 12:39:06 1.2 +++ netinet6/ipcomp.h 2001/08/12 07:32:51 @@ -62,9 +62,10 @@ size_t minplen; /* minimum required length for compression */ }; +extern pr_input_t ipcomp4_input; + struct ipsecrequest; extern const struct ipcomp_algorithm *ipcomp_algorithm_lookup __P((int)); -extern void ipcomp4_input __P((struct mbuf *, ...)); extern int ipcomp4_output __P((struct mbuf *, struct ipsecrequest *)); #endif /*KERNEL*/ Index: netinet6/ipcomp_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ipcomp_input.c,v retrieving revision 1.2 diff -u -r1.2 ipcomp_input.c --- netinet6/ipcomp_input.c 2001/06/11 12:39:06 1.2 +++ netinet6/ipcomp_input.c 2001/08/12 07:32:52 @@ -83,17 +83,13 @@ #define IPLEN_FLIPPED #ifdef INET -#include -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; void -#if __STDC__ -ipcomp4_input(struct mbuf *m, ...) -#else -ipcomp4_input(m, va_alist) +ipcomp4_input(m, off, proto) struct mbuf *m; - va_dcl -#endif + int off; + protonum_t proto; { struct mbuf *md; struct ip *ip; @@ -105,13 +101,6 @@ int error; size_t newlen, olen; struct secasvar *sav = NULL; - int off, proto; - va_list ap; - - va_start(ap, m); - off = va_arg(ap, int); - proto = va_arg(ap, int); - va_end(ap); if (m->m_pkthdr.len < off + sizeof(struct ipcomp)) { ipseclog((LOG_DEBUG, "IPv4 IPComp input: assumption failed " Index: netinet6/nd6_nbr.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/nd6_nbr.c,v retrieving revision 1.10 diff -u -r1.10 nd6_nbr.c --- netinet6/nd6_nbr.c 2001/06/19 14:48:02 1.10 +++ netinet6/nd6_nbr.c 2001/08/12 07:32:54 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include Index: netinet6/nd6_rtr.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/nd6_rtr.c,v retrieving revision 1.8 diff -u -r1.8 nd6_rtr.c --- netinet6/nd6_rtr.c 2001/06/18 11:37:06 1.8 +++ netinet6/nd6_rtr.c 2001/08/12 07:32:57 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include Index: netinet6/raw_ip6.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/raw_ip6.c,v retrieving revision 1.12 diff -u -r1.12 raw_ip6.c --- netinet6/raw_ip6.c 2001/07/26 19:19:49 1.12 +++ netinet6/raw_ip6.c 2001/08/12 07:32:58 @@ -286,7 +286,7 @@ sa6_src = &sa6_any; } - (void) in6_pcbnotify(&ripcb, sa, 0, (struct sockaddr *)sa6_src, + (void) in6_pcbnotify(&ripcb, sa, 0, (const struct sockaddr *)sa6_src, 0, cmd, notify); } @@ -295,16 +295,12 @@ * Tack on options user may have setup with control call. */ int -#if __STDC__ -rip6_output(struct mbuf *m, ...) -#else -rip6_output(m, va_alist) +rip6_output(m, so, sockaddr) struct mbuf *m; - va_dcl -#endif -{ struct socket *so; - struct sockaddr_in6 *dstsock; + struct sockaddr *sockaddr; +{ + struct sockaddr_in6 *dstsock = (struct sockaddr_in6 *)sockaddr; struct mbuf *control; struct in6_addr *dst; struct ip6_hdr *ip6; @@ -315,14 +311,12 @@ struct ifnet *oifp = NULL; int type = 0, code = 0; /* for ICMPv6 output statistics only */ int priv = 0; - va_list ap; - - va_start(ap, m); - so = va_arg(ap, struct socket *); - dstsock = va_arg(ap, struct sockaddr_in6 *); - control = va_arg(ap, struct mbuf *); - va_end(ap); + if (m->m_type == MT_CONTROL) { + control = m; + m = m->m_next; + } else + control = NULL; in6p = sotoin6pcb(so); priv = 0; @@ -718,7 +712,11 @@ dst->sin6_scope_id = scope6_addr2default(&dst->sin6_addr); } #endif - return rip6_output(m, so, dst, control); + if (control) { + control->m_next = m; + m = control; + } + return rip6_output(m, so, (struct sockaddr *)dst); } struct pr_usrreqs rip6_usrreqs = { Index: netinet6/route6.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/route6.c,v retrieving revision 1.4 diff -u -r1.4 route6.c --- netinet6/route6.c 2001/06/11 12:39:06 1.4 +++ netinet6/route6.c 2001/08/12 07:32:58 @@ -38,6 +38,7 @@ #include #include #include +#include #include Index: netinet6/udp6_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/udp6_usrreq.c,v retrieving revision 1.16 diff -u -r1.16 udp6_usrreq.c --- netinet6/udp6_usrreq.c 2001/07/26 19:19:49 1.16 +++ netinet6/udp6_usrreq.c 2001/08/12 07:33:00 @@ -456,10 +456,11 @@ bzero(&uh, sizeof(uh)); m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh); - (void) in6_pcbnotify(&udb, sa, uh.uh_dport, ip6cp->ip6c_src, + (void) in6_pcbnotify(&udb, sa, uh.uh_dport, + (const struct sockaddr *)ip6cp->ip6c_src, uh.uh_sport, cmd, notify); } else - (void) in6_pcbnotify(&udb, sa, 0, (struct sockaddr *)&sa6_src, + (void) in6_pcbnotify(&udb, sa, 0, (const struct sockaddr *)&sa6_src, 0, cmd, notify); } Index: netipx/ipx_ip.c =================================================================== RCS file: /home/ncvs/src/sys/netipx/ipx_ip.c,v retrieving revision 1.27 diff -u -r1.27 ipx_ip.c --- netipx/ipx_ip.c 2001/02/04 13:13:10 1.27 +++ netipx/ipx_ip.c 2001/08/12 07:33:00 @@ -162,9 +162,10 @@ static int ipxip_hold_input; void -ipxip_input(m, hlen) +ipxip_input(m, hlen, proto) register struct mbuf *m; int hlen; + protonum_t proto; /* ignored */ { register struct ip *ip; register struct ipx *ipx; Index: netipx/ipx_ip.h =================================================================== RCS file: /home/ncvs/src/sys/netipx/ipx_ip.h,v retrieving revision 1.14 diff -u -r1.14 ipx_ip.h --- netipx/ipx_ip.h 1999/12/29 04:46:08 1.14 +++ netipx/ipx_ip.h 2001/08/12 07:33:00 @@ -51,8 +51,8 @@ #ifdef _KERNEL -void ipxip_ctlinput __P((int cmd, struct sockaddr *sa, void *arg)); -void ipxip_input __P((struct mbuf *m, int hlen)); +pr_ctlinput_t ipxip_ctlinput; +pr_input_t ipxip_input; int ipxip_route __P((struct socket *so, struct sockopt *sopt)); #endif Index: netkey/keysock.c =================================================================== RCS file: /home/ncvs/src/sys/netkey/keysock.c,v retrieving revision 1.6 diff -u -r1.6 keysock.c --- netkey/keysock.c 2001/06/11 12:39:10 1.6 +++ netkey/keysock.c 2001/08/12 07:33:01 @@ -71,23 +71,14 @@ * key_output() */ int -#if __STDC__ -key_output(struct mbuf *m, ...) -#else -key_output(m, va_alist) +key_output(m, so, sockaddr) struct mbuf *m; - va_dcl -#endif + struct socket *so; + struct sockaddr *sockaddr; /* ignored */ { struct sadb_msg *msg; int len, error = 0; int s; - struct socket *so; - va_list ap; - - va_start(ap, m); - so = va_arg(ap, struct socket *); - va_end(ap); if (m == 0) panic("key_output: NULL pointer was passed.\n"); Index: netkey/keysock.h =================================================================== RCS file: /home/ncvs/src/sys/netkey/keysock.h,v retrieving revision 1.5 diff -u -r1.5 keysock.h --- netkey/keysock.h 2000/07/04 16:35:14 1.5 +++ netkey/keysock.h 2001/08/12 07:33:02 @@ -71,7 +71,7 @@ extern struct pfkeystat pfkeystat; -extern int key_output __P((struct mbuf *, ...)); +extern pr_output_t key_output; extern int key_usrreq __P((struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *)); Index: sys/mbuf.h =================================================================== RCS file: /home/ncvs/src/sys/sys/mbuf.h,v retrieving revision 1.83 diff -u -r1.83 mbuf.h --- sys/mbuf.h 2001/07/26 18:47:40 1.83 +++ sys/mbuf.h 2001/08/12 07:33:04 @@ -434,7 +434,7 @@ void m_extadd(struct mbuf *, caddr_t, u_int, void (*free)(caddr_t, void *), void *, short, int); void m_copyback(struct mbuf *, int, int, caddr_t); -void m_copydata(struct mbuf *, int, int, caddr_t); +void m_copydata(const struct mbuf *, int, int, caddr_t); struct mbuf *m_copym(struct mbuf *, int, int, int); struct mbuf *m_copypacket(struct mbuf *, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, Index: sys/protosw.h =================================================================== RCS file: /home/ncvs/src/sys/sys/protosw.h,v retrieving revision 1.34 diff -u -r1.34 protosw.h --- sys/protosw.h 2001/08/10 23:17:22 1.34 +++ sys/protosw.h 2001/08/12 07:33:05 @@ -73,9 +73,13 @@ * similar to the vnode VOP interface. */ /* USE THESE FOR YOUR PROTOTYPES ! */ -typedef void pr_input_t (struct mbuf *, int); + +typedef short int protonum_t; + +typedef void pr_input_t (struct mbuf *, int, protonum_t); +typedef int pr_input6_t (struct mbuf **, int*, int); /* XXX FIX THIS */ typedef void pr_in_input_t (struct mbuf *, int, int); /* XXX FIX THIS */ -typedef int pr_output_t (struct mbuf *, struct socket *); +typedef int pr_output_t (struct mbuf *, struct socket *, struct sockaddr *); typedef void pr_ctlinput_t (int, struct sockaddr *, void *); typedef int pr_ctloutput_t (struct socket *, struct sockopt *); typedef void pr_init_t (void); @@ -83,6 +87,9 @@ typedef void pr_slowtimo_t (void); typedef void pr_drain_t (void); +typedef int pr_usrreq_t(struct socket *, int, struct mbuf *, + struct mbuf *, struct mbuf *, struct proc *); + struct protosw { short pr_type; /* socket type used for */ @@ -95,7 +102,7 @@ pr_ctlinput_t *pr_ctlinput; /* control input (from below) */ pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* user-protocol hook */ - void *pr_ousrreq; + pr_usrreq_t *pr_ousrreq; /* utility hooks */ pr_init_t *pr_init; pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ --------------8E304995AC7CC80311DE7C03-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message