2 * Copyright (c) 2003, 2004 Jeffrey Hsu
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Jeffrey M. Hsu.
16 * 4. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * $DragonFly: src/sys/sys/socketops.h,v 1.1 2004/03/04 10:29:24 hsu Exp $
36 #include <sys/protosw.h>
37 #include <sys/socket.h>
38 #include <sys/socketvar.h>
41 so_pru_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
42 struct mbuf *top, struct mbuf *control, int flags, struct thread *td)
44 return ((*so->so_proto->pr_usrreqs->pru_sosend)(so, addr, uio, top,
49 so_pru_soreceive(struct socket *so, struct sockaddr **paddr, struct uio *uio,
50 struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
52 return ((*so->so_proto->pr_usrreqs->pru_soreceive)(so, paddr, uio, mp0,
57 so_pru_abort(struct socket *so)
59 return ((*so->so_proto->pr_usrreqs->pru_abort)(so));
63 so_pru_accept(struct socket *so,
64 struct sockaddr **nam)
66 return ((*so->so_proto->pr_usrreqs->pru_accept)(so, nam));
70 so_pru_attach(struct socket *so, int proto, struct thread *td)
72 return ((*so->so_proto->pr_usrreqs->pru_attach)(so, proto, td));
76 so_pru_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
78 return ((*so->so_proto->pr_usrreqs->pru_bind)(so, nam, td));
82 so_pru_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
84 return ((*so->so_proto->pr_usrreqs->pru_connect)(so, nam, td));
88 so_pru_connect2(struct socket *so1, struct socket *so2)
90 return ((*so1->so_proto->pr_usrreqs->pru_connect2)(so1, so2));
94 so_pru_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
97 return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd, data, ifp,
102 so_pru_detach(struct socket *so)
104 return ((*so->so_proto->pr_usrreqs->pru_detach)(so));
108 so_pru_disconnect(struct socket *so)
110 return ((*so->so_proto->pr_usrreqs->pru_disconnect)(so));
114 so_pru_listen(struct socket *so, struct thread *td)
116 return ((*so->so_proto->pr_usrreqs->pru_listen)(so, td));
120 so_pru_peeraddr(struct socket *so,
121 struct sockaddr **nam)
123 return ((*so->so_proto->pr_usrreqs->pru_peeraddr)(so, nam));
127 so_pru_rcvd(struct socket *so, int flags)
129 return ((*so->so_proto->pr_usrreqs->pru_rcvd)(so, flags));
133 so_pru_rcvoob(struct socket *so, struct mbuf *m, int flags)
135 return ((*so->so_proto->pr_usrreqs->pru_rcvoob)(so, m, flags));
139 so_pru_send(struct socket *so, int flags, struct mbuf *m,
140 struct sockaddr *addr, struct mbuf *control, struct thread *td)
142 return ((*so->so_proto->pr_usrreqs->pru_send)(so, flags, m, addr,
147 so_pru_sense(struct socket *so, struct stat *sb)
149 return ((*so->so_proto->pr_usrreqs->pru_sense)(so, sb));
153 so_pru_shutdown(struct socket *so)
155 return ((*so->so_proto->pr_usrreqs->pru_shutdown)(so));
159 so_pru_sockaddr(struct socket *so, struct sockaddr **nam)
161 return ((*so->so_proto->pr_usrreqs->pru_sockaddr)(so, nam));
165 so_pru_sopoll(struct socket *so, int events, struct ucred *cred,
168 return ((*so->so_proto->pr_usrreqs->pru_sopoll)(so, events, cred, td));
172 so_pr_ctloutput(struct socket *so, struct sockopt *sopt)
174 return ((*so->so_proto->pr_ctloutput)(so, sopt));