|
From: | Ed Criscuolo |
Subject: | Re: [Discuss-gnuradio] Re: tun/tap OS X for tunneling |
Date: | Tue, 06 Jan 2009 11:59:50 -0500 |
User-agent: | Thunderbird 2.0.0.18 (Macintosh/20081105) |
Johnathan Corgan wrote:
On Tue, Jan 6, 2009 at 6:34 AM, Mark Kuhr <address@hidden> wrote:ifs = ioctl(tun, TUNSETIFF, struct.pack("16sH", "gr%d", mode)) I'm guessing there is a difference in the ioctl implementation between linux and OS X. I'm working through it and will post any progress. But if someone can point out what's wrong that would be helpful.In tunnel.py, line 77, TUNSETIFF is hardcoded to a value appropriate for Linux, which really is defined in linux/tun_if.h (see comment on line 66). It's almost a certainty this value is invalid for OS X.
There also seems to be a fundamental difference between the way the TUN/TAP driver works on the two OS's. In the Linux/Unix/Solaris world, the TUN/TAP driver presents a single character device in the /dev directory (either /dev/tun or /dev/tap). Opening this creates a NEW device (/dev/tun0, tun1, etc) using the next available name, and returns a filehandle to it. An associated pseudo-network device is created at the time of the open. In the OSX TUN/TAP driver, a preset number of tun and tap char devices (/dev/tun0 - /dev/tun15 and /dev/tap0 - /dev/tap15) are PRECREATED when the driver is installed. You must open the specific char device you want in order to get a filehandle to it. An associated pseudo-network device is created at the time of the open. @(^.^)@ Ed
[Prev in Thread] | Current Thread | [Next in Thread] |