On Tue, 22 Feb 2005, and...@libero.it wrote:

> Hi to all,
> i am disperately in need of some advices about a subject not
> strictly about OpenVPN, but maybe there is someone here who
> can help me..
> I ve developed a tunnel-broker apps for Linux using TUN/TAP support,
> based on TUN virtual interfce like OpenVPN. In Linux, create (and open) 
> a TUN device is easy, as i do:
> 
> #include <net/tun.h>
> #include <linux/if_tun.h>
> 
> fp = fopen("/dev/net/tun",O_RDWR);
> ioctl(fd, TUNSETIFF, &ifr);
> 
> and then i can read and write to and from TUN device with simple
> read() and write() calls.
> 
> Now, i'd like to port that software on win32. I have installed the TAP
> DRIVER on my machine, and now i have a TAP davide named "tap0801".
> Can someone explain me how i can do the same thing
> under win32 ?  

Look at the #ifdef WIN32 sections in tun.c.

Look especially for ReadFile, WriteFile, CreateFile, and DeviceIoControl 
calls, as these are used to interact with the TAP-Win32 driver.

James

Reply via email to