1/*- 2 * Copyright (c) 2004-2005 Robert N. M. Watson 3 * Copyright (c) 1995, Mike Mitchell 4 * Copyright (c) 1984, 1985, 1986, 1987, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 22 unchanged lines hidden (view full) --- 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)ipx_pcb.c 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/netipx/ipx_pcb.c 139925 2005-01-09 05:00:41Z rwatson $"); |
40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/malloc.h> 44#include <sys/socket.h> 45#include <sys/socketvar.h> 46 47#include <net/if.h> --- 13 unchanged lines hidden (view full) --- 61 struct ipxpcbhead *head; 62 struct thread *td; 63{ 64 register struct ipxpcb *ipxp; 65 66 MALLOC(ipxp, struct ipxpcb *, sizeof *ipxp, M_PCB, M_NOWAIT | M_ZERO); 67 if (ipxp == NULL) 68 return (ENOBUFS); |
69 IPX_LOCK_INIT(ipxp); |
70 ipxp->ipxp_socket = so; 71 if (ipxcksum) 72 ipxp->ipxp_flags |= IPXP_CHECKSUM; 73 LIST_INSERT_HEAD(head, ipxp, ipxp_list); 74 so->so_pcb = (caddr_t)ipxp; 75 return (0); 76} 77 --- 195 unchanged lines hidden (view full) --- 273 274 ACCEPT_LOCK(); 275 SOCK_LOCK(so); 276 so->so_pcb = NULL; 277 sotryfree(so); 278 if (ipxp->ipxp_route.ro_rt != NULL) 279 RTFREE(ipxp->ipxp_route.ro_rt); 280 LIST_REMOVE(ipxp, ipxp_list); |
281 IPX_LOCK_DESTROY(ipxp); |
282 FREE(ipxp, M_PCB); 283} 284 285void 286ipx_setsockaddr(ipxp, nam) 287 register struct ipxpcb *ipxp; 288 struct sockaddr **nam; 289{ --- 68 unchanged lines hidden --- |