Deleted Added
full compact
ng_ip_input.c (180372) ng_ip_input.c (194012)
1/*
2 * ng_ip_input.c
3 */
4
5/*-
6 * Copyright 2001 The Aerospace Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 50 unchanged lines hidden (view full) ---

59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
61 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
62 * OF SUCH DAMAGE.
63 *
64 * Author: Brooks Davis <brooks@FreeBSD.org>
65 * Derived from: ng_hole.c
66 *
1/*
2 * ng_ip_input.c
3 */
4
5/*-
6 * Copyright 2001 The Aerospace Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 50 unchanged lines hidden (view full) ---

59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
61 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
62 * OF SUCH DAMAGE.
63 *
64 * Author: Brooks Davis <brooks@FreeBSD.org>
65 * Derived from: ng_hole.c
66 *
67 * $FreeBSD: head/sys/netgraph/ng_ip_input.c 180372 2008-07-08 20:19:43Z gonzo $
67 * $FreeBSD: head/sys/netgraph/ng_ip_input.c 194012 2009-06-11 16:50:49Z zec $
68 */
69
70/*
71 * This node simply takes IP packets and calls ip_input on them
72 */
73
74#include <sys/param.h>
75#include <sys/systm.h>
76#include <sys/kernel.h>
77#include <sys/malloc.h>
78#include <sys/mbuf.h>
79#include <sys/socket.h>
68 */
69
70/*
71 * This node simply takes IP packets and calls ip_input on them
72 */
73
74#include <sys/param.h>
75#include <sys/systm.h>
76#include <sys/kernel.h>
77#include <sys/malloc.h>
78#include <sys/mbuf.h>
79#include <sys/socket.h>
80#include <sys/proc.h>
80#include <net/if.h>
81#include <net/if_types.h>
82#include <net/if_var.h>
83#include <netinet/in.h>
84#include <netinet/in_var.h>
85#include <net/netisr.h>
86#include <netgraph/ng_message.h>
87#include <netgraph/netgraph.h>

--- 27 unchanged lines hidden (view full) ---

115 */
116static int
117ngipi_rcvdata(hook_p hook, item_p item)
118{
119 struct mbuf *m;
120
121 NGI_GET_M(item, m);
122 NG_FREE_ITEM(item);
81#include <net/if.h>
82#include <net/if_types.h>
83#include <net/if_var.h>
84#include <netinet/in.h>
85#include <netinet/in_var.h>
86#include <net/netisr.h>
87#include <netgraph/ng_message.h>
88#include <netgraph/netgraph.h>

--- 27 unchanged lines hidden (view full) ---

116 */
117static int
118ngipi_rcvdata(hook_p hook, item_p item)
119{
120 struct mbuf *m;
121
122 NGI_GET_M(item, m);
123 NG_FREE_ITEM(item);
123 netisr_dispatch(NETISR_IP, m);
124 if (curthread->td_ng_outbound)
125 netisr_queue(NETISR_IP, m);
126 else
127 netisr_dispatch(NETISR_IP, m);
124 return 0;
125}
126
127/*
128 * Hook disconnection
129 */
130static int
131ngipi_disconnect(hook_p hook)
132{
133 if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
134 ng_rmnode_self(NG_HOOK_NODE(hook));
135 return (0);
136}
128 return 0;
129}
130
131/*
132 * Hook disconnection
133 */
134static int
135ngipi_disconnect(hook_p hook)
136{
137 if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
138 ng_rmnode_self(NG_HOOK_NODE(hook));
139 return (0);
140}