From owner-freebsd-net@FreeBSD.ORG Thu Dec 13 20:26:17 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D0A016A419 for ; Thu, 13 Dec 2007 20:26:17 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (ns1.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id D4DAF13C4D3 for ; Thu, 13 Dec 2007 20:26:16 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 1C7A25B2E; Thu, 13 Dec 2007 12:26:16 -0800 (PST) To: "Bruce M. Simpson" In-reply-to: Your message of "Thu, 13 Dec 2007 10:31:11 GMT." <476109EF.10808@FreeBSD.org> Date: Thu, 13 Dec 2007 12:26:16 -0800 From: Bakul Shah Message-Id: <20071213202616.1C7A25B2E@mail.bitblocks.com> Cc: FreeBSD Net , Julian Elischer Subject: Re: bikeshed for all! X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2007 20:26:17 -0000 Here is another idea spurred by this: > I understand that this feature is something which swaps in a different > forwarding table for the application one is currently running? > > And that it works in a manner similar to chroot()? Swapping in a different forwarding table is very much like swapping in a different root as in chroot. In that case how about a more general command "with-resource" or just "with"? with (- )* command [args] or with (=)* command [args] The latter syntax will allow a dynamic resource list (like what you can do with sysctl). So "chroot foo cmd" becomes "with root=foo cmd" and Julian's baby can be "with net.FIB=bar cmd". And if you want, even "with root=foo net.FIB=bar cmd" will work! And if ever forwarding tables are associated with specific interfaces you can do something like "with net.int.fe0.FIB=foo cmd" too! I suggest this in the hope that more kernel things can be resourcified and that we have a uniform way of dealing with them all. Now if resources were represented in the file system namespace and mounts were local to a process, you could achieve the above simply by doing a few mounts (or binds as in plan9) such as bind /resource/FIB/foo /net/FIB/default exec cmd and now all packets going out from cmd will use /resource/FIB/foo to find their next hop. -- bakul FIB == forwarding information base, a pompous name for a forwarding table. Also because sometimes it fibs, if not up to date.