Skip to contentSkip to conversation

help on win32 tap interface

Openvpn-devel [email protected] 2 participants 2 messages Mar 8, 2005

lore
Share & tools
lore
#0 lore raw

Hi to all,
i can't understand why my code (based on openvpn's tun.c file) to correctly read and write on win32 tap device doesn't work, All i do is:

1 -- call get_tap_reg and get_panel_reg functions

2 -- call get_unspecified_device_guid function to obtain TAP id

3 -- call CreateFile on the device_path returned. It returns OK

4 -- call TAP_IOCTL_GET_VERSION, TAP_IOCTL_GET_MTU, IoControls , to obtain TAP device driver and mtu info. All seems ok.

5 -- call TAP_IOCTL_SET_MEDIA_STATUS IoControl to set the device as "connected". ok

6 -- Then i call simple ReadFile to read data submitted on the TAP interface. The problem is that some kind of packet arrives, but they seems to be corrupted (es. an IPv6 header format is totally wrong).

Anyone has some suggestion ??? Please !!!

____________________________________________________________
Navighi a 2 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it

#1 lore raw
Quoted 15 lines · On Tue, 8 Mar 2005, [email protected]... wrote:

Hi to all,
i can't understand why my code (based on openvpn's tun.c file) to correctly read and write on win32 tap device doesn't work, All i do is:

1 -- call get_tap_reg and get_panel_reg functions

2 -- call get_unspecified_device_guid function to obtain TAP id

3 -- call CreateFile on the device_path returned. It returns OK

4 -- call TAP_IOCTL_GET_VERSION, TAP_IOCTL_GET_MTU, IoControls , to obtain TAP device driver and mtu info. All seems ok.

Quoted 7 lines

5 -- call TAP_IOCTL_SET_MEDIA_STATUS IoControl to set the device as "connected". ok

6 -- Then i call simple ReadFile to read data submitted on the TAP interface. The problem is that some kind of packet arrives, but they seems to be corrupted (es. an IPv6 header format is totally wrong).

Does IPv4 work?

Are you correctly extracting the IPv6 packet from the ethernet frame?

Have you tried running OpenVPN in a debugger, and break on the TAP-Win32 calls, to get an idea of how OpenVPN is interacting with the driver?

James