From 117e6fb356aa6c523ce6fa097e15987e1a943994 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 31 Jan 2014 12:40:06 -0800 Subject: Remove some more junk from tap driver tree. --- ext/tap-mac/tuntap/Changelog | 141 --------------------- ext/tap-mac/tuntap/README | 85 ------------- ext/tap-mac/tuntap/README.orig | 85 +++++++++++++ ext/tap-mac/tuntap/README.zerotier-build | 7 +- .../Resources/English.lproj/Localizable.strings | 11 -- .../startup_item/tap/StartupParameters.plist | 6 - ext/tap-mac/tuntap/startup_item/tap/tap | 33 ----- .../Resources/English.lproj/Localizable.strings | 11 -- .../startup_item/tun/StartupParameters.plist | 6 - ext/tap-mac/tuntap/startup_item/tun/tun | 33 ----- 10 files changed, 91 insertions(+), 327 deletions(-) delete mode 100644 ext/tap-mac/tuntap/Changelog delete mode 100644 ext/tap-mac/tuntap/README create mode 100644 ext/tap-mac/tuntap/README.orig delete mode 100644 ext/tap-mac/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings delete mode 100644 ext/tap-mac/tuntap/startup_item/tap/StartupParameters.plist delete mode 100755 ext/tap-mac/tuntap/startup_item/tap/tap delete mode 100644 ext/tap-mac/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings delete mode 100644 ext/tap-mac/tuntap/startup_item/tun/StartupParameters.plist delete mode 100755 ext/tap-mac/tuntap/startup_item/tun/tun (limited to 'ext/tap-mac') diff --git a/ext/tap-mac/tuntap/Changelog b/ext/tap-mac/tuntap/Changelog deleted file mode 100644 index 4599a132..00000000 --- a/ext/tap-mac/tuntap/Changelog +++ /dev/null @@ -1,141 +0,0 @@ - -November 1, 2011: - o Make the netmask address family fix work without knowledge of the struct - ifaddr definition. This fixes a crash on Lion, where the layout of the - structure has been changed, but at the cost of the fix no longer working for - IPv6. I think this is OK though, since mDNSResponder has been fixed on - Leopard and beyond to no longer require the hack. - o Proper multicast address checking for tun; multicast should now work reliably - with IP and IPv6 on tun also. - o A quite comprehensive test suite has been added that allows for quick release - testing. - o PPC support has been dropped due to XCode 4 no longer supporting PPC arch. - -September 13, 2009: - o Change linker options to produce 64 bit kext bundle for Snow Leopard. - o Switch from kmem_alloc and friends to OSAlloc for memory allocation and - avoid the delay() call. Respective symbols are not available on 64 bit - kernels anymore. - -September 5, 2009: - o Initial Snow Leopard port. Thanks to various people contributing patches in - the bugtracker. The new official version can only be compiled on Snow - Leopard but has been tested to work on all Tiger, Leopard and Snow Leopard - o Clean up unused locking code and switch to rwlocks even for simple mutexes, - which avoids a symbol incompatibility for Tiger and Leopard. - o Clean up compilation flags in the Makefiles. - -July 4, 2008: - o Adapt the former Leopard package to also be installable on Tiger systems. - This obsoletes the Tiger version, both Leopard and Tiger are now supported - by a single package. - -June 7, 2008: - o Protect the selwakeup() call by the lock. This fixes incorrect select() - behaviour, thanks to Roland Wendelin for reporting this. - o Fix tuntap_mbuf_queue::size initialization - o Use a proper wait condition for synchronization when detaching the network - interface. The old code would crash if the if_detached() handler was called - from a different thread than unregister_interface(). - -January 21, 2008: - o Work around an issue in the Darwin kernel. When unregistering an interface, - addresses are not properly removed from the interface. This leads to - crashes and other problems when reusing the interface. Introduce an ugly - hack that tries to remove all interface addresses when shutting the - interface down. - o Fix a small mbuf leak that could occur when the output queue was full. - Thanks to Oleg Dolgov for reporting this. - -December 21, 2007: - o Fix paths in the startup item postflight scripts - o Check if_ioctl arguments more defensively after a report of a panic after - receiving a NULL arg. - -November 14, 2007: - o I have done a complete rework of the installer package generation. The - package is now edited in PackageMaker. The distribution package can still - be built from the commandline though. - o Fix incorrect permission & ownership of the installed files. - -Oktober 11, 2007: - o Fix the permissions of the postflight scripts. Installer packages should work - again. - o Drop the kmod and kmodc++ in the linker command, they seem to be unneeded - with Leopard. - -September 20, 2007: - o Initial Leopard port, it's basically the latest Tiger version with some - Leopard-related fixes and s/Tiger/Leopard/g - o I have switched to a proper version management system (git) and could - remove some of the CVS hacks subsequently. - o The installation packages have been reworked a bit, they now install into - /System/Extensions and /System/StartupItems directly by using - DestinationPaths. - -May 13, 2006: - o This version is not stable, it may crash, sorry. - o Universal binaries that run on ppc and intel macs. - o Adds tap MAC address randomization - o Redesigned locking. - o Better multicast support - o mDNSResponder workaround, so that the tap interfaces should get picked up - now. Note that we are fixing ifconfig/kernel behaviour here. - o All tapX and tunX devices are visible in /dev at all times, network - interfaces still created dynamically, though. - o Startup items moved to /Library/StartupItems - -May 17, 2005: - o Initial Tiger port. We now have KPI-style interfaces. I guess the Tiger - version is little slower than the Panther version because of all the - wrapping and hiding in the kernel. - o The kernel extensions moved to /Library/Extensions. That is the place where - non-Apple kexts are supposed to live. - -April 21, 2005: - o I added support in tun for AF prepending like some BSDs do. Thanks to Dennis - kSchneider for mailing the initial patch. You can also set the value of - AF_INET6 to be used. - o I finally found that major bug causing crashes (especially on multiprocessor - machines). It also caused a memory leak (lost mbufs), and might have caused - performance/througput/data-loss problems. Everyone is recommended to upgrade. - -April 6, 2005: - o I rewrote the common part concerning the tun and tap initialization and - cleanup. This should make the code more maintainable (less duplication). - o The devices now reinitialize to the state they were started in when they - are closed by an application. This concerns IP addresses for example. - o I changed the package building system to use PackageMaker.app in batch - mode. The packages also check for version 10.3 now, so nobody should be - able to install tun/tap on 10.2 using installer packages. Furthermore I - have sprinkled some warnings telling you not to use tun/tap on SMP machines - over the installation process ;-) - o Some minor locking fixes. - -November 19, 2004: - o Jamie Wood reported that the packet queue in the driver could be considered - empty even if there were packets in it. This was probably caused by a - synchronization problem that should be fixed now. People encountering - timeouts etc. should try the new version. - o I finally implemented support for changing the interface MTU. The driver - enforces the MTU when writing packets to the character device now. However, - packets coming from the kernel are not checked. - -September 9, 2004: - o Marcello Teodori told me that the tun driver wasn't working with openvpn. - The problem was the fcntl call, fixed that. Should work now. Thanks - Marcello! - o changed the tun driver not to prepend the address family field before each - and every packet (which is the behaviour of OpenBSD). As there is currently - only IPv4 and IPv6 support there is no problem with the standard tun - approach used on other OSes. This should make the driver much more - compatible. - o Did a script and makefile support so that the installer packages can now be - built from the command prompt. Unfortunately this might break things - someday as I am not using the 'official' way to build the packages - o Cleaned up installer packages a little. - -August 24, 2004: - o initial version put online - o basic tun/tap support, tap working with qemu - diff --git a/ext/tap-mac/tuntap/README b/ext/tap-mac/tuntap/README deleted file mode 100644 index 6a9e526b..00000000 --- a/ext/tap-mac/tuntap/README +++ /dev/null @@ -1,85 +0,0 @@ - -tun/tap driver for Mac OS X -=========================== - -This is an experimental IP tunnel/ethertap driver for Mac OS X/Darwin. It -provides /dev/tunX and /dev/tapX devices. The maximum number of devices can be -configured at compile time, it is currently set to 16. That should be enough in -most cases. - -The driver ships as two kernel extensions, one for tap and one for tun. They are -located in /Library/Extensions and can also be loaded and unloaded by hand. If -you install the startup item, the system will load them automatically at -startup (tun and tap startup items get installed in /Library/StartupItems). - -Operation & Programming notes -============================= - -tapX are ethertap devices which provide an interface to the kernel's ethernet -layer. Packets can be read from and written to the /dev/tapX character devices -one at a time (same name as the interface that shows up in ifconfig). - -tunX are IP tunnel devices. These can be used to exchange IP packets with the -kernel. You will get single packets for each read() and should write() packets -one at a time to /dev/tunX. - -There are some special ioctls with the tun devices that allow you to have them -prepend the address family of the packet when reading it from /dev/tunX. Using -this mode the driver also expects you put this 4-byte address family field -(network byte order) in front of the packets you write to /dev/tunX. - -Here are the ioctls to setup up address prepending mode (for convenience there -also is a header called tun_ioctls.h in the source package that you can use) -Set the int argument to one if you want to have AF prepending, use 0 if you want -to switch it off. - -#define TUNSIFHEAD _IOW('t', 96, int) -#define TUNGIFHEAD _IOR('t', 97, int) - -Prepending mode is off by default. Currently it is not recommended to switch the -mode while packets are in flight on the device. - -The character devices are always visible in the filesystem as /dev/tunX and -/dev/tapX. The number of available character devices is a compile time constant -and is currently fixed to 16. Each character devices is associated with a -network interface of the same name. The network interfaces are only created when -the corresponding character device is opened by a program and will be removed -when the character device is closed. - -The character devices currently provide a pretty minimal interface. Whole -packets are read and written using a singe read/write call. File descriptors -opened on the devices can also be select()ed and support O_NONBLOCK. -Asynchronous i/o and some ioctls are currently unimplemented, but implementing -them shouldn't be very hard. Do it yourself or contact me if you can't live -without. - -There is another limitation imposed by the Darwin 8 kernel. It concerns the -poll() system call; Darwin currently does *not* support that for (character) -devices. Use select() instead. - -The interfaces can be configured using ifconfig, the tap devices also support -setting the MAC address to be used. Both tun and tap should be ready for IPv6. -Just setup addresses and routing as you would do with other interfaces. - -Please contact me if you find any bugs or have suggestions. - -Enjoy! - -Mattias - - - -Uninstalling -============ - -The installer packages for OS X currently don't have support for uninstall as -the installer doesn't provide it. Remove the following directories if you want -to completely remove the files installed: - -/Library/Extensions/tap.kext -/Library/Extensions/tun.kext -/Library/StartupItems/tap -/Library/StartupItems/tun - -Unload the the kernel extensions or reboot and you're done. - diff --git a/ext/tap-mac/tuntap/README.orig b/ext/tap-mac/tuntap/README.orig new file mode 100644 index 00000000..6a9e526b --- /dev/null +++ b/ext/tap-mac/tuntap/README.orig @@ -0,0 +1,85 @@ + +tun/tap driver for Mac OS X +=========================== + +This is an experimental IP tunnel/ethertap driver for Mac OS X/Darwin. It +provides /dev/tunX and /dev/tapX devices. The maximum number of devices can be +configured at compile time, it is currently set to 16. That should be enough in +most cases. + +The driver ships as two kernel extensions, one for tap and one for tun. They are +located in /Library/Extensions and can also be loaded and unloaded by hand. If +you install the startup item, the system will load them automatically at +startup (tun and tap startup items get installed in /Library/StartupItems). + +Operation & Programming notes +============================= + +tapX are ethertap devices which provide an interface to the kernel's ethernet +layer. Packets can be read from and written to the /dev/tapX character devices +one at a time (same name as the interface that shows up in ifconfig). + +tunX are IP tunnel devices. These can be used to exchange IP packets with the +kernel. You will get single packets for each read() and should write() packets +one at a time to /dev/tunX. + +There are some special ioctls with the tun devices that allow you to have them +prepend the address family of the packet when reading it from /dev/tunX. Using +this mode the driver also expects you put this 4-byte address family field +(network byte order) in front of the packets you write to /dev/tunX. + +Here are the ioctls to setup up address prepending mode (for convenience there +also is a header called tun_ioctls.h in the source package that you can use) +Set the int argument to one if you want to have AF prepending, use 0 if you want +to switch it off. + +#define TUNSIFHEAD _IOW('t', 96, int) +#define TUNGIFHEAD _IOR('t', 97, int) + +Prepending mode is off by default. Currently it is not recommended to switch the +mode while packets are in flight on the device. + +The character devices are always visible in the filesystem as /dev/tunX and +/dev/tapX. The number of available character devices is a compile time constant +and is currently fixed to 16. Each character devices is associated with a +network interface of the same name. The network interfaces are only created when +the corresponding character device is opened by a program and will be removed +when the character device is closed. + +The character devices currently provide a pretty minimal interface. Whole +packets are read and written using a singe read/write call. File descriptors +opened on the devices can also be select()ed and support O_NONBLOCK. +Asynchronous i/o and some ioctls are currently unimplemented, but implementing +them shouldn't be very hard. Do it yourself or contact me if you can't live +without. + +There is another limitation imposed by the Darwin 8 kernel. It concerns the +poll() system call; Darwin currently does *not* support that for (character) +devices. Use select() instead. + +The interfaces can be configured using ifconfig, the tap devices also support +setting the MAC address to be used. Both tun and tap should be ready for IPv6. +Just setup addresses and routing as you would do with other interfaces. + +Please contact me if you find any bugs or have suggestions. + +Enjoy! + +Mattias + + + +Uninstalling +============ + +The installer packages for OS X currently don't have support for uninstall as +the installer doesn't provide it. Remove the following directories if you want +to completely remove the files installed: + +/Library/Extensions/tap.kext +/Library/Extensions/tun.kext +/Library/StartupItems/tap +/Library/StartupItems/tun + +Unload the the kernel extensions or reboot and you're done. + diff --git a/ext/tap-mac/tuntap/README.zerotier-build b/ext/tap-mac/tuntap/README.zerotier-build index 20d6d461..550e0378 100644 --- a/ext/tap-mac/tuntap/README.zerotier-build +++ b/ext/tap-mac/tuntap/README.zerotier-build @@ -2,7 +2,12 @@ Building the tap for both x86_64 and i386 requires an older version of the Xcode tools than what now ships for Mavericks (10.9). The newer version does not support creating i386 kernel images. -These can be obtained from: +At the moment this is done on an OSX 10.6 virtual image that is used for +building. (It doesn't have to be done often.) Then the kext is signed on +the regular build system. That's because images built on newer OSX don't +seem to load on 10.6 but 10.6 built kexts seem fine on 10.9. Go figure. + +Older Xcode can also be found at: https://developer.apple.com/downloads diff --git a/ext/tap-mac/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings b/ext/tap-mac/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings deleted file mode 100644 index 4d3b29ca..00000000 --- a/ext/tap-mac/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings +++ /dev/null @@ -1,11 +0,0 @@ - - - - - ethertap device kernel extension - ethertap kernel extension - Initializing tap devices - Initializing tap devices - - - diff --git a/ext/tap-mac/tuntap/startup_item/tap/StartupParameters.plist b/ext/tap-mac/tuntap/startup_item/tap/StartupParameters.plist deleted file mode 100644 index fe9cf001..00000000 --- a/ext/tap-mac/tuntap/startup_item/tap/StartupParameters.plist +++ /dev/null @@ -1,6 +0,0 @@ -{ - Description = "ethertap device kernel extension"; - Provides = ("ethertap"); - Requires = ("Network Configuration"); - OrderPreference = "None"; -} diff --git a/ext/tap-mac/tuntap/startup_item/tap/tap b/ext/tap-mac/tuntap/startup_item/tap/tap deleted file mode 100755 index d7600991..00000000 --- a/ext/tap-mac/tuntap/startup_item/tap/tap +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -## -# load the tap kext -## - -. /etc/rc.common - -StartService () -{ - ConsoleMessage "Initializing tap devices" - - if [ -d /Library/Extensions/tap.kext ]; then - kextload /Library/Extensions/tap.kext - fi -} - -StopService () -{ - if [ -d /Library/Extensions/tap.kext ]; then - kextunload /Library/Extensions/tap.kext - fi -} - -RestartService () -{ - if [ -d /Library/Extensions/tap.kext ]; then - kextunload /Library/Extensions/tap.kext - kextload /Library/Extensions/tap.kext - fi -} - -RunService "$1" diff --git a/ext/tap-mac/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings b/ext/tap-mac/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings deleted file mode 100644 index 054790e7..00000000 --- a/ext/tap-mac/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings +++ /dev/null @@ -1,11 +0,0 @@ - - - - - ip tunnel device kernel extension - ip tunnel kernel extension - Initializing tun devices - Initializing tun devices - - - diff --git a/ext/tap-mac/tuntap/startup_item/tun/StartupParameters.plist b/ext/tap-mac/tuntap/startup_item/tun/StartupParameters.plist deleted file mode 100644 index 71a92626..00000000 --- a/ext/tap-mac/tuntap/startup_item/tun/StartupParameters.plist +++ /dev/null @@ -1,6 +0,0 @@ -{ - Description = "ip tunnel device kernel extension"; - Provides = ("tun"); - Requires = ("Network Configuration"); - OrderPreference = "None"; -} diff --git a/ext/tap-mac/tuntap/startup_item/tun/tun b/ext/tap-mac/tuntap/startup_item/tun/tun deleted file mode 100755 index 40b1b411..00000000 --- a/ext/tap-mac/tuntap/startup_item/tun/tun +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -## -# load the tun kext -## - -. /etc/rc.common - -StartService () -{ - ConsoleMessage "Initializing tun devices" - - if [ -d /Library/Extensions/tun.kext ]; then - kextload /Library/Extensions/tun.kext - fi -} - -StopService () -{ - if [ -d /Library/Extensions/tun.kext ]; then - kextunload /Library/Extensions/tun.kext - fi -} - -RestartService () -{ - if [ -d /Library/Extensions/tun.kext ]; then - kextunload /Library/Extensions/tun.kext - kextload /Library/Extensions/tun.kext - fi -} - -RunService "$1" -- cgit v1.2.3