raw_usrreq.c (29366) | raw_usrreq.c (31016) |
---|---|
1/* 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 | 1/* 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 |
34 * $Id: raw_usrreq.c,v 1.14 1997/08/16 19:15:27 wollman Exp $ | 34 * $Id: raw_usrreq.c,v 1.15 1997/09/14 03:10:38 peter Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/mbuf.h> 40#include <sys/proc.h> 41#include <sys/protosw.h> 42#include <sys/socket.h> --- 163 unchanged lines hidden (view full) --- 206} 207 208/* pru_listen is EOPNOTSUPP */ 209 210static int 211raw_upeeraddr(struct socket *so, struct sockaddr **nam) 212{ 213 struct rawcb *rp = sotorawcb(so); | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/mbuf.h> 40#include <sys/proc.h> 41#include <sys/protosw.h> 42#include <sys/socket.h> --- 163 unchanged lines hidden (view full) --- 206} 207 208/* pru_listen is EOPNOTSUPP */ 209 210static int 211raw_upeeraddr(struct socket *so, struct sockaddr **nam) 212{ 213 struct rawcb *rp = sotorawcb(so); |
214 unsigned len; | |
215 216 if (rp == 0) 217 return EINVAL; 218 if (rp->rcb_faddr == 0) { 219 return ENOTCONN; 220 } 221 *nam = dup_sockaddr(rp->rcb_faddr, 1); 222 return 0; --- 55 unchanged lines hidden (view full) --- 278 socantsendmore(so); 279 return 0; 280} 281 282static int 283raw_usockaddr(struct socket *so, struct sockaddr **nam) 284{ 285 struct rawcb *rp = sotorawcb(so); | 214 215 if (rp == 0) 216 return EINVAL; 217 if (rp->rcb_faddr == 0) { 218 return ENOTCONN; 219 } 220 *nam = dup_sockaddr(rp->rcb_faddr, 1); 221 return 0; --- 55 unchanged lines hidden (view full) --- 277 socantsendmore(so); 278 return 0; 279} 280 281static int 282raw_usockaddr(struct socket *so, struct sockaddr **nam) 283{ 284 struct rawcb *rp = sotorawcb(so); |
286 unsigned len; | |
287 288 if (rp == 0) 289 return EINVAL; 290 if (rp->rcb_laddr == 0) 291 return EINVAL; 292 *nam = dup_sockaddr(rp->rcb_laddr, 1); 293 return 0; 294} 295 296struct pr_usrreqs raw_usrreqs = { 297 raw_uabort, pru_accept_notsupp, raw_uattach, raw_ubind, raw_uconnect, 298 pru_connect2_notsupp, pru_control_notsupp, raw_udetach, 299 raw_udisconnect, pru_listen_notsupp, raw_upeeraddr, pru_rcvd_notsupp, 300 pru_rcvoob_notsupp, raw_usend, pru_sense_null, raw_ushutdown, 301 raw_usockaddr, sosend, soreceive, sopoll 302}; | 285 286 if (rp == 0) 287 return EINVAL; 288 if (rp->rcb_laddr == 0) 289 return EINVAL; 290 *nam = dup_sockaddr(rp->rcb_laddr, 1); 291 return 0; 292} 293 294struct pr_usrreqs raw_usrreqs = { 295 raw_uabort, pru_accept_notsupp, raw_uattach, raw_ubind, raw_uconnect, 296 pru_connect2_notsupp, pru_control_notsupp, raw_udetach, 297 raw_udisconnect, pru_listen_notsupp, raw_upeeraddr, pru_rcvd_notsupp, 298 pru_rcvoob_notsupp, raw_usend, pru_sense_null, raw_ushutdown, 299 raw_usockaddr, sosend, soreceive, sopoll 300}; |