ng_socket.c (163468) | ng_socket.c (163475) |
---|---|
1/* 2 * ng_socket.c 3 */ 4 5/*- 6 * Copyright (c) 1996-1999 Whistle Communications, Inc. 7 * All rights reserved. 8 * --- 23 unchanged lines hidden (view full) --- 32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36 * OF SUCH DAMAGE. 37 * 38 * Author: Julian Elischer <julian@freebsd.org> 39 * | 1/* 2 * ng_socket.c 3 */ 4 5/*- 6 * Copyright (c) 1996-1999 Whistle Communications, Inc. 7 * All rights reserved. 8 * --- 23 unchanged lines hidden (view full) --- 32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36 * OF SUCH DAMAGE. 37 * 38 * Author: Julian Elischer <julian@freebsd.org> 39 * |
40 * $FreeBSD: head/sys/netgraph/ng_socket.c 163468 2006-10-17 16:52:09Z glebius $ | 40 * $FreeBSD: head/sys/netgraph/ng_socket.c 163475 2006-10-18 07:47:07Z glebius $ |
41 * $Whistle: ng_socket.c,v 1.28 1999/11/01 09:24:52 julian Exp $ 42 */ 43 44/* 45 * Netgraph socket nodes 46 * 47 * There are two types of netgraph sockets, control and data. 48 * Control sockets have a netgraph node, but data sockets are --- 781 unchanged lines hidden (view full) --- 830 * Incoming messages get passed up to the control socket. 831 * Unless they are for us specifically (socket_type) 832 */ 833static int 834ngs_rcvmsg(node_p node, item_p item, hook_p lasthook) 835{ 836 struct ngsock *const priv = NG_NODE_PRIVATE(node); 837 struct ngpcb *const pcbp = priv->ctlsock; | 41 * $Whistle: ng_socket.c,v 1.28 1999/11/01 09:24:52 julian Exp $ 42 */ 43 44/* 45 * Netgraph socket nodes 46 * 47 * There are two types of netgraph sockets, control and data. 48 * Control sockets have a netgraph node, but data sockets are --- 781 unchanged lines hidden (view full) --- 830 * Incoming messages get passed up to the control socket. 831 * Unless they are for us specifically (socket_type) 832 */ 833static int 834ngs_rcvmsg(node_p node, item_p item, hook_p lasthook) 835{ 836 struct ngsock *const priv = NG_NODE_PRIVATE(node); 837 struct ngpcb *const pcbp = priv->ctlsock; |
838 struct socket *const so = pcbp->ng_socket; | 838 struct socket *so; |
839 struct sockaddr_ng addr; 840 struct ng_mesg *msg; 841 struct mbuf *m; 842 ng_ID_t retaddr = NGI_RETADDR(item); 843 int addrlen; 844 int error = 0; 845 846 NGI_GET_MSG(item, msg); 847 NG_FREE_ITEM(item); 848 849 /* 850 * Only allow mesgs to be passed if we have the control socket. 851 * Data sockets can only support the generic messages. 852 */ 853 if (pcbp == NULL) { 854 TRAP_ERROR; 855 NG_FREE_MSG(msg); 856 return (EINVAL); 857 } | 839 struct sockaddr_ng addr; 840 struct ng_mesg *msg; 841 struct mbuf *m; 842 ng_ID_t retaddr = NGI_RETADDR(item); 843 int addrlen; 844 int error = 0; 845 846 NGI_GET_MSG(item, msg); 847 NG_FREE_ITEM(item); 848 849 /* 850 * Only allow mesgs to be passed if we have the control socket. 851 * Data sockets can only support the generic messages. 852 */ 853 if (pcbp == NULL) { 854 TRAP_ERROR; 855 NG_FREE_MSG(msg); 856 return (EINVAL); 857 } |
858 so = pcbp->ng_socket; |
|
858 859#ifdef TRACE_MESSAGES 860 printf("[%x]:---------->[socket]: c=<%d>cmd=%x(%s) f=%x #%d\n", 861 retaddr, 862 msg->header.typecookie, 863 msg->header.cmd, 864 msg->header.cmdstr, 865 msg->header.flags, --- 270 unchanged lines hidden --- | 859 860#ifdef TRACE_MESSAGES 861 printf("[%x]:---------->[socket]: c=<%d>cmd=%x(%s) f=%x #%d\n", 862 retaddr, 863 msg->header.typecookie, 864 msg->header.cmd, 865 msg->header.cmdstr, 866 msg->header.flags, --- 270 unchanged lines hidden --- |