Universal TUN (tun/tap) device driver.
Maxim Krasnyanskiy <max_mk@yahoo.com>

TUN provides packet reception and transmission for user space programs. 
It can be viewed as a simple Point-to-Point or Ethernet device, which 
instead of receiving packets from a physical media, receives them from 
user space program and instead of sending packets via physical media 
writes them to the user space program. 

When a program opens /dev/tunX or /dev/tapX, driver creates and 
registers corresponding net device tunX or tapX. After a program closed 
above devices, driver will automatically delete tunXX or tapXX device 
and all routes corresponding to it.

TUN package(http://vtun.netpedia.net/tun) contains two simple example 
programs how to use tun and tap devices. Both programs works like 
bridge between two network interfaces.
br_select.c - bridge based on select system call.
br_sigio.c  - bridge based on async io and SIGIO signal.
However best example is VTun http://vtun.netpedia.net :))  
