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

[Openvpn-users] Problem setting point-to-point mode in 2.0 versions (fwd)


  • Subject: [Openvpn-users] Problem setting point-to-point mode in 2.0 versions (fwd)
  • From: "Harsha V. Madhyastha" <harsha@xxxxxxxxxxxxxxxxx>
  • Date: Tue, 18 Jan 2005 08:28:19 -0800 (PST)

I got no response on the devel mailing list, so forwarding it on to users, 
just in case someone out there has come across the same problem.

Thanks!
Harsha

---------- Forwarded message ----------
Date: Sun, 16 Jan 2005 12:23:45 -0800 (PST)
From: Harsha V. Madhyastha <harsha@xxxxxxxxxxxxxxxxx>
To: openvpn-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Problem setting point-to-point mode in 2.0 versions

Hi,

I'm using OpenVPN on Windows XP and I need to set Point-to-Point mode on 
the device in order to emulate a "tun" interface (as specified in 
http://cvs.sourceforge.net/viewcvs.py/openvpn/openvpn/tap-win32/tapdrvr.c?rev=1.2.2.5)

As specified in 
http://www.tinc-vpn.org/svn/tinc/branches/1.0-gnutls/src/mingw/device.c 
and
http://cvs.sourceforge.net/viewcvs.py/openvpn/openvpn/tun.c?rev=1.46
I used the following code to do this:

#define TAP_CONTROL_CODE(request, method) \
CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD | 8000, request, method, \
FILE_ANY_ACCESS)
#define TAP_IOCTL_CONFIG_POINT_TO_POINT TAP_CONTROL_CODE(6, METHOD_BUFFERED)

unsigned long ep[2];
HANDLE hTAP32;
long len;

hTAP32 = CreateFile(device_path, GENERIC_READ | GENERIC_WRITE, 0, 0, \
	OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0);
ep[0] = inet_addr("10.0.0.1");
ep[1] = ep[0] ^ inet_addr("0.0.0.3");
if (!DeviceIoControl (hTAP32, TAP_IOCTL_CONFIG_POINT_TO_POINT, \
	ep, sizeof (ep), ep, sizeof (ep), &len, NULL))
{
	fprintf (stderr, "ERROR: The TAP-Win32 driver rejected a 
DeviceIoControl call to set Point-to-Point mode\n");
}

The above call to DeviceIoControl works in the 1.6 version of OpenVPN but 
fails in all the 2.0 beta versions. It would be great if any of could let 
me know what the cause for the problem could be.

BTW, thank you very much Charles for replying to my previous post. I guess 
the point you raised there was pertinent. I will look into the JVM source 
to figure out the root of the problem.

Thanks!
Harsha


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Openvpn-users mailing list
Openvpn-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/openvpn-users