[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] Windows TUN/TAP driver??


  • Subject: Re: [Openvpn-users] Windows TUN/TAP driver??
  • From: Charles Duffy <cduffy@xxxxxxxxxxx>
  • Date: Tue, 02 Jan 2007 16:46:27 -0600

The TAP-win32 driver isn't OpenVPN-only; it was initially developed by 
CIPE-Win32 (though James has done a significant amount of development 
since then), and is also used by tinc and others.

The driver can be checked out separately from source control if you wish 
to build your own copy and/or installer; it's in the "tap-win32" 
directory to the source tree.

If you want a packet source and sink, I would expect that the tap-win32 
driver would be very likely The Right Thing; however, I don't know of 
win32-specific API documentation outside of the source itself. That 
said, there's a level of standardization in terms of what packets coming 
from or going to a tap adapter look like on any OS: The interface was 
defined with UNIX in mind, and UNIX very much has a "everything's a 
file" mentality where possible; thus except for initialization and such 
[done through ioctls on UNIX and DeviceIoControl calls on win32], 
reading and writing packets to the driver is done with regular file I/O 
operations (ReadFile and WriteFile).

The DeviceIoControl calls made by OpenVPN's tun.c are very much 
self-explanatory. As for how packets are encapsulated, one read call 
reads a single Ethernet frame and one write call writes a frame; the 
win32 event model is used in OpenVPN to wait for frames to be available. 
You might consider starting with CipeTapIO.cpp (from the CIPE-Win32 
distribution) for a simple implementation and looking at OpenVPN's tun.c 
and event.c files for something more complete and robust.


I hope this helps (and is accurate -- I scrounged in the source a few 
minutes to get you what's here).

______________________
OpenVPN mailing lists
https://lists.sourceforge.net/lists/listinfo/openvpn-users