Message-ID: <1348153254.3326.YahooMailNeo@...1763...> Date: Thu, 20 Sep 2012 08:00:54 -0700 (PDT) From: vijayakumar palaniappan MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1831474865-1880787094-1348153254=:3326" Subject: [Openvpn-devel] Using TUN driver in Windows Reply-To: vijayakumar palaniappan List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "openvpn-devel@lists.sourceforge.net" --1831474865-1880787094-1348153254=:3326 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have installed the TAP-WIN32 Adapter V9 on my windows 7 machine. I want t= o use TUN to read the IP packets out of the interface. I followed the C# sample f= rom http://www.varsanofiev.com/inside/using_tuntap_under_windows.htm=A0 i modified the code like below IntPtr ptun =3D Marshal.AllocHGlobal(8);=A0 =A0 =A0 =A0=A0 Marshal.WriteInt32(ptun, 0, 0x0a030001); Marshal.WriteInt32(ptun, 4, unchecked((int)0x00ffffFF)); bool val =3D DeviceIoControl (ptr, TAP_CONTROL_CODE (5, METHOD_BUFFERED) /*= POINT TO POINT */, ptun, 8,ptun, 8, out len, IntPtr.Zero); However i still don't seem to get IP Packets. I ran tcpdump on the other en= d and it complains "Wrong link layer encapsulation". Is this the correct way of trying to get IP Packets out of TUN interface?. -Vijay=A0= --1831474865-1880787094-1348153254=:3326 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
I have installed the TAP-WIN32 Adapter V9 on my windows 7 machine. I want = to use
TUN to read = the IP packets out of the interface. I followed the C# sample fromhttp://www.varsanofiev= .com/inside/using_tuntap_under_windows.htm&nb= sp;

i modified the code like below

IntPtr ptun =3D Marshal.AllocHGlobal(8);&nb= sp;       
Marshal.WriteInt32(ptun, 0, 0x0a030001);
Marshal.WriteInt32(ptun, 4, unchecked((in= t)0x00ffffFF));
boo= l val =3D DeviceIoControl (ptr, TAP_CONTROL_CODE (5, METHOD_BUFFERED) /*POI= NT
TO POINT */, ptun= , 8,ptun, 8, out len, IntPtr.Zero);

However i still don't seem to get = IP Packets. I ran tcpdump on the other end and
it complains "Wrong link layer encapsulation".<= /span>

Is this the correct way of trying to get IP Packets out of TUN interface?.=

-Vijay 

= --1831474865-1880787094-1348153254=:3326--