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 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> |
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[] |
174 = NG_BRIDGE_HOST_TYPE_INFO(&ng_parse_enaddr_type); |
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 |
289/****************************************************************** 290 NETGRAPH NODE METHODS 291******************************************************************/ 292 293/* 294 * Node constructor 295 */ 296static int --- 769 unchanged lines hidden --- |