On Sat, 08 May 2010 03:54:26 +1000 Tully Gray <tullyg...@arc.net.au> wrote: > > I have modified Erik Quanstrom's raw socket ethernet driver > for 9vx so that it uses the Linux kernel's "tap" device.
Neat! > < if((fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) < 0) > --- > > if((fd = open("/dev/net/tun", O_RDWR)) < 0){ On *BSD tun is for IP frames, tap is for ethernet frames so there you'd use /dev/tap. You may wish to see how Qemu handles tap differences & multiple tap interfaces on various platforms. On Fri, 07 May 2010 19:14:58 BST "Devon H. O'Dell" <devon.od...@gmail.com> wrot e: > > Yes. The tap(4) interface allows you to clone an existing ethernet > device on the system, and it's what most virtualization platforms use. Sorry for nitpicking! "tap" appears as a completely separate virtual ethernet interface to the host. The "other end" of tap is a device, to be open()ed by a program. One can bridge the host side interface to existing physical ethernet interfaces but you don't have to.