Subject: Re: Moving ethfoo in the main tree
To: Manuel Bouyer <firstname.lastname@example.org>
From: Quentin Garnier <email@example.com>
Date: 12/13/2004 16:57:53
Content-Type: text/plain; charset=us-ascii
On Mon, Dec 13, 2004 at 04:49:06PM +0100, Manuel Bouyer wrote:
> > Here's my idea of how things could be done. Currently I have the whole
> > space of minor numbers devoted to actual ethfoo interfaces, indexed by
> > the number. The exception is the cloner device, whose minor number is
> > 0xfffff.
> > I could simply part in half the minor number space between tun and tap
> > interfaces, and have two cloners. That way the code is shared, but you
> > get two cloning interface and two cloning devices.
> > Moreover, I would keep minor numbers starting at 0 for tun devices, and
> > get tun major number for the merged ethfoo. That way existing tun0,
> > tun1 etc. devices found in /dev would still work as before.
> > You would have tap, tap0, tap1, ... and tun, tun0, tun1, ... in /dev,
> > with tap's minor being 0xfffff, tun's 0x7ffff, tap0's 0x80000 and
> > tun0's 0. That way you choose first what kind of device you want,
> > then you open it.
> > That way of doing it would make things much simpler.
> > As I said, we also need an API to retrieve the name of the interface.
> > Linux writes the name of the interface in the answer to the setting-up
> > ioctl() call. I don't know if FreeBSD has a specific API for that
> > as qemu uses devname(), but our devname(3) is too weak for the dynamic
> > aspect of such interfaces. Another TUN* ioctl() would do just fine.
> > Comments?
> How would we create an interface of the desired type (i.e.
> ifconfig foo1 create) before using it ?
Two ifcloners. So you would do either 'ifconfig tap0 create' or
'ifconfig tun0 create'.
> In some cases, having the interface created when the application wants to
> use it isn't the desired behavior, we want to application to use an
> already-existing and configured interface.
I'm well aware of that, that's why I provide both traditional cdevsw
access and a cloning device.
Quentin Garnier - firstname.lastname@example.org - cube@NetBSD.org
"Commala-come-five! / Even when the shadows rise!
To see the world and walk the world / Makes ya glad to be alive."
Susannah's Song, The Dark Tower VI, Stephen King, 2004.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
-----END PGP SIGNATURE-----