1/* 2 * ng_ip_input.c 3 * 4 * Copyright 2001 The Aerospace Corporation. 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: --- 48 unchanged lines hidden (view full) --- 57 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 59 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 60 * OF SUCH DAMAGE. 61 * 62 * Author: Brooks Davis <brooks@FreeBSD.org> 63 * Derived from: ng_hole.c 64 * |
65 * $FreeBSD: head/sys/netgraph/ng_ip_input.c 111888 2003-03-04 23:19:55Z jlemon $ |
66 */ 67 68/* 69 * This node simply takes IP packets and calls ip_input on them 70 */ 71 72#include <sys/param.h> 73#include <sys/systm.h> --- 46 unchanged lines hidden (view full) --- 120 */ 121static int 122ngipi_rcvdata(hook_p hook, item_p item) 123{ 124 struct mbuf *m; 125 126 NGI_GET_M(item, m); 127 NG_FREE_ITEM(item); |
128 netisr_dispatch(NETISR_IP, m); |
129 return 0; 130} 131 132/* 133 * Hook disconnection 134 */ 135static int 136ngipi_disconnect(hook_p hook) 137{ 138 if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) 139 ng_rmnode_self(NG_HOOK_NODE(hook)); 140 return (0); 141} |