diff --git a/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj b/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj index 991db49..b2fa265 100644 --- a/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj +++ b/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj @@ -7,6 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 7C2228D11DCC1193006A2661 /* lwip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2228CF1DCC1193006A2661 /* lwip.cpp */; }; + 7C2228D41DCC11A8006A2661 /* picotcp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2228D21DCC11A8006A2661 /* picotcp.cpp */; }; + 7C2228D51DCC11B8006A2661 /* picotcp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2228D21DCC11A8006A2661 /* picotcp.cpp */; }; + 7C2228D61DCC11B8006A2661 /* lwip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2228CF1DCC1193006A2661 /* lwip.cpp */; }; + 7C5B40971DCC14E300C43410 /* picotcp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2228D21DCC11A8006A2661 /* picotcp.cpp */; }; + 7C5B40981DCC14E300C43410 /* lwip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2228CF1DCC1193006A2661 /* lwip.cpp */; }; 7C7D52831DBEADD200896C93 /* intercept.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52791DBEADD200896C93 /* intercept.c */; }; 7C7D52841DBEADD200896C93 /* proxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527A1DBEADD200896C93 /* proxy.cpp */; }; 7C7D52851DBEADD200896C93 /* rpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527B1DBEADD200896C93 /* rpc.c */; }; @@ -21,9 +27,6 @@ 7C7D52911DBEADE600896C93 /* sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527F1DBEADD200896C93 /* sockets.c */; }; 7C7D52921DBEADE600896C93 /* tap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52801DBEADD200896C93 /* tap.cpp */; }; 7C7D52931DBEADE600896C93 /* tap.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52811DBEADD200896C93 /* tap.hpp */; }; - 7C7D52941DBEADE600896C93 /* utils.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52821DBEADD200896C93 /* utils.hpp */; }; - 7C7F16451DBEB76F00C7AFFD /* jip.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52971DBEAE2500896C93 /* jip.hpp */; }; - 7C7F16461DBEB76F00C7AFFD /* lwip.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52961DBEADFF00896C93 /* lwip.hpp */; }; 7C7F16471DBEB76F00C7AFFD /* intercept.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52791DBEADD200896C93 /* intercept.c */; }; 7C7F16481DBEB76F00C7AFFD /* proxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527A1DBEADD200896C93 /* proxy.cpp */; }; 7C7F16491DBEB76F00C7AFFD /* rpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527B1DBEADD200896C93 /* rpc.c */; }; @@ -224,6 +227,10 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 7C2228CF1DCC1193006A2661 /* lwip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lwip.cpp; path = ../../../src/stack_drivers/lwip/lwip.cpp; sourceTree = ""; }; + 7C2228D01DCC1193006A2661 /* lwip.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = lwip.hpp; path = ../../../src/stack_drivers/lwip/lwip.hpp; sourceTree = ""; }; + 7C2228D21DCC11A8006A2661 /* picotcp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = picotcp.cpp; path = ../../../src/stack_drivers/picotcp/picotcp.cpp; sourceTree = ""; }; + 7C2228D31DCC11A8006A2661 /* picotcp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = picotcp.hpp; path = ../../../src/stack_drivers/picotcp/picotcp.hpp; sourceTree = ""; }; 7C7D52771DBEADD200896C93 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = debug.h; path = ../../../src/debug.h; sourceTree = ""; }; 7C7D52781DBEADD200896C93 /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = defs.h; path = ../../../src/defs.h; sourceTree = ""; }; 7C7D52791DBEADD200896C93 /* intercept.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = intercept.c; path = ../../../src/intercept.c; sourceTree = ""; }; @@ -235,9 +242,6 @@ 7C7D527F1DBEADD200896C93 /* sockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sockets.c; path = ../../../src/sockets.c; sourceTree = ""; }; 7C7D52801DBEADD200896C93 /* tap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tap.cpp; path = ../../../src/tap.cpp; sourceTree = ""; }; 7C7D52811DBEADD200896C93 /* tap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = tap.hpp; path = ../../../src/tap.hpp; sourceTree = ""; }; - 7C7D52821DBEADD200896C93 /* utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = utils.hpp; path = ../../../src/utils.hpp; sourceTree = ""; }; - 7C7D52961DBEADFF00896C93 /* lwip.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = lwip.hpp; path = ../../../src/stack_drivers/lwip.hpp; sourceTree = ""; }; - 7C7D52971DBEAE2500896C93 /* jip.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = jip.hpp; path = ../../../src/stack_drivers/jip.hpp; sourceTree = ""; }; 7C969B3C1DB99E7900BD3F7F /* def.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = def.c; path = ../../../ext/lwip/src/core/def.c; sourceTree = ""; }; 7C969B3D1DB99E7900BD3F7F /* dns.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dns.c; path = ../../../ext/lwip/src/core/dns.c; sourceTree = ""; }; 7C969B3E1DB99E7900BD3F7F /* inet_chksum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inet_chksum.c; path = ../../../ext/lwip/src/core/inet_chksum.c; sourceTree = ""; }; @@ -693,8 +697,10 @@ 7CC003131D12167D003E68DC /* SDK */ = { isa = PBXGroup; children = ( - 7C7D52971DBEAE2500896C93 /* jip.hpp */, - 7C7D52961DBEADFF00896C93 /* lwip.hpp */, + 7C2228D21DCC11A8006A2661 /* picotcp.cpp */, + 7C2228D31DCC11A8006A2661 /* picotcp.hpp */, + 7C2228CF1DCC1193006A2661 /* lwip.cpp */, + 7C2228D01DCC1193006A2661 /* lwip.hpp */, 7C7D52771DBEADD200896C93 /* debug.h */, 7C7D52781DBEADD200896C93 /* defs.h */, 7C7D52791DBEADD200896C93 /* intercept.c */, @@ -706,7 +712,6 @@ 7C7D527F1DBEADD200896C93 /* sockets.c */, 7C7D52801DBEADD200896C93 /* tap.cpp */, 7C7D52811DBEADD200896C93 /* tap.hpp */, - 7C7D52821DBEADD200896C93 /* utils.hpp */, 7CC0034F1D12178D003E68DC /* SDK.h */, ); name = SDK; @@ -920,11 +925,13 @@ files = ( 7C969B7F1DB99E9A00BD3F7F /* nd6.c in Sources */, 7CEAF5531DBAC872006585E7 /* Multicaster.cpp in Sources */, + 7C2228D41DCC11A8006A2661 /* picotcp.cpp in Sources */, 7CEAF50B1DBAC841006585E7 /* PortMapper.cpp in Sources */, 7C969B6D1DB99E8E00BD3F7F /* ip4.c in Sources */, 7CEAF5501DBAC872006585E7 /* Identity.cpp in Sources */, 7CEAF5601DBAC872006585E7 /* Topology.cpp in Sources */, 7C969B691DB99E8E00BD3F7F /* icmp.c in Sources */, + 7C2228D11DCC1193006A2661 /* lwip.cpp in Sources */, 7CEAF5521DBAC872006585E7 /* InetAddress.cpp in Sources */, 7CEAF58B1DBAD0BF006585E7 /* DeferredPackets.cpp in Sources */, 7CEAF55C1DBAC872006585E7 /* Salsa20.cpp in Sources */, @@ -997,6 +1004,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7C2228D51DCC11B8006A2661 /* picotcp.cpp in Sources */, + 7C2228D61DCC11B8006A2661 /* lwip.cpp in Sources */, 7C7F16881DBEB8B300C7AFFD /* lz4.c in Sources */, 7C7F16891DBEB8B300C7AFFD /* http_parser.c in Sources */, 7C7F16721DBEB88700C7AFFD /* autoip.c in Sources */, @@ -1057,8 +1066,6 @@ 7C7F16681DBEB7AB00C7AFFD /* OSUtils.cpp in Sources */, 7C7F16691DBEB7AB00C7AFFD /* PortMapper.cpp in Sources */, 7C7F166B1DBEB7AB00C7AFFD /* ControlPlane.cpp in Sources */, - 7C7F16451DBEB76F00C7AFFD /* jip.hpp in Sources */, - 7C7F16461DBEB76F00C7AFFD /* lwip.hpp in Sources */, 7C7F16471DBEB76F00C7AFFD /* intercept.c in Sources */, 7C7F16481DBEB76F00C7AFFD /* proxy.cpp in Sources */, 7C7F16491DBEB76F00C7AFFD /* rpc.c in Sources */, @@ -1072,6 +1079,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7C5B40971DCC14E300C43410 /* picotcp.cpp in Sources */, + 7C5B40981DCC14E300C43410 /* lwip.cpp in Sources */, 7C7D528B1DBEADE600896C93 /* intercept.c in Sources */, 7C7D528C1DBEADE600896C93 /* proxy.cpp in Sources */, 7C7D528D1DBEADE600896C93 /* rpc.c in Sources */, @@ -1080,7 +1089,6 @@ 7C7D52911DBEADE600896C93 /* sockets.c in Sources */, 7C7D52921DBEADE600896C93 /* tap.cpp in Sources */, 7C7D52931DBEADE600896C93 /* tap.hpp in Sources */, - 7C7D52941DBEADE600896C93 /* utils.hpp in Sources */, 7C969BCE1DB99F9E00BD3F7F /* tcp_in.c in Sources */, 7C969BCF1DB99F9E00BD3F7F /* tcp_out.c in Sources */, 7C969BD01DB99F9E00BD3F7F /* tcp.c in Sources */, @@ -1308,6 +1316,8 @@ "$(SRCROOT)/../../../ext/lwip/src/include", "$(SRCROOT)/../../../ext", "$(SRCROOT)/../../../zerotierone", + "$(SRCROOT)/../../../src/stack_drivers/lwip", + "$(SRCROOT)/../../../src", ); INFOPLIST_FILE = ZeroTierSDK_iOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1346,6 +1356,8 @@ "$(SRCROOT)/../../../ext/lwip/src/include", "$(SRCROOT)/../../../ext", "$(SRCROOT)/../../../zerotierone", + "$(SRCROOT)/../../../src/stack_drivers/lwip", + "$(SRCROOT)/../../../src", ); INFOPLIST_FILE = ZeroTierSDK_iOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1385,6 +1397,7 @@ "$(SRCROOT)/../../../ext/lwip/src/include", "$(SRCROOT)/../../../ext/lwip/src/include/ipv4/", "$(SRCROOT)/../../../ext/", + "$(SRCROOT)/../../../src", ); INFOPLIST_FILE = ZeroTierSDK_OSX/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1421,6 +1434,7 @@ "$(SRCROOT)/../../../ext/lwip/src/include", "$(SRCROOT)/../../../ext/lwip/src/include/ipv4/", "$(SRCROOT)/../../../ext/", + "$(SRCROOT)/../../../src", ); INFOPLIST_FILE = ZeroTierSDK_OSX/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1432,6 +1446,8 @@ "-DSDK_BUNDLED", "-D__XCODE__", "-D__APP_FRAMEWORK__", + "-DSDK_IPV4", + "-DSDK_LWIP", ); PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-OSX"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/project.pbxproj b/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/project.pbxproj index ec5d8f0..8dc2a48 100644 --- a/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/project.pbxproj +++ b/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 7C74DAD21D3C47D300A6C0B9 /* ZeroTierSDK_OSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C74DAD01D3C472C00A6C0B9 /* ZeroTierSDK_OSX.framework */; }; 7C74DAD31D3C485800A6C0B9 /* ZeroTierSDK_OSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C74DAD01D3C472C00A6C0B9 /* ZeroTierSDK_OSX.framework */; }; 7C74DAD41D3C485800A6C0B9 /* ZeroTierSDK_OSX.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7C74DAD01D3C472C00A6C0B9 /* ZeroTierSDK_OSX.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7C7D529B1DBEAED300896C93 /* XcodeWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52981DBEAED300896C93 /* XcodeWrapper.cpp */; }; @@ -53,7 +52,6 @@ buildActionMask = 2147483647; files = ( 7C74DAD31D3C485800A6C0B9 /* ZeroTierSDK_OSX.framework in Frameworks */, - 7C74DAD21D3C47D300A6C0B9 /* ZeroTierSDK_OSX.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/xcuserdata/Joseph.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/xcuserdata/Joseph.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index d923050..912a928 100644 --- a/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/xcuserdata/Joseph.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/integrations/apple/example_app/OSX/Example_OSX_App.xcodeproj/xcuserdata/Joseph.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -26,11 +26,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Example_OSX_App/ViewController.swift" - timestampString = "490574990.533534" + timestampString = "499915440.501071" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "194" - endingLineNumber = "194" + startingLineNumber = "196" + endingLineNumber = "196" landmarkName = "update_rx()" landmarkType = "5"> @@ -58,11 +58,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Example_OSX_App/ViewController.swift" - timestampString = "490574990.533534" + timestampString = "499915440.501071" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "193" - endingLineNumber = "193" + startingLineNumber = "195" + endingLineNumber = "195" landmarkName = "update_rx()" landmarkType = "5"> diff --git a/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift b/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift index 206f9cf..ecee3bd 100644 --- a/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift +++ b/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift @@ -181,8 +181,10 @@ class ViewController: NSViewController { { sleep(1) dispatch_async(dispatch_get_main_queue()) { - print("IPV4 = ", String.fromCString(self.zt.get_ipv4_address(self.txtNWID.stringValue)!)) // get IP address + var str_buf = [Int8](count: 16, repeatedValue: 0) + print("addr = ", String.fromCString(str_buf)) } + // TCP if(selectedProtocol == SOCK_STREAM) { @@ -248,7 +250,6 @@ class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() - // Set initial UI values for demo txtAddr.stringValue = serverAddr txtPort.intValue = serverPort diff --git a/integrations/docker/docker_demo/monitor_entrypoint.sh b/integrations/docker/docker_demo/monitor_entrypoint.sh index 6b85ac2..384a226 100644 --- a/integrations/docker/docker_demo/monitor_entrypoint.sh +++ b/integrations/docker/docker_demo/monitor_entrypoint.sh @@ -47,8 +47,4 @@ else echo 'REDIS RESPONSE FAIL' touch "$file_path$fail$test_name.txt" printf 'Test: redis server did NOT respond!\n' >> "$file_path$fail$test_name.txt" -fi - - - - +fi \ No newline at end of file diff --git a/src/stack_drivers/lwip/lwip.cpp b/src/stack_drivers/lwip/lwip.cpp index 9e4e701..901e49b 100644 --- a/src/stack_drivers/lwip/lwip.cpp +++ b/src/stack_drivers/lwip/lwip.cpp @@ -25,10 +25,8 @@ * LLC. Start here: http://www.zerotier.com/ */ -//#include "lwip.hpp" #include "tap.hpp" #include "sdkutils.hpp" -//#include "debug.h" namespace ZeroTier { diff --git a/src/tap.hpp b/src/tap.hpp index 5e7def6..79345d9 100644 --- a/src/tap.hpp +++ b/src/tap.hpp @@ -49,7 +49,7 @@ #include "defs.h" #include "rpc.h" #include "lwip.hpp" -#include "jip.hpp" +// #include "jip.hpp" #if defined(SDK_PICOTCP) #include "picotcp.hpp" diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..3b91df8 --- /dev/null +++ b/test.sh @@ -0,0 +1,13 @@ +# Calls target in makefile to build docker images and execute unit tests + +# lwIP +make clean; make -f make-linux.mk unit_test SDK_DEBUG=1 SDK_LWIP=1 SDK_IPV4=1 +./tests/unit/docker/start.sh +make clean; make -f make-linux.mk unit_test SDK_DEBUG=1 SDK_LWIP=1 SDK_IPV6=1 +./tests/unit/docker/start.sh + +# picoTCP +make clean; make -f make-linux.mk unit_test SDK_DEBUG=1 SDK_PICOTCP=1 SDK_IPV4=1 +./tests/unit/docker/start.sh +make clean; make -f make-linux.mk unit_test SDK_DEBUG=1 SDK_PICOTCP=1 SDK_IPV6=1 +./tests/unit/docker/start.sh \ No newline at end of file