diff --git a/.gitignore b/.gitignore
index c80615527..94ebeeb6e 100755
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,7 @@ enc_temp_folder
/world/mkworld
/world/*.c25519
zt1-src.tar.gz
+/MacEthernetTapAgent
# Miscellaneous temporaries, build files, etc.
*.log
diff --git a/make-mac.mk b/make-mac.mk
index 12357f689..bb5b15479 100644
--- a/make-mac.mk
+++ b/make-mac.mk
@@ -19,7 +19,7 @@ ZT_VERSION_BUILD=$(shell cat version.h | grep -F VERSION_BUILD | cut -d ' ' -f 3
DEFS+=-DZT_BUILD_PLATFORM=$(ZT_BUILD_PLATFORM) -DZT_BUILD_ARCHITECTURE=$(ZT_BUILD_ARCHITECTURE)
include objects.mk
-ONE_OBJS+=osdep/OSXEthernetTap.o ext/http-parser/http_parser.o
+ONE_OBJS+=osdep/MacEthernetTap.o ext/http-parser/http_parser.o
# Official releases are signed with our Apple cert and apply software updates by default
ifeq ($(ZT_OFFICIAL_RELEASE),1)
@@ -78,7 +78,11 @@ all: one macui
ext/x64-salsa2012-asm/salsa2012.o:
$(CC) $(CFLAGS) -c ext/x64-salsa2012-asm/salsa2012.s -o ext/x64-salsa2012-asm/salsa2012.o
-one: $(CORE_OBJS) $(ONE_OBJS) one.o
+mac-agent: FORCE
+ $(CC) -O -s -o MacEthernetTapAgent osdep/MacEthernetTapAgent.c
+ $(CODESIGN) -f -s $(CODESIGN_APP_CERT) MacEthernetTapAgent
+
+one: $(CORE_OBJS) $(ONE_OBJS) one.o mac-agent
$(CXX) $(CXXFLAGS) -o zerotier-one $(CORE_OBJS) $(ONE_OBJS) one.o $(LIBS)
$(STRIP) zerotier-one
ln -sf zerotier-one zerotier-idtool
@@ -128,17 +132,17 @@ official: FORCE
make ZT_OFFICIAL_RELEASE=1 mac-dist-pkg
clean:
- rm -rf *.dSYM build-* *.a *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-selftest zerotier-cli zerotier doc/node_modules macui/build zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_*
+ rm -rf MacEthernetTapAgent *.dSYM build-* *.a *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-selftest zerotier-cli zerotier doc/node_modules macui/build zt1_update_$(ZT_BUILD_PLATFORM)_$(ZT_BUILD_ARCHITECTURE)_*
distclean: clean
realclean: clean
# For those building from source -- installs signed binary tap driver in system ZT home
-install-mac-tap: FORCE
- mkdir -p /Library/Application\ Support/ZeroTier/One
- rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext
- cp -R ext/bin/tap-mac/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 ext/bin/tap-mac/tap.kext /Library/Application\ Support/ZeroTier/One
+# chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext
FORCE:
diff --git a/osdep/MacEthernetTap.cpp b/osdep/MacEthernetTap.cpp
new file mode 100644
index 000000000..ec1a56151
--- /dev/null
+++ b/osdep/MacEthernetTap.cpp
@@ -0,0 +1,404 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2018 ZeroTier, Inc. https://www.zerotier.com/
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * --
+ *
+ * You can be released from the requirements of the license by purchasing
+ * a commercial license. Buying such a license is mandatory as soon as you
+ * develop commercial closed-source software that incorporates or links
+ * directly against ZeroTier software without disclosing the source code
+ * of your own application.
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include