Subject: Re: Tap(4) interface in NetBSD?
To: Manuel Bouyer <>
From: Greg Troxel <>
List: current-users
Date: 04/28/2003 09:33:24
  Please consider integrating it to if_tun instead. I think if_tun can be
  extended to do this, and we should avoid adding another pseudo-interface
  if we can.

I implemented something similar for FreeSBD a while ago, and may have
cycles to dust it off for NetBSD at some point in the next year.  But
don't let that stop anyone....  My pseudo-interface enabled the
user-space program to

  set the type of the interface (ethernet, ptp/tun-like),

  get notification of promisc mode, multicast filters, and set the
  promiscuous flag (essentially acting as the 'hardware', and being
  able to return an error when trying to set promiscous mode).

I used this to build an emulator that could be glued in for real
traffic.  IMHO the big differentiator of the new interface is the
ability to control far more about how the interface behaves than tun
currently lets you do.  But having implemented this, I don't see any
obvious reason tun could not be extended instead - it could simply
default to tun-like behavior if none of the special ioctls are called.

The tricky part is having interfaces be able to change type.  But,
since tun is a create/destroy interface already, one can augment the
create call to pass in the tunnel/ethernet flag and the mac address,
and not allow type changing once created.  It would be good for this
to be extensible, since one might want to add the ability to say
e.g. 'this is an 802.11 interface'.

        Greg Troxel <>