Uniformized pr_ctlinput protosw functions. The third arg is now `void

*' instead of caddr_t and it isn't optional (it never was).  Most of the
netipx (and netns) pr_ctlinput functions abuse the second arg instead of
using the third arg but fixing this is beyond the scope of this round
of changes.
This commit is contained in:
Bruce Evans 1995-12-16 02:14:44 +00:00
parent a5db65d39f
commit b62d102cbb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12881
16 changed files with 52 additions and 40 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
* $Id: uipc_domain.c,v 1.10 1995/11/16 18:59:50 phk Exp $
* $Id: uipc_domain.c,v 1.11 1995/12/02 17:10:38 bde Exp $
*/
#include <sys/param.h>
@ -198,7 +198,7 @@ pfctlinput(cmd, sa)
for (dp = domains; dp; dp = dp->dom_next)
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_ctlinput)
(*pr->pr_ctlinput)(cmd, sa, (caddr_t)0);
(*pr->pr_ctlinput)(cmd, sa, (void *)0);
}
static void

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)raw_cb.h 8.1 (Berkeley) 6/10/93
* $Id: raw_cb.h,v 1.3 1994/08/21 05:11:46 paul Exp $
* $Id: raw_cb.h,v 1.4 1995/07/29 11:41:00 bde Exp $
*/
#ifndef _NET_RAW_CB_H_
@ -62,7 +62,7 @@ struct rawcb {
extern struct rawcb rawcb; /* head of list */
int raw_attach __P((struct socket *, int));
void raw_ctlinput __P((int, struct sockaddr *));
void raw_ctlinput __P((int, struct sockaddr *, void *));
void raw_detach __P((struct rawcb *));
void raw_disconnect __P((struct rawcb *));
void raw_init __P((void));

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93
* $Id: raw_usrreq.c,v 1.5 1995/02/16 01:11:38 wollman Exp $
* $Id: raw_usrreq.c,v 1.6 1995/05/30 08:08:22 rgrimes Exp $
*/
#include <sys/param.h>
@ -129,9 +129,10 @@ raw_input(m0, proto, src, dst)
/*ARGSUSED*/
void
raw_ctlinput(cmd, arg)
raw_ctlinput(cmd, arg, dummy)
int cmd;
struct sockaddr *arg;
void *dummy;
{
if (cmd < 0 || cmd > PRC_NCMDS)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
* $Id: ip_icmp.c,v 1.15 1995/12/08 16:46:06 wollman Exp $
* $Id: ip_icmp.c,v 1.16 1995/12/14 09:53:40 phk Exp $
*/
#include <sys/param.h>
@ -194,7 +194,7 @@ icmp_input(m, hlen)
int icmplen = ip->ip_len;
register int i;
struct in_ifaddr *ia;
void (*ctlfunc) __P((int, struct sockaddr *, caddr_t));
void (*ctlfunc) __P((int, struct sockaddr *, void *));
int code;
/*
@ -357,7 +357,7 @@ icmp_input(m, hlen)
ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
if (ctlfunc)
(*ctlfunc)(code, (struct sockaddr *)&icmpsrc,
(caddr_t)&icp->icmp_ip);
(void *)&icp->icmp_ip);
break;
badcode:

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
* $Id: tcp_subr.c,v 1.22 1995/11/14 20:34:41 phk Exp $
* $Id: tcp_subr.c,v 1.23 1995/12/05 17:46:43 wollman Exp $
*/
#include <sys/param.h>
@ -444,11 +444,12 @@ tcp_notify(inp, error)
}
void
tcp_ctlinput(cmd, sa, ip)
tcp_ctlinput(cmd, sa, vip)
int cmd;
struct sockaddr *sa;
register struct ip *ip;
void *vip;
{
register struct ip *ip = vip;
register struct tcphdr *th;
void (*notify) __P((struct inpcb *, int)) = tcp_notify;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
* $Id: tcp_subr.c,v 1.22 1995/11/14 20:34:41 phk Exp $
* $Id: tcp_subr.c,v 1.23 1995/12/05 17:46:43 wollman Exp $
*/
#include <sys/param.h>
@ -444,11 +444,12 @@ tcp_notify(inp, error)
}
void
tcp_ctlinput(cmd, sa, ip)
tcp_ctlinput(cmd, sa, vip)
int cmd;
struct sockaddr *sa;
register struct ip *ip;
void *vip;
{
register struct ip *ip = vip;
register struct tcphdr *th;
void (*notify) __P((struct inpcb *, int)) = tcp_notify;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
* $Id: tcp_var.h,v 1.23 1995/11/14 20:34:50 phk Exp $
* $Id: tcp_var.h,v 1.24 1995/12/05 17:46:50 wollman Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@ -332,7 +332,7 @@ extern u_short tcp_lastport; /* last assigned port */
void tcp_canceltimers __P((struct tcpcb *));
struct tcpcb *
tcp_close __P((struct tcpcb *));
void tcp_ctlinput __P((int, struct sockaddr *, struct ip *));
void tcp_ctlinput __P((int, struct sockaddr *, void *));
int tcp_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
struct tcpcb *
tcp_drop __P((struct tcpcb *, int));

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
* $Id: udp_usrreq.c,v 1.17 1995/12/06 23:37:44 bde Exp $
* $Id: udp_usrreq.c,v 1.18 1995/12/14 09:53:49 phk Exp $
*/
#include <sys/param.h>
@ -373,11 +373,12 @@ udp_notify(inp, errno)
}
void
udp_ctlinput(cmd, sa, ip)
udp_ctlinput(cmd, sa, vip)
int cmd;
struct sockaddr *sa;
register struct ip *ip;
void *vip;
{
register struct ip *ip = vip;
register struct udphdr *uh;
if (!PRC_IS_REDIRECT(cmd) &&

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_var.h 8.1 (Berkeley) 6/10/93
* $Id: udp_var.h,v 1.6 1995/11/14 20:34:56 phk Exp $
* $Id: udp_var.h,v 1.7 1995/11/16 09:51:07 bde Exp $
*/
#ifndef _NETINET_UDP_VAR_H_
@ -92,7 +92,7 @@ extern struct inpcbhead udb;
extern struct inpcbinfo udbinfo;
extern struct udpstat udpstat;
void udp_ctlinput __P((int, struct sockaddr *, struct ip *));
void udp_ctlinput __P((int, struct sockaddr *, void *));
void udp_init __P((void));
void udp_input __P((struct mbuf *, int));
int udp_usrreq __P((struct socket *,

View File

@ -33,7 +33,7 @@
*
* @(#)ipx.h
*
* $Id: ipx.h,v 1.4 1995/11/04 09:02:37 julian Exp $
* $Id: ipx.h,v 1.5 1995/11/24 12:25:02 bde Exp $
*/
#ifndef _NETIPX_IPX_H_
@ -174,12 +174,13 @@ extern u_char ipxctlerrmap[];
extern struct ipxpcb ipxrawpcb;
struct route;
struct sockaddr;
struct socket;
void ipx_abort __P((struct ipxpcb *ipxp));
u_short ipx_cksum __P((struct mbuf *m, int len));
int ipx_control __P((struct socket *so, int cmd, caddr_t data,
struct ifnet *ifp));
void ipx_ctlinput __P((int cmd, caddr_t arg));
void ipx_ctlinput __P((int cmd, struct sockaddr *arg_as_sa, void *dummy));
int ipx_ctloutput __P((int req, struct socket *so, int level, int name,
struct mbuf **value));
int ipx_do_route __P((struct ipx_addr *src, struct route *ro));

View File

@ -33,7 +33,7 @@
*
* @(#)ipx_error.c
*
* $Id: ipx_error.c,v 1.2 1995/10/31 23:36:22 julian Exp $
* $Id: ipx_error.c,v 1.3 1995/11/04 09:02:43 julian Exp $
*/
#include <sys/param.h>
@ -312,11 +312,13 @@ ipx_err_input(m)
switch(ep->ipx_err_ipx.ipx_pt) {
case IPXPROTO_SPX:
spx_ctlinput(code, (caddr_t)ep);
spx_ctlinput(code, (/* XXX */ struct sockaddr *)ep,
(void *)NULL);
break;
default:
ipx_ctlinput(code, (caddr_t)ep);
ipx_ctlinput(code, (/* XXX */ struct sockaddr *)ep,
(void *)NULL);
}
goto freeit;

View File

@ -33,7 +33,7 @@
*
* @(#)ipx_input.c
*
* $Id: ipx_input.c,v 1.4 1995/11/04 09:02:54 julian Exp $
* $Id: ipx_input.c,v 1.5 1995/11/24 11:43:52 bde Exp $
*/
#include <sys/param.h>
@ -280,10 +280,12 @@ u_char ipxctlerrmap[PRC_NCMDS] = {
};
void
ipx_ctlinput(cmd, arg)
ipx_ctlinput(cmd, arg_as_sa, dummy)
int cmd;
caddr_t arg;
struct sockaddr *arg_as_sa; /* XXX should be swapped with dummy */
void *dummy;
{
caddr_t arg = (/* XXX */ caddr_t)arg_as_sa;
struct ipx_addr *ipx;
struct ipxpcb *ipxp;
struct ipx_errp *errp;

View File

@ -33,7 +33,7 @@
*
* @(#)ipx_ip.c
*
* $Id: ipx_ip.c,v 1.4 1995/11/04 09:02:58 julian Exp $
* $Id: ipx_ip.c,v 1.5 1995/11/24 12:07:33 bde Exp $
*/
/*
@ -394,9 +394,10 @@ struct ifnet *ifp;
}
void
ipxip_ctlinput(cmd, sa)
ipxip_ctlinput(cmd, sa, dummy)
int cmd;
struct sockaddr *sa;
void *dummy;
{
/*extern u_char inetctlerrmap[]; */ /*XXX*/ /*JRE*/
struct sockaddr_in *sin;

View File

@ -33,7 +33,7 @@
*
* @(#)spx.h
*
* $Id: spx.h,v 1.4 1995/11/04 09:03:29 julian Exp $
* $Id: spx.h,v 1.5 1995/11/24 12:25:11 bde Exp $
*/
#ifndef _NETIPX_SPX_H_
@ -172,7 +172,7 @@ struct spxpcb {
void spx_abort __P((struct ipxpcb *ipxp));
struct spxpcb *
spx_close __P((struct spxpcb *cb));
void spx_ctlinput __P((int cmd, caddr_t arg));
void spx_ctlinput __P((int cmd, struct sockaddr *arg_as_sa, void *dummy));
int spx_ctloutput __P((int req, struct socket *so, int level, int name,
struct mbuf **value));
struct spxpcb *

View File

@ -33,7 +33,7 @@
*
* @(#)spx_usrreq.h
*
* $Id: spx_usrreq.c,v 1.5 1995/11/24 11:43:55 bde Exp $
* $Id: spx_usrreq.c,v 1.6 1995/11/24 12:01:08 bde Exp $
*/
#include <sys/param.h>
@ -585,10 +585,12 @@ register struct spx *si;
}
void
spx_ctlinput(cmd, arg)
spx_ctlinput(cmd, arg_as_sa, dummy)
int cmd;
caddr_t arg;
struct sockaddr *arg_as_sa; /* XXX should be swapped with dummy */
void *dummy;
{
caddr_t arg = (/* XXX */ caddr_t)arg_as_sa;
struct ipx_addr *na;
struct ipx_errp *errp = (struct ipx_errp *)arg;
struct ipxpcb *ipxp;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)protosw.h 8.1 (Berkeley) 6/2/93
* $Id: protosw.h,v 1.7 1995/11/20 12:27:00 phk Exp $
* $Id: protosw.h,v 1.8 1995/11/21 12:55:13 bde Exp $
*/
#ifndef _SYS_PROTOSW_H_
@ -74,7 +74,7 @@ struct protosw {
/* input to protocol (from below) */
int (*pr_output) __P((struct mbuf *m, struct socket *so));
/* output to protocol (from above) */
void (*pr_ctlinput)__P((int, struct sockaddr *, caddr_t));
void (*pr_ctlinput)__P((int, struct sockaddr *, void *));
/* control input (from below) */
int (*pr_ctloutput)__P((int, struct socket *, int, int,
struct mbuf **));
@ -166,7 +166,7 @@ char *prurequests[] = {
* The arguments to the ctlinput routine are
* (*protosw[].pr_ctlinput)(cmd, sa, arg);
* where cmd is one of the commands below, sa is a pointer to a sockaddr,
* and arg is an optional caddr_t argument used within a protocol family.
* and arg is a `void *' argument used within a protocol family.
*/
#define PRC_IFDOWN 0 /* interface transition */
#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */