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

[Openvpn-users] Re: Problem opening TAP device on Win XP from Java


  • Subject: [Openvpn-users] Re: Problem opening TAP device on Win XP from Java
  • From: Charles Duffy <cduffy@xxxxxxxxxxx>
  • Date: Sun, 16 Jan 2005 08:46:28 -0600

I'm taking the users list off of CC, as this thread isn't relevant to
end-users of OpenVPN. (I'm not entirely convinced of its relevance to
OpenVPN developers, either).


On Sat, 15 Jan 2005 23:36:58 -0800, Harsha V. Madhyastha wrote:

> char *tun_dev_name = "\\\\.\\{5998ABF4-70CC-4B8C-9CBF-F2B985BAD4A2}.tap";
> FILE *f = fopen(tun_dev_name, "rw");
> fclose(f);
> HANDLE h = CreateFile(tun_dev_name, GENERIC_WRITE | GENERIC_READ, 0, 0,
>          OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
>          0);
> CloseHandle(h);

> String tun_dev_name =
>    new String("\\\\.\\{5998ABF4-70CC-4B8C-9CBF-F2B985BAD4A2}.tap");
> RandomAccessFile raf = new RandomAccessFile(tun_dev_name, "rw");

Since you know the correct way to open the tap device (from C) and your
only objection is that Java is butchering it, you'd do best to look in a
forum where Java is the core topic. Effectively, you need to find out the
system calls that the JVM is making, and compare them to the (correctly
functioning) C.

A few obvious questions:

You're passing FILE_ATTRIBUTE_SYSTEM, FILE_FLAG_OVERLAPPED, etc in to the
CreateFile() call. Is the JVM doing that in its version? Does the C
interface fail in the same way as the JVM does if you take out the flags
that (looking at the Java RandomAccessFile class's semantics) you don't
have reason to believe the JVM also passes?

Generally speaking, though, what you've got is a Java question -- and, at
that, a Java question that needs knowledge of the JVM's underlying
operation to be answered. This really isn't the forum.



-------------------------------------------------------
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