raw_cb.c (180305) | raw_cb.c (180385) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 |
31 * $FreeBSD: head/sys/net/raw_cb.c 180305 2008-07-05 18:03:39Z rwatson $ | 31 * $FreeBSD: head/sys/net/raw_cb.c 180385 2008-07-09 15:48:16Z rwatson $ |
32 */ 33 34#include <sys/param.h> 35#include <sys/domain.h> 36#include <sys/lock.h> 37#include <sys/malloc.h> 38#include <sys/mutex.h> 39#include <sys/protosw.h> --- 56 unchanged lines hidden (view full) --- 96 struct socket *so = rp->rcb_socket; 97 98 KASSERT(so->so_pcb == rp, ("raw_detach: so_pcb != rp")); 99 100 so->so_pcb = NULL; 101 mtx_lock(&rawcb_mtx); 102 LIST_REMOVE(rp, list); 103 mtx_unlock(&rawcb_mtx); | 32 */ 33 34#include <sys/param.h> 35#include <sys/domain.h> 36#include <sys/lock.h> 37#include <sys/malloc.h> 38#include <sys/mutex.h> 39#include <sys/protosw.h> --- 56 unchanged lines hidden (view full) --- 96 struct socket *so = rp->rcb_socket; 97 98 KASSERT(so->so_pcb == rp, ("raw_detach: so_pcb != rp")); 99 100 so->so_pcb = NULL; 101 mtx_lock(&rawcb_mtx); 102 LIST_REMOVE(rp, list); 103 mtx_unlock(&rawcb_mtx); |
104#ifdef notdef 105 if (rp->rcb_laddr) 106 m_freem(dtom(rp->rcb_laddr)); 107 rp->rcb_laddr = 0; 108#endif | |
109 free((caddr_t)(rp), M_PCB); 110} | 104 free((caddr_t)(rp), M_PCB); 105} |
111 112/* 113 * Disconnect raw socket. 114 */ 115void 116raw_disconnect(struct rawcb *rp) 117{ 118 119#ifdef notdef 120 if (rp->rcb_faddr) 121 m_freem(dtom(rp->rcb_faddr)); 122 rp->rcb_faddr = 0; 123#endif 124} 125 126#ifdef notdef 127#include <sys/mbuf.h> 128 129int 130raw_bind(struct socket *so, struct mbuf *nam) 131{ 132 struct sockaddr *addr = mtod(nam, struct sockaddr *); 133 struct rawcb *rp; 134 135 if (ifnet == 0) 136 return (EADDRNOTAVAIL); 137 rp = sotorawcb(so); 138 nam = m_copym(nam, 0, M_COPYALL, M_WAIT); 139 rp->rcb_laddr = mtod(nam, struct sockaddr *); 140 return (0); 141} 142#endif | |