Add struct pr_usrreqs with a pr_generic function and prepare for the
dismantling of pr_usrreq in the protocols; no functional change intended. PRU_ATTACH/PRU_DETACH changes will follow soon. Bump for struct protosw. Welcome to 6.99.62!
This commit is contained in:
parent
9cf83d0317
commit
39bd8dee77
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_43.c,v 1.4 2011/01/19 10:21:16 tsutsui Exp $ */
|
||||
/* $NetBSD: if_43.c,v 1.5 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1990, 1993
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.4 2011/01/19 10:21:16 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.5 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -256,7 +256,7 @@ compat_ifioctl(struct socket *so, u_long ocmd, u_long cmd, void *data,
|
||||
cmd = SIOCGIFNETMASK;
|
||||
}
|
||||
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_CONTROL,
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so, PRU_CONTROL,
|
||||
(struct mbuf *)cmd, (struct mbuf *)ifr, (struct mbuf *)ifp, l);
|
||||
|
||||
switch (ocmd) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kttcp.c,v 1.32 2014/03/16 05:20:26 dholland Exp $ */
|
||||
/* $NetBSD: kttcp.c,v 1.33 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Wasabi Systems, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kttcp.c,v 1.32 2014/03/16 05:20:26 dholland Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kttcp.c,v 1.33 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
@ -319,7 +319,7 @@ nopages:
|
||||
so->so_options |= SO_DONTROUTE;
|
||||
if (resid > 0)
|
||||
so->so_state |= SS_MORETOCOME;
|
||||
error = (*so->so_proto->pr_usrreq)(so,
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
(flags & MSG_OOB) ? PRU_SENDOOB : PRU_SEND,
|
||||
top, NULL, NULL, l);
|
||||
if (dontroute)
|
||||
@ -367,7 +367,7 @@ kttcp_soreceive(struct socket *so, unsigned long long slen,
|
||||
if (flags & MSG_OOB) {
|
||||
m = m_get(M_WAIT, MT_DATA);
|
||||
solock(so);
|
||||
error = (*pr->pr_usrreq)(so, PRU_RCVOOB, m,
|
||||
error = (*pr->pr_usrreqs->pr_generic)(so, PRU_RCVOOB, m,
|
||||
(struct mbuf *)(long)(flags & MSG_PEEK), NULL, NULL);
|
||||
sounlock(so);
|
||||
if (error)
|
||||
@ -631,9 +631,10 @@ kttcp_soreceive(struct socket *so, unsigned long long slen,
|
||||
* protocol in case it needs to do something to
|
||||
* get it filled again.
|
||||
*/
|
||||
if ((pr->pr_flags & PR_WANTRCVD) && so->so_pcb)
|
||||
(*pr->pr_usrreq)(so, PRU_RCVD, NULL,
|
||||
if ((pr->pr_flags & PR_WANTRCVD) && so->so_pcb) {
|
||||
(*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD, NULL,
|
||||
(struct mbuf *)(long)flags, NULL, NULL);
|
||||
}
|
||||
SBLASTRECORDCHK(&so->so_rcv,
|
||||
"kttcp_soreceive sbwait 2");
|
||||
SBLASTMBUFCHK(&so->so_rcv,
|
||||
@ -670,9 +671,10 @@ kttcp_soreceive(struct socket *so, unsigned long long slen,
|
||||
}
|
||||
SBLASTRECORDCHK(&so->so_rcv, "kttcp_soreceive 4");
|
||||
SBLASTMBUFCHK(&so->so_rcv, "kttcp_soreceive 4");
|
||||
if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
|
||||
(*pr->pr_usrreq)(so, PRU_RCVD, NULL,
|
||||
if (pr->pr_flags & PR_WANTRCVD && so->so_pcb) {
|
||||
(*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD, NULL,
|
||||
(struct mbuf *)(long)flags, NULL, NULL);
|
||||
}
|
||||
}
|
||||
if (orig_resid == resid && orig_resid &&
|
||||
(flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sys_socket.c,v 1.67 2014/04/26 11:16:22 pooka Exp $ */
|
||||
/* $NetBSD: sys_socket.c,v 1.68 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.67 2014/04/26 11:16:22 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.68 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -201,9 +201,9 @@ soo_ioctl(file_t *fp, u_long cmd, void *data)
|
||||
if (IOCGROUP(cmd) == 'i')
|
||||
error = ifioctl(so, cmd, data, curlwp);
|
||||
else {
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_CONTROL,
|
||||
(struct mbuf *)cmd, (struct mbuf *)data, NULL,
|
||||
curlwp);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_CONTROL, (struct mbuf *)cmd,
|
||||
(struct mbuf *)data, NULL, curlwp);
|
||||
}
|
||||
KERNEL_UNLOCK_ONE(NULL);
|
||||
break;
|
||||
@ -240,7 +240,7 @@ soo_stat(file_t *fp, struct stat *ub)
|
||||
ub->st_mode = S_IFSOCK;
|
||||
|
||||
solock(so);
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_SENSE,
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so, PRU_SENSE,
|
||||
(struct mbuf *)ub, NULL, NULL, curlwp);
|
||||
sounlock(so);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uipc_proto.c,v 1.22 2011/05/29 03:32:46 manu Exp $ */
|
||||
/* $NetBSD: uipc_proto.c,v 1.23 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_proto.c,v 1.22 2011/05/29 03:32:46 manu Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_proto.c,v 1.23 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
@ -57,25 +57,22 @@ const struct protosw unixsw[] = {
|
||||
.pr_domain = &unixdomain,
|
||||
.pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS|PR_LISTEN,
|
||||
.pr_ctloutput = uipc_ctloutput,
|
||||
.pr_usrreq = uipc_usrreq,
|
||||
}, {
|
||||
.pr_usrreqs = &unp_usrreqs,
|
||||
},
|
||||
{
|
||||
.pr_type = SOCK_DGRAM,
|
||||
.pr_domain = &unixdomain,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS,
|
||||
.pr_ctloutput = uipc_ctloutput,
|
||||
.pr_usrreq = uipc_usrreq,
|
||||
}, {
|
||||
.pr_usrreqs = &unp_usrreqs,
|
||||
},
|
||||
{
|
||||
.pr_type = SOCK_SEQPACKET,
|
||||
.pr_domain = &unixdomain,
|
||||
.pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS|PR_LISTEN|
|
||||
PR_ATOMIC,
|
||||
.pr_ctloutput = uipc_ctloutput,
|
||||
.pr_usrreq = uipc_usrreq,
|
||||
}, {
|
||||
.pr_input = raw_input,
|
||||
.pr_ctlinput = raw_ctlinput,
|
||||
.pr_usrreq = raw_usrreq,
|
||||
.pr_init = raw_init,
|
||||
.pr_usrreqs = &unp_usrreqs,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uipc_socket.c,v 1.222 2014/05/17 23:27:59 rmind Exp $ */
|
||||
/* $NetBSD: uipc_socket.c,v 1.223 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.222 2014/05/17 23:27:59 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.223 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
#include "opt_sock_counters.h"
|
||||
@ -520,7 +520,7 @@ socreate(int dom, struct socket **aso, int type, int proto, struct lwp *l,
|
||||
return EPROTOTYPE;
|
||||
return EPROTONOSUPPORT;
|
||||
}
|
||||
if (prp->pr_usrreq == NULL)
|
||||
if (prp->pr_usrreqs == NULL)
|
||||
return EPROTONOSUPPORT;
|
||||
if (prp->pr_type != type)
|
||||
return EPROTOTYPE;
|
||||
@ -548,7 +548,7 @@ socreate(int dom, struct socket **aso, int type, int proto, struct lwp *l,
|
||||
} else {
|
||||
/* Lock assigned and taken during PRU_ATTACH. */
|
||||
}
|
||||
error = (*prp->pr_usrreq)(so, PRU_ATTACH, NULL,
|
||||
error = (*prp->pr_usrreqs->pr_generic)(so, PRU_ATTACH, NULL,
|
||||
(struct mbuf *)(long)proto, NULL, l);
|
||||
KASSERT(solocked(so));
|
||||
if (error != 0) {
|
||||
@ -625,7 +625,8 @@ sobind(struct socket *so, struct mbuf *nam, struct lwp *l)
|
||||
int error;
|
||||
|
||||
solock(so);
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_BIND, NULL, nam, NULL, l);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_BIND, NULL, nam, NULL, l);
|
||||
sounlock(so);
|
||||
return error;
|
||||
}
|
||||
@ -641,8 +642,8 @@ solisten(struct socket *so, int backlog, struct lwp *l)
|
||||
sounlock(so);
|
||||
return EINVAL;
|
||||
}
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL,
|
||||
NULL, NULL, l);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_LISTEN, NULL, NULL, NULL, l);
|
||||
if (error != 0) {
|
||||
sounlock(so);
|
||||
return error;
|
||||
@ -751,8 +752,8 @@ soclose(struct socket *so)
|
||||
}
|
||||
drop:
|
||||
if (so->so_pcb) {
|
||||
int error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH,
|
||||
NULL, NULL, NULL, NULL);
|
||||
int error2 = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_DETACH, NULL, NULL, NULL, NULL);
|
||||
if (error == 0)
|
||||
error = error2;
|
||||
}
|
||||
@ -777,8 +778,8 @@ soabort(struct socket *so)
|
||||
KASSERT(so->so_head == NULL);
|
||||
|
||||
so->so_aborting++; /* XXX */
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_ABORT, NULL,
|
||||
NULL, NULL, NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_ABORT, NULL, NULL, NULL, NULL);
|
||||
refs = --so->so_aborting; /* XXX */
|
||||
if (error || (refs == 0)) {
|
||||
sofree(so);
|
||||
@ -799,8 +800,8 @@ soaccept(struct socket *so, struct mbuf *nam)
|
||||
so->so_state &= ~SS_NOFDREF;
|
||||
if ((so->so_state & SS_ISDISCONNECTED) == 0 ||
|
||||
(so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0)
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT,
|
||||
NULL, nam, NULL, NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_ACCEPT, NULL, nam, NULL, NULL);
|
||||
else
|
||||
error = ECONNABORTED;
|
||||
|
||||
@ -827,8 +828,8 @@ soconnect(struct socket *so, struct mbuf *nam, struct lwp *l)
|
||||
(error = sodisconnect(so))))
|
||||
error = EISCONN;
|
||||
else
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_CONNECT,
|
||||
NULL, nam, NULL, l);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_CONNECT, NULL, nam, NULL, l);
|
||||
|
||||
return error;
|
||||
}
|
||||
@ -838,8 +839,8 @@ soconnect2(struct socket *so1, struct socket *so2)
|
||||
{
|
||||
KASSERT(solocked2(so1, so2));
|
||||
|
||||
return (*so1->so_proto->pr_usrreq)(so1, PRU_CONNECT2,
|
||||
NULL, (struct mbuf *)so2, NULL, NULL);
|
||||
return (*so1->so_proto->pr_usrreqs->pr_generic)(so1,
|
||||
PRU_CONNECT2, NULL, (struct mbuf *)so2, NULL, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
@ -854,8 +855,8 @@ sodisconnect(struct socket *so)
|
||||
} else if (so->so_state & SS_ISDISCONNECTING) {
|
||||
error = EALREADY;
|
||||
} else {
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_DISCONNECT,
|
||||
NULL, NULL, NULL, NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_DISCONNECT, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -1051,7 +1052,7 @@ sosend(struct socket *so, struct mbuf *addr, struct uio *uio, struct mbuf *top,
|
||||
so->so_options |= SO_DONTROUTE;
|
||||
if (resid > 0)
|
||||
so->so_state |= SS_MORETOCOME;
|
||||
error = (*so->so_proto->pr_usrreq)(so,
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
(flags & MSG_OOB) ? PRU_SENDOOB : PRU_SEND,
|
||||
top, addr, control, curlwp);
|
||||
if (dontroute)
|
||||
@ -1165,7 +1166,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio,
|
||||
if (flags & MSG_OOB) {
|
||||
m = m_get(M_WAIT, MT_DATA);
|
||||
solock(so);
|
||||
error = (*pr->pr_usrreq)(so, PRU_RCVOOB, m,
|
||||
error = (*pr->pr_usrreqs->pr_generic)(so, PRU_RCVOOB, m,
|
||||
(struct mbuf *)(long)(flags & MSG_PEEK), NULL, l);
|
||||
sounlock(so);
|
||||
if (error)
|
||||
@ -1533,7 +1534,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio,
|
||||
* get it filled again.
|
||||
*/
|
||||
if ((pr->pr_flags & PR_WANTRCVD) && so->so_pcb)
|
||||
(*pr->pr_usrreq)(so, PRU_RCVD,
|
||||
(*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD,
|
||||
NULL, (struct mbuf *)(long)flags, NULL, l);
|
||||
SBLASTRECORDCHK(&so->so_rcv, "soreceive sbwait 2");
|
||||
SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 2");
|
||||
@ -1575,7 +1576,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio,
|
||||
SBLASTRECORDCHK(&so->so_rcv, "soreceive 4");
|
||||
SBLASTMBUFCHK(&so->so_rcv, "soreceive 4");
|
||||
if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
|
||||
(*pr->pr_usrreq)(so, PRU_RCVD, NULL,
|
||||
(*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD, NULL,
|
||||
(struct mbuf *)(long)flags, NULL, l);
|
||||
}
|
||||
if (orig_resid == uio->uio_resid && orig_resid &&
|
||||
@ -1610,8 +1611,8 @@ soshutdown(struct socket *so, int how)
|
||||
error = 0;
|
||||
}
|
||||
if (how == SHUT_WR || how == SHUT_RDWR)
|
||||
error = (*pr->pr_usrreq)(so, PRU_SHUTDOWN, NULL,
|
||||
NULL, NULL, NULL);
|
||||
error = (*pr->pr_usrreqs->pr_generic)(so,
|
||||
PRU_SHUTDOWN, NULL, NULL, NULL, NULL);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uipc_socket2.c,v 1.117 2014/05/17 23:55:24 rmind Exp $ */
|
||||
/* $NetBSD: uipc_socket2.c,v 1.118 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
@ -58,7 +58,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.117 2014/05/17 23:55:24 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.118 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include "opt_mbuftrace.h"
|
||||
#include "opt_sb_max.h"
|
||||
@ -303,8 +303,8 @@ sonewconn(struct socket *head, bool soready)
|
||||
mutex_obj_hold(head->so_lock);
|
||||
so->so_lock = head->so_lock;
|
||||
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_ATTACH, NULL, NULL,
|
||||
NULL, NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_ATTACH, NULL, NULL, NULL, NULL);
|
||||
KASSERT(solocked(so));
|
||||
if (error) {
|
||||
out:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uipc_syscalls.c,v 1.169 2014/05/17 23:27:59 rmind Exp $ */
|
||||
/* $NetBSD: uipc_syscalls.c,v 1.170 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.169 2014/05/17 23:27:59 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.170 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include "opt_pipe.h"
|
||||
|
||||
@ -1316,8 +1316,8 @@ do_sys_getsockname(struct lwp *l, int fd, int which, struct mbuf **nam)
|
||||
error = ENOTCONN;
|
||||
} else {
|
||||
*nam = m;
|
||||
error = (*so->so_proto->pr_usrreq)(so, which, NULL, m, NULL,
|
||||
NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
which, NULL, m, NULL, NULL);
|
||||
}
|
||||
sounlock(so);
|
||||
if (error != 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uipc_usrreq.c,v 1.150 2014/01/23 10:13:56 hannken Exp $ */
|
||||
/* $NetBSD: uipc_usrreq.c,v 1.151 2014/05/18 14:46:15 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
@ -96,7 +96,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.150 2014/01/23 10:13:56 hannken Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.151 2014/05/18 14:46:15 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -362,10 +362,9 @@ unp_setaddr(struct socket *so, struct mbuf *nam, bool peeraddr)
|
||||
}
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
uipc_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
static int
|
||||
unp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
{
|
||||
struct unpcb *unp = sotounpcb(so);
|
||||
struct socket *so2;
|
||||
@ -1829,3 +1828,7 @@ unp_discard_later(file_t *fp)
|
||||
}
|
||||
mutex_exit(&filelist_lock);
|
||||
}
|
||||
|
||||
const struct pr_usrreqs unp_usrreqs = {
|
||||
.pr_generic = unp_usrreq,
|
||||
};
|
||||
|
19
sys/net/if.c
19
sys/net/if.c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if.c,v 1.274 2014/05/18 00:33:20 rmind Exp $ */
|
||||
/* $NetBSD: if.c,v 1.275 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
|
||||
@ -90,7 +90,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.274 2014/05/18 00:33:20 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.275 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
@ -785,8 +785,8 @@ again:
|
||||
for (pr = dp->dom_protosw;
|
||||
pr < dp->dom_protoswNPROTOSW; pr++) {
|
||||
so.so_proto = pr;
|
||||
if (pr->pr_usrreq != NULL) {
|
||||
(void) (*pr->pr_usrreq)(&so,
|
||||
if (pr->pr_usrreqs) {
|
||||
(void) (*pr->pr_usrreqs->pr_generic)(&so,
|
||||
PRU_PURGEIF, NULL, NULL,
|
||||
(struct mbuf *) ifp, curlwp);
|
||||
purged = 1;
|
||||
@ -837,9 +837,10 @@ again:
|
||||
*/
|
||||
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
|
||||
so.so_proto = pr;
|
||||
if (pr->pr_usrreq != NULL && pr->pr_flags & PR_PURGEIF)
|
||||
(void)(*pr->pr_usrreq)(&so, PRU_PURGEIF, NULL,
|
||||
NULL, (struct mbuf *)ifp, curlwp);
|
||||
if (pr->pr_usrreqs && pr->pr_flags & PR_PURGEIF)
|
||||
(void)(*pr->pr_usrreqs->pr_generic)(&so,
|
||||
PRU_PURGEIF, NULL, NULL,
|
||||
(struct mbuf *)ifp, curlwp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1910,8 +1911,8 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
|
||||
#ifdef COMPAT_OSOCK
|
||||
error = compat_ifioctl(so, ocmd, cmd, data, l);
|
||||
#else
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_CONTROL,
|
||||
(struct mbuf *)cmd, (struct mbuf *)data,
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_CONTROL, (struct mbuf *)cmd, (struct mbuf *)data,
|
||||
(struct mbuf *)ifp, l);
|
||||
#endif
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_gre.c,v 1.154 2014/05/17 23:27:59 rmind Exp $ */
|
||||
/* $NetBSD: if_gre.c,v 1.155 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
|
||||
@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.154 2014/05/17 23:27:59 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.155 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_atalk.h"
|
||||
#include "opt_gre.h"
|
||||
@ -528,7 +528,8 @@ gre_sosend(struct socket *so, struct mbuf *top)
|
||||
*/
|
||||
if (so->so_state & SS_CANTSENDMORE)
|
||||
snderr(EPIPE);
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, top, NULL, NULL, l);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_SEND, top, NULL, NULL, l);
|
||||
top = NULL;
|
||||
release:
|
||||
sbunlock(&so->so_snd);
|
||||
@ -723,7 +724,7 @@ gre_soreceive(struct socket *so, struct mbuf **mp0)
|
||||
SBLASTRECORDCHK(&so->so_rcv, "soreceive 4");
|
||||
SBLASTMBUFCHK(&so->so_rcv, "soreceive 4");
|
||||
if (pr->pr_flags & PR_WANTRCVD && so->so_pcb)
|
||||
(*pr->pr_usrreq)(so, PRU_RCVD, NULL,
|
||||
(*pr->pr_usrreqs->pr_generic)(so, PRU_RCVD, NULL,
|
||||
(struct mbuf *)(long)flags, NULL, curlwp);
|
||||
if (*mp0 == NULL && (flags & MSG_EOR) == 0 &&
|
||||
(so->so_state & SS_CANTRCVMORE) == 0) {
|
||||
@ -964,7 +965,8 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
static int
|
||||
gre_getname(struct socket *so, int req, struct mbuf *nam, struct lwp *l)
|
||||
{
|
||||
return (*so->so_proto->pr_usrreq)(so, req, NULL, nam, NULL, l);
|
||||
return (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
req, NULL, nam, NULL, l);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_stf.c,v 1.77 2011/10/28 20:13:32 dyoung Exp $ */
|
||||
/* $NetBSD: if_stf.c,v 1.78 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -75,7 +75,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.77 2011/10/28 20:13:32 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.78 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
@ -149,11 +149,18 @@ static int ip_gif_ttl = 40; /*XXX*/
|
||||
#endif
|
||||
|
||||
extern struct domain inetdomain;
|
||||
|
||||
static const struct protosw in_stf_protosw =
|
||||
{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
|
||||
in_stf_input, rip_output, 0, rip_ctloutput,
|
||||
rip_usrreq,
|
||||
0, 0, 0, 0
|
||||
{
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &inetdomain,
|
||||
.pr_protocol = IPPROTO_IPV6,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_input = in_stf_input,
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = NULL,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
};
|
||||
|
||||
void stfattach(int);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: link_proto.c,v 1.7 2011/10/07 16:34:31 dyoung Exp $ */
|
||||
/* $NetBSD: link_proto.c,v 1.8 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.7 2011/10/07 16:34:31 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.8 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
@ -58,6 +58,10 @@ static void link_init(void);
|
||||
|
||||
DOMAIN_DEFINE(linkdomain); /* forward define and add to link set */
|
||||
|
||||
static const struct pr_usrreqs link_usrreqs = {
|
||||
.pr_generic = link_usrreq,
|
||||
};
|
||||
|
||||
const struct protosw linksw[] = {
|
||||
{ .pr_type = SOCK_DGRAM,
|
||||
.pr_domain = &linkdomain,
|
||||
@ -66,7 +70,7 @@ const struct protosw linksw[] = {
|
||||
.pr_input = NULL,
|
||||
.pr_ctlinput = NULL,
|
||||
.pr_ctloutput = NULL,
|
||||
.pr_usrreq = link_usrreq,
|
||||
.pr_usrreqs = &link_usrreqs,
|
||||
.pr_init = link_init,
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: raw_usrreq.c,v 1.37 2011/07/17 20:54:52 joerg Exp $ */
|
||||
/* $NetBSD: raw_usrreq.c,v 1.38 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.37 2011/07/17 20:54:52 joerg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.38 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mbuf.h>
|
||||
@ -252,8 +252,8 @@ raw_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
error = EISCONN;
|
||||
goto die;
|
||||
}
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_CONNECT,
|
||||
NULL, nam, NULL, l);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_CONNECT, NULL, nam, NULL, l);
|
||||
if (error) {
|
||||
die:
|
||||
m_freem(m);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rtsock.c,v 1.143 2014/02/25 18:30:12 pooka Exp $ */
|
||||
/* $NetBSD: rtsock.c,v 1.144 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.143 2014/02/25 18:30:12 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.144 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
@ -1311,6 +1311,10 @@ PR_WRAP_USRREQ(route_usrreq);
|
||||
PR_WRAP_USRREQ(compat_50_route_usrreq);
|
||||
#endif
|
||||
|
||||
static const struct pr_usrreqs route_usrreqs = {
|
||||
.pr_generic = COMPATNAME(route_usrreq_wrapper),
|
||||
};
|
||||
|
||||
static const struct protosw COMPATNAME(route_protosw)[] = {
|
||||
{
|
||||
.pr_type = SOCK_RAW,
|
||||
@ -1319,7 +1323,7 @@ static const struct protosw COMPATNAME(route_protosw)[] = {
|
||||
.pr_input = raw_input,
|
||||
.pr_output = COMPATNAME(route_output),
|
||||
.pr_ctlinput = raw_ctlinput,
|
||||
.pr_usrreq = COMPATNAME(route_usrreq_wrapper),
|
||||
.pr_usrreqs = &route_usrreqs,
|
||||
.pr_init = raw_init,
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: at_extern.h,v 1.16 2007/12/05 23:47:18 dyoung Exp $ */
|
||||
/* $NetBSD: at_extern.h,v 1.17 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990,1994 Regents of The University of Michigan.
|
||||
@ -41,6 +41,8 @@ struct socket;
|
||||
extern struct mowner atalk_rx_mowner;
|
||||
extern struct mowner atalk_tx_mowner;
|
||||
|
||||
extern const struct pr_usrreqs ddp_usrreqs;
|
||||
|
||||
void atintr(void);
|
||||
void aarpprobe(void *);
|
||||
int aarpresolve(struct ifnet *, struct mbuf *, const struct sockaddr_at *,
|
||||
@ -54,8 +56,6 @@ void at_purgeaddr(struct ifaddr *);
|
||||
void at_purgeif(struct ifnet *);
|
||||
u_int16_t
|
||||
at_cksum(struct mbuf *, int);
|
||||
int ddp_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
|
||||
struct mbuf *, struct lwp *);
|
||||
void ddp_init(void);
|
||||
struct ifaddr *
|
||||
at_ifawithnet(const struct sockaddr_at *, struct ifnet *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: at_proto.c,v 1.17 2011/03/31 19:40:52 dyoung Exp $ */
|
||||
/* $NetBSD: at_proto.c,v 1.18 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990,1991 Regents of The University of Michigan.
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: at_proto.c,v 1.17 2011/03/31 19:40:52 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: at_proto.c,v 1.18 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -37,7 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: at_proto.c,v 1.17 2011/03/31 19:40:52 dyoung Exp $")
|
||||
|
||||
#include <sys/kernel.h>
|
||||
#include <net/if.h>
|
||||
#include <net/radix.h>
|
||||
#include <net/if_ether.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/route.h>
|
||||
@ -50,9 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: at_proto.c,v 1.17 2011/03/31 19:40:52 dyoung Exp $")
|
||||
|
||||
DOMAIN_DEFINE(atalkdomain); /* forward declare and add to link set */
|
||||
|
||||
PR_WRAP_USRREQ(ddp_usrreq)
|
||||
#define ddp_usrreq ddp_usrreq_wrapper
|
||||
|
||||
const struct protosw atalksw[] = {
|
||||
{
|
||||
.pr_type = SOCK_DGRAM,
|
||||
@ -60,7 +56,7 @@ const struct protosw atalksw[] = {
|
||||
.pr_protocol = ATPROTO_DDP,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_output = ddp_output,
|
||||
.pr_usrreq = ddp_usrreq,
|
||||
.pr_usrreqs = &ddp_usrreqs,
|
||||
.pr_init = ddp_init,
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ddp_usrreq.c,v 1.41 2014/02/25 18:30:12 pooka Exp $ */
|
||||
/* $NetBSD: ddp_usrreq.c,v 1.42 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990,1991 Regents of The University of Michigan.
|
||||
@ -27,14 +27,13 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.41 2014/02/25 18:30:12 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.42 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_mbuftrace.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/queue.h>
|
||||
@ -76,9 +75,9 @@ struct mowner atalk_rx_mowner = MOWNER_INIT("atalk", "rx");
|
||||
struct mowner atalk_tx_mowner = MOWNER_INIT("atalk", "tx");
|
||||
#endif
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
ddp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr, struct mbuf *rights, struct lwp *l)
|
||||
static int
|
||||
ddp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr,
|
||||
struct mbuf *rights, struct lwp *l)
|
||||
{
|
||||
struct ddpcb *ddp;
|
||||
int error = 0;
|
||||
@ -557,16 +556,13 @@ ddp_init(void)
|
||||
MOWNER_ATTACH(&aarp_mowner);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
ddp_clean(void)
|
||||
{
|
||||
struct ddpcb *ddp;
|
||||
PR_WRAP_USRREQ(ddp_usrreq)
|
||||
|
||||
for (ddp = ddpcb; ddp; ddp = ddp->ddp_next)
|
||||
at_pcbdetach(ddp->ddp_socket, ddp);
|
||||
}
|
||||
#endif
|
||||
#define ddp_usrreq ddp_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs ddp_usrreqs = {
|
||||
.pr_generic = ddp_usrreq,
|
||||
};
|
||||
|
||||
static int
|
||||
sysctl_net_atalk_ddp_stats(SYSCTLFN_ARGS)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bluetooth.h,v 1.11 2011/04/27 00:36:48 rmind Exp $ */
|
||||
/* $NetBSD: bluetooth.h,v 1.12 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Iain Hibbert.
|
||||
@ -103,6 +103,8 @@ struct sockaddr_bt {
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#include <sys/protosw.h>
|
||||
|
||||
#include <sys/mallocvar.h>
|
||||
MALLOC_DECLARE(M_BLUETOOTH);
|
||||
|
||||
@ -120,6 +122,13 @@ struct btproto {
|
||||
void (*input)(void *, struct mbuf *);
|
||||
};
|
||||
|
||||
extern const struct pr_usrreqs hci_usrreqs;
|
||||
extern const struct pr_usrreqs sco_usrreqs;
|
||||
extern const struct pr_usrreqs l2cap_usrreqs;
|
||||
extern const struct pr_usrreqs rfcomm_usrreqs;
|
||||
|
||||
extern kmutex_t *bt_lock;
|
||||
|
||||
/*
|
||||
* Debugging stuff
|
||||
*/
|
||||
@ -147,8 +156,6 @@ extern int bluetooth_debug;
|
||||
# define UNKNOWN(x) ((void)0)
|
||||
#endif /* BLUETOOTH_DEBUG */
|
||||
|
||||
extern kmutex_t *bt_lock;
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* _NETBT_BLUETOOTH_H_ */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bt_proto.c,v 1.12 2009/09/13 18:45:11 pooka Exp $ */
|
||||
/* $NetBSD: bt_proto.c,v 1.13 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Iain Hibbert.
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bt_proto.c,v 1.12 2009/09/13 18:45:11 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bt_proto.c,v 1.13 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/domain.h>
|
||||
@ -62,16 +62,6 @@ PR_WRAP_CTLOUTPUT(rfcomm_ctloutput)
|
||||
#define l2cap_ctloutput l2cap_ctloutput_wrapper
|
||||
#define rfcomm_ctloutput rfcomm_ctloutput_wrapper
|
||||
|
||||
PR_WRAP_USRREQ(hci_usrreq)
|
||||
PR_WRAP_USRREQ(sco_usrreq)
|
||||
PR_WRAP_USRREQ(l2cap_usrreq)
|
||||
PR_WRAP_USRREQ(rfcomm_usrreq)
|
||||
|
||||
#define hci_usrreq hci_usrreq_wrapper
|
||||
#define sco_usrreq sco_usrreq_wrapper
|
||||
#define l2cap_usrreq l2cap_usrreq_wrapper
|
||||
#define rfcomm_usrreq rfcomm_usrreq_wrapper
|
||||
|
||||
const struct protosw btsw[] = {
|
||||
{ /* raw HCI commands */
|
||||
.pr_type = SOCK_RAW,
|
||||
@ -80,7 +70,7 @@ const struct protosw btsw[] = {
|
||||
.pr_flags = (PR_ADDR | PR_ATOMIC),
|
||||
.pr_init = hci_init,
|
||||
.pr_ctloutput = hci_ctloutput,
|
||||
.pr_usrreq = hci_usrreq,
|
||||
.pr_usrreqs = &hci_usrreqs,
|
||||
},
|
||||
{ /* HCI SCO data (audio) */
|
||||
.pr_type = SOCK_SEQPACKET,
|
||||
@ -88,7 +78,7 @@ const struct protosw btsw[] = {
|
||||
.pr_protocol = BTPROTO_SCO,
|
||||
.pr_flags = (PR_CONNREQUIRED | PR_ATOMIC | PR_LISTEN),
|
||||
.pr_ctloutput = sco_ctloutput,
|
||||
.pr_usrreq = sco_usrreq,
|
||||
.pr_usrreqs = &sco_usrreqs,
|
||||
},
|
||||
{ /* L2CAP Connection Oriented */
|
||||
.pr_type = SOCK_SEQPACKET,
|
||||
@ -96,7 +86,7 @@ const struct protosw btsw[] = {
|
||||
.pr_protocol = BTPROTO_L2CAP,
|
||||
.pr_flags = (PR_CONNREQUIRED | PR_ATOMIC | PR_LISTEN),
|
||||
.pr_ctloutput = l2cap_ctloutput,
|
||||
.pr_usrreq = l2cap_usrreq,
|
||||
.pr_usrreqs = &l2cap_usrreqs,
|
||||
.pr_init = l2cap_init,
|
||||
},
|
||||
{ /* RFCOMM */
|
||||
@ -105,7 +95,7 @@ const struct protosw btsw[] = {
|
||||
.pr_protocol = BTPROTO_RFCOMM,
|
||||
.pr_flags = (PR_CONNREQUIRED | PR_LISTEN | PR_WANTRCVD),
|
||||
.pr_ctloutput = rfcomm_ctloutput,
|
||||
.pr_usrreq = rfcomm_usrreq,
|
||||
.pr_usrreqs = &rfcomm_usrreqs,
|
||||
.pr_init = rfcomm_init,
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hci.h,v 1.35 2011/09/17 08:23:36 plunky Exp $ */
|
||||
/* $NetBSD: hci.h,v 1.36 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Iain Hibbert.
|
||||
@ -54,7 +54,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: hci.h,v 1.35 2011/09/17 08:23:36 plunky Exp $
|
||||
* $Id: hci.h,v 1.36 2014/05/18 14:46:16 rmind Exp $
|
||||
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
|
||||
*/
|
||||
|
||||
@ -2567,7 +2567,6 @@ void hci_memo_free(struct hci_memo *);
|
||||
/* hci_socket.c */
|
||||
void hci_drop(void *);
|
||||
void hci_init(void);
|
||||
int hci_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
int hci_ctloutput(int, struct socket *, struct sockopt *);
|
||||
void hci_mtap(struct mbuf *, struct hci_unit *);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hci_socket.c,v 1.20 2011/01/30 17:23:23 plunky Exp $ */
|
||||
/* $NetBSD: hci_socket.c,v 1.21 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Iain Hibbert.
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.20 2011/01/30 17:23:23 plunky Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.21 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
/* load symbolic names */
|
||||
#ifdef BLUETOOTH_DEBUG
|
||||
@ -441,7 +441,7 @@ bad:
|
||||
* we are responsible for disposing of m and ctl if
|
||||
* they are mbuf chains
|
||||
*/
|
||||
int
|
||||
static int
|
||||
hci_usrreq(struct socket *up, int req, struct mbuf *m,
|
||||
struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
|
||||
{
|
||||
@ -849,3 +849,11 @@ hci_mtap(struct mbuf *m, struct hci_unit *unit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(hci_usrreq)
|
||||
|
||||
#define hci_usrreq hci_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs hci_usrreqs = {
|
||||
.pr_generic = hci_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: l2cap.h,v 1.10 2011/02/06 18:50:59 plunky Exp $ */
|
||||
/* $NetBSD: l2cap.h,v 1.11 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Iain Hibbert.
|
||||
@ -54,7 +54,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: l2cap.h,v 1.10 2011/02/06 18:50:59 plunky Exp $
|
||||
* $Id: l2cap.h,v 1.11 2014/05/18 14:46:16 rmind Exp $
|
||||
* $FreeBSD: src/sys/netgraph/bluetooth/include/l2cap.h,v 1.4 2005/08/31 18:13:23 emax Exp $
|
||||
*/
|
||||
|
||||
@ -458,7 +458,6 @@ int l2cap_send_disconnect_req(struct l2cap_channel *);
|
||||
int l2cap_send_connect_rsp(struct hci_link *, uint8_t, uint16_t, uint16_t, uint16_t);
|
||||
|
||||
/* l2cap_socket.c */
|
||||
int l2cap_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
int l2cap_ctloutput(int, struct socket *, struct sockopt *);
|
||||
|
||||
/* l2cap_upper.c */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: l2cap_socket.c,v 1.10 2013/08/29 17:49:21 rmind Exp $ */
|
||||
/* $NetBSD: l2cap_socket.c,v 1.11 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Iain Hibbert.
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.10 2013/08/29 17:49:21 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.11 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
/* load symbolic names */
|
||||
#ifdef BLUETOOTH_DEBUG
|
||||
@ -101,7 +101,7 @@ int l2cap_recvspace = 4096;
|
||||
* we are responsible for disposing of m and ctl if
|
||||
* they are mbuf chains
|
||||
*/
|
||||
int
|
||||
static int
|
||||
l2cap_usrreq(struct socket *up, int req, struct mbuf *m,
|
||||
struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
|
||||
{
|
||||
@ -396,3 +396,11 @@ l2cap_input(void *arg, struct mbuf *m)
|
||||
sbappendrecord(&so->so_rcv, m);
|
||||
sorwakeup(so);
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(l2cap_usrreq)
|
||||
|
||||
#define l2cap_usrreq l2cap_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs l2cap_usrreqs = {
|
||||
.pr_generic = l2cap_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rfcomm.h,v 1.9 2009/09/13 18:45:11 pooka Exp $ */
|
||||
/* $NetBSD: rfcomm.h,v 1.10 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Itronix Inc.
|
||||
@ -55,7 +55,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rfcomm.h,v 1.9 2009/09/13 18:45:11 pooka Exp $
|
||||
* $Id: rfcomm.h,v 1.10 2014/05/18 14:46:16 rmind Exp $
|
||||
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h,v 1.4 2005/01/11 01:39:53 emax Exp $
|
||||
*/
|
||||
|
||||
@ -404,7 +404,6 @@ int rfcomm_session_send_mcc(struct rfcomm_session *, int, uint8_t, void *, int);
|
||||
void rfcomm_init(void);
|
||||
|
||||
/* rfcomm_socket.c */
|
||||
int rfcomm_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
int rfcomm_ctloutput(int, struct socket *, struct sockopt *);
|
||||
|
||||
/* rfcomm_upper.c */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rfcomm_socket.c,v 1.11 2013/08/29 17:49:21 rmind Exp $ */
|
||||
/* $NetBSD: rfcomm_socket.c,v 1.12 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Itronix Inc.
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.11 2013/08/29 17:49:21 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.12 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
/* load symbolic names */
|
||||
#ifdef BLUETOOTH_DEBUG
|
||||
@ -100,7 +100,7 @@ int rfcomm_recvspace = 4096;
|
||||
* we are responsible for disposing of m and ctl if
|
||||
* they are mbuf chains
|
||||
*/
|
||||
int
|
||||
static int
|
||||
rfcomm_usrreq(struct socket *up, int req, struct mbuf *m,
|
||||
struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
|
||||
{
|
||||
@ -411,3 +411,11 @@ rfcomm_input(void *arg, struct mbuf *m)
|
||||
sbappendstream(&so->so_rcv, m);
|
||||
sorwakeup(so);
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(rfcomm_usrreq)
|
||||
|
||||
#define rfcomm_usrreq rfcomm_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs rfcomm_usrreqs = {
|
||||
.pr_generic = rfcomm_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sco.h,v 1.3 2008/08/06 15:01:24 plunky Exp $ */
|
||||
/* $NetBSD: sco.h,v 1.4 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Itronix Inc.
|
||||
@ -65,8 +65,6 @@ struct sockopt;
|
||||
/* sco_socket.c */
|
||||
extern int sco_sendspace;
|
||||
extern int sco_recvspace;
|
||||
int sco_usrreq(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *, struct lwp *);
|
||||
int sco_ctloutput(int, struct socket *, struct sockopt *);
|
||||
|
||||
/* sco_upper.c */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sco_socket.c,v 1.12 2013/08/29 17:49:21 rmind Exp $ */
|
||||
/* $NetBSD: sco_socket.c,v 1.13 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Itronix Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.12 2013/08/29 17:49:21 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.13 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
/* load symbolic names */
|
||||
#ifdef BLUETOOTH_DEBUG
|
||||
@ -94,7 +94,7 @@ int sco_recvspace = 4096;
|
||||
* we are responsible for disposing of m and ctl if
|
||||
* they are mbuf chains
|
||||
*/
|
||||
int
|
||||
static int
|
||||
sco_usrreq(struct socket *up, int req, struct mbuf *m,
|
||||
struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
|
||||
{
|
||||
@ -365,3 +365,11 @@ sco_input(void *arg, struct mbuf *m)
|
||||
sbappendrecord(&so->so_rcv, m);
|
||||
sorwakeup(so);
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(sco_usrreq)
|
||||
|
||||
#define sco_usrreq sco_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs sco_usrreqs = {
|
||||
.pr_generic = sco_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_arp.c,v 1.156 2014/04/12 12:24:50 gdt Exp $ */
|
||||
/* $NetBSD: if_arp.c,v 1.157 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
|
||||
@ -68,7 +68,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.156 2014/04/12 12:24:50 gdt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.157 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_inet.h"
|
||||
@ -249,7 +249,7 @@ const struct protosw arpsw[] = {
|
||||
.pr_output = 0,
|
||||
.pr_ctlinput = 0,
|
||||
.pr_ctloutput = 0,
|
||||
.pr_usrreq = 0,
|
||||
.pr_usrreqs = 0,
|
||||
.pr_init = arp_init,
|
||||
.pr_fasttimo = arp_fasttimo,
|
||||
.pr_slowtimo = 0,
|
||||
@ -257,7 +257,6 @@ const struct protosw arpsw[] = {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct domain arpdomain = {
|
||||
.dom_family = PF_ARP,
|
||||
.dom_name = "arp",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: in_gif.c,v 1.63 2013/03/01 18:25:57 joerg Exp $ */
|
||||
/* $NetBSD: in_gif.c,v 1.64 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.63 2013/03/01 18:25:57 joerg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.64 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
@ -77,11 +77,16 @@ int ip_gif_ttl = GIF_TTL;
|
||||
int ip_gif_ttl = 0;
|
||||
#endif
|
||||
|
||||
const struct protosw in_gif_protosw =
|
||||
{ SOCK_RAW, &inetdomain, 0/* IPPROTO_IPV[46] */, PR_ATOMIC|PR_ADDR,
|
||||
in_gif_input, rip_output, 0, rip_ctloutput,
|
||||
rip_usrreq,
|
||||
0, 0, 0, 0,
|
||||
const struct protosw in_gif_protosw = {
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &inetdomain,
|
||||
.pr_protocol = 0 /* IPPROTO_IPV[46] */,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_input = in_gif_input,
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = NULL,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: in_proto.c,v 1.108 2014/03/20 20:44:15 christos Exp $ */
|
||||
/* $NetBSD: in_proto.c,v 1.109 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.108 2014/03/20 20:44:15 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.109 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_mrouting.h"
|
||||
#include "opt_inet.h"
|
||||
@ -122,6 +122,7 @@ __KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.108 2014/03/20 20:44:15 christos Exp
|
||||
|
||||
#include "carp.h"
|
||||
#if NCARP > 0
|
||||
#include <netinet/in_var.h>
|
||||
#include <netinet/ip_carp.h>
|
||||
#endif
|
||||
|
||||
@ -140,14 +141,6 @@ DOMAIN_DEFINE(inetdomain); /* forward declare and add to link set */
|
||||
|
||||
/* Wrappers to acquire kernel_lock. */
|
||||
|
||||
PR_WRAP_USRREQ(rip_usrreq)
|
||||
PR_WRAP_USRREQ(udp_usrreq)
|
||||
PR_WRAP_USRREQ(tcp_usrreq)
|
||||
|
||||
#define rip_usrreq rip_usrreq_wrapper
|
||||
#define udp_usrreq udp_usrreq_wrapper
|
||||
#define tcp_usrreq tcp_usrreq_wrapper
|
||||
|
||||
PR_WRAP_CTLINPUT(rip_ctlinput)
|
||||
PR_WRAP_CTLINPUT(udp_ctlinput)
|
||||
PR_WRAP_CTLINPUT(tcp_ctlinput)
|
||||
@ -188,7 +181,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_input = udp_input,
|
||||
.pr_ctlinput = udp_ctlinput,
|
||||
.pr_ctloutput = udp_ctloutput,
|
||||
.pr_usrreq = udp_usrreq,
|
||||
.pr_usrreqs = &udp_usrreqs,
|
||||
.pr_init = udp_init,
|
||||
},
|
||||
{ .pr_type = SOCK_STREAM,
|
||||
@ -198,7 +191,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_input = tcp_input,
|
||||
.pr_ctlinput = tcp_ctlinput,
|
||||
.pr_ctloutput = tcp_ctloutput,
|
||||
.pr_usrreq = tcp_usrreq,
|
||||
.pr_usrreqs = &tcp_usrreqs,
|
||||
.pr_init = tcp_init,
|
||||
.pr_fasttimo = tcp_fasttimo,
|
||||
.pr_drain = tcp_drainstub,
|
||||
@ -211,7 +204,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
},
|
||||
{ .pr_type = SOCK_RAW,
|
||||
.pr_domain = &inetdomain,
|
||||
@ -221,7 +214,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_init = icmp_init,
|
||||
},
|
||||
#ifdef GATEWAY
|
||||
@ -261,7 +254,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_init = encap_init,
|
||||
},
|
||||
#ifdef INET6
|
||||
@ -273,7 +266,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_init = encap_init,
|
||||
},
|
||||
#endif /* INET6 */
|
||||
@ -286,7 +279,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
},
|
||||
#endif /* NETHERIP > 0 */
|
||||
#if NCARP > 0
|
||||
@ -297,7 +290,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_input = carp_proto_input,
|
||||
.pr_output = rip_output,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_init = carp_init,
|
||||
},
|
||||
#endif /* NCARP > 0 */
|
||||
@ -309,7 +302,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_input = pfsync_input,
|
||||
.pr_output = rip_output,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
},
|
||||
#endif /* NPFSYNC > 0 */
|
||||
{ .pr_type = SOCK_RAW,
|
||||
@ -320,7 +313,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_fasttimo = igmp_fasttimo,
|
||||
.pr_slowtimo = igmp_slowtimo,
|
||||
.pr_init = igmp_init,
|
||||
@ -334,7 +327,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
},
|
||||
#endif /* PIM */
|
||||
/* raw wildcard */
|
||||
@ -345,7 +338,7 @@ const struct protosw inetsw[] = {
|
||||
.pr_output = rip_output,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_ctlinput = rip_ctlinput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_init = rip_init,
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip_mroute.c,v 1.128 2013/09/14 11:43:22 martin Exp $ */
|
||||
/* $NetBSD: ip_mroute.c,v 1.129 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -93,7 +93,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.128 2013/09/14 11:43:22 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.129 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ipsec.h"
|
||||
@ -188,11 +188,15 @@ extern int rsvp_on;
|
||||
static void vif_input(struct mbuf *, ...);
|
||||
static int vif_encapcheck(struct mbuf *, int, int, void *);
|
||||
|
||||
static const struct protosw vif_protosw =
|
||||
{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
|
||||
vif_input, rip_output, 0, rip_ctloutput,
|
||||
rip_usrreq,
|
||||
0, 0, 0, 0,
|
||||
static const struct protosw vif_protosw = {
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &inetdomain,
|
||||
.pr_protocol = IPPROTO_IPV4,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_input = vif_input,
|
||||
.pr_output = rip_output,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
};
|
||||
|
||||
#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip_var.h,v 1.99 2014/03/19 10:54:20 liamjfoy Exp $ */
|
||||
/* $NetBSD: ip_var.h,v 1.100 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -176,6 +176,7 @@ struct ip_moptions {
|
||||
#define IP_MTUDISC 0x0400 /* Path MTU Discovery; set DF */
|
||||
|
||||
extern struct domain inetdomain;
|
||||
extern const struct pr_usrreqs rip_usrreqs;
|
||||
|
||||
extern int ip_defttl; /* default IP ttl */
|
||||
extern int ipforwarding; /* ip forwarding */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: raw_ip.c,v 1.119 2014/05/18 00:10:11 rmind Exp $ */
|
||||
/* $NetBSD: raw_ip.c,v 1.120 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.119 2014/05/18 00:10:11 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.120 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -687,6 +687,14 @@ release:
|
||||
return (error);
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(rip_usrreq)
|
||||
|
||||
#define rip_usrreq rip_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs rip_usrreqs = {
|
||||
.pr_generic = rip_usrreq,
|
||||
};
|
||||
|
||||
static void
|
||||
sysctl_net_inet_raw_setup(struct sysctllog **clog)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tcp_usrreq.c,v 1.171 2014/02/25 18:30:12 pooka Exp $ */
|
||||
/* $NetBSD: tcp_usrreq.c,v 1.172 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -95,7 +95,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.171 2014/02/25 18:30:12 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.172 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ipsec.h"
|
||||
@ -162,10 +162,9 @@ __KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.171 2014/02/25 18:30:12 pooka Exp $
|
||||
* then m is the mbuf chain of send data. If this is a timer expiration
|
||||
* (called from the software clock routine), then timertype tells which timer.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
tcp_usrreq(struct socket *so, int req,
|
||||
struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct lwp *l)
|
||||
static int
|
||||
tcp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
{
|
||||
struct inpcb *inp;
|
||||
#ifdef INET6
|
||||
@ -2152,3 +2151,11 @@ tcp_usrreq_init(void)
|
||||
sysctl_net_inet_tcp_setup2(NULL, PF_INET6, "inet6", "tcp6");
|
||||
#endif
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(tcp_usrreq)
|
||||
|
||||
#define tcp_usrreq tcp_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs tcp_usrreqs = {
|
||||
.pr_generic = tcp_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tcp_var.h,v 1.172 2014/01/02 18:29:01 pooka Exp $ */
|
||||
/* $NetBSD: tcp_var.h,v 1.173 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -790,7 +790,10 @@ struct syn_cache_head {
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
extern struct inpcbtable tcbtable; /* head of queue of active tcpcb's */
|
||||
extern const struct pr_usrreqs tcp_usrreqs;
|
||||
|
||||
extern u_int32_t tcp_now; /* for RFC 1323 timestamps */
|
||||
extern int tcp_do_rfc1323; /* enabled/disabled? */
|
||||
extern int tcp_do_sack; /* SACK enabled/disabled? */
|
||||
@ -961,8 +964,6 @@ void tcp_trace(short, short, struct tcpcb *, struct mbuf *, int);
|
||||
struct tcpcb *
|
||||
tcp_usrclosed(struct tcpcb *);
|
||||
void tcp_usrreq_init(void);
|
||||
int tcp_usrreq(struct socket *,
|
||||
int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
void tcp_xmit_timer(struct tcpcb *, uint32_t);
|
||||
tcp_seq tcp_new_iss(struct tcpcb *, tcp_seq);
|
||||
tcp_seq tcp_new_iss1(void *, void *, u_int16_t, u_int16_t, size_t,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: udp_usrreq.c,v 1.194 2014/02/25 18:30:12 pooka Exp $ */
|
||||
/* $NetBSD: udp_usrreq.c,v 1.195 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.194 2014/02/25 18:30:12 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.195 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -1195,10 +1195,9 @@ int udp_sendspace = 9216; /* really max datagram size */
|
||||
int udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
|
||||
/* 40 1K datagrams */
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
static int
|
||||
udp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
struct mbuf *control, struct lwp *l)
|
||||
{
|
||||
struct inpcb *inp;
|
||||
int s;
|
||||
@ -1586,3 +1585,11 @@ udp4_espinudp(struct mbuf **mp, int off, struct sockaddr *src,
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
PR_WRAP_USRREQ(udp_usrreq)
|
||||
|
||||
#define udp_usrreq udp_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs udp_usrreqs = {
|
||||
.pr_generic = udp_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: udp_var.h,v 1.39 2014/01/02 18:29:01 pooka Exp $ */
|
||||
/* $NetBSD: udp_var.h,v 1.40 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -87,7 +87,9 @@ struct udpiphdr {
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
extern struct inpcbtable udbtable;
|
||||
extern const struct pr_usrreqs udp_usrreqs;
|
||||
|
||||
void *udp_ctlinput(int, const struct sockaddr *, void *);
|
||||
int udp_ctloutput(int, struct socket *, struct sockopt *);
|
||||
@ -96,8 +98,6 @@ void udp_init_common(void);
|
||||
void udp_input(struct mbuf *, ...);
|
||||
int udp_output(struct mbuf *, ...);
|
||||
int udp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
|
||||
int udp_usrreq(struct socket *,
|
||||
int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
|
||||
int udp_input_checksum(int af, struct mbuf *, const struct udphdr *, int,
|
||||
int);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: in6_gif.c,v 1.59 2013/03/01 18:25:58 joerg Exp $ */
|
||||
/* $NetBSD: in6_gif.c,v 1.60 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.59 2013/03/01 18:25:58 joerg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.60 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
@ -441,16 +441,20 @@ in6_gif_ctlinput(int cmd, const struct sockaddr *sa, void *d)
|
||||
|
||||
PR_WRAP_CTLINPUT(in6_gif_ctlinput)
|
||||
PR_WRAP_CTLOUTPUT(rip6_ctloutput)
|
||||
PR_WRAP_USRREQ(rip6_usrreq)
|
||||
|
||||
#define in6_gif_ctlinput in6_gif_ctlinput_wrapper
|
||||
#define rip6_ctloutput rip6_ctloutput_wrapper
|
||||
#define rip6_usrreq rip6_usrreq_wrapper
|
||||
|
||||
extern struct domain inet6domain;
|
||||
const struct ip6protosw in6_gif_protosw =
|
||||
{ SOCK_RAW, &inet6domain, 0/* IPPROTO_IPV[46] */, PR_ATOMIC|PR_ADDR,
|
||||
in6_gif_input, rip6_output, in6_gif_ctlinput, rip6_ctloutput,
|
||||
rip6_usrreq,
|
||||
0, 0, 0, 0,
|
||||
|
||||
const struct ip6protosw in6_gif_protosw = {
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &inet6domain,
|
||||
.pr_protocol = 0 /* IPPROTO_IPV[46] */,
|
||||
.pr_flags = PR_ATOMIC | PR_ADDR,
|
||||
.pr_input = in6_gif_input,
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctlinput = in6_gif_ctlinput,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: in6_proto.c,v 1.100 2014/01/02 18:29:01 pooka Exp $ */
|
||||
/* $NetBSD: in6_proto.c,v 1.101 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -62,7 +62,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.100 2014/01/02 18:29:01 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.101 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_gateway.h"
|
||||
#include "opt_inet.h"
|
||||
@ -135,14 +135,6 @@ DOMAIN_DEFINE(inet6domain); /* forward declare and add to link set */
|
||||
|
||||
/* Wrappers to acquire kernel_lock. */
|
||||
|
||||
PR_WRAP_USRREQ(rip6_usrreq)
|
||||
PR_WRAP_USRREQ(udp6_usrreq)
|
||||
PR_WRAP_USRREQ(tcp_usrreq)
|
||||
|
||||
#define rip6_usrreq rip6_usrreq_wrapper
|
||||
#define udp6_usrreq udp6_usrreq_wrapper
|
||||
#define tcp_usrreq tcp_usrreq_wrapper
|
||||
|
||||
PR_WRAP_CTLINPUT(rip6_ctlinput)
|
||||
PR_WRAP_CTLINPUT(encap6_ctlinput)
|
||||
PR_WRAP_CTLINPUT(udp6_ctlinput)
|
||||
@ -199,7 +191,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_input = udp6_input,
|
||||
.pr_ctlinput = udp6_ctlinput,
|
||||
.pr_ctloutput = udp6_ctloutput,
|
||||
.pr_usrreq = udp6_usrreq,
|
||||
.pr_usrreqs = &udp6_usrreqs,
|
||||
.pr_init = udp6_init,
|
||||
},
|
||||
{ .pr_type = SOCK_STREAM,
|
||||
@ -209,7 +201,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_input = tcp6_input,
|
||||
.pr_ctlinput = tcp6_ctlinput,
|
||||
.pr_ctloutput = tcp_ctloutput,
|
||||
.pr_usrreq = tcp_usrreq,
|
||||
.pr_usrreqs = &tcp_usrreqs,
|
||||
.pr_init = tcp6_init,
|
||||
.pr_fasttimo = tcp_fasttimo,
|
||||
.pr_drain = tcp_drainstub,
|
||||
@ -222,7 +214,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctlinput = rip6_ctlinput,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
},
|
||||
#ifdef GATEWAY
|
||||
{ .pr_domain = &inet6domain,
|
||||
@ -239,7 +231,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctlinput = rip6_ctlinput,
|
||||
.pr_ctloutput = icmp6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
.pr_init = icmp6_init,
|
||||
},
|
||||
{ .pr_type = SOCK_RAW,
|
||||
@ -291,7 +283,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctlinput = encap6_ctlinput,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
.pr_init = encap_init,
|
||||
},
|
||||
#endif
|
||||
@ -303,7 +295,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctlinput = encap6_ctlinput,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
.pr_init = encap_init,
|
||||
},
|
||||
#if NETHERIP > 0
|
||||
@ -315,7 +307,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctlinput = rip6_ctlinput,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
},
|
||||
#endif
|
||||
#if NCARP > 0
|
||||
@ -326,7 +318,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_input = carp6_proto_input,
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
},
|
||||
#endif /* NCARP */
|
||||
{ .pr_type = SOCK_RAW,
|
||||
@ -336,7 +328,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_input = pim6_input,
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
.pr_init = pim6_init,
|
||||
},
|
||||
/* raw wildcard */
|
||||
@ -346,7 +338,7 @@ const struct ip6protosw inet6sw[] = {
|
||||
.pr_input = rip6_input,
|
||||
.pr_output = rip6_output,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
.pr_init = rip6_init,
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip6_var.h,v 1.59 2012/06/23 03:14:04 christos Exp $ */
|
||||
/* $NetBSD: ip6_var.h,v 1.60 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
@ -312,6 +312,7 @@ extern int ip6_hashsize; /* size of hash table */
|
||||
#endif
|
||||
|
||||
struct in6pcb;
|
||||
extern const struct pr_usrreqs rip6_usrreqs;
|
||||
|
||||
int icmp6_ctloutput(int, struct socket *, struct sockopt *);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip6protosw.h,v 1.21 2008/08/06 15:01:23 plunky Exp $ */
|
||||
/* $NetBSD: ip6protosw.h,v 1.22 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: ip6protosw.h,v 1.22 2001/02/08 18:02:08 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -129,9 +129,7 @@ struct ip6protosw {
|
||||
(int, struct socket *, struct sockopt *);
|
||||
|
||||
/* user-protocol hook */
|
||||
int (*pr_usrreq) /* user request: see list below */
|
||||
(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *, struct lwp *);
|
||||
const struct pr_usrreqs *pr_usrreqs;
|
||||
|
||||
/* utility hooks */
|
||||
void (*pr_init) /* initialization hook */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: raw_ip6.c,v 1.114 2014/05/18 00:10:11 rmind Exp $ */
|
||||
/* $NetBSD: raw_ip6.c,v 1.115 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
@ -62,7 +62,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.114 2014/05/18 00:10:11 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.115 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_ipsec.h"
|
||||
|
||||
@ -881,3 +881,11 @@ sysctl_net_inet6_raw6_setup(struct sysctllog **clog)
|
||||
CTL_NET, PF_INET6, IPPROTO_RAW, RAW6CTL_STATS,
|
||||
CTL_EOL);
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(rip6_usrreq)
|
||||
|
||||
#define rip6_usrreq rip6_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs rip6_usrreqs = {
|
||||
.pr_generic = rip6_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: udp6_usrreq.c,v 1.93 2014/02/25 18:30:12 pooka Exp $ */
|
||||
/* $NetBSD: udp6_usrreq.c,v 1.94 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -62,7 +62,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.93 2014/02/25 18:30:12 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.94 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
@ -521,3 +521,11 @@ udp6_statinc(u_int stat)
|
||||
KASSERT(stat < UDP6_NSTATS);
|
||||
UDP6_STATINC(stat);
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(udp6_usrreq)
|
||||
|
||||
#define udp6_usrreq udp6_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs udp6_usrreqs = {
|
||||
.pr_generic = udp6_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: udp6_var.h,v 1.25 2012/06/22 14:54:35 christos Exp $ */
|
||||
/* $NetBSD: udp6_var.h,v 1.26 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $KAME: udp6_var.h,v 1.11 2000/06/05 00:14:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -99,6 +99,9 @@
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
extern const struct pr_usrreqs udp6_usrreqs;
|
||||
|
||||
void *udp6_ctlinput(int, const struct sockaddr *, void *);
|
||||
int udp6_ctloutput(int, struct socket *, struct sockopt *);
|
||||
void udp6_init(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: keysock.c,v 1.21 2011/07/17 20:54:54 joerg Exp $ */
|
||||
/* $NetBSD: keysock.c,v 1.22 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.21 2011/07/17 20:54:54 joerg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.22 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_ipsec.h"
|
||||
|
||||
@ -627,9 +627,9 @@ key_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
* key_usrreq()
|
||||
* derived from net/rtsock.c:route_usrreq()
|
||||
*/
|
||||
int
|
||||
key_usrreq(struct socket *so, int req,struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
static int
|
||||
key_usrreq(struct socket *so, int req,struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
{
|
||||
int error = 0;
|
||||
struct keycb *kp = (struct keycb *)sotorawcb(so);
|
||||
@ -728,6 +728,14 @@ DOMAIN_SET(key);
|
||||
|
||||
DOMAIN_DEFINE(keydomain);
|
||||
|
||||
PR_WRAP_USRREQ(key_usrreq)
|
||||
|
||||
#define key_usrreq key_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs key_usrreqs = {
|
||||
.pr_generic = key_usrreq,
|
||||
};
|
||||
|
||||
const struct protosw keysw[] = {
|
||||
{
|
||||
.pr_type = SOCK_RAW,
|
||||
@ -736,7 +744,7 @@ const struct protosw keysw[] = {
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_output = key_output,
|
||||
.pr_ctlinput = raw_ctlinput,
|
||||
.pr_usrreq = key_usrreq,
|
||||
.pr_usrreqs = &key_usrreqs,
|
||||
.pr_init = raw_init,
|
||||
}
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: keysock.h,v 1.6 2008/04/23 07:29:47 thorpej Exp $ */
|
||||
/* $NetBSD: keysock.h,v 1.7 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/keysock.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $KAME: keysock.h,v 1.8 2000/03/27 05:11:06 sumikawa Exp $ */
|
||||
|
||||
@ -71,14 +71,6 @@ struct keycb {
|
||||
};
|
||||
|
||||
int key_output (struct mbuf *, ...);
|
||||
#ifndef __NetBSD__
|
||||
int key_usrreq (struct socket *,
|
||||
int, struct mbuf *, struct mbuf *, struct mbuf *);
|
||||
#else
|
||||
int key_usrreq (struct socket *,
|
||||
int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
#endif
|
||||
|
||||
int key_sendup (struct socket *, struct sadb_msg *, u_int, int);
|
||||
int key_sendup_mbuf (struct socket *, struct mbuf *, int);
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xform_ipip.c,v 1.29 2013/06/05 19:01:26 christos Exp $ */
|
||||
/* $NetBSD: xform_ipip.c,v 1.30 2014/05/18 14:46:16 rmind Exp $ */
|
||||
/* $FreeBSD: src/sys/netipsec/xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */
|
||||
/* $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.29 2013/06/05 19:01:26 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.30 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
/*
|
||||
* IP-inside-IP processing
|
||||
@ -688,9 +688,7 @@ static struct xformsw ipe4_xformsw = {
|
||||
|
||||
#ifdef INET
|
||||
PR_WRAP_CTLOUTPUT(rip_ctloutput)
|
||||
PR_WRAP_USRREQ(rip_usrreq)
|
||||
#define rip_ctloutput rip_ctloutput_wrapper
|
||||
#define rip_usrreq rip_usrreq_wrapper
|
||||
|
||||
extern struct domain inetdomain;
|
||||
static struct ipprotosw ipe4_protosw = {
|
||||
@ -702,7 +700,7 @@ static struct ipprotosw ipe4_protosw = {
|
||||
.pr_output = 0,
|
||||
.pr_ctlinput = 0,
|
||||
.pr_ctloutput = rip_ctloutput,
|
||||
.pr_usrreq = rip_usrreq,
|
||||
.pr_usrreqs = &rip_usrreqs,
|
||||
.pr_init = 0,
|
||||
.pr_fasttimo = 0,
|
||||
.pr_slowtimo = 0,
|
||||
@ -711,9 +709,7 @@ static struct ipprotosw ipe4_protosw = {
|
||||
#endif
|
||||
#ifdef INET6
|
||||
PR_WRAP_CTLOUTPUT(rip6_ctloutput)
|
||||
PR_WRAP_USRREQ(rip6_usrreq)
|
||||
#define rip6_ctloutput rip6_ctloutput_wrapper
|
||||
#define rip6_usrreq rip6_usrreq_wrapper
|
||||
|
||||
extern struct domain inet6domain;
|
||||
static struct ip6protosw ipe4_protosw6 = {
|
||||
@ -725,7 +721,7 @@ static struct ip6protosw ipe4_protosw6 = {
|
||||
.pr_output = 0,
|
||||
.pr_ctlinput = 0,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreq = rip6_usrreq,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
.pr_init = 0,
|
||||
.pr_fasttimo = 0,
|
||||
.pr_slowtimo = 0,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mpls_proto.c,v 1.6 2014/02/25 18:30:12 pooka Exp $ */
|
||||
/* $NetBSD: mpls_proto.c,v 1.7 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mpls_proto.c,v 1.6 2014/02/25 18:30:12 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mpls_proto.c,v 1.7 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_mbuftrace.h"
|
||||
@ -78,47 +78,6 @@ void mpls_init(void)
|
||||
sysctl_net_mpls_setup(NULL);
|
||||
}
|
||||
|
||||
DOMAIN_DEFINE(mplsdomain);
|
||||
|
||||
const struct protosw mplssw[] = {
|
||||
{ .pr_domain = &mplsdomain,
|
||||
.pr_init = mpls_init,
|
||||
},
|
||||
{
|
||||
.pr_type = SOCK_DGRAM,
|
||||
.pr_domain = &mplsdomain,
|
||||
.pr_flags = PR_ATOMIC | PR_ADDR,
|
||||
.pr_usrreq = mpls_usrreq,
|
||||
},
|
||||
{
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &mplsdomain,
|
||||
.pr_flags = PR_ATOMIC | PR_ADDR,
|
||||
.pr_usrreq = mpls_usrreq,
|
||||
},
|
||||
};
|
||||
|
||||
struct domain mplsdomain = {
|
||||
.dom_family = PF_MPLS,
|
||||
.dom_name = "MPLS",
|
||||
.dom_init = NULL,
|
||||
.dom_externalize = NULL,
|
||||
.dom_dispose = NULL,
|
||||
.dom_protosw = mplssw,
|
||||
.dom_protoswNPROTOSW = &mplssw[__arraycount(mplssw)],
|
||||
.dom_rtattach = rt_inithead,
|
||||
.dom_rtoffset = offsetof(struct sockaddr_mpls, smpls_addr) << 3,
|
||||
.dom_maxrtkey = sizeof(union mpls_shim),
|
||||
.dom_ifattach = NULL,
|
||||
.dom_ifdetach = NULL,
|
||||
.dom_ifqueues = { &mplsintrq, NULL },
|
||||
.dom_link = { NULL },
|
||||
.dom_mowner = MOWNER_INIT("MPLS", ""),
|
||||
.dom_sa_cmpofs = offsetof(struct sockaddr_mpls, smpls_addr),
|
||||
.dom_sa_cmplen = sizeof(union mpls_shim),
|
||||
.dom_rtcache = LIST_HEAD_INITIALIZER(mplsdomain.dom_rtcache)
|
||||
};
|
||||
|
||||
static int
|
||||
mpls_usrreq(struct socket *so, int req, struct mbuf *m,
|
||||
struct mbuf *nam, struct mbuf *control, struct lwp *l)
|
||||
@ -213,3 +172,52 @@ sysctl_net_mpls_setup(struct sysctllog **clog)
|
||||
CTL_NET, PF_MPLS, CTL_CREATE, CTL_EOL);
|
||||
#endif
|
||||
}
|
||||
|
||||
DOMAIN_DEFINE(mplsdomain);
|
||||
|
||||
PR_WRAP_USRREQ(mpls_usrreq)
|
||||
|
||||
#define mpls_usrreq mpls_usrreq_wrapper
|
||||
|
||||
static const struct pr_usrreqs mpls_usrreqs = {
|
||||
.pr_generic = mpls_usrreq,
|
||||
};
|
||||
|
||||
const struct protosw mplssw[] = {
|
||||
{ .pr_domain = &mplsdomain,
|
||||
.pr_init = mpls_init,
|
||||
},
|
||||
{
|
||||
.pr_type = SOCK_DGRAM,
|
||||
.pr_domain = &mplsdomain,
|
||||
.pr_flags = PR_ATOMIC | PR_ADDR,
|
||||
.pr_usrreqs = &mpls_usrreqs,
|
||||
},
|
||||
{
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &mplsdomain,
|
||||
.pr_flags = PR_ATOMIC | PR_ADDR,
|
||||
.pr_usrreqs = &mpls_usrreqs,
|
||||
},
|
||||
};
|
||||
|
||||
struct domain mplsdomain = {
|
||||
.dom_family = PF_MPLS,
|
||||
.dom_name = "MPLS",
|
||||
.dom_init = NULL,
|
||||
.dom_externalize = NULL,
|
||||
.dom_dispose = NULL,
|
||||
.dom_protosw = mplssw,
|
||||
.dom_protoswNPROTOSW = &mplssw[__arraycount(mplssw)],
|
||||
.dom_rtattach = rt_inithead,
|
||||
.dom_rtoffset = offsetof(struct sockaddr_mpls, smpls_addr) << 3,
|
||||
.dom_maxrtkey = sizeof(union mpls_shim),
|
||||
.dom_ifattach = NULL,
|
||||
.dom_ifdetach = NULL,
|
||||
.dom_ifqueues = { &mplsintrq, NULL },
|
||||
.dom_link = { NULL },
|
||||
.dom_mowner = MOWNER_INIT("MPLS", ""),
|
||||
.dom_sa_cmpofs = offsetof(struct sockaddr_mpls, smpls_addr),
|
||||
.dom_sa_cmplen = sizeof(union mpls_shim),
|
||||
.dom_rtcache = LIST_HEAD_INITIALIZER(mplsdomain.dom_rtcache)
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: natm.c,v 1.24 2011/03/09 22:06:42 dyoung Exp $ */
|
||||
/* $NetBSD: natm.c,v 1.25 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Charles D. Cranor and Washington University.
|
||||
@ -30,14 +30,13 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.24 2011/03/09 22:06:42 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.25 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/domain.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/socket.h>
|
||||
@ -46,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.24 2011/03/09 22:06:42 dyoung Exp $");
|
||||
#include <net/if.h>
|
||||
#include <net/if_atm.h>
|
||||
#include <net/netisr.h>
|
||||
#include <net/radix.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
@ -63,13 +61,9 @@ u_long natm0_recvspace = 16*1024;
|
||||
* user requests
|
||||
*/
|
||||
|
||||
int natm_usrreq(so, req, m, nam, control, l)
|
||||
|
||||
struct socket *so;
|
||||
int req;
|
||||
struct mbuf *m, *nam, *control;
|
||||
struct lwp *l;
|
||||
|
||||
static int
|
||||
natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
{
|
||||
int error = 0, s, s2;
|
||||
struct natmpcb *npcb;
|
||||
@ -396,3 +390,11 @@ m->m_pkthdr.rcvif = NULL; /* null it out to be safe */
|
||||
|
||||
goto next;
|
||||
}
|
||||
|
||||
PR_WRAP_USRREQ(natm_usrreq)
|
||||
|
||||
#define natm_usrreq natm_usrreq_wrapper
|
||||
|
||||
const struct pr_usrreqs natm_usrreqs = {
|
||||
.pr_generic = natm_usrreq,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: natm.h,v 1.11 2011/02/01 19:40:24 chuck Exp $ */
|
||||
/* $NetBSD: natm.h,v 1.12 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Charles D. Cranor and Washington University.
|
||||
@ -119,6 +119,8 @@ extern u_int natm_sookcnt,
|
||||
natm_sookbytes; /* account of ok */
|
||||
#endif
|
||||
|
||||
extern const struct pr_usrreqs natm_usrreqs;
|
||||
|
||||
/* atm_rawioctl: kernel's version of SIOCRAWATM [for internal use only!] */
|
||||
struct atm_rawioctl {
|
||||
struct natmpcb *npcb;
|
||||
@ -134,13 +136,6 @@ void npcb_free(struct natmpcb *, int);
|
||||
struct natmpcb *npcb_add(struct natmpcb *, struct ifnet *, int, int);
|
||||
|
||||
/* natm.c */
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
int natm_usrreq(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *, struct lwp *);
|
||||
#elif defined(__FreeBSD__)
|
||||
int natm_usrreq(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *);
|
||||
#endif
|
||||
int natm0_sysctl(int *, u_int, void *, size_t *, void *, size_t);
|
||||
int natm5_sysctl(int *, u_int, void *, size_t *, void *, size_t);
|
||||
void natmintr(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: natm_proto.c,v 1.14 2011/02/01 19:40:24 chuck Exp $ */
|
||||
/* $NetBSD: natm_proto.c,v 1.15 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Charles D. Cranor and Washington University.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: natm_proto.c,v 1.14 2011/02/01 19:40:24 chuck Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: natm_proto.c,v 1.15 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: natm_proto.c,v 1.14 2011/02/01 19:40:24 chuck Exp $"
|
||||
#include <sys/mbuf.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/radix.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
@ -57,10 +56,6 @@ struct npcblist natm_pcbs = LIST_HEAD_INITIALIZER(natm_pcbs);
|
||||
struct ifqueue natmintrq; /* natm packet input queue */
|
||||
int natmqmaxlen = IFQ_MAXLEN; /* max # of packets on queue */
|
||||
|
||||
PR_WRAP_USRREQ(natm_usrreq)
|
||||
|
||||
#define natm_usrreq natm_usrreq_wrapper
|
||||
|
||||
const struct protosw natmsw[] = {
|
||||
{ .pr_type = SOCK_STREAM,
|
||||
.pr_domain = &natmdomain,
|
||||
@ -70,7 +65,7 @@ const struct protosw natmsw[] = {
|
||||
.pr_output = 0,
|
||||
.pr_ctlinput = 0,
|
||||
.pr_ctloutput = 0,
|
||||
.pr_usrreq = natm_usrreq,
|
||||
.pr_usrreqs = &natm_usrreq,
|
||||
.pr_init = 0,
|
||||
.pr_fasttimo = 0,
|
||||
.pr_slowtimo = 0,
|
||||
@ -84,7 +79,7 @@ const struct protosw natmsw[] = {
|
||||
.pr_output = 0,
|
||||
.pr_ctlinput = 0,
|
||||
.pr_ctloutput = 0,
|
||||
.pr_usrreq = natm_usrreq,
|
||||
.pr_usrreqs = &natm_usrreq,
|
||||
.pr_init = 0,
|
||||
.pr_fasttimo = 0,
|
||||
.pr_slowtimo = 0,
|
||||
@ -98,7 +93,7 @@ const struct protosw natmsw[] = {
|
||||
.pr_output = 0,
|
||||
.pr_ctlinput = 0,
|
||||
.pr_ctloutput = 0,
|
||||
.pr_usrreq = natm_usrreq,
|
||||
.pr_usrreqs = &natm_usrreqs,
|
||||
.pr_init = 0,
|
||||
.pr_fasttimo = 0,
|
||||
.pr_slowtimo = 0,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_socket.c,v 1.190 2013/09/14 22:29:08 martin Exp $ */
|
||||
/* $NetBSD: nfs_socket.c,v 1.191 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1991, 1993, 1995
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.190 2013/09/14 22:29:08 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.191 2014/05/18 14:46:16 rmind Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_nfs.h"
|
||||
@ -805,11 +805,11 @@ nfs_timer(void *arg)
|
||||
nmp->nm_sent < nmp->nm_cwnd) &&
|
||||
(m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
|
||||
if (so->so_state & SS_ISCONNECTED)
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
|
||||
NULL, NULL, NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_SEND, m, NULL, NULL, NULL);
|
||||
else
|
||||
error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
|
||||
nmp->nm_nam, NULL, NULL);
|
||||
error = (*so->so_proto->pr_usrreqs->pr_generic)(so,
|
||||
PRU_SEND, m, nmp->nm_nam, NULL, NULL);
|
||||
if (error) {
|
||||
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) {
|
||||
#ifdef DEBUG
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: param.h,v 1.451 2014/05/08 08:21:53 hannken Exp $ */
|
||||
/* $NetBSD: param.h,v 1.452 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
* 2.99.9 (299000900)
|
||||
*/
|
||||
|
||||
#define __NetBSD_Version__ 699004100 /* NetBSD 6.99.41 */
|
||||
#define __NetBSD_Version__ 699004200 /* NetBSD 6.99.42 */
|
||||
|
||||
#define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
|
||||
(m) * 1000000) + (p) * 100) <= __NetBSD_Version__)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: protosw.h,v 1.44 2008/08/06 15:01:24 plunky Exp $ */
|
||||
/* $NetBSD: protosw.h,v 1.45 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -64,6 +64,7 @@ struct sockopt;
|
||||
struct domain;
|
||||
struct proc;
|
||||
struct lwp;
|
||||
struct pr_usrreqs;
|
||||
|
||||
struct protosw {
|
||||
int pr_type; /* socket type used for */
|
||||
@ -81,10 +82,8 @@ struct protosw {
|
||||
int (*pr_ctloutput) /* control output (from above) */
|
||||
(int, struct socket *, struct sockopt *);
|
||||
|
||||
/* user-protocol hook */
|
||||
int (*pr_usrreq) /* user request: see list below */
|
||||
(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *, struct lwp *);
|
||||
/* user-protocol hooks */
|
||||
const struct pr_usrreqs *pr_usrreqs;
|
||||
|
||||
/* utility hooks */
|
||||
void (*pr_init) /* initialization hook */
|
||||
@ -233,6 +232,12 @@ static const char * const prcorequests[] = {
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
struct pr_usrreqs {
|
||||
int (*pr_generic)(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *, struct lwp *);
|
||||
};
|
||||
|
||||
/*
|
||||
* Monotonically increasing time values for slow and fast timers.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: un.h,v 1.46 2011/06/26 16:43:12 christos Exp $ */
|
||||
/* $NetBSD: un.h,v 1.47 2014/05/18 14:46:16 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -71,12 +71,13 @@ struct unpcbid {
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
struct unpcb;
|
||||
struct socket;
|
||||
struct sockopt;
|
||||
|
||||
int uipc_usrreq(struct socket *, int, struct mbuf *,
|
||||
struct mbuf *, struct mbuf *, struct lwp *);
|
||||
extern const struct pr_usrreqs unp_usrreqs;
|
||||
|
||||
int uipc_ctloutput(int, struct socket *, struct sockopt *);
|
||||
void uipc_init (void);
|
||||
kmutex_t *uipc_dgramlock (void);
|
||||
|
Loading…
Reference in New Issue
Block a user