Generally migrate to ANSI function headers, and remove 'register' use.
This commit is contained in:
parent
002b1f0bba
commit
d19e16a72c
@ -197,11 +197,11 @@ socket_zone_change(void *tag)
|
|||||||
static void
|
static void
|
||||||
domaininit(void *dummy)
|
domaininit(void *dummy)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Before we do any setup, make sure to initialize the
|
* Before we do any setup, make sure to initialize the
|
||||||
* zone allocator we get struct sockets from.
|
* zone allocator we get struct sockets from.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
|
socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
|
||||||
NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
|
NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
|
||||||
uma_zone_set_max(socket_zone, maxsockets);
|
uma_zone_set_max(socket_zone, maxsockets);
|
||||||
@ -229,6 +229,7 @@ domaininit(void *dummy)
|
|||||||
static void
|
static void
|
||||||
domainfinalize(void *dummy)
|
domainfinalize(void *dummy)
|
||||||
{
|
{
|
||||||
|
|
||||||
mtx_lock(&dom_mtx);
|
mtx_lock(&dom_mtx);
|
||||||
KASSERT(domain_init_status == 1, ("domainfinalize called too late!"));
|
KASSERT(domain_init_status == 1, ("domainfinalize called too late!"));
|
||||||
domain_init_status = 2;
|
domain_init_status = 2;
|
||||||
@ -239,12 +240,10 @@ domainfinalize(void *dummy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct protosw *
|
struct protosw *
|
||||||
pffindtype(family, type)
|
pffindtype(int family, int type)
|
||||||
int family;
|
|
||||||
int type;
|
|
||||||
{
|
{
|
||||||
register struct domain *dp;
|
struct domain *dp;
|
||||||
register struct protosw *pr;
|
struct protosw *pr;
|
||||||
|
|
||||||
for (dp = domains; dp; dp = dp->dom_next)
|
for (dp = domains; dp; dp = dp->dom_next)
|
||||||
if (dp->dom_family == family)
|
if (dp->dom_family == family)
|
||||||
@ -258,13 +257,10 @@ found:
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct protosw *
|
struct protosw *
|
||||||
pffindproto(family, protocol, type)
|
pffindproto(int family, int protocol, int type)
|
||||||
int family;
|
|
||||||
int protocol;
|
|
||||||
int type;
|
|
||||||
{
|
{
|
||||||
register struct domain *dp;
|
struct domain *dp;
|
||||||
register struct protosw *pr;
|
struct protosw *pr;
|
||||||
struct protosw *maybe = 0;
|
struct protosw *maybe = 0;
|
||||||
|
|
||||||
if (family == 0)
|
if (family == 0)
|
||||||
@ -290,9 +286,7 @@ found:
|
|||||||
* accept requests before it is registered.
|
* accept requests before it is registered.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
pf_proto_register(family, npr)
|
pf_proto_register(int family, struct protosw *npr)
|
||||||
int family;
|
|
||||||
struct protosw *npr;
|
|
||||||
{
|
{
|
||||||
struct domain *dp;
|
struct domain *dp;
|
||||||
struct protosw *pr, *fpr;
|
struct protosw *pr, *fpr;
|
||||||
@ -359,10 +353,7 @@ found:
|
|||||||
* all sockets and release all locks and memory references.
|
* all sockets and release all locks and memory references.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
pf_proto_unregister(family, protocol, type)
|
pf_proto_unregister(int family, int protocol, int type)
|
||||||
int family;
|
|
||||||
int protocol;
|
|
||||||
int type;
|
|
||||||
{
|
{
|
||||||
struct domain *dp;
|
struct domain *dp;
|
||||||
struct protosw *pr, *dpr;
|
struct protosw *pr, *dpr;
|
||||||
@ -427,12 +418,10 @@ found:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pfctlinput(cmd, sa)
|
pfctlinput(int cmd, struct sockaddr *sa)
|
||||||
int cmd;
|
|
||||||
struct sockaddr *sa;
|
|
||||||
{
|
{
|
||||||
register struct domain *dp;
|
struct domain *dp;
|
||||||
register struct protosw *pr;
|
struct protosw *pr;
|
||||||
|
|
||||||
for (dp = domains; dp; dp = dp->dom_next)
|
for (dp = domains; dp; dp = dp->dom_next)
|
||||||
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
|
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
|
||||||
@ -441,10 +430,7 @@ pfctlinput(cmd, sa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pfctlinput2(cmd, sa, ctlparam)
|
pfctlinput2(int cmd, struct sockaddr *sa, void *ctlparam)
|
||||||
int cmd;
|
|
||||||
struct sockaddr *sa;
|
|
||||||
void *ctlparam;
|
|
||||||
{
|
{
|
||||||
struct domain *dp;
|
struct domain *dp;
|
||||||
struct protosw *pr;
|
struct protosw *pr;
|
||||||
@ -467,11 +453,10 @@ pfctlinput2(cmd, sa, ctlparam)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pfslowtimo(arg)
|
pfslowtimo(void *arg)
|
||||||
void *arg;
|
|
||||||
{
|
{
|
||||||
register struct domain *dp;
|
struct domain *dp;
|
||||||
register struct protosw *pr;
|
struct protosw *pr;
|
||||||
|
|
||||||
NET_ASSERT_GIANT();
|
NET_ASSERT_GIANT();
|
||||||
|
|
||||||
@ -483,11 +468,10 @@ pfslowtimo(arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pffasttimo(arg)
|
pffasttimo(void *arg)
|
||||||
void *arg;
|
|
||||||
{
|
{
|
||||||
register struct domain *dp;
|
struct domain *dp;
|
||||||
register struct protosw *pr;
|
struct protosw *pr;
|
||||||
|
|
||||||
NET_ASSERT_GIANT();
|
NET_ASSERT_GIANT();
|
||||||
|
|
||||||
|
@ -349,7 +349,6 @@ sbdestroy(struct sockbuf *sb, struct socket *so)
|
|||||||
sbrelease_internal(sb, so);
|
sbrelease_internal(sb, so);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Routines to add and remove data from an mbuf queue.
|
* Routines to add and remove data from an mbuf queue.
|
||||||
*
|
*
|
||||||
@ -902,7 +901,6 @@ sbdrop(struct sockbuf *sb, int len)
|
|||||||
SOCKBUF_UNLOCK(sb);
|
SOCKBUF_UNLOCK(sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maintain a pointer and offset pair into the socket buffer mbuf chain to
|
* Maintain a pointer and offset pair into the socket buffer mbuf chain to
|
||||||
* avoid traversal of the entire socket buffer for larger offsets.
|
* avoid traversal of the entire socket buffer for larger offsets.
|
||||||
@ -981,12 +979,9 @@ sbdroprecord(struct sockbuf *sb)
|
|||||||
* type for presentation on a socket buffer.
|
* type for presentation on a socket buffer.
|
||||||
*/
|
*/
|
||||||
struct mbuf *
|
struct mbuf *
|
||||||
sbcreatecontrol(p, size, type, level)
|
sbcreatecontrol(caddr_t p, int size, int type, int level)
|
||||||
caddr_t p;
|
|
||||||
register int size;
|
|
||||||
int type, level;
|
|
||||||
{
|
{
|
||||||
register struct cmsghdr *cp;
|
struct cmsghdr *cp;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
|
|
||||||
if (CMSG_SPACE((u_int)size) > MCLBYTES)
|
if (CMSG_SPACE((u_int)size) > MCLBYTES)
|
||||||
@ -1020,6 +1015,7 @@ sbcreatecontrol(p, size, type, level)
|
|||||||
void
|
void
|
||||||
sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb)
|
sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb)
|
||||||
{
|
{
|
||||||
|
|
||||||
xsb->sb_cc = sb->sb_cc;
|
xsb->sb_cc = sb->sb_cc;
|
||||||
xsb->sb_hiwat = sb->sb_hiwat;
|
xsb->sb_hiwat = sb->sb_hiwat;
|
||||||
xsb->sb_mbcnt = sb->sb_mbcnt;
|
xsb->sb_mbcnt = sb->sb_mbcnt;
|
||||||
|
@ -327,13 +327,8 @@ sodealloc(struct socket *so)
|
|||||||
* closed with soclose().
|
* closed with soclose().
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
socreate(dom, aso, type, proto, cred, td)
|
socreate(int dom, struct socket **aso, int type, int proto,
|
||||||
int dom;
|
struct ucred *cred, struct thread *td)
|
||||||
struct socket **aso;
|
|
||||||
int type;
|
|
||||||
int proto;
|
|
||||||
struct ucred *cred;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
struct protosw *prp;
|
struct protosw *prp;
|
||||||
struct socket *so;
|
struct socket *so;
|
||||||
@ -406,11 +401,9 @@ SYSCTL_INT(_regression, OID_AUTO, sonewconn_earlytest, CTLFLAG_RW,
|
|||||||
* Note: the ref count on the socket is 0 on return.
|
* Note: the ref count on the socket is 0 on return.
|
||||||
*/
|
*/
|
||||||
struct socket *
|
struct socket *
|
||||||
sonewconn(head, connstatus)
|
sonewconn(struct socket *head, int connstatus)
|
||||||
register struct socket *head;
|
|
||||||
int connstatus;
|
|
||||||
{
|
{
|
||||||
register struct socket *so;
|
struct socket *so;
|
||||||
int over;
|
int over;
|
||||||
|
|
||||||
ACCEPT_LOCK();
|
ACCEPT_LOCK();
|
||||||
@ -492,10 +485,7 @@ sonewconn(head, connstatus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sobind(so, nam, td)
|
sobind(struct socket *so, struct sockaddr *nam, struct thread *td)
|
||||||
struct socket *so;
|
|
||||||
struct sockaddr *nam;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return ((*so->so_proto->pr_usrreqs->pru_bind)(so, nam, td));
|
return ((*so->so_proto->pr_usrreqs->pru_bind)(so, nam, td));
|
||||||
@ -514,18 +504,14 @@ sobind(so, nam, td)
|
|||||||
* socket-layer test and set to avoid races at the socket layer.
|
* socket-layer test and set to avoid races at the socket layer.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
solisten(so, backlog, td)
|
solisten(struct socket *so, int backlog, struct thread *td)
|
||||||
struct socket *so;
|
|
||||||
int backlog;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return ((*so->so_proto->pr_usrreqs->pru_listen)(so, backlog, td));
|
return ((*so->so_proto->pr_usrreqs->pru_listen)(so, backlog, td));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
solisten_proto_check(so)
|
solisten_proto_check(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
SOCK_LOCK_ASSERT(so);
|
SOCK_LOCK_ASSERT(so);
|
||||||
@ -537,9 +523,7 @@ solisten_proto_check(so)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
solisten_proto(so, backlog)
|
solisten_proto(struct socket *so, int backlog)
|
||||||
struct socket *so;
|
|
||||||
int backlog;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
SOCK_LOCK_ASSERT(so);
|
SOCK_LOCK_ASSERT(so);
|
||||||
@ -571,8 +555,7 @@ solisten_proto(so, backlog)
|
|||||||
* conditions are right, can succeed.
|
* conditions are right, can succeed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sofree(so)
|
sofree(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
struct protosw *pr = so->so_proto;
|
struct protosw *pr = so->so_proto;
|
||||||
struct socket *head;
|
struct socket *head;
|
||||||
@ -647,8 +630,7 @@ sofree(so)
|
|||||||
* not be freed until the ref count reaches zero.
|
* not be freed until the ref count reaches zero.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
soclose(so)
|
soclose(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
@ -723,8 +705,7 @@ drop:
|
|||||||
* to review in the future.
|
* to review in the future.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
soabort(so)
|
soabort(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -747,9 +728,7 @@ soabort(so)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
soaccept(so, nam)
|
soaccept(struct socket *so, struct sockaddr **nam)
|
||||||
struct socket *so;
|
|
||||||
struct sockaddr **nam;
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@ -762,10 +741,7 @@ soaccept(so, nam)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
soconnect(so, nam, td)
|
soconnect(struct socket *so, struct sockaddr *nam, struct thread *td)
|
||||||
struct socket *so;
|
|
||||||
struct sockaddr *nam;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@ -793,17 +769,14 @@ soconnect(so, nam, td)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
soconnect2(so1, so2)
|
soconnect2(struct socket *so1, struct socket *so2)
|
||||||
struct socket *so1;
|
|
||||||
struct socket *so2;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return ((*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2));
|
return ((*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sodisconnect(so)
|
sodisconnect(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@ -946,14 +919,8 @@ out:
|
|||||||
#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK)
|
#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK)
|
||||||
|
|
||||||
int
|
int
|
||||||
sosend_dgram(so, addr, uio, top, control, flags, td)
|
sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio,
|
||||||
struct socket *so;
|
struct mbuf *top, struct mbuf *control, int flags, struct thread *td)
|
||||||
struct sockaddr *addr;
|
|
||||||
struct uio *uio;
|
|
||||||
struct mbuf *top;
|
|
||||||
struct mbuf *control;
|
|
||||||
int flags;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
long space, resid;
|
long space, resid;
|
||||||
int clen = 0, error, dontroute;
|
int clen = 0, error, dontroute;
|
||||||
@ -1126,14 +1093,8 @@ out:
|
|||||||
* on return.
|
* on return.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
sosend_generic(so, addr, uio, top, control, flags, td)
|
sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio,
|
||||||
struct socket *so;
|
struct mbuf *top, struct mbuf *control, int flags, struct thread *td)
|
||||||
struct sockaddr *addr;
|
|
||||||
struct uio *uio;
|
|
||||||
struct mbuf *top;
|
|
||||||
struct mbuf *control;
|
|
||||||
int flags;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
long space, resid;
|
long space, resid;
|
||||||
int clen = 0, error, dontroute;
|
int clen = 0, error, dontroute;
|
||||||
@ -1314,14 +1275,8 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sosend(so, addr, uio, top, control, flags, td)
|
sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
|
||||||
struct socket *so;
|
struct mbuf *top, struct mbuf *control, int flags, struct thread *td)
|
||||||
struct sockaddr *addr;
|
|
||||||
struct uio *uio;
|
|
||||||
struct mbuf *top;
|
|
||||||
struct mbuf *control;
|
|
||||||
int flags;
|
|
||||||
struct thread *td;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* XXXRW: Temporary debugging. */
|
/* XXXRW: Temporary debugging. */
|
||||||
@ -1341,10 +1296,7 @@ sosend(so, addr, uio, top, control, flags, td)
|
|||||||
* unable to return an mbuf chain to the caller.
|
* unable to return an mbuf chain to the caller.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
soreceive_rcvoob(so, uio, flags)
|
soreceive_rcvoob(struct socket *so, struct uio *uio, int flags)
|
||||||
struct socket *so;
|
|
||||||
struct uio *uio;
|
|
||||||
int flags;
|
|
||||||
{
|
{
|
||||||
struct protosw *pr = so->so_proto;
|
struct protosw *pr = so->so_proto;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
@ -1437,13 +1389,8 @@ sockbuf_pushsync(struct sockbuf *sb, struct mbuf *nextrecord)
|
|||||||
* the count in uio_resid.
|
* the count in uio_resid.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
soreceive_generic(so, psa, uio, mp0, controlp, flagsp)
|
soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio,
|
||||||
struct socket *so;
|
struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
|
||||||
struct sockaddr **psa;
|
|
||||||
struct uio *uio;
|
|
||||||
struct mbuf **mp0;
|
|
||||||
struct mbuf **controlp;
|
|
||||||
int *flagsp;
|
|
||||||
{
|
{
|
||||||
struct mbuf *m, **mp;
|
struct mbuf *m, **mp;
|
||||||
int flags, len, error, offset;
|
int flags, len, error, offset;
|
||||||
@ -1895,13 +1842,8 @@ release:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
soreceive(so, psa, uio, mp0, controlp, flagsp)
|
soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio,
|
||||||
struct socket *so;
|
struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
|
||||||
struct sockaddr **psa;
|
|
||||||
struct uio *uio;
|
|
||||||
struct mbuf **mp0;
|
|
||||||
struct mbuf **controlp;
|
|
||||||
int *flagsp;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* XXXRW: Temporary debugging. */
|
/* XXXRW: Temporary debugging. */
|
||||||
@ -1913,9 +1855,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
soshutdown(so, how)
|
soshutdown(struct socket *so, int how)
|
||||||
struct socket *so;
|
|
||||||
int how;
|
|
||||||
{
|
{
|
||||||
struct protosw *pr = so->so_proto;
|
struct protosw *pr = so->so_proto;
|
||||||
|
|
||||||
@ -1930,8 +1870,7 @@ soshutdown(so, how)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sorflush(so)
|
sorflush(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
struct sockbuf *sb = &so->so_rcv;
|
struct sockbuf *sb = &so->so_rcv;
|
||||||
struct protosw *pr = so->so_proto;
|
struct protosw *pr = so->so_proto;
|
||||||
@ -1977,11 +1916,7 @@ sorflush(so)
|
|||||||
* routines.
|
* routines.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
sooptcopyin(sopt, buf, len, minlen)
|
sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen)
|
||||||
struct sockopt *sopt;
|
|
||||||
void *buf;
|
|
||||||
size_t len;
|
|
||||||
size_t minlen;
|
|
||||||
{
|
{
|
||||||
size_t valsize;
|
size_t valsize;
|
||||||
|
|
||||||
@ -2024,9 +1959,7 @@ so_setsockopt(struct socket *so, int level, int optname, void *optval,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sosetopt(so, sopt)
|
sosetopt(struct socket *so, struct sockopt *sopt)
|
||||||
struct socket *so;
|
|
||||||
struct sockopt *sopt;
|
|
||||||
{
|
{
|
||||||
int error, optval;
|
int error, optval;
|
||||||
struct linger l;
|
struct linger l;
|
||||||
@ -2241,9 +2174,7 @@ sooptcopyout(struct sockopt *sopt, const void *buf, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sogetopt(so, sopt)
|
sogetopt(struct socket *so, struct sockopt *sopt)
|
||||||
struct socket *so;
|
|
||||||
struct sockopt *sopt;
|
|
||||||
{
|
{
|
||||||
int error, optval;
|
int error, optval;
|
||||||
struct linger l;
|
struct linger l;
|
||||||
@ -2507,9 +2438,9 @@ soopt_mcopyout(struct sockopt *sopt, struct mbuf *m)
|
|||||||
* out-of-band data, which will then notify socket consumers.
|
* out-of-band data, which will then notify socket consumers.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sohasoutofband(so)
|
sohasoutofband(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (so->so_sigio != NULL)
|
if (so->so_sigio != NULL)
|
||||||
pgsigio(&so->so_sigio, SIGURG, 0);
|
pgsigio(&so->so_sigio, SIGURG, 0);
|
||||||
selwakeuppri(&so->so_rcv.sb_sel, PSOCK);
|
selwakeuppri(&so->so_rcv.sb_sel, PSOCK);
|
||||||
@ -2608,30 +2539,35 @@ soo_kqfilter(struct file *fp, struct knote *kn)
|
|||||||
int
|
int
|
||||||
pru_accept_notsupp(struct socket *so, struct sockaddr **nam)
|
pru_accept_notsupp(struct socket *so, struct sockaddr **nam)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_attach_notsupp(struct socket *so, int proto, struct thread *td)
|
pru_attach_notsupp(struct socket *so, int proto, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_bind_notsupp(struct socket *so, struct sockaddr *nam, struct thread *td)
|
pru_bind_notsupp(struct socket *so, struct sockaddr *nam, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_connect_notsupp(struct socket *so, struct sockaddr *nam, struct thread *td)
|
pru_connect_notsupp(struct socket *so, struct sockaddr *nam, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_connect2_notsupp(struct socket *so1, struct socket *so2)
|
pru_connect2_notsupp(struct socket *so1, struct socket *so2)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2639,36 +2575,42 @@ int
|
|||||||
pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data,
|
pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data,
|
||||||
struct ifnet *ifp, struct thread *td)
|
struct ifnet *ifp, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_disconnect_notsupp(struct socket *so)
|
pru_disconnect_notsupp(struct socket *so)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_listen_notsupp(struct socket *so, int backlog, struct thread *td)
|
pru_listen_notsupp(struct socket *so, int backlog, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_peeraddr_notsupp(struct socket *so, struct sockaddr **nam)
|
pru_peeraddr_notsupp(struct socket *so, struct sockaddr **nam)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_rcvd_notsupp(struct socket *so, int flags)
|
pru_rcvd_notsupp(struct socket *so, int flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags)
|
pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2676,6 +2618,7 @@ int
|
|||||||
pru_send_notsupp(struct socket *so, int flags, struct mbuf *m,
|
pru_send_notsupp(struct socket *so, int flags, struct mbuf *m,
|
||||||
struct sockaddr *addr, struct mbuf *control, struct thread *td)
|
struct sockaddr *addr, struct mbuf *control, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2686,6 +2629,7 @@ pru_send_notsupp(struct socket *so, int flags, struct mbuf *m,
|
|||||||
int
|
int
|
||||||
pru_sense_null(struct socket *so, struct stat *sb)
|
pru_sense_null(struct socket *so, struct stat *sb)
|
||||||
{
|
{
|
||||||
|
|
||||||
sb->st_blksize = so->so_snd.sb_hiwat;
|
sb->st_blksize = so->so_snd.sb_hiwat;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2693,12 +2637,14 @@ pru_sense_null(struct socket *so, struct stat *sb)
|
|||||||
int
|
int
|
||||||
pru_shutdown_notsupp(struct socket *so)
|
pru_shutdown_notsupp(struct socket *so)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_sockaddr_notsupp(struct socket *so, struct sockaddr **nam)
|
pru_sockaddr_notsupp(struct socket *so, struct sockaddr **nam)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2706,14 +2652,15 @@ int
|
|||||||
pru_sosend_notsupp(struct socket *so, struct sockaddr *addr, struct uio *uio,
|
pru_sosend_notsupp(struct socket *so, struct sockaddr *addr, struct uio *uio,
|
||||||
struct mbuf *top, struct mbuf *control, int flags, struct thread *td)
|
struct mbuf *top, struct mbuf *control, int flags, struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pru_soreceive_notsupp(struct socket *so, struct sockaddr **paddr,
|
pru_soreceive_notsupp(struct socket *so, struct sockaddr **paddr,
|
||||||
struct uio *uio, struct mbuf **mp0, struct mbuf **controlp,
|
struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
|
||||||
int *flagsp)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2721,6 +2668,7 @@ int
|
|||||||
pru_sopoll_notsupp(struct socket *so, int events, struct ucred *cred,
|
pru_sopoll_notsupp(struct socket *so, int events, struct ucred *cred,
|
||||||
struct thread *td)
|
struct thread *td)
|
||||||
{
|
{
|
||||||
|
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2866,8 +2814,7 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
|
|||||||
* here will sometimes cause software-interrupt process scheduling.
|
* here will sometimes cause software-interrupt process scheduling.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
soisconnecting(so)
|
soisconnecting(struct socket *so)
|
||||||
register struct socket *so;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
SOCK_LOCK(so);
|
SOCK_LOCK(so);
|
||||||
@ -2877,8 +2824,7 @@ soisconnecting(so)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
soisconnected(so)
|
soisconnected(struct socket *so)
|
||||||
struct socket *so;
|
|
||||||
{
|
{
|
||||||
struct socket *head;
|
struct socket *head;
|
||||||
|
|
||||||
@ -2919,8 +2865,7 @@ soisconnected(so)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
soisdisconnecting(so)
|
soisdisconnecting(struct socket *so)
|
||||||
register struct socket *so;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2939,8 +2884,7 @@ soisdisconnecting(so)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
soisdisconnected(so)
|
soisdisconnected(struct socket *so)
|
||||||
register struct socket *so;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2984,6 +2928,7 @@ sodupsockaddr(const struct sockaddr *sa, int mflags)
|
|||||||
void
|
void
|
||||||
sotoxsocket(struct socket *so, struct xsocket *xso)
|
sotoxsocket(struct socket *so, struct xsocket *xso)
|
||||||
{
|
{
|
||||||
|
|
||||||
xso->xso_len = sizeof *xso;
|
xso->xso_len = sizeof *xso;
|
||||||
xso->xso_so = so;
|
xso->xso_so = so;
|
||||||
xso->so_type = so->so_type;
|
xso->so_type = so->so_type;
|
||||||
|
@ -153,7 +153,7 @@ getsock(struct filedesc *fdp, int fd, struct file **fpp, u_int *fflagp)
|
|||||||
int
|
int
|
||||||
socket(td, uap)
|
socket(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct socket_args /* {
|
struct socket_args /* {
|
||||||
int domain;
|
int domain;
|
||||||
int type;
|
int type;
|
||||||
int protocol;
|
int protocol;
|
||||||
@ -198,7 +198,7 @@ socket(td, uap)
|
|||||||
int
|
int
|
||||||
bind(td, uap)
|
bind(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct bind_args /* {
|
struct bind_args /* {
|
||||||
int s;
|
int s;
|
||||||
caddr_t name;
|
caddr_t name;
|
||||||
int namelen;
|
int namelen;
|
||||||
@ -251,7 +251,7 @@ done2:
|
|||||||
int
|
int
|
||||||
listen(td, uap)
|
listen(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct listen_args /* {
|
struct listen_args /* {
|
||||||
int s;
|
int s;
|
||||||
int backlog;
|
int backlog;
|
||||||
} */ *uap;
|
} */ *uap;
|
||||||
@ -287,7 +287,7 @@ done:
|
|||||||
static int
|
static int
|
||||||
accept1(td, uap, compat)
|
accept1(td, uap, compat)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct accept_args /* {
|
struct accept_args /* {
|
||||||
int s;
|
int s;
|
||||||
struct sockaddr * __restrict name;
|
struct sockaddr * __restrict name;
|
||||||
socklen_t * __restrict anamelen;
|
socklen_t * __restrict anamelen;
|
||||||
@ -520,7 +520,7 @@ oaccept(td, uap)
|
|||||||
int
|
int
|
||||||
connect(td, uap)
|
connect(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct connect_args /* {
|
struct connect_args /* {
|
||||||
int s;
|
int s;
|
||||||
caddr_t name;
|
caddr_t name;
|
||||||
int namelen;
|
int namelen;
|
||||||
@ -603,14 +603,14 @@ done2:
|
|||||||
int
|
int
|
||||||
socketpair(td, uap)
|
socketpair(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct socketpair_args /* {
|
struct socketpair_args /* {
|
||||||
int domain;
|
int domain;
|
||||||
int type;
|
int type;
|
||||||
int protocol;
|
int protocol;
|
||||||
int *rsv;
|
int *rsv;
|
||||||
} */ *uap;
|
} */ *uap;
|
||||||
{
|
{
|
||||||
register struct filedesc *fdp = td->td_proc->p_fd;
|
struct filedesc *fdp = td->td_proc->p_fd;
|
||||||
struct file *fp1, *fp2;
|
struct file *fp1, *fp2;
|
||||||
struct socket *so1, *so2;
|
struct socket *so1, *so2;
|
||||||
int fd, error, sv[2];
|
int fd, error, sv[2];
|
||||||
@ -690,9 +690,9 @@ done2:
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
sendit(td, s, mp, flags)
|
sendit(td, s, mp, flags)
|
||||||
register struct thread *td;
|
struct thread *td;
|
||||||
int s;
|
int s;
|
||||||
register struct msghdr *mp;
|
struct msghdr *mp;
|
||||||
int flags;
|
int flags;
|
||||||
{
|
{
|
||||||
struct mbuf *control;
|
struct mbuf *control;
|
||||||
@ -725,7 +725,7 @@ sendit(td, s, mp, flags)
|
|||||||
goto bad;
|
goto bad;
|
||||||
#ifdef COMPAT_OLDSOCK
|
#ifdef COMPAT_OLDSOCK
|
||||||
if (mp->msg_flags == MSG_COMPAT) {
|
if (mp->msg_flags == MSG_COMPAT) {
|
||||||
register struct cmsghdr *cm;
|
struct cmsghdr *cm;
|
||||||
|
|
||||||
M_PREPEND(control, sizeof(*cm), M_TRYWAIT);
|
M_PREPEND(control, sizeof(*cm), M_TRYWAIT);
|
||||||
if (control == 0) {
|
if (control == 0) {
|
||||||
@ -834,7 +834,7 @@ bad2:
|
|||||||
int
|
int
|
||||||
sendto(td, uap)
|
sendto(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct sendto_args /* {
|
struct sendto_args /* {
|
||||||
int s;
|
int s;
|
||||||
caddr_t buf;
|
caddr_t buf;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -865,7 +865,7 @@ sendto(td, uap)
|
|||||||
int
|
int
|
||||||
osend(td, uap)
|
osend(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct osend_args /* {
|
struct osend_args /* {
|
||||||
int s;
|
int s;
|
||||||
caddr_t buf;
|
caddr_t buf;
|
||||||
int len;
|
int len;
|
||||||
@ -1131,7 +1131,7 @@ recvit(td, s, mp, namelenp)
|
|||||||
int
|
int
|
||||||
recvfrom(td, uap)
|
recvfrom(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct recvfrom_args /* {
|
struct recvfrom_args /* {
|
||||||
int s;
|
int s;
|
||||||
caddr_t buf;
|
caddr_t buf;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -1180,7 +1180,7 @@ orecvfrom(td, uap)
|
|||||||
int
|
int
|
||||||
orecv(td, uap)
|
orecv(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct orecv_args /* {
|
struct orecv_args /* {
|
||||||
int s;
|
int s;
|
||||||
caddr_t buf;
|
caddr_t buf;
|
||||||
int len;
|
int len;
|
||||||
@ -1276,7 +1276,7 @@ recvmsg(td, uap)
|
|||||||
int
|
int
|
||||||
shutdown(td, uap)
|
shutdown(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct shutdown_args /* {
|
struct shutdown_args /* {
|
||||||
int s;
|
int s;
|
||||||
int how;
|
int how;
|
||||||
} */ *uap;
|
} */ *uap;
|
||||||
@ -1300,7 +1300,7 @@ shutdown(td, uap)
|
|||||||
int
|
int
|
||||||
setsockopt(td, uap)
|
setsockopt(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct setsockopt_args /* {
|
struct setsockopt_args /* {
|
||||||
int s;
|
int s;
|
||||||
int level;
|
int level;
|
||||||
int name;
|
int name;
|
||||||
@ -1364,7 +1364,7 @@ kern_setsockopt(td, s, level, name, val, valseg, valsize)
|
|||||||
int
|
int
|
||||||
getsockopt(td, uap)
|
getsockopt(td, uap)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct getsockopt_args /* {
|
struct getsockopt_args /* {
|
||||||
int s;
|
int s;
|
||||||
int level;
|
int level;
|
||||||
int name;
|
int name;
|
||||||
@ -1448,7 +1448,7 @@ kern_getsockopt(td, s, level, name, val, valseg, valsize)
|
|||||||
static int
|
static int
|
||||||
getsockname1(td, uap, compat)
|
getsockname1(td, uap, compat)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct getsockname_args /* {
|
struct getsockname_args /* {
|
||||||
int fdes;
|
int fdes;
|
||||||
struct sockaddr * __restrict asa;
|
struct sockaddr * __restrict asa;
|
||||||
socklen_t * __restrict alen;
|
socklen_t * __restrict alen;
|
||||||
@ -1544,7 +1544,7 @@ ogetsockname(td, uap)
|
|||||||
static int
|
static int
|
||||||
getpeername1(td, uap, compat)
|
getpeername1(td, uap, compat)
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
register struct getpeername_args /* {
|
struct getpeername_args /* {
|
||||||
int fdes;
|
int fdes;
|
||||||
struct sockaddr * __restrict asa;
|
struct sockaddr * __restrict asa;
|
||||||
socklen_t * __restrict alen;
|
socklen_t * __restrict alen;
|
||||||
@ -1645,8 +1645,8 @@ sockargs(mp, buf, buflen, type)
|
|||||||
caddr_t buf;
|
caddr_t buf;
|
||||||
int buflen, type;
|
int buflen, type;
|
||||||
{
|
{
|
||||||
register struct sockaddr *sa;
|
struct sockaddr *sa;
|
||||||
register struct mbuf *m;
|
struct mbuf *m;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if ((u_int)buflen > MLEN) {
|
if ((u_int)buflen > MLEN) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user