diff --git a/Makefile.mac b/Makefile.mac index 335357984..25bfab110 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -35,18 +35,18 @@ idtool: $(OBJS) $(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS) $(STRIP) zerotier-idtool -mac-tap: FORCE - cd mac-tap/tuntap ; make tap.kext +#mac-tap: FORCE +# cd mac-tap/tuntap ; make tap.kext -install-mac-tap: FORCE - mkdir -p /Library/Application\ Support/ZeroTier/One - rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext - cp -R mac-tap/tuntap/tap.kext /Library/Application\ Support/ZeroTier/One - chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext +#install-mac-tap: FORCE +# mkdir -p /Library/Application\ Support/ZeroTier/One +# rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext +# cp -R mac-tap/tuntap/tap.kext /Library/Application\ Support/ZeroTier/One +# chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext clean: rm -rf *.dSYM rm -f $(OBJS) zerotier-* - cd mac-tap/tuntap ; make clean + cd tap-mac/tuntap ; make clean FORCE: diff --git a/ext/bin/tap-mac/tap.kext/Contents/Info.plist b/ext/bin/tap-mac/tap.kext/Contents/Info.plist new file mode 100644 index 000000000..3cc41b073 --- /dev/null +++ b/ext/bin/tap-mac/tap.kext/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + tap + CFBundleIdentifier + com.zerotier.tap + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + tap + CFBundlePackageType + KEXT + CFBundleShortVersionString + 20111101 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + OSBundleLibraries + + com.apple.kpi.mach + 8.0 + com.apple.kpi.bsd + 8.0 + com.apple.kpi.libkern + 8.0 + com.apple.kpi.unsupported + 8.0 + + + + diff --git a/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap b/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap new file mode 100755 index 000000000..d464702f4 Binary files /dev/null and b/ext/bin/tap-mac/tap.kext/Contents/MacOS/tap differ diff --git a/mac-tap/README.txt b/tap-mac/README.txt similarity index 100% rename from mac-tap/README.txt rename to tap-mac/README.txt diff --git a/mac-tap/tuntap/Changelog b/tap-mac/tuntap/Changelog similarity index 100% rename from mac-tap/tuntap/Changelog rename to tap-mac/tuntap/Changelog diff --git a/mac-tap/tuntap/INSTALL b/tap-mac/tuntap/INSTALL similarity index 100% rename from mac-tap/tuntap/INSTALL rename to tap-mac/tuntap/INSTALL diff --git a/mac-tap/tuntap/Makefile b/tap-mac/tuntap/Makefile similarity index 100% rename from mac-tap/tuntap/Makefile rename to tap-mac/tuntap/Makefile diff --git a/mac-tap/tuntap/README b/tap-mac/tuntap/README similarity index 100% rename from mac-tap/tuntap/README rename to tap-mac/tuntap/README diff --git a/mac-tap/tuntap/README.installer b/tap-mac/tuntap/README.installer similarity index 100% rename from mac-tap/tuntap/README.installer rename to tap-mac/tuntap/README.installer diff --git a/tap-mac/tuntap/README.zerotier-build b/tap-mac/tuntap/README.zerotier-build new file mode 100644 index 000000000..20d6d461f --- /dev/null +++ b/tap-mac/tuntap/README.zerotier-build @@ -0,0 +1,18 @@ +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: + +https://developer.apple.com/downloads + +It requires a bit of a dance to unpack the package and obtain an unpacked +tree, but once it's there you can change the line in tap/Makefile and +build for both architectures. + +This will go on until i386 is thoroughly legacy, at which point we'll +probably start just supporting x86_64. But that might be a while. We want +to support old Macs through their entire useful life. + +Since this build is irritating, a pre-built copy is packaged in ext/ and +is installed by 'make install'. So users shouldn't have to build this. diff --git a/mac-tap/tuntap/pkg/res/License.rtfd/TXT.rtf b/tap-mac/tuntap/pkg/res/License.rtfd/TXT.rtf similarity index 100% rename from mac-tap/tuntap/pkg/res/License.rtfd/TXT.rtf rename to tap-mac/tuntap/pkg/res/License.rtfd/TXT.rtf diff --git a/mac-tap/tuntap/pkg/res/Welcome.rtfd/TXT.rtf b/tap-mac/tuntap/pkg/res/Welcome.rtfd/TXT.rtf similarity index 100% rename from mac-tap/tuntap/pkg/res/Welcome.rtfd/TXT.rtf rename to tap-mac/tuntap/pkg/res/Welcome.rtfd/TXT.rtf diff --git a/mac-tap/tuntap/pkg/res/Welcome.rtfd/paypal_button.gif b/tap-mac/tuntap/pkg/res/Welcome.rtfd/paypal_button.gif similarity index 100% rename from mac-tap/tuntap/pkg/res/Welcome.rtfd/paypal_button.gif rename to tap-mac/tuntap/pkg/res/Welcome.rtfd/paypal_button.gif diff --git a/mac-tap/tuntap/pkg/scripts/startup_item_tap/postflight b/tap-mac/tuntap/pkg/scripts/startup_item_tap/postflight similarity index 100% rename from mac-tap/tuntap/pkg/scripts/startup_item_tap/postflight rename to tap-mac/tuntap/pkg/scripts/startup_item_tap/postflight diff --git a/mac-tap/tuntap/pkg/scripts/startup_item_tun/postflight b/tap-mac/tuntap/pkg/scripts/startup_item_tun/postflight similarity index 100% rename from mac-tap/tuntap/pkg/scripts/startup_item_tun/postflight rename to tap-mac/tuntap/pkg/scripts/startup_item_tun/postflight diff --git a/mac-tap/tuntap/pkg/scripts/tap/postflight b/tap-mac/tuntap/pkg/scripts/tap/postflight similarity index 100% rename from mac-tap/tuntap/pkg/scripts/tap/postflight rename to tap-mac/tuntap/pkg/scripts/tap/postflight diff --git a/mac-tap/tuntap/pkg/scripts/tun/postflight b/tap-mac/tuntap/pkg/scripts/tun/postflight similarity index 100% rename from mac-tap/tuntap/pkg/scripts/tun/postflight rename to tap-mac/tuntap/pkg/scripts/tun/postflight diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/01tun-contents.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/01tun-contents.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/01tun-contents.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/01tun-contents.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/01tun.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/01tun.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/01tun.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/01tun.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/02tap-contents.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/02tap-contents.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/02tap-contents.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/02tap-contents.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/02tap.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/02tap.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/02tap.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/02tap.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/03tap-contents.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/03tap-contents.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/03tap-contents.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/03tap-contents.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/03tap.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/03tap.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/03tap.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/03tap.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/04tun-contents.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/04tun-contents.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/04tun-contents.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/04tun-contents.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/04tun.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/04tun.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/04tun.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/04tun.xml diff --git a/mac-tap/tuntap/pkg/tuntap.pmdoc/index.xml b/tap-mac/tuntap/pkg/tuntap.pmdoc/index.xml similarity index 100% rename from mac-tap/tuntap/pkg/tuntap.pmdoc/index.xml rename to tap-mac/tuntap/pkg/tuntap.pmdoc/index.xml diff --git a/mac-tap/tuntap/src/lock.cc b/tap-mac/tuntap/src/lock.cc similarity index 100% rename from mac-tap/tuntap/src/lock.cc rename to tap-mac/tuntap/src/lock.cc diff --git a/mac-tap/tuntap/src/lock.h b/tap-mac/tuntap/src/lock.h similarity index 100% rename from mac-tap/tuntap/src/lock.h rename to tap-mac/tuntap/src/lock.h diff --git a/mac-tap/tuntap/src/mem.cc b/tap-mac/tuntap/src/mem.cc similarity index 100% rename from mac-tap/tuntap/src/mem.cc rename to tap-mac/tuntap/src/mem.cc diff --git a/mac-tap/tuntap/src/mem.h b/tap-mac/tuntap/src/mem.h similarity index 100% rename from mac-tap/tuntap/src/mem.h rename to tap-mac/tuntap/src/mem.h diff --git a/mac-tap/tuntap/src/tap/Info.plist b/tap-mac/tuntap/src/tap/Info.plist similarity index 100% rename from mac-tap/tuntap/src/tap/Info.plist rename to tap-mac/tuntap/src/tap/Info.plist diff --git a/mac-tap/tuntap/src/tap/Makefile b/tap-mac/tuntap/src/tap/Makefile similarity index 88% rename from mac-tap/tuntap/src/tap/Makefile rename to tap-mac/tuntap/src/tap/Makefile index 428555d0c..a69b967e2 100644 --- a/mac-tap/tuntap/src/tap/Makefile +++ b/tap-mac/tuntap/src/tap/Makefile @@ -19,7 +19,7 @@ BUNDLE_SIGNATURE = ???? BUNDLE_PACKAGETYPE = KEXT BUNDLE_VERSION = $(TAP_KEXT_VERSION) -INCLUDE = -I.. -I/System/Library/Frameworks/Kernel.framework/Headers +INCLUDE = -I.. -I/System/Library/Frameworks/Kernel.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Kernel.framework/Headers CFLAGS = -Wall -mkernel -force_cpusubtype_ALL \ -fno-builtin -fno-stack-protector -arch i386 -arch x86_64 \ -DKERNEL -D__APPLE__ -DKERNEL_PRIVATE -DTUNTAP_VERSION=\"$(TUNTAP_VERSION)\" \ @@ -27,7 +27,9 @@ CFLAGS = -Wall -mkernel -force_cpusubtype_ALL \ CCFLAGS = $(CFLAGS) LDFLAGS = -Wall -mkernel -nostdlib -r -lcc_kext -arch i386 -arch x86_64 -Xlinker -kext -CCP = $(shell if [ -f /usr/bin/llvm-g++ ]; then echo llvm-g++; else echo g++; fi) +#CCP = g++ +CCP = $(HOME)/Code/llvm-g++-Xcode4.6.2/bin/llvm-g++ + CC = gcc all: $(KMOD_BIN) bundle diff --git a/mac-tap/tuntap/src/tap/kmod.cc b/tap-mac/tuntap/src/tap/kmod.cc similarity index 100% rename from mac-tap/tuntap/src/tap/kmod.cc rename to tap-mac/tuntap/src/tap/kmod.cc diff --git a/mac-tap/tuntap/src/tap/tap.cc b/tap-mac/tuntap/src/tap/tap.cc similarity index 100% rename from mac-tap/tuntap/src/tap/tap.cc rename to tap-mac/tuntap/src/tap/tap.cc diff --git a/mac-tap/tuntap/src/tap/tap.h b/tap-mac/tuntap/src/tap/tap.h similarity index 98% rename from mac-tap/tuntap/src/tap/tap.h rename to tap-mac/tuntap/src/tap/tap.h index 95e2f13f4..b3070676e 100644 --- a/mac-tap/tuntap/src/tap/tap.h +++ b/tap-mac/tuntap/src/tap/tap.h @@ -34,8 +34,7 @@ #define TAP_IF_COUNT 16 /* max number of tap interfaces */ -// ZeroTier default MTU, see Constants.hpp -#define TAP_MTU 2800 +#define TAP_MTU 4000 #define TAP_LLADDR tap_lladdr diff --git a/mac-tap/tuntap/src/tun/Info.plist b/tap-mac/tuntap/src/tun/Info.plist similarity index 100% rename from mac-tap/tuntap/src/tun/Info.plist rename to tap-mac/tuntap/src/tun/Info.plist diff --git a/mac-tap/tuntap/src/tun/Makefile b/tap-mac/tuntap/src/tun/Makefile similarity index 100% rename from mac-tap/tuntap/src/tun/Makefile rename to tap-mac/tuntap/src/tun/Makefile diff --git a/mac-tap/tuntap/src/tun/kmod.cc b/tap-mac/tuntap/src/tun/kmod.cc similarity index 100% rename from mac-tap/tuntap/src/tun/kmod.cc rename to tap-mac/tuntap/src/tun/kmod.cc diff --git a/mac-tap/tuntap/src/tun/tun.cc b/tap-mac/tuntap/src/tun/tun.cc similarity index 100% rename from mac-tap/tuntap/src/tun/tun.cc rename to tap-mac/tuntap/src/tun/tun.cc diff --git a/mac-tap/tuntap/src/tun/tun.h b/tap-mac/tuntap/src/tun/tun.h similarity index 100% rename from mac-tap/tuntap/src/tun/tun.h rename to tap-mac/tuntap/src/tun/tun.h diff --git a/mac-tap/tuntap/src/tun/tun_inet6_proto.c b/tap-mac/tuntap/src/tun/tun_inet6_proto.c similarity index 100% rename from mac-tap/tuntap/src/tun/tun_inet6_proto.c rename to tap-mac/tuntap/src/tun/tun_inet6_proto.c diff --git a/mac-tap/tuntap/src/tun/tun_inet_proto.c b/tap-mac/tuntap/src/tun/tun_inet_proto.c similarity index 100% rename from mac-tap/tuntap/src/tun/tun_inet_proto.c rename to tap-mac/tuntap/src/tun/tun_inet_proto.c diff --git a/mac-tap/tuntap/src/tun/tun_ioctls.h b/tap-mac/tuntap/src/tun/tun_ioctls.h similarity index 100% rename from mac-tap/tuntap/src/tun/tun_ioctls.h rename to tap-mac/tuntap/src/tun/tun_ioctls.h diff --git a/mac-tap/tuntap/src/tuntap.cc b/tap-mac/tuntap/src/tuntap.cc similarity index 100% rename from mac-tap/tuntap/src/tuntap.cc rename to tap-mac/tuntap/src/tuntap.cc diff --git a/mac-tap/tuntap/src/tuntap.h b/tap-mac/tuntap/src/tuntap.h similarity index 100% rename from mac-tap/tuntap/src/tuntap.h rename to tap-mac/tuntap/src/tuntap.h diff --git a/mac-tap/tuntap/src/tuntap_mgr.cc b/tap-mac/tuntap/src/tuntap_mgr.cc similarity index 100% rename from mac-tap/tuntap/src/tuntap_mgr.cc rename to tap-mac/tuntap/src/tuntap_mgr.cc diff --git a/mac-tap/tuntap/src/util.h b/tap-mac/tuntap/src/util.h similarity index 100% rename from mac-tap/tuntap/src/util.h rename to tap-mac/tuntap/src/util.h diff --git a/mac-tap/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings b/tap-mac/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings similarity index 100% rename from mac-tap/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings rename to tap-mac/tuntap/startup_item/tap/Resources/English.lproj/Localizable.strings diff --git a/mac-tap/tuntap/startup_item/tap/StartupParameters.plist b/tap-mac/tuntap/startup_item/tap/StartupParameters.plist similarity index 100% rename from mac-tap/tuntap/startup_item/tap/StartupParameters.plist rename to tap-mac/tuntap/startup_item/tap/StartupParameters.plist diff --git a/mac-tap/tuntap/startup_item/tap/tap b/tap-mac/tuntap/startup_item/tap/tap similarity index 100% rename from mac-tap/tuntap/startup_item/tap/tap rename to tap-mac/tuntap/startup_item/tap/tap diff --git a/mac-tap/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings b/tap-mac/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings similarity index 100% rename from mac-tap/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings rename to tap-mac/tuntap/startup_item/tun/Resources/English.lproj/Localizable.strings diff --git a/mac-tap/tuntap/startup_item/tun/StartupParameters.plist b/tap-mac/tuntap/startup_item/tun/StartupParameters.plist similarity index 100% rename from mac-tap/tuntap/startup_item/tun/StartupParameters.plist rename to tap-mac/tuntap/startup_item/tun/StartupParameters.plist diff --git a/mac-tap/tuntap/startup_item/tun/tun b/tap-mac/tuntap/startup_item/tun/tun similarity index 100% rename from mac-tap/tuntap/startup_item/tun/tun rename to tap-mac/tuntap/startup_item/tun/tun diff --git a/mac-tap/tuntap/test/tuntap/__init__.py b/tap-mac/tuntap/test/tuntap/__init__.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/__init__.py rename to tap-mac/tuntap/test/tuntap/__init__.py diff --git a/mac-tap/tuntap/test/tuntap/char_dev_harness.py b/tap-mac/tuntap/test/tuntap/char_dev_harness.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/char_dev_harness.py rename to tap-mac/tuntap/test/tuntap/char_dev_harness.py diff --git a/mac-tap/tuntap/test/tuntap/interface_harness.py b/tap-mac/tuntap/test/tuntap/interface_harness.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/interface_harness.py rename to tap-mac/tuntap/test/tuntap/interface_harness.py diff --git a/mac-tap/tuntap/test/tuntap/ioctl.py b/tap-mac/tuntap/test/tuntap/ioctl.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/ioctl.py rename to tap-mac/tuntap/test/tuntap/ioctl.py diff --git a/mac-tap/tuntap/test/tuntap/packet.py b/tap-mac/tuntap/test/tuntap/packet.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/packet.py rename to tap-mac/tuntap/test/tuntap/packet.py diff --git a/mac-tap/tuntap/test/tuntap/packet_codec.py b/tap-mac/tuntap/test/tuntap/packet_codec.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/packet_codec.py rename to tap-mac/tuntap/test/tuntap/packet_codec.py diff --git a/mac-tap/tuntap/test/tuntap/packet_reader.py b/tap-mac/tuntap/test/tuntap/packet_reader.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/packet_reader.py rename to tap-mac/tuntap/test/tuntap/packet_reader.py diff --git a/mac-tap/tuntap/test/tuntap/route.py b/tap-mac/tuntap/test/tuntap/route.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/route.py rename to tap-mac/tuntap/test/tuntap/route.py diff --git a/mac-tap/tuntap/test/tuntap/sockaddr.py b/tap-mac/tuntap/test/tuntap/sockaddr.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/sockaddr.py rename to tap-mac/tuntap/test/tuntap/sockaddr.py diff --git a/mac-tap/tuntap/test/tuntap/test_char_dev.py b/tap-mac/tuntap/test/tuntap/test_char_dev.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/test_char_dev.py rename to tap-mac/tuntap/test/tuntap/test_char_dev.py diff --git a/mac-tap/tuntap/test/tuntap/test_interface.py b/tap-mac/tuntap/test/tuntap/test_interface.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/test_interface.py rename to tap-mac/tuntap/test/tuntap/test_interface.py diff --git a/mac-tap/tuntap/test/tuntap/test_ip.py b/tap-mac/tuntap/test/tuntap/test_ip.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/test_ip.py rename to tap-mac/tuntap/test/tuntap/test_ip.py diff --git a/mac-tap/tuntap/test/tuntap/tun_tap_harness.py b/tap-mac/tuntap/test/tuntap/tun_tap_harness.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/tun_tap_harness.py rename to tap-mac/tuntap/test/tuntap/tun_tap_harness.py diff --git a/mac-tap/tuntap/test/tuntap/tun_tap_test_case.py b/tap-mac/tuntap/test/tuntap/tun_tap_test_case.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/tun_tap_test_case.py rename to tap-mac/tuntap/test/tuntap/tun_tap_test_case.py diff --git a/mac-tap/tuntap/test/tuntap/tuntap_tests.py b/tap-mac/tuntap/test/tuntap/tuntap_tests.py similarity index 100% rename from mac-tap/tuntap/test/tuntap/tuntap_tests.py rename to tap-mac/tuntap/test/tuntap/tuntap_tests.py