From owner-p4-projects@FreeBSD.ORG Tue Aug 7 16:30:18 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B727516A4C9; Tue, 7 Aug 2007 16:30:18 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FAD116A4D0 for ; Tue, 7 Aug 2007 16:30:18 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 520DB13C474 for ; Tue, 7 Aug 2007 16:30:18 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l77GUISG087423 for ; Tue, 7 Aug 2007 16:30:18 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l77GUHE6087418 for perforce@freebsd.org; Tue, 7 Aug 2007 16:30:17 GMT (envelope-from zec@FreeBSD.org) Date: Tue, 7 Aug 2007 16:30:17 GMT Message-Id: <200708071630.l77GUHE6087418@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 124837 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2007 16:30:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=124837 Change 124837 by zec@zec_tpx32 on 2007/08/07 16:30:15 Initial netgraph wormhole implementation. A "worm" node can be used to establish a datapath between independent netgraph address spaces, i.e. between two virtual network stacks. A wormhole path is defined by a pair of wormhole nodes each residing in a different stack instance. Each node accepts only a single arbitrarily named hook. Once a wormhole datapath is established, all data messages received on the local hook will be forwarded to the hook connected to the remote node, and vice versa. "worm" nodes understand two node-specific messages: "peer" and "status". The "peer" message is used to specify the remote endpoint in form of "remote_worm_node_name@remote_vnet_name", or to fetch the current peering configuration if invoked without arguments. Both involved nodes must configure their peerings before the datapath will be established. The "status" command can be used to check the current state of the wormhole path, which can be one of unconfigured, pending or active. Affected files ... .. //depot/projects/vimage/src/sys/modules/netgraph/Makefile#4 edit .. //depot/projects/vimage/src/sys/netgraph/ng_wormhole.c#1 add .. //depot/projects/vimage/src/sys/netgraph/vnetgraph.h#6 edit .. //depot/projects/vimage/src/sys/sys/vimage.h#32 edit Differences ... ==== //depot/projects/vimage/src/sys/modules/netgraph/Makefile#4 (text+ko) ==== @@ -51,7 +51,8 @@ tty \ UI \ vjc \ - vlan + vlan \ + wormhole .if ${MACHINE_ARCH} == "i386" _sync_ar= sync_ar ==== //depot/projects/vimage/src/sys/netgraph/vnetgraph.h#6 (text+ko) ==== @@ -50,6 +50,7 @@ ng_ID_t _nextID; struct unrhdr *_ng_iface_unit; struct unrhdr *_ng_eiface_unit; + struct unrhdr *_ng_wormhole_unit; }; #endif @@ -59,5 +60,6 @@ #define V_nextID VNET_NETGRAPH(nextID) #define V_ng_iface_unit VNET_NETGRAPH(ng_iface_unit) #define V_ng_eiface_unit VNET_NETGRAPH(ng_eiface_unit) +#define V_ng_wormhole_unit VNET_NETGRAPH(ng_wormhole_unit) #endif /* !_NETGRAPH_VNETGRAPH_H_ */ ==== //depot/projects/vimage/src/sys/sys/vimage.h#32 (text+ko) ==== @@ -68,6 +68,7 @@ #define V_CPU 3 #define VNET_MOD_NONE -1 +/*statefull modules */ #define VNET_MOD_NET 0 #define VNET_MOD_NETGRAPH 1 #define VNET_MOD_INET 2 @@ -79,7 +80,8 @@ #define VNET_MOD_ALTQ 8 #define VNET_MOD_IPX 9 #define VNET_MOD_ATALK 10 - +/* stateless modules */ +#define VNET_MOD_NG_WORMHOLE 19 #define VNET_MOD_NG_ETHER 20 #define VNET_MOD_NG_IFACE 21 #define VNET_MOD_NG_EIFACE 22