Deleted Added
full compact
ng_bridge.c (121816) ng_bridge.c (123600)
1
2/*
3 * ng_bridge.c
4 *
5 * Copyright (c) 2000 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

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

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Archie Cobbs <archie@freebsd.org>
38 *
1
2/*
3 * ng_bridge.c
4 *
5 * Copyright (c) 2000 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

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

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Archie Cobbs <archie@freebsd.org>
38 *
39 * $FreeBSD: head/sys/netgraph/ng_bridge.c 121816 2003-10-31 18:32:15Z brooks $
39 * $FreeBSD: head/sys/netgraph/ng_bridge.c 123600 2003-12-17 12:40:34Z ru $
40 */
41
42/*
43 * ng_bridge(4) netgraph node type
44 *
45 * The node performs standard intelligent Ethernet bridging over
46 * each of its connected hooks, or links. A simple loop detection
47 * algorithm is included which disables a link for priv->conf.loopTimeout

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

72
73#include <netinet/in.h>
74#include <netinet/ip_fw.h>
75
76#include <netgraph/ng_message.h>
77#include <netgraph/netgraph.h>
78#include <netgraph/ng_parse.h>
79#include <netgraph/ng_bridge.h>
40 */
41
42/*
43 * ng_bridge(4) netgraph node type
44 *
45 * The node performs standard intelligent Ethernet bridging over
46 * each of its connected hooks, or links. A simple loop detection
47 * algorithm is included which disables a link for priv->conf.loopTimeout

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

72
73#include <netinet/in.h>
74#include <netinet/ip_fw.h>
75
76#include <netgraph/ng_message.h>
77#include <netgraph/netgraph.h>
78#include <netgraph/ng_parse.h>
79#include <netgraph/ng_bridge.h>
80#include <netgraph/ng_ether.h>
81
82#ifdef NG_SEPARATE_MALLOC
83MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", "netgraph bridge node ");
84#else
85#define M_NETGRAPH_BRIDGE M_NETGRAPH
86#endif
87
88/* Per-link private data */

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

167 const struct ng_bridge_host_ary *const hary
168 = (const struct ng_bridge_host_ary *)(buf - sizeof(u_int32_t));
169
170 return hary->numHosts;
171}
172
173/* Parse type for struct ng_bridge_host_ary */
174static const struct ng_parse_struct_field ng_bridge_host_type_fields[]
80
81#ifdef NG_SEPARATE_MALLOC
82MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", "netgraph bridge node ");
83#else
84#define M_NETGRAPH_BRIDGE M_NETGRAPH
85#endif
86
87/* Per-link private data */

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

166 const struct ng_bridge_host_ary *const hary
167 = (const struct ng_bridge_host_ary *)(buf - sizeof(u_int32_t));
168
169 return hary->numHosts;
170}
171
172/* Parse type for struct ng_bridge_host_ary */
173static const struct ng_parse_struct_field ng_bridge_host_type_fields[]
175 = NG_BRIDGE_HOST_TYPE_INFO(&ng_ether_enaddr_type);
174 = NG_BRIDGE_HOST_TYPE_INFO(&ng_parse_enaddr_type);
176static const struct ng_parse_type ng_bridge_host_type = {
177 &ng_parse_struct_type,
178 &ng_bridge_host_type_fields
179};
180static const struct ng_parse_array_info ng_bridge_hary_type_info = {
181 &ng_bridge_host_type,
182 ng_bridge_getTableLength
183};

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

282 NULL,
283 NULL,
284 ng_bridge_rcvdata,
285 ng_bridge_disconnect,
286 ng_bridge_cmdlist,
287};
288NETGRAPH_INIT(bridge, &ng_bridge_typestruct);
289
175static const struct ng_parse_type ng_bridge_host_type = {
176 &ng_parse_struct_type,
177 &ng_bridge_host_type_fields
178};
179static const struct ng_parse_array_info ng_bridge_hary_type_info = {
180 &ng_bridge_host_type,
181 ng_bridge_getTableLength
182};

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

281 NULL,
282 NULL,
283 ng_bridge_rcvdata,
284 ng_bridge_disconnect,
285 ng_bridge_cmdlist,
286};
287NETGRAPH_INIT(bridge, &ng_bridge_typestruct);
288
290/* Depend on ng_ether so we can use the Ethernet parse type */
291MODULE_DEPEND(ng_bridge, ng_ether, 1, 1, 1);
292
293/******************************************************************
294 NETGRAPH NODE METHODS
295******************************************************************/
296
297/*
298 * Node constructor
299 */
300static int

--- 769 unchanged lines hidden ---
289/******************************************************************
290 NETGRAPH NODE METHODS
291******************************************************************/
292
293/*
294 * Node constructor
295 */
296static int

--- 769 unchanged lines hidden ---