pre-release preparation (organization of source files, added readmes, etc)

This commit is contained in:
Joseph Henry
2016-10-24 09:44:14 -07:00
parent a538b9131b
commit 27eeed0fa9
55 changed files with 463 additions and 345 deletions

View File

@@ -80,6 +80,7 @@ INCLUDES+= -Iext \
-I../$(ZT1)/service \ -I../$(ZT1)/service \
-I. \ -I. \
-Isrc \ -Isrc \
-Isrc/stack_drivers \
-I$(LWIP_DIR)/src/include \ -I$(LWIP_DIR)/src/include \
-I$(LWIP_DIR)/src/include/ipv4 \ -I$(LWIP_DIR)/src/include/ipv4 \
-I$(LWIP_DIR)/src/include/ipv6 \ -I$(LWIP_DIR)/src/include/ipv6 \
@@ -125,7 +126,7 @@ endif
# Debug output for the SDK # Debug output for the SDK
# Specific levels can be controlled in src/SDK_Debug.h # Specific levels can be controlled in src/debug.h
ifeq ($(SDK_DEBUG),1) ifeq ($(SDK_DEBUG),1)
DEFS+=-DSDK_DEBUG -g DEFS+=-DSDK_DEBUG -g
endif endif
@@ -173,11 +174,11 @@ one: $(OBJS) $(ZT1)/service/OneService.o $(ZT1)/one.o $(ZT1)/osdep/LinuxEthernet
# Build only the intercept library # Build only the intercept library
linux_intercept: linux_intercept:
# Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility # Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility
cd src ; gcc $(DEFS) $(INCLUDES) -g -O2 -Wall -std=c99 -fPIC -DVERBOSE -D_GNU_SOURCE -DSDK_INTERCEPT -nostdlib -nostdlib -shared -o ../$(INTERCEPT) SDK_Sockets.c SDK_Intercept.c SDK_RPC.c -ldl cd src ; gcc $(DEFS) $(INCLUDES) -g -O2 -Wall -std=c99 -fPIC -DVERBOSE -D_GNU_SOURCE -DSDK_INTERCEPT -nostdlib -nostdlib -shared -o ../$(INTERCEPT) sockets.c intercept.c rpc.c -ldl
# Build only the SDK service # Build only the SDK service
linux_sdk_service: pico lwip $(OBJS) linux_sdk_service: pico lwip $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(STACK_FLAGS) $(DEFS) $(INCLUDES) -DSDK -DZT_ONE_NO_ROOT_CHECK -o $(SDK_SERVICE) $(OBJS) $(ZT1)/service/OneService.cpp src/SDK_EthernetTap.cpp src/SDK_Proxy.cpp $(ZT1)/one.cpp src/SDK_RPC.c $(LDLIBS) -ldl $(CXX) $(CXXFLAGS) $(LDFLAGS) $(STACK_FLAGS) $(DEFS) $(INCLUDES) -DSDK -DZT_ONE_NO_ROOT_CHECK -o $(SDK_SERVICE) $(OBJS) $(ZT1)/service/OneService.cpp src/tap.cpp src/proxy.cpp $(ZT1)/one.cpp src/rpc.c $(LDLIBS) -ldl
ln -sf $(SDK_SERVICE_NAME) $(BUILD)/zerotier-cli ln -sf $(SDK_SERVICE_NAME) $(BUILD)/zerotier-cli
ln -sf $(SDK_SERVICE_NAME) $(BUILD)/zerotier-idtool ln -sf $(SDK_SERVICE_NAME) $(BUILD)/zerotier-idtool
@@ -186,7 +187,7 @@ linux_service_and_intercept: linux_intercept linux_sdk_service
# Builds a single shared library which contains everything # Builds a single shared library which contains everything
linux_shared_lib: $(OBJS) linux_shared_lib: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(INCLUDES) -DSDK -DZT_ONE_NO_ROOT_CHECK -shared -o $(SHARED_LIB) $(OBJS) zerotierone/service/OneService.cpp src/SDK_Service.cpp src/SDK_EthernetTap.cpp src/SDK_Proxy.cpp zerotierone/one.cpp -x c src/SDK_Sockets.c src/SDK_Intercept.c src/SDK_RPC.c $(LDLIBS) -ldl $(CXX) $(CXXFLAGS) $(LDFLAGS) $(INCLUDES) -DSDK -DZT_ONE_NO_ROOT_CHECK -shared -o $(SHARED_LIB) $(OBJS) zerotierone/service/OneService.cpp src/service.cpp src/tap.cpp src/proxy.cpp zerotierone/one.cpp -x c src/sockets.c src/intercept.c src/rpc.c $(LDLIBS) -ldl

View File

@@ -24,8 +24,6 @@ ONE_CLI = $(BUILD)/$(ONE_CLI_NAME)
ONE_IDTOOL = $(BUILD)/$(ONE_IDTOOL_NAME) ONE_IDTOOL = $(BUILD)/$(ONE_IDTOOL_NAME)
LWIP_LIB = $(BUILD)/$(LWIP_LIB_NAME) LWIP_LIB = $(BUILD)/$(LWIP_LIB_NAME)
# #
LWIP_2_DIR = ext/lwip_2.0.0
LWIP_1_DIR = ext/lwip_1.4.1
LWIP_BASE_DIR = ext/lwip LWIP_BASE_DIR = ext/lwip
# Automagically pick clang or gcc, with preference for clang # Automagically pick clang or gcc, with preference for clang

View File

@@ -2,15 +2,14 @@ OBJS=\
zerotierone/ext/lz4/lz4.o \ zerotierone/ext/lz4/lz4.o \
zerotierone/ext/json-parser/json.o \ zerotierone/ext/json-parser/json.o \
zerotierone/ext/http-parser/http_parser.o \ zerotierone/ext/http-parser/http_parser.o \
zerotierone/controller/EmbeddedNetworkController.o \
zerotierone/node/C25519.o \ zerotierone/node/C25519.o \
zerotierone/node/Capability.o \
zerotierone/node/CertificateOfMembership.o \ zerotierone/node/CertificateOfMembership.o \
zerotierone/node/Cluster.o \ zerotierone/node/Cluster.o \
zerotierone/node/DeferredPackets.o \
zerotierone/node/Dictionary.o \
zerotierone/node/Identity.o \ zerotierone/node/Identity.o \
zerotierone/node/IncomingPacket.o \ zerotierone/node/IncomingPacket.o \
zerotierone/node/InetAddress.o \ zerotierone/node/InetAddress.o \
zerotierone/node/Membership.o \
zerotierone/node/Multicaster.o \ zerotierone/node/Multicaster.o \
zerotierone/node/Network.o \ zerotierone/node/Network.o \
zerotierone/node/NetworkConfig.o \ zerotierone/node/NetworkConfig.o \
@@ -20,16 +19,13 @@ OBJS=\
zerotierone/node/Path.o \ zerotierone/node/Path.o \
zerotierone/node/Peer.o \ zerotierone/node/Peer.o \
zerotierone/node/Poly1305.o \ zerotierone/node/Poly1305.o \
zerotierone/node/Revocation.o \
zerotierone/node/Salsa20.o \ zerotierone/node/Salsa20.o \
zerotierone/node/SelfAwareness.o \ zerotierone/node/SelfAwareness.o \
zerotierone/node/SHA512.o \ zerotierone/node/SHA512.o \
zerotierone/node/Switch.o \ zerotierone/node/Switch.o \
zerotierone/node/Tag.o \
zerotierone/node/Topology.o \ zerotierone/node/Topology.o \
zerotierone/node/Utils.o \ zerotierone/node/Utils.o \
zerotierone/osdep/BackgroundResolver.o \ zerotierone/osdep/BackgroundResolver.o \
zerotierone/osdep/ManagedRoute.o \
zerotierone/osdep/Http.o \ zerotierone/osdep/Http.o \
zerotierone/osdep/OSUtils.o \ zerotierone/osdep/OSUtils.o \
zerotierone/service/ClusterGeoIpService.o \ zerotierone/service/ClusterGeoIpService.o \

5
src/README.md Normal file
View File

@@ -0,0 +1,5 @@
Source Directory Structure
====
`wrappers` - Example bindings of the ZeroTierSDK Sockets API to your favorite native languages
`stack_drivers` - Drivers to mate various network stacks to the ZeroTier tap interface

View File

@@ -30,14 +30,14 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <stdbool.h> #include <stdbool.h>
#include "SDK_Signatures.h" #include "signatures.h"
#if defined(__ANDROID__) #if defined(__ANDROID__)
// For defining the Android direct-call API // For defining the Android direct-call API
#include <jni.h> #include <jni.h>
#endif #endif
#include "SDK_LocalBuild.h" #include "build.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@@ -42,7 +42,6 @@
#include <pthread.h> #include <pthread.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
//#include <sys/socket.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <sys/un.h> #include <sys/un.h>
#include <sys/resource.h> #include <sys/resource.h>
@@ -55,9 +54,9 @@
#include <linux/net.h> #include <linux/net.h>
#endif #endif
#include "SDK.h" #include "sdk.h"
#include "SDK_Debug.h" #include "debug.h"
#include "SDK_RPC.h" #include "rpc.h"
pthread_key_t thr_id_key; pthread_key_t thr_id_key;
//char *api_netpath; //char *api_netpath;

View File

@@ -25,8 +25,9 @@
* LLC. Start here: http://www.zerotier.com/ * LLC. Start here: http://www.zerotier.com/
*/ */
#include "SDK_Debug.h" #include "debug.h"
#include "SDK_EthernetTap.hpp" #include "tap.hpp"
#include "Phy.hpp" #include "Phy.hpp"
#include "Utils.hpp" #include "Utils.hpp"
#include "OSUtils.hpp" #include "OSUtils.hpp"

View File

@@ -41,12 +41,11 @@
#include <fcntl.h> #include <fcntl.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdint.h> #include <stdint.h>
//#include <sys/socket.h>
#include <strings.h> #include <strings.h>
#include "SDK.h" #include "sdk.h"
#include "SDK_RPC.h" #include "rpc.h"
#include "SDK_Debug.h" #include "debug.h"
// externs common between SDK_Intercept and SDK_Socket from SDK.h // externs common between SDK_Intercept and SDK_Socket from SDK.h

View File

@@ -46,10 +46,10 @@
#include "Utils.hpp" #include "Utils.hpp"
#include "OSUtils.hpp" #include "OSUtils.hpp"
#include "SDK_EthernetTap.hpp" #include "tap.hpp"
#include "SDK.h" #include "sdk.h"
#include "SDK_Debug.h" #include "debug.h"
#include "SDK_LocalBuild.h" #include "build.h"
std::string service_path; std::string service_path;
pthread_t intercept_thread; pthread_t intercept_thread;

View File

@@ -68,10 +68,11 @@
#endif #endif
#define SOCK_TYPE_MASK 0xf #define SOCK_TYPE_MASK 0xf
#include "SDK.h" #include "sdk.h"
#include "SDK_Signatures.h" #include "signatures.h"
#include "SDK_Debug.h" #include "debug.h"
#include "SDK_RPC.h" #include "rpc.h"
#include "Constants.hpp" // For Tap's MTU #include "Constants.hpp" // For Tap's MTU
// Prototypes // Prototypes

View File

@@ -0,0 +1,4 @@
Stack Drivers
====
These files contain code to load and interface with network stacks.

View File

@@ -30,7 +30,7 @@
#include "Mutex.hpp" #include "Mutex.hpp"
#include "OSUtils.hpp" #include "OSUtils.hpp"
#include "SDK_Debug.h" #include "debug.h"
#include <stdio.h> #include <stdio.h>
#include <dlfcn.h> #include <dlfcn.h>

View File

@@ -42,7 +42,7 @@
#include "Mutex.hpp" #include "Mutex.hpp"
#include "OSUtils.hpp" #include "OSUtils.hpp"
#include "SDK_Debug.h" #include "debug.h"
#include <stdio.h> #include <stdio.h>
#include <dlfcn.h> #include <dlfcn.h>

View File

@@ -43,8 +43,8 @@
#include "Constants.hpp" #include "Constants.hpp"
#include "Phy.hpp" #include "Phy.hpp"
#include "SDK_Debug.h" #include "debug.h"
#include "SDK_EthernetTap.hpp" #include "tap.hpp"
#include "pico_stack.h" #include "pico_stack.h"
#include "pico_ipv4.h" #include "pico_ipv4.h"

View File

@@ -35,16 +35,16 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include "SDK_EthernetTap.hpp" #include "tap.hpp"
#include "SDK_Utils.hpp" #include "utils.hpp"
#include "SDK.h" #include "sdk.h"
#include "SDK_defs.h" #include "defs.h"
#include "SDK_Debug.h" #include "debug.h"
#if defined(SDK_LWIP) #if defined(SDK_LWIP)
#include "SDK_lwIP.hpp" #include "lwip.hpp"
#elif defined(SDK_PICOTCP) #elif defined(SDK_PICOTCP)
#include "SDK_picoTCP.hpp" #include "picotcp.hpp"
#include "pico_stack.h" #include "pico_stack.h"
#include "pico_ipv4.h" #include "pico_ipv4.h"
#include "pico_icmp4.h" #include "pico_icmp4.h"
@@ -52,7 +52,7 @@
#include "pico_protocol.h" #include "pico_protocol.h"
#include "pico_socket.h" #include "pico_socket.h"
#elif defined(SDK_JIP) #elif defined(SDK_JIP)
#include "SDK_jip.hpp" #include "jip.hpp"
#endif #endif
#include "Utils.hpp" #include "Utils.hpp"

View File

@@ -46,13 +46,13 @@
#include "netif/etharp.h" #include "netif/etharp.h"
#include "SDK_defs.h" #include "defs.h"
#include "SDK_RPC.h" #include "rpc.h"
#include "SDK_lwIP.hpp" #include "lwip.hpp"
#include "SDK_jip.hpp" #include "jip.hpp"
#if defined(SDK_PICOTCP) #if defined(SDK_PICOTCP)
#include "SDK_picoTCP.hpp" #include "picotcp.hpp"
#include "pico_protocol.h" #include "pico_protocol.h"
#endif #endif

3
src/wrappers/README.md Normal file
View File

@@ -0,0 +1,3 @@
Language/Framework Wrappers
====
These wrappers are designed to abstract the ZeroTierSDK Sockets API (implemented in `src/Sockets.c`) to your native language of choice. Specific examples of how to use these are located in the `integrations` directory..

View File

@@ -1 +1,10 @@
The ext/ folder contains third party code, drivers, installation support files, etc. Miscellaneous Stuff
======
This subfolder contains:
* Bundled third party libraries that are compiled into the binary on platforms and Linux distributions where they are not available on the system.
* Pre-compiled binaries for some platforms, such as pre-built and signed drivers for Mac and Windows.
* Miscellaneous files used by installers and packages on various platform targets.

View File

@@ -61,3 +61,8 @@ Marc O'Morain <github.com@marcomorain.com>
Jeff Pinner <jpinner@twitter.com> Jeff Pinner <jpinner@twitter.com>
Timothy J Fontaine <tjfontaine@gmail.com> Timothy J Fontaine <tjfontaine@gmail.com>
Akagi201 <akagi201@gmail.com> Akagi201 <akagi201@gmail.com>
Romain Giraud <giraud.romain@gmail.com>
Jay Satiro <raysatiro@yahoo.com>
Arne Steen <Arne.Steen@gmx.de>
Kjell Schubert <kjell.schubert@gmail.com>
Olivier Mengué <dolmen@cpan.org>

View File

@@ -440,7 +440,7 @@ enum http_host_state
* character or %x80-FF * character or %x80-FF
**/ **/
#define IS_HEADER_CHAR(ch) \ #define IS_HEADER_CHAR(ch) \
(ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127)) (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res) #define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
@@ -1007,89 +1007,40 @@ reexecute:
UPDATE_STATE(s_req_spaces_before_url); UPDATE_STATE(s_req_spaces_before_url);
} else if (ch == matcher[parser->index]) { } else if (ch == matcher[parser->index]) {
; /* nada */ ; /* nada */
} else if (parser->method == HTTP_CONNECT) { } else if (IS_ALPHA(ch)) {
if (parser->index == 1 && ch == 'H') {
parser->method = HTTP_CHECKOUT; switch (parser->method << 16 | parser->index << 8 | ch) {
} else if (parser->index == 2 && ch == 'P') { #define XX(meth, pos, ch, new_meth) \
parser->method = HTTP_COPY; case (HTTP_##meth << 16 | pos << 8 | ch): \
} else { parser->method = HTTP_##new_meth; break;
SET_ERRNO(HPE_INVALID_METHOD);
goto error; XX(POST, 1, 'U', PUT)
} XX(POST, 1, 'A', PATCH)
} else if (parser->method == HTTP_MKCOL) { XX(CONNECT, 1, 'H', CHECKOUT)
if (parser->index == 1 && ch == 'O') { XX(CONNECT, 2, 'P', COPY)
parser->method = HTTP_MOVE; XX(MKCOL, 1, 'O', MOVE)
} else if (parser->index == 1 && ch == 'E') { XX(MKCOL, 1, 'E', MERGE)
parser->method = HTTP_MERGE; XX(MKCOL, 2, 'A', MKACTIVITY)
} else if (parser->index == 1 && ch == '-') { XX(MKCOL, 3, 'A', MKCALENDAR)
parser->method = HTTP_MSEARCH; XX(SUBSCRIBE, 1, 'E', SEARCH)
} else if (parser->index == 2 && ch == 'A') { XX(REPORT, 2, 'B', REBIND)
parser->method = HTTP_MKACTIVITY; XX(POST, 1, 'R', PROPFIND)
} else if (parser->index == 3 && ch == 'A') { XX(PROPFIND, 4, 'P', PROPPATCH)
parser->method = HTTP_MKCALENDAR; XX(PUT, 2, 'R', PURGE)
} else { XX(LOCK, 1, 'I', LINK)
SET_ERRNO(HPE_INVALID_METHOD); XX(UNLOCK, 2, 'S', UNSUBSCRIBE)
goto error; XX(UNLOCK, 2, 'B', UNBIND)
} XX(UNLOCK, 3, 'I', UNLINK)
} else if (parser->method == HTTP_SUBSCRIBE) { #undef XX
if (parser->index == 1 && ch == 'E') {
parser->method = HTTP_SEARCH; default:
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->method == HTTP_REPORT) {
if (parser->index == 2 && ch == 'B') {
parser->method = HTTP_REBIND;
} else {
SET_ERRNO(HPE_INVALID_METHOD); SET_ERRNO(HPE_INVALID_METHOD);
goto error; goto error;
}
} else if (parser->index == 1) {
if (parser->method == HTTP_POST) {
if (ch == 'R') {
parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
} else if (ch == 'U') {
parser->method = HTTP_PUT; /* or HTTP_PURGE */
} else if (ch == 'A') {
parser->method = HTTP_PATCH;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->method == HTTP_LOCK) {
if (ch == 'I') {
parser->method = HTTP_LINK;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} }
} else if (parser->index == 2) { } else if (ch == '-' &&
if (parser->method == HTTP_PUT) { parser->index == 1 &&
if (ch == 'R') { parser->method == HTTP_MKCOL) {
parser->method = HTTP_PURGE; parser->method = HTTP_MSEARCH;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->method == HTTP_UNLOCK) {
if (ch == 'S') {
parser->method = HTTP_UNSUBSCRIBE;
} else if(ch == 'B') {
parser->method = HTTP_UNBIND;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
parser->method = HTTP_PROPPATCH;
} else if (parser->index == 3 && parser->method == HTTP_UNLOCK && ch == 'I') {
parser->method = HTTP_UNLINK;
} else { } else {
SET_ERRNO(HPE_INVALID_METHOD); SET_ERRNO(HPE_INVALID_METHOD);
goto error; goto error;
@@ -1861,6 +1812,9 @@ reexecute:
case 0: case 0:
break; break;
case 2:
parser->upgrade = 1;
case 1: case 1:
parser->flags |= F_SKIPBODY; parser->flags |= F_SKIPBODY;
break; break;
@@ -2299,12 +2253,13 @@ http_parse_host_char(enum http_host_state s, const char ch) {
static int static int
http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
//assert(u->field_set & (1 << UF_HOST));
enum http_host_state s; enum http_host_state s;
const char *p; const char *p;
size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len; size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
assert(u->field_set & (1 << UF_HOST));
u->field_data[UF_HOST].len = 0; u->field_data[UF_HOST].len = 0;
s = found_at ? s_http_userinfo_start : s_http_host_start; s = found_at ? s_http_userinfo_start : s_http_host_start;

View File

@@ -26,8 +26,8 @@ extern "C" {
/* Also update SONAME in the Makefile whenever you change these. */ /* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2 #define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 6 #define HTTP_PARSER_VERSION_MINOR 7
#define HTTP_PARSER_VERSION_PATCH 1 #define HTTP_PARSER_VERSION_PATCH 0
#include <sys/types.h> #include <sys/types.h>
#if defined(_WIN32) && !defined(__MINGW32__) && \ #if defined(_WIN32) && !defined(__MINGW32__) && \
@@ -77,6 +77,11 @@ typedef struct http_parser_settings http_parser_settings;
* HEAD request which may contain 'Content-Length' or 'Transfer-Encoding: * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding:
* chunked' headers that indicate the presence of a body. * chunked' headers that indicate the presence of a body.
* *
* Returning `2` from on_headers_complete will tell parser that it should not
* expect neither a body nor any futher responses on this connection. This is
* useful for handling responses to a CONNECT request which may not contain
* `Upgrade` or `Connection: upgrade` headers.
*
* http_data_cb does not return data chunks. It will be called arbitrarily * http_data_cb does not return data chunks. It will be called arbitrarily
* many times for each string. E.G. you might get 10 callbacks for "on_url" * many times for each string. E.G. you might get 10 callbacks for "on_url"
* each providing just a few characters more data. * each providing just a few characters more data.

View File

@@ -37,7 +37,7 @@
<key>GID</key> <key>GID</key>
<integer>80</integer> <integer>80</integer>
<key>PATH</key> <key>PATH</key>
<string>../../mac-ui-macgap1-wrapper/bin/ZeroTier One.app</string> <string>mac-ui-macgap1-wrapper/bin/ZeroTier One.app</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -130,7 +130,7 @@
<key>GID</key> <key>GID</key>
<integer>0</integer> <integer>0</integer>
<key>PATH</key> <key>PATH</key>
<string>../../../ui/index.html</string> <string>ui/index.html</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -146,7 +146,7 @@
<key>GID</key> <key>GID</key>
<integer>0</integer> <integer>0</integer>
<key>PATH</key> <key>PATH</key>
<string>../../../ui/main.js</string> <string>ui/main.js</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -162,7 +162,7 @@
<key>GID</key> <key>GID</key>
<integer>0</integer> <integer>0</integer>
<key>PATH</key> <key>PATH</key>
<string>../../../ui/react.min.js</string> <string>ui/react.min.js</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -178,7 +178,7 @@
<key>GID</key> <key>GID</key>
<integer>0</integer> <integer>0</integer>
<key>PATH</key> <key>PATH</key>
<string>../../../ui/simpleajax.min.js</string> <string>ui/simpleajax.min.js</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -194,7 +194,7 @@
<key>GID</key> <key>GID</key>
<integer>0</integer> <integer>0</integer>
<key>PATH</key> <key>PATH</key>
<string>../../../ui/zerotier.css</string> <string>ui/zerotier.css</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -210,7 +210,7 @@
<key>GID</key> <key>GID</key>
<integer>0</integer> <integer>0</integer>
<key>PATH</key> <key>PATH</key>
<string>../../../ui/ztui.min.js</string> <string>ui/ztui.min.js</string>
<key>PATH_TYPE</key> <key>PATH_TYPE</key>
<integer>1</integer> <integer>1</integer>
<key>PERMISSIONS</key> <key>PERMISSIONS</key>
@@ -759,7 +759,7 @@
<key>OVERWRITE_PERMISSIONS</key> <key>OVERWRITE_PERMISSIONS</key>
<false/> <false/>
<key>VERSION</key> <key>VERSION</key>
<string>1.0.3</string> <string>1.1.14</string>
</dict> </dict>
<key>PROJECT_COMMENTS</key> <key>PROJECT_COMMENTS</key>
<dict> <dict>
@@ -773,26 +773,27 @@
ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp
dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u
dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD
b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjEzNDcuNTciPgo8c3R5bGUg b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjE0MDQuNDciPgo8c3R5bGUg
dHlwZT0idGV4dC9jc3MiPgpwLnAxIHttYXJnaW46IDAuMHB4IDAu dHlwZT0idGV4dC9jc3MiPgpwLnAxIHttYXJnaW46IDAuMHB4IDAu
MHB4IDAuMHB4IDAuMHB4OyBmb250OiAxMi4wcHggSGVsdmV0aWNh MHB4IDAuMHB4IDAuMHB4OyBsaW5lLWhlaWdodDogMTQuMHB4OyBm
OyBjb2xvcjogIzAwMDAwMDsgLXdlYmtpdC10ZXh0LXN0cm9rZTog b250OiAxMi4wcHggSGVsdmV0aWNhOyBjb2xvcjogIzAwMDAwMDsg
IzAwMDAwMH0Kc3Bhbi5zMSB7Zm9udC1rZXJuaW5nOiBub25lfQo8 LXdlYmtpdC10ZXh0LXN0cm9rZTogIzAwMDAwMH0Kc3Bhbi5zMSB7
L3N0eWxlPgo8L2hlYWQ+Cjxib2R5Pgo8cCBjbGFzcz0icDEiPjxz Zm9udC1rZXJuaW5nOiBub25lfQo8L3N0eWxlPgo8L2hlYWQ+Cjxi
cGFuIGNsYXNzPSJzMSI+WmVyb1RpZXIgT25lIC0gTmV0d29yayBW b2R5Pgo8cCBjbGFzcz0icDEiPjxzcGFuIGNsYXNzPSJzMSI+WmVy
aXJ0dWFsaXphdGlvbiBFdmVyeXdoZXJlPC9zcGFuPjwvcD4KPHAg b1RpZXIgT25lIC0gTmV0d29yayBWaXJ0dWFsaXphdGlvbiBFdmVy
Y2xhc3M9InAxIj48c3BhbiBjbGFzcz0iczEiPihjKTIwMTEtMjAx eXdoZXJlPC9zcGFuPjwvcD4KPHAgY2xhc3M9InAxIj48c3BhbiBj
NSBaZXJvVGllciwgSW5jLjwvc3Bhbj48L3A+CjxwIGNsYXNzPSJw bGFzcz0iczEiPihjKTIwMTEtMjAxNiBaZXJvVGllciwgSW5jLjwv
MSI+PHNwYW4gY2xhc3M9InMxIj5jb250YWN0QHplcm90aWVyLmNv c3Bhbj48L3A+CjxwIGNsYXNzPSJwMSI+PHNwYW4gY2xhc3M9InMx
bTwvc3Bhbj48L3A+CjxwIGNsYXNzPSJwMSI+PHNwYW4gY2xhc3M9 Ij5jb250YWN0QHplcm90aWVyLmNvbTwvc3Bhbj48L3A+CjxwIGNs
InMxIj48YnI+Cjwvc3Bhbj48L3A+CjxwIGNsYXNzPSJwMSI+PHNw YXNzPSJwMSI+PHNwYW4gY2xhc3M9InMxIj48YnI+Cjwvc3Bhbj48
YW4gY2xhc3M9InMxIj5UbyB1bmluc3RhbGwgbWFudWFsbHksIHR5 L3A+CjxwIGNsYXNzPSJwMSI+PHNwYW4gY2xhc3M9InMxIj5UbyB1
cGUgdGhlIGZvbGxvd2luZyBpbiBhIHRlcm1pbmFsIHdpbmRvdzo8 bmluc3RhbGwgbWFudWFsbHksIHR5cGUgdGhlIGZvbGxvd2luZyBp
L3NwYW4+PC9wPgo8cCBjbGFzcz0icDEiPjxzcGFuIGNsYXNzPSJz biBhIHRlcm1pbmFsIHdpbmRvdzo8L3NwYW4+PC9wPgo8cCBjbGFz
MSI+PGJyPgo8L3NwYW4+PC9wPgo8cCBjbGFzcz0icDEiPjxzcGFu cz0icDEiPjxzcGFuIGNsYXNzPSJzMSI+PGJyPgo8L3NwYW4+PC9w
IGNsYXNzPSJzMSI+c3VkbyAiL0xpYnJhcnkvQXBwbGljYXRpb24g Pgo8cCBjbGFzcz0icDEiPjxzcGFuIGNsYXNzPSJzMSI+c3VkbyAi
U3VwcG9ydC9aZXJvVGllci9PbmUvdW5pbnN0YWxsLnNoIjwvc3Bh L0xpYnJhcnkvQXBwbGljYXRpb24gU3VwcG9ydC9aZXJvVGllci9P
bj48L3A+CjwvYm9keT4KPC9odG1sPgo= bmUvdW5pbnN0YWxsLnNoIjwvc3Bhbj48L3A+CjwvYm9keT4KPC9o
dG1sPgo=
</data> </data>
</dict> </dict>
<key>PROJECT_SETTINGS</key> <key>PROJECT_SETTINGS</key>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT Type="Advanced Installer" CreateVersion="10.9" version="12.5.1" Modules="enterprise" RootPath="." Language="en" Id="{DC564647-6BF0-4550-87F4-89C938D0159C}"> <DOCUMENT Type="Advanced Installer" CreateVersion="10.9" version="12.5.1" Modules="enterprise" RootPath="." Language="en" Id="{DC564647-6BF0-4550-87F4-89C938D0159C}">
<COMPONENT cid="caphyon.advinst.msicomp.ProjectOptionsComponent"> <COMPONENT cid="caphyon.advinst.msicomp.ProjectOptionsComponent">
<ROW Name="HiddenItems" Value="UpdaterComponent;SerValComponent;AutorunComponent;MultipleInstancesComponent;MsiJavaComponent;MsiRegsComponent;MsiExtComponent;MsiAssemblyComponent;MsiDriverPackagesComponent;AnalyticsComponent;ActSyncAppComponent;MsiMergeModsComponent;MsiThemeComponent;BackgroundImagesComponent;DictionaryComponent;MsiEnvComponent;ScheduledTasksComponent;CPLAppletComponent;GameUxComponent;UserAccountsComponent;MsiClassComponent;WebApplicationsComponent;MsiOdbcDataSrcComponent;SqlConnectionComponent;SharePointSlnComponent;SilverlightSlnComponent;MsiAppSearchComponent"/> <ROW Name="HiddenItems" Value="UpdaterComponent;SerValComponent;AutorunComponent;MultipleInstancesComponent;MsiJavaComponent;MsiRegsComponent;MsiExtComponent;MsiAssemblyComponent;MsiDriverPackagesComponent;AnalyticsComponent;ActSyncAppComponent;MsiMergeModsComponent;MsiThemeComponent;BackgroundImagesComponent;DictionaryComponent;ScheduledTasksComponent;CPLAppletComponent;GameUxComponent;UserAccountsComponent;MsiClassComponent;WebApplicationsComponent;MsiOdbcDataSrcComponent;SqlConnectionComponent;SharePointSlnComponent;SilverlightSlnComponent;MsiAppSearchComponent"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
<ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/> <ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/>
@@ -26,10 +26,10 @@
<ROW Property="CTRLS" Value="2"/> <ROW Property="CTRLS" Value="2"/>
<ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/> <ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/>
<ROW Property="Manufacturer" Value="ZeroTier, Inc."/> <ROW Property="Manufacturer" Value="ZeroTier, Inc."/>
<ROW Property="ProductCode" Value="1033:{A6D97FB1-02FA-4042-A0EE-A080D53CDBBF} " Type="16"/> <ROW Property="ProductCode" Value="1033:{856F3AA0-1B20-427F-8509-877EBB751BAA} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="ZeroTier One"/> <ROW Property="ProductName" Value="ZeroTier One"/>
<ROW Property="ProductVersion" Value="1.1.5" Type="32"/> <ROW Property="ProductVersion" Value="1.1.12" Type="32"/>
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/> <ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
<ROW Property="RUNAPPLICATION" Value="1" Type="4"/> <ROW Property="RUNAPPLICATION" Value="1" Type="4"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
@@ -54,17 +54,15 @@
<ROW Directory="networks.d_Dir" Directory_Parent="One_Dir" DefaultDir="networks.d"/> <ROW Directory="networks.d_Dir" Directory_Parent="One_Dir" DefaultDir="networks.d"/>
<ROW Directory="regid.201001.com.zerotier_Dir" Directory_Parent="CommonAppDataFolder" DefaultDir="REGID2~1.ZER|regid.2010-01.com.zerotier"/> <ROW Directory="regid.201001.com.zerotier_Dir" Directory_Parent="CommonAppDataFolder" DefaultDir="REGID2~1.ZER|regid.2010-01.com.zerotier"/>
<ROW Directory="tapwindows_Dir" Directory_Parent="One_Dir" DefaultDir="TAP-WI~1|tap-windows"/> <ROW Directory="tapwindows_Dir" Directory_Parent="One_Dir" DefaultDir="TAP-WI~1|tap-windows"/>
<ROW Directory="ui_Dir" Directory_Parent="One_Dir" DefaultDir="ui" DirectoryOptions="3"/>
<ROW Directory="x64_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x64"/> <ROW Directory="x64_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x64"/>
<ROW Directory="x86_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x86"/> <ROW Directory="x86_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x86"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="AI_CustomARPName" ComponentId="{738BDE1C-E12F-4DFB-B279-9038EECEFF45}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/> <ROW Component="AI_CustomARPName" ComponentId="{B80291A9-8CEC-406C-BB08-611D3CEF1BF6}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_DisableModify" ComponentId="{020DCABD-5D56-49B9-AF48-F07F0B55E590}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/> <ROW Component="AI_DisableModify" ComponentId="{020DCABD-5D56-49B9-AF48-F07F0B55E590}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/>
<ROW Component="Newtonsoft.Json.dll" ComponentId="{0B2F229D-5425-42FB-9E28-F6D25AB2B4B5}" Directory_="APPDIR" Attributes="0" KeyPath="Newtonsoft.Json.dll"/> <ROW Component="Newtonsoft.Json.dll" ComponentId="{0B2F229D-5425-42FB-9E28-F6D25AB2B4B5}" Directory_="APPDIR" Attributes="0" KeyPath="Newtonsoft.Json.dll"/>
<ROW Component="ProductInformation" ComponentId="{DB078D04-EA8E-4A7C-9001-89BAD932F9D9}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/> <ROW Component="ProductInformation" ComponentId="{DB078D04-EA8E-4A7C-9001-89BAD932F9D9}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/>
<ROW Component="ZeroTierOne.exe" ComponentId="{18B51525-77BF-4FD9-9C18-A10D4CFC25BA}" Directory_="APPDIR" Attributes="0" KeyPath="ZeroTierOne.exe"/> <ROW Component="ZeroTierOne.exe" ComponentId="{18B51525-77BF-4FD9-9C18-A10D4CFC25BA}" Directory_="APPDIR" Attributes="0" KeyPath="ZeroTierOne.exe"/>
<ROW Component="index.html" ComponentId="{24AB46DC-56EA-4F3C-A8B7-95957509CDD1}" Directory_="ui_Dir" Attributes="0" KeyPath="index.html" Type="0"/>
<ROW Component="networks.d" ComponentId="{EF54D0DF-889F-41DC-AF5C-4E7F96AB1C8B}" Directory_="networks.d_Dir" Attributes="0"/> <ROW Component="networks.d" ComponentId="{EF54D0DF-889F-41DC-AF5C-4E7F96AB1C8B}" Directory_="networks.d_Dir" Attributes="0"/>
<ROW Component="regid.201001.com.zerotier" ComponentId="{A39C80FC-6A8F-454F-9052-10DAC3C3B139}" Directory_="regid.201001.com.zerotier_Dir" Attributes="0"/> <ROW Component="regid.201001.com.zerotier" ComponentId="{A39C80FC-6A8F-454F-9052-10DAC3C3B139}" Directory_="regid.201001.com.zerotier_Dir" Attributes="0"/>
<ROW Component="zerotierone_x64.exe" ComponentId="{DFCFB72D-B055-4E60-B6D8-81FF585C2183}" Directory_="One_Dir" Attributes="256" Condition="VersionNT64" KeyPath="zerotierone_x64.exe"/> <ROW Component="zerotierone_x64.exe" ComponentId="{DFCFB72D-B055-4E60-B6D8-81FF585C2183}" Directory_="One_Dir" Attributes="256" Condition="VersionNT64" KeyPath="zerotierone_x64.exe"/>
@@ -73,26 +71,20 @@
<ROW Component="zttap300.cat_1" ComponentId="{9F913E48-095B-4EA3-98DA-EDAB1593F3E3}" Directory_="x86_Dir" Attributes="0" Condition="NOT VersionNT64" KeyPath="zttap300.cat_3" Type="0"/> <ROW Component="zttap300.cat_1" ComponentId="{9F913E48-095B-4EA3-98DA-EDAB1593F3E3}" Directory_="x86_Dir" Attributes="0" Condition="NOT VersionNT64" KeyPath="zttap300.cat_3" Type="0"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="ZeroTierOne" Title="MainFeature" Description="ZeroTier One" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify Newtonsoft.Json.dll ProductInformation ZeroTierOne.exe index.html networks.d regid.201001.com.zerotier zerotierone_x64.exe zerotierone_x86.exe zttap300.cat zttap300.cat_1"/> <ROW Feature="ZeroTierOne" Title="MainFeature" Description="ZeroTier One" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify Newtonsoft.Json.dll ProductInformation ZeroTierOne.exe networks.d regid.201001.com.zerotier zerotierone_x64.exe zerotierone_x86.exe zttap300.cat zttap300.cat_1"/>
<ATTRIBUTE name="CurrentFeature" value="ZeroTierOne"/> <ATTRIBUTE name="CurrentFeature" value="ZeroTierOne"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
<ROW File="Newtonsoft.Json.dll" Component_="Newtonsoft.Json.dll" FileName="NEWTON~1.DLL|Newtonsoft.Json.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\Newtonsoft.Json.dll" SelfReg="false" DigSign="true"/> <ROW File="Newtonsoft.Json.dll" Component_="Newtonsoft.Json.dll" FileName="NEWTON~1.DLL|Newtonsoft.Json.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\Newtonsoft.Json.dll" SelfReg="false" DigSign="true"/>
<ROW File="ZeroTierOne.exe" Component_="ZeroTierOne.exe" FileName="ZEROTI~1.EXE|ZeroTier One.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\ZeroTier One.exe" SelfReg="false" NextFile="zttap300.cat_2" DigSign="true"/> <ROW File="ZeroTierOne.exe" Component_="ZeroTierOne.exe" FileName="ZEROTI~1.EXE|ZeroTier One.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\ZeroTier One.exe" SelfReg="false" NextFile="zttap300.cat_2" DigSign="true"/>
<ROW File="index.html" Component_="index.html" FileName="INDEX~1.HTM|index.html" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\ui\index.html" SelfReg="false" NextFile="main.js"/>
<ROW File="main.js" Component_="index.html" FileName="main.js" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\ui\main.js" SelfReg="false" NextFile="react.min.js"/>
<ROW File="react.min.js" Component_="index.html" FileName="REACTM~1.JS|react.min.js" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\ui\react.min.js" SelfReg="false" NextFile="simpleajax.min.js"/>
<ROW File="simpleajax.min.js" Component_="index.html" FileName="SIMPLE~1.JS|simpleajax.min.js" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\ui\simpleajax.min.js" SelfReg="false" NextFile="zerotier.css"/>
<ROW File="zerotier.css" Component_="index.html" FileName="zerotier.css" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\ui\zerotier.css" SelfReg="false" NextFile="ztui.min.js"/>
<ROW File="zerotierone_x64.exe" Component_="zerotierone_x64.exe" FileName="ZEROTI~2.EXE|zerotier-one_x64.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\Build\x64\Release\zerotier-one_x64.exe" SelfReg="false" NextFile="ZeroTierOne.exe" DigSign="true"/> <ROW File="zerotierone_x64.exe" Component_="zerotierone_x64.exe" FileName="ZEROTI~2.EXE|zerotier-one_x64.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\Build\x64\Release\zerotier-one_x64.exe" SelfReg="false" NextFile="ZeroTierOne.exe" DigSign="true"/>
<ROW File="zerotierone_x86.exe" Component_="zerotierone_x86.exe" FileName="ZEROTI~1.EXE|zerotier-one_x86.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\Build\Win32\Release\zerotier-one_x86.exe" SelfReg="false" NextFile="zerotierone_x64.exe" DigSign="true"/> <ROW File="zerotierone_x86.exe" Component_="zerotierone_x86.exe" FileName="ZEROTI~1.EXE|zerotier-one_x86.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\Build\Win32\Release\zerotier-one_x86.exe" SelfReg="false" NextFile="zerotierone_x64.exe" DigSign="true"/>
<ROW File="zttap300.cat_2" Component_="zttap300.cat" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.cat" SelfReg="false" NextFile="zttap300.sys_2"/> <ROW File="zttap300.cat_2" Component_="zttap300.cat" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.cat" SelfReg="false" NextFile="zttap300.sys_2"/>
<ROW File="zttap300.cat_3" Component_="zttap300.cat_1" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.cat" SelfReg="false" NextFile="zttap300.sys_3"/> <ROW File="zttap300.cat_3" Component_="zttap300.cat_1" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.cat" SelfReg="false" NextFile="zttap300.sys_3"/>
<ROW File="zttap300.inf" Component_="zttap300.cat" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.inf" SelfReg="false" NextFile="zttap300.cat_3"/> <ROW File="zttap300.inf" Component_="zttap300.cat" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.inf" SelfReg="false" NextFile="zttap300.cat_3"/>
<ROW File="zttap300.inf_1" Component_="zttap300.cat_1" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.inf" SelfReg="false" NextFile="index.html"/> <ROW File="zttap300.inf_1" Component_="zttap300.cat_1" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.inf" SelfReg="false" NextFile="Newtonsoft.Json.dll"/>
<ROW File="zttap300.sys_2" Component_="zttap300.cat" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.sys" SelfReg="false" NextFile="zttap300.inf"/> <ROW File="zttap300.sys_2" Component_="zttap300.cat" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.sys" SelfReg="false" NextFile="zttap300.inf"/>
<ROW File="zttap300.sys_3" Component_="zttap300.cat_1" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.sys" SelfReg="false" NextFile="zttap300.inf_1"/> <ROW File="zttap300.sys_3" Component_="zttap300.cat_1" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.sys" SelfReg="false" NextFile="zttap300.inf_1"/>
<ROW File="ztui.min.js" Component_="index.html" FileName="ZTUIMI~1.JS|ztui.min.js" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\ui\ztui.min.js" SelfReg="false" NextFile="Newtonsoft.Json.dll"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
<ROW BuildKey="DefaultBuild" BuildName="MSI" BuildOrder="1" BuildType="1" PackageFolder="..\..\.." PackageFileName="ZeroTier One" Languages="en" InstallationType="4" ExtUI="true" UseLargeSchema="true"/> <ROW BuildKey="DefaultBuild" BuildName="MSI" BuildOrder="1" BuildType="1" PackageFolder="..\..\.." PackageFileName="ZeroTier One" Languages="en" InstallationType="4" ExtUI="true" UseLargeSchema="true"/>
@@ -114,7 +106,7 @@
<ROW Path="&lt;AI_DICTS&gt;ui_en.ail"/> <ROW Path="&lt;AI_DICTS&gt;ui_en.ail"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.DigCertStoreComponent"> <COMPONENT cid="caphyon.advinst.msicomp.DigCertStoreComponent">
<ROW TimeStampUrl="http://timestamp.verisign.com/scripts/timstamp.dll" SignerDescription="ZeroTier One" DescriptionUrl="https://www.zerotier.com/" SignOptions="7" SignTool="0" Thumbprint="2ad023dc7aa92bf4265b33852a2ed2406d2bee86 Subject: ZeroTier Networks LLC&#10;Issuer: DigiCert High Assurance Code Signing CA-1&#10;Valid from 04/24/2015 to 04/01/2016"/> <ROW TimeStampUrl="http://timestamp.verisign.com/scripts/timstamp.dll" SignerDescription="ZeroTier One" DescriptionUrl="https://www.zerotier.com/" SignOptions="7" SignTool="0" UseSha256="1" Thumbprint="45f6b8ef02b543eeaa08d5f0f08ebe72c2a8a2d5 Subject: ZeroTier, Inc.&#10;Issuer: DigiCert SHA2 High Assurance Code Signing CA&#10;Valid from 03/22/2016 to 05/06/2019"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.FirewallExceptionComponent"> <COMPONENT cid="caphyon.advinst.msicomp.FirewallExceptionComponent">
<ROW FirewallException="ZeroTierOneUDP9993" DisplayName="ZeroTier One UDP/9993" GroupName="ZeroTierOne" Enabled="1" Scope="*" Condition="1" Profiles="7" Port="9993" Protocol="UDP"/> <ROW FirewallException="ZeroTierOneUDP9993" DisplayName="ZeroTier One UDP/9993" GroupName="ZeroTierOne" Enabled="1" Scope="*" Condition="1" Profiles="7" Port="9993" Protocol="UDP"/>
@@ -138,6 +130,10 @@
<ROW Action="AI_FwRemove" Description="Executing Windows Firewall configurations" Template="Configuring Windows Firewall rule: &quot;[1]&quot;" DescriptionLocId="ActionText.Description.AI_FwRemove" TemplateLocId="ActionText.Template.AI_FwRemove"/> <ROW Action="AI_FwRemove" Description="Executing Windows Firewall configurations" Template="Configuring Windows Firewall rule: &quot;[1]&quot;" DescriptionLocId="ActionText.Description.AI_FwRemove" TemplateLocId="ActionText.Template.AI_FwRemove"/>
<ROW Action="AI_FwRollback" Description="Rolling back Windows Firewall configurations." Template="Rolling back Windows Firewall configurations." DescriptionLocId="ActionText.Description.AI_FwRollback" TemplateLocId="ActionText.Template.AI_FwRollback"/> <ROW Action="AI_FwRollback" Description="Rolling back Windows Firewall configurations." Template="Rolling back Windows Firewall configurations." DescriptionLocId="ActionText.Description.AI_FwRollback" TemplateLocId="ActionText.Template.AI_FwRollback"/>
<ROW Action="AI_FwUninstall" Description="Generating actions to configure Windows Firewall" DescriptionLocId="ActionText.Description.AI_FwUninstall"/> <ROW Action="AI_FwUninstall" Description="Generating actions to configure Windows Firewall" DescriptionLocId="ActionText.Description.AI_FwUninstall"/>
<ROW Action="AI_TxtUpdaterCommit" Description="Commit text file changes. " Template="Commit text file changes." DescriptionLocId="ActionText.Description.AI_TxtUpdaterCommit" TemplateLocId="ActionText.Template.AI_TxtUpdaterCommit"/>
<ROW Action="AI_TxtUpdaterConfig" Description="Executing text file updates" Template="Updating text file: &quot;[1]&quot;" DescriptionLocId="ActionText.Description.AI_TxtUpdaterConfig" TemplateLocId="ActionText.Template.AI_TxtUpdaterConfig"/>
<ROW Action="AI_TxtUpdaterInstall" Description="Generating actions to configure text files updates" DescriptionLocId="ActionText.Description.AI_TxtUpdaterInstall"/>
<ROW Action="AI_TxtUpdaterRollback" Description="Rolling back text file changes. " Template="Rolling back text file changes." DescriptionLocId="ActionText.Description.AI_TxtUpdaterRollback" TemplateLocId="ActionText.Template.AI_TxtUpdaterRollback"/>
<ROW Action="AI_XmlCommit" Description="Committing XML file configurations." Template="Committing XML file configurations." DescriptionLocId="ActionText.Description.AI_XmlCommit" TemplateLocId="ActionText.Template.AI_XmlCommit"/> <ROW Action="AI_XmlCommit" Description="Committing XML file configurations." Template="Committing XML file configurations." DescriptionLocId="ActionText.Description.AI_XmlCommit" TemplateLocId="ActionText.Template.AI_XmlCommit"/>
<ROW Action="AI_XmlConfig" Description="Executing XML file configurations" Template="Configuring XML file: &quot;[1]&quot;" DescriptionLocId="ActionText.Description.AI_XmlConfig" TemplateLocId="ActionText.Template.AI_XmlConfig"/> <ROW Action="AI_XmlConfig" Description="Executing XML file configurations" Template="Configuring XML file: &quot;[1]&quot;" DescriptionLocId="ActionText.Description.AI_XmlConfig" TemplateLocId="ActionText.Template.AI_XmlConfig"/>
<ROW Action="AI_XmlInstall" Description="Generating actions to configure XML files" DescriptionLocId="ActionText.Description.AI_XmlInstall"/> <ROW Action="AI_XmlInstall" Description="Generating actions to configure XML files" DescriptionLocId="ActionText.Description.AI_XmlInstall"/>
@@ -150,6 +146,7 @@
<ROW Name="NetFirewall.dll" SourcePath="&lt;AI_CUSTACTS&gt;NetFirewall.dll"/> <ROW Name="NetFirewall.dll" SourcePath="&lt;AI_CUSTACTS&gt;NetFirewall.dll"/>
<ROW Name="ShortcutFlags.dll" SourcePath="&lt;AI_CUSTACTS&gt;ShortcutFlags.dll"/> <ROW Name="ShortcutFlags.dll" SourcePath="&lt;AI_CUSTACTS&gt;ShortcutFlags.dll"/>
<ROW Name="SoftwareDetector.dll" SourcePath="&lt;AI_CUSTACTS&gt;SoftwareDetector.dll"/> <ROW Name="SoftwareDetector.dll" SourcePath="&lt;AI_CUSTACTS&gt;SoftwareDetector.dll"/>
<ROW Name="TxtUpdater.dll" SourcePath="&lt;AI_CUSTACTS&gt;TxtUpdater.dll"/>
<ROW Name="aicustact.dll" SourcePath="&lt;AI_CUSTACTS&gt;aicustact.dll"/> <ROW Name="aicustact.dll" SourcePath="&lt;AI_CUSTACTS&gt;aicustact.dll"/>
<ROW Name="chainersupport.dll" SourcePath="&lt;AI_CUSTACTS&gt;chainersupport.dll"/> <ROW Name="chainersupport.dll" SourcePath="&lt;AI_CUSTACTS&gt;chainersupport.dll"/>
<ROW Name="msichainer.exe" SourcePath="&lt;AI_CUSTACTS&gt;msichainer.exe"/> <ROW Name="msichainer.exe" SourcePath="&lt;AI_CUSTACTS&gt;msichainer.exe"/>
@@ -212,6 +209,8 @@
<ROW Action="AI_InstallModeCheck" Type="1" Source="aicustact.dll" Target="UpdateInstallMode" WithoutSeq="true"/> <ROW Action="AI_InstallModeCheck" Type="1" Source="aicustact.dll" Target="UpdateInstallMode" WithoutSeq="true"/>
<ROW Action="AI_LaunchApp" Type="1" Source="aicustact.dll" Target="[#ZeroTierOne.exe]"/> <ROW Action="AI_LaunchApp" Type="1" Source="aicustact.dll" Target="[#ZeroTierOne.exe]"/>
<ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/> <ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/>
<ROW Action="AI_PinShortcuts" Type="1" Source="ShortcutFlags.dll" Target="PinShortcuts"/>
<ROW Action="AI_PinToTaskbar" Type="1025" Source="ShortcutFlags.dll" Target="PinToTaskbar" WithoutSeq="true"/>
<ROW Action="AI_PrepareChainers" Type="1" Source="chainersupport.dll" Target="PrepareChainedPackages"/> <ROW Action="AI_PrepareChainers" Type="1" Source="chainersupport.dll" Target="PrepareChainedPackages"/>
<ROW Action="AI_PrepareShortcutFlags" Type="1" Source="ShortcutFlags.dll" Target="PrepareActionData"/> <ROW Action="AI_PrepareShortcutFlags" Type="1" Source="ShortcutFlags.dll" Target="PrepareActionData"/>
<ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Type="51" Source="AI_SETUPEXEPATH" Target="[AI_SETUPEXEPATH_ORIGINAL]"/> <ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Type="51" Source="AI_SETUPEXEPATH" Target="[AI_SETUPEXEPATH_ORIGINAL]"/>
@@ -221,6 +220,12 @@
<ROW Action="AI_RollbackChainers" Type="11585" Source="chainersupport.dll" Target="RollbackChainedPackages" WithoutSeq="true"/> <ROW Action="AI_RollbackChainers" Type="11585" Source="chainersupport.dll" Target="RollbackChainedPackages" WithoutSeq="true"/>
<ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/> <ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/>
<ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/> <ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/>
<ROW Action="AI_TxtUpdaterCommit" Type="11777" Source="TxtUpdater.dll" Target="OnTxtUpdaterCommit" WithoutSeq="true"/>
<ROW Action="AI_TxtUpdaterConfig" Type="11265" Source="TxtUpdater.dll" Target="OnTxtUpdaterConfig" WithoutSeq="true"/>
<ROW Action="AI_TxtUpdaterInstall" Type="1" Source="TxtUpdater.dll" Target="OnTxtUpdaterInstall"/>
<ROW Action="AI_TxtUpdaterRollback" Type="11521" Source="TxtUpdater.dll" Target="OnTxtUpdaterRollback" WithoutSeq="true"/>
<ROW Action="AI_UnpinFromTaskbar" Type="1025" Source="ShortcutFlags.dll" Target="UnpinFromTaskbar" WithoutSeq="true"/>
<ROW Action="AI_UnpinShortcuts" Type="1" Source="ShortcutFlags.dll" Target="UnpinShortcuts"/>
<ROW Action="AI_XmlCommit" Type="11777" Source="xmlCfg.dll" Target="OnXmlCommit" WithoutSeq="true"/> <ROW Action="AI_XmlCommit" Type="11777" Source="xmlCfg.dll" Target="OnXmlCommit" WithoutSeq="true"/>
<ROW Action="AI_XmlConfig" Type="11265" Source="xmlCfg.dll" Target="OnXmlConfig" WithoutSeq="true"/> <ROW Action="AI_XmlConfig" Type="11265" Source="xmlCfg.dll" Target="OnXmlConfig" WithoutSeq="true"/>
<ROW Action="AI_XmlInstall" Type="1" Source="xmlCfg.dll" Target="OnXmlInstall" AdditionalSeq="AI_DATA_SETTER"/> <ROW Action="AI_XmlInstall" Type="1" Source="xmlCfg.dll" Target="OnXmlInstall" AdditionalSeq="AI_DATA_SETTER"/>
@@ -236,6 +241,9 @@
<COMPONENT cid="caphyon.advinst.msicomp.MsiEmbeddedChainerComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiEmbeddedChainerComponent">
<ROW MsiEmbeddedChainer="msichainer.exe" Condition="VersionMsi &gt;= &quot;4.05&quot;" CommandLine="[AI_CHAINER_CMD_LINE]" Source="msichainer.exe" Type="2"/> <ROW MsiEmbeddedChainer="msichainer.exe" Condition="VersionMsi &gt;= &quot;4.05&quot;" CommandLine="[AI_CHAINER_CMD_LINE]" Source="msichainer.exe" Type="2"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiEnvComponent">
<ROW Environment="Path" Name="=-*Path" Value="[~];[APPDIR]" Component_="ZeroTierOne.exe"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent">
<ROW Name="ZeroTierIcon.exe" SourcePath="..\..\..\artwork\ZeroTierIcon.ico" Index="0"/> <ROW Name="ZeroTierIcon.exe" SourcePath="..\..\..\artwork\ZeroTierIcon.ico" Index="0"/>
</COMPONENT> </COMPONENT>
@@ -246,8 +254,8 @@
<ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE=&quot;No&quot; AND (Not Installed)" Sequence="1399"/> <ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE=&quot;No&quot; AND (Not Installed)" Sequence="1399"/>
<ROW Action="AI_ResolveKnownFolders" Sequence="51"/> <ROW Action="AI_ResolveKnownFolders" Sequence="51"/>
<ROW Action="AI_PrepareShortcutFlags" Condition="(VersionNT &gt; 501) AND ((NOT Installed) OR (Installed AND (REMOVE&lt;&gt;&quot;ALL&quot;) AND (AI_INSTALL_MODE&lt;&gt;&quot;Remove&quot;)))" Sequence="4501"/> <ROW Action="AI_PrepareShortcutFlags" Condition="(VersionNT &gt; 501) AND ((NOT Installed) OR (Installed AND (REMOVE&lt;&gt;&quot;ALL&quot;) AND (AI_INSTALL_MODE&lt;&gt;&quot;Remove&quot;)))" Sequence="4501"/>
<ROW Action="AI_XmlInstall" Condition="(REMOVE &lt;&gt; &quot;ALL&quot;)" Sequence="5102"/> <ROW Action="AI_XmlInstall" Condition="(REMOVE &lt;&gt; &quot;ALL&quot;)" Sequence="5103"/>
<ROW Action="AI_DATA_SETTER" Condition="(REMOVE &lt;&gt; &quot;ALL&quot;)" Sequence="5101"/> <ROW Action="AI_DATA_SETTER" Condition="(REMOVE &lt;&gt; &quot;ALL&quot;)" Sequence="5102"/>
<ROW Action="AI_XmlUninstall" Condition="(REMOVE)" Sequence="3102"/> <ROW Action="AI_XmlUninstall" Condition="(REMOVE)" Sequence="3102"/>
<ROW Action="AI_DATA_SETTER_1" Condition="(REMOVE)" Sequence="3101"/> <ROW Action="AI_DATA_SETTER_1" Condition="(REMOVE)" Sequence="3101"/>
<ROW Action="InstallFinalize" Sequence="6597" SeqType="0" MsiKey="InstallFinalize"/> <ROW Action="InstallFinalize" Sequence="6597" SeqType="0" MsiKey="InstallFinalize"/>
@@ -261,6 +269,9 @@
<ROW Action="AI_FwUninstall" Condition="(VersionNT &gt;= 501) AND (REMOVE=&quot;ALL&quot;)" Sequence="1702"/> <ROW Action="AI_FwUninstall" Condition="(VersionNT &gt;= 501) AND (REMOVE=&quot;ALL&quot;)" Sequence="1702"/>
<ROW Action="AI_DATA_SETTER_3" Condition="(VersionNT &gt;= 501) AND (REMOVE=&quot;ALL&quot;)" Sequence="1701"/> <ROW Action="AI_DATA_SETTER_3" Condition="(VersionNT &gt;= 501) AND (REMOVE=&quot;ALL&quot;)" Sequence="1701"/>
<ROW Action="AI_DetectSoftware" Sequence="101"/> <ROW Action="AI_DetectSoftware" Sequence="101"/>
<ROW Action="AI_PinShortcuts" Condition="(VersionNT &gt; 600) AND ((NOT Installed) OR (Installed AND (REMOVE&lt;&gt;&quot;ALL&quot;) AND (AI_INSTALL_MODE&lt;&gt;&quot;Remove&quot;)))" Sequence="4502"/>
<ROW Action="AI_UnpinShortcuts" Condition="(VersionNT &gt; 600) AND (REMOVE = &quot;ALL&quot;)" Sequence="3199"/>
<ROW Action="AI_TxtUpdaterInstall" Sequence="5101"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent"> <COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="749"/> <ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="749"/>
@@ -331,6 +342,13 @@
<ATTRIBUTE name="LocalFile" value="regid.199509.com.example_ProductName.swidtag"/> <ATTRIBUTE name="LocalFile" value="regid.199509.com.example_ProductName.swidtag"/>
<ATTRIBUTE name="SystemFile" value="regid.199509.com.example_ProductName.swidtag_1"/> <ATTRIBUTE name="SystemFile" value="regid.199509.com.example_ProductName.swidtag_1"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.TxtUpdateComponent">
<ROW Name="Append/Create" TxtUpdateSet="zerotiercli.bat" FindPattern="@ECHO OFF&#13;&#10;if [\[][#zerotierone_x64.exe][\]] == [\[][\]] (&#13;&#10;&#9;[#zerotierone_x86.exe] -q %*&#13;&#10;) else (&#13;&#10;&#9;[#zerotierone_x64.exe] -q %*&#13;&#10;)&#13;&#10;" Options="160" Order="0" FileEncoding="0"/>
<ROW Name="Replace" TxtUpdateSet="zerotiercli.bat" FindPattern="YourFindText" ReplacePattern="YourReplaceText" Options="2" Order="1" FileEncoding="-1"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.TxtUpdateSetComponent">
<ROW Key="zerotiercli.bat" Component="zerotierone_x64.exe" FileName="zerotier-cli.bat" Directory="APPDIR" Options="17"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.XmlAttributeComponent"> <COMPONENT cid="caphyon.advinst.msicomp.XmlAttributeComponent">
<ROW XmlAttribute="xmlnsds" XmlElement="swidsoftware_identification_tag" Name="xmlns:ds" Flags="14" Order="0" Value="http://www.w3.org/2000/09/xmldsig#"/> <ROW XmlAttribute="xmlnsds" XmlElement="swidsoftware_identification_tag" Name="xmlns:ds" Flags="14" Order="0" Value="http://www.w3.org/2000/09/xmldsig#"/>
<ROW XmlAttribute="xmlnsswid" XmlElement="swidsoftware_identification_tag" Name="xmlns:swid" Flags="14" Order="1" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd"/> <ROW XmlAttribute="xmlnsswid" XmlElement="swidsoftware_identification_tag" Name="xmlns:swid" Flags="14" Order="1" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd"/>
@@ -338,7 +356,7 @@
<ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/> <ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent"> <COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent">
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="5"/> <ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="12"/>
<ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Condition="1" Order="0" Flags="14" Text="false"/> <ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Condition="1" Order="0" Flags="14" Text="false"/>
<ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Condition="1" Order="0" Flags="14" Text="1"/> <ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Condition="1" Order="0" Flags="14" Text="1"/>
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Condition="1" Order="1" Flags="14" Text="1"/> <ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Condition="1" Order="1" Flags="14" Text="1"/>

View File

@@ -53,6 +53,7 @@ POSSIBILITY OF SUCH DAMAGE.
#undef USE_PROC_NET_ROUTE #undef USE_PROC_NET_ROUTE
#define USE_SOCKET_ROUTE #define USE_SOCKET_ROUTE
#undef USE_SYSCTL_NET_ROUTE #undef USE_SYSCTL_NET_ROUTE
#include <sys/sysctl.h>
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
@@ -96,7 +97,6 @@ POSSIBILITY OF SUCH DAMAGE.
#ifdef USE_SYSCTL_NET_ROUTE #ifdef USE_SYSCTL_NET_ROUTE
#include <stdlib.h> #include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <net/route.h> #include <net/route.h>
#endif #endif

View File

@@ -1,6 +1,16 @@
$Id: Changelog.txt,v 1.219 2015/10/26 17:05:06 nanard Exp $ $Id: Changelog.txt,v 1.223 2016/04/19 21:06:20 nanard Exp $
miniUPnP client Changelog. miniUPnP client Changelog.
VERSION 2.0 : released 2016/04/19
2016/01/24:
change miniwget to return HTTP status code
increments API_VERSION to 16
2016/01/22:
Improve UPNPIGD_IsConnected() to check if WAN address is not private.
parse HTTP response status line in miniwget.c
2015/10/26: 2015/10/26:
snprintf() overflow check. check overflow in simpleUPnPcommand2() snprintf() overflow check. check overflow in simpleUPnPcommand2()

View File

@@ -3,7 +3,7 @@ Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
github: https://github.com/miniupnp/miniupnp github: https://github.com/miniupnp/miniupnp
freecode: http://freecode.com/projects/miniupnp freecode: http://freecode.com/projects/miniupnp
Author: Thomas Bernard Author: Thomas Bernard
Copyright (c) 2005-2014 Thomas Bernard Copyright (c) 2005-2016 Thomas Bernard
This software is subject to the conditions detailed in the This software is subject to the conditions detailed in the
LICENSE file provided within this distribution. LICENSE file provided within this distribution.
@@ -32,6 +32,7 @@ To use the libminiupnpc in your application, link it with
libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h, libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h,
upnpcommands.h and miniwget.h : upnpcommands.h and miniwget.h :
- upnpDiscover() - upnpDiscover()
- UPNP_GetValidIGD()
- miniwget() - miniwget()
- parserootdesc() - parserootdesc()
- GetUPNPUrls() - GetUPNPUrls()
@@ -59,3 +60,5 @@ send me an email !
For any question, you can use the web forum : For any question, you can use the web forum :
http://miniupnp.tuxfamily.org/forum/ http://miniupnp.tuxfamily.org/forum/
Bugs should be reported on github :
https://github.com/miniupnp/miniupnp/issues

View File

@@ -1 +1 @@
1.9 2.0

View File

@@ -1,7 +1,12 @@
$Id: apiversions.txt,v 1.8 2015/10/08 16:15:47 nanard Exp $ $Id: apiversions.txt,v 1.9 2016/01/24 17:24:36 nanard Exp $
Differences in API between miniUPnPc versions Differences in API between miniUPnPc versions
API version 16
added "status_code" argument to getHTTPResponse(), miniwget() and miniwget_getaddr()
updated macro :
#define MINIUPNPC_API_VERSION 16
API version 15 API version 15
changed "sameport" argument of upnpDiscover() upnpDiscoverAll() upnpDiscoverDevice() changed "sameport" argument of upnpDiscover() upnpDiscoverAll() upnpDiscoverDevice()
to "localport". When 0 or 1, behaviour is not changed, but it can take to "localport". When 0 or 1, behaviour is not changed, but it can take

View File

@@ -1,4 +1,4 @@
/* $Id: minihttptestserver.c,v 1.18 2015/07/15 12:41:15 nanard Exp $ */ /* $Id: minihttptestserver.c,v 1.19 2015/11/17 09:07:17 nanard Exp $ */
/* Project : miniUPnP /* Project : miniUPnP
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2011-2015 Thomas Bernard * Copyright (c) 2011-2015 Thomas Bernard
@@ -18,6 +18,10 @@
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7f000001
#endif
#define CRAP_LENGTH (2048) #define CRAP_LENGTH (2048)
volatile sig_atomic_t quit = 0; volatile sig_atomic_t quit = 0;

View File

@@ -22,7 +22,7 @@
#include "minisoap.h" #include "minisoap.h"
#ifdef _WIN32 #ifdef _WIN32
#define OS_STRING "Win32" #define OS_STRING "Win32"
#define MINIUPNPC_VERSION_STRING "1.9" #define MINIUPNPC_VERSION_STRING "2.0"
#define UPNP_VERSION_STRING "UPnP/1.1" #define UPNP_VERSION_STRING "UPnP/1.1"
#endif #endif

View File

@@ -1,7 +1,8 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
/* $Id: minissdpc.c,v 1.30 2015/10/26 17:05:07 nanard Exp $ */ /* $Id: minissdpc.c,v 1.31 2016/01/19 09:56:46 nanard Exp $ */
/* Project : miniupnp /* vim: tabstop=4 shiftwidth=4 noexpandtab
* Project : miniupnp
* Web : http://miniupnp.free.fr/ * Web : http://miniupnp.free.fr/
* Author : Thomas BERNARD * Author : Thomas BERNARD
* copyright (c) 2005-2015 Thomas Bernard * copyright (c) 2005-2015 Thomas Bernard
@@ -69,6 +70,10 @@ struct sockaddr_un {
#define HAS_IP_MREQN #define HAS_IP_MREQN
#endif #endif
#if !defined(HAS_IP_MREQN) && !defined(_WIN32)
#include <sys/ioctl.h>
#endif
#if defined(HAS_IP_MREQN) && defined(NEED_STRUCT_IP_MREQN) #if defined(HAS_IP_MREQN) && defined(NEED_STRUCT_IP_MREQN)
/* Several versions of glibc don't define this structure, /* Several versions of glibc don't define this structure,
* define it here and compile with CFLAGS NEED_STRUCT_IP_MREQN */ * define it here and compile with CFLAGS NEED_STRUCT_IP_MREQN */
@@ -649,11 +654,25 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
{ {
PRINT_SOCKET_ERROR("setsockopt"); PRINT_SOCKET_ERROR("setsockopt");
} }
#else #elif !defined(_WIN32)
struct ifreq ifr;
int ifrlen = sizeof(ifr);
strncpy(ifr.ifr_name, multicastif, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ-1] = '\0';
if(ioctl(sudp, SIOCGIFADDR, &ifr, &ifrlen) < 0)
{
PRINT_SOCKET_ERROR("ioctl(...SIOCGIFADDR...)");
}
mc_if.s_addr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr;
if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF, (const char *)&mc_if, sizeof(mc_if)) < 0)
{
PRINT_SOCKET_ERROR("setsockopt");
}
#else /* _WIN32 */
#ifdef DEBUG #ifdef DEBUG
printf("Setting of multicast interface not supported with interface name.\n"); printf("Setting of multicast interface not supported with interface name.\n");
#endif #endif
#endif #endif /* #ifdef HAS_IP_MREQN / !defined(_WIN32) */
} }
} }
} }

View File

@@ -1,10 +1,11 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
/* $Id: miniupnpc.c,v 1.141 2015/10/26 17:05:07 nanard Exp $ */
/* vim: tabstop=4 shiftwidth=4 noexpandtab */ /* $Id: miniupnpc.c,v 1.149 2016/02/09 09:50:46 nanard Exp $ */
/* Project : miniupnp /* vim: tabstop=4 shiftwidth=4 noexpandtab
* Project : miniupnp
* Web : http://miniupnp.free.fr/ * Web : http://miniupnp.free.fr/
* Author : Thomas BERNARD * Author : Thomas BERNARD
* copyright (c) 2005-2015 Thomas Bernard * copyright (c) 2005-2016 Thomas Bernard
* This software is subjet to the conditions detailed in the * This software is subjet to the conditions detailed in the
* provided LICENSE file. */ * provided LICENSE file. */
#include <stdlib.h> #include <stdlib.h>
@@ -73,6 +74,25 @@
#define SERVICEPREFIX "u" #define SERVICEPREFIX "u"
#define SERVICEPREFIX2 'u' #define SERVICEPREFIX2 'u'
/* check if an ip address is a private (LAN) address
* see https://tools.ietf.org/html/rfc1918 */
static int is_rfc1918addr(const char * addr)
{
/* 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) */
if(COMPARE(addr, "192.168."))
return 1;
/* 10.0.0.0 - 10.255.255.255 (10/8 prefix) */
if(COMPARE(addr, "10."))
return 1;
/* 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) */
if(COMPARE(addr, "172.")) {
int i = atoi(addr + 4);
if((16 <= i) && (i <= 31))
return 1;
}
return 0;
}
/* root description parsing */ /* root description parsing */
MINIUPNP_LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data) MINIUPNP_LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data)
{ {
@@ -108,6 +128,7 @@ char * simpleUPnPcommand2(int s, const char * url, const char * service,
int soapbodylen; int soapbodylen;
char * buf; char * buf;
int n; int n;
int status_code;
*bufsize = 0; *bufsize = 0;
snprintf(soapact, sizeof(soapact), "%s#%s", service, action); snprintf(soapact, sizeof(soapact), "%s#%s", service, action);
@@ -211,11 +232,15 @@ char * simpleUPnPcommand2(int s, const char * url, const char * service,
return NULL; return NULL;
} }
buf = getHTTPResponse(s, bufsize); buf = getHTTPResponse(s, bufsize, &status_code);
#ifdef DEBUG #ifdef DEBUG
if(*bufsize > 0 && buf) if(*bufsize > 0 && buf)
{ {
printf("SOAP Response :\n%.*s\n", *bufsize, buf); printf("HTTP %d SOAP Response :\n%.*s\n", status_code, *bufsize, buf);
}
else
{
printf("HTTP %d, empty SOAP response. size=%d\n", status_code, *bufsize);
} }
#endif #endif
closesocket(s); closesocket(s);
@@ -527,7 +552,7 @@ UPNPIGD_IsConnected(struct UPNPUrls * urls, struct IGDdatas * data)
* 3 = an UPnP device has been found but was not recognized as an IGD * 3 = an UPnP device has been found but was not recognized as an IGD
* *
* In any positive non zero return case, the urls and data structures * In any positive non zero return case, the urls and data structures
* passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to * passed as parameters are set. Dont forget to call FreeUPNPUrls(urls) to
* free allocated memory. * free allocated memory.
*/ */
MINIUPNP_LIBSPEC int MINIUPNP_LIBSPEC int
@@ -547,6 +572,9 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
int state = -1; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */ int state = -1; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */
int n_igd = 0; int n_igd = 0;
char extIpAddr[16]; char extIpAddr[16];
char myLanAddr[40];
int status_code = -1;
if(!devlist) if(!devlist)
{ {
#ifdef DEBUG #ifdef DEBUG
@@ -569,8 +597,8 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
/* we should choose an internet gateway device. /* we should choose an internet gateway device.
* with st == urn:schemas-upnp-org:device:InternetGatewayDevice:1 */ * with st == urn:schemas-upnp-org:device:InternetGatewayDevice:1 */
desc[i].xml = miniwget_getaddr(dev->descURL, &(desc[i].size), desc[i].xml = miniwget_getaddr(dev->descURL, &(desc[i].size),
lanaddr, lanaddrlen, myLanAddr, sizeof(myLanAddr),
dev->scope_id); dev->scope_id, &status_code);
#ifdef DEBUG #ifdef DEBUG
if(!desc[i].xml) if(!desc[i].xml)
{ {
@@ -587,6 +615,8 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
{ {
desc[i].is_igd = 1; desc[i].is_igd = 1;
n_igd++; n_igd++;
if(lanaddr)
strncpy(lanaddr, myLanAddr, lanaddrlen);
} }
} }
} }
@@ -602,20 +632,25 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
parserootdesc(desc[i].xml, desc[i].size, data); parserootdesc(desc[i].xml, desc[i].size, data);
if(desc[i].is_igd || state >= 3 ) if(desc[i].is_igd || state >= 3 )
{ {
int is_connected;
GetUPNPUrls(urls, data, dev->descURL, dev->scope_id); GetUPNPUrls(urls, data, dev->descURL, dev->scope_id);
/* in state 2 and 3 we dont test if device is connected ! */ /* in state 2 and 3 we dont test if device is connected ! */
if(state >= 2) if(state >= 2)
goto free_and_return; goto free_and_return;
is_connected = UPNPIGD_IsConnected(urls, data);
#ifdef DEBUG #ifdef DEBUG
printf("UPNPIGD_IsConnected(%s) = %d\n", printf("UPNPIGD_IsConnected(%s) = %d\n",
urls->controlURL, urls->controlURL, is_connected);
UPNPIGD_IsConnected(urls, data));
#endif #endif
/* checks that status is connected AND there is a external IP address assigned */ /* checks that status is connected AND there is a external IP address assigned */
if(UPNPIGD_IsConnected(urls, data) if(is_connected &&
&& (UPNP_GetExternalIPAddress(urls->controlURL, data->first.servicetype, extIpAddr) == 0)) (UPNP_GetExternalIPAddress(urls->controlURL, data->first.servicetype, extIpAddr) == 0)) {
goto free_and_return; if(!is_rfc1918addr(extIpAddr) && (extIpAddr[0] != '\0')
&& (0 != strcmp(extIpAddr, "0.0.0.0")))
goto free_and_return;
}
FreeUPNPUrls(urls); FreeUPNPUrls(urls);
if(data->second.servicetype[0] != '\0') { if(data->second.servicetype[0] != '\0') {
#ifdef DEBUG #ifdef DEBUG
@@ -627,14 +662,17 @@ UPNP_GetValidIGD(struct UPNPDev * devlist,
memcpy(&data->first, &data->second, sizeof(struct IGDdatas_service)); memcpy(&data->first, &data->second, sizeof(struct IGDdatas_service));
memcpy(&data->second, &data->tmp, sizeof(struct IGDdatas_service)); memcpy(&data->second, &data->tmp, sizeof(struct IGDdatas_service));
GetUPNPUrls(urls, data, dev->descURL, dev->scope_id); GetUPNPUrls(urls, data, dev->descURL, dev->scope_id);
is_connected = UPNPIGD_IsConnected(urls, data);
#ifdef DEBUG #ifdef DEBUG
printf("UPNPIGD_IsConnected(%s) = %d\n", printf("UPNPIGD_IsConnected(%s) = %d\n",
urls->controlURL, urls->controlURL, is_connected);
UPNPIGD_IsConnected(urls, data));
#endif #endif
if(UPNPIGD_IsConnected(urls, data) if(is_connected &&
&& (UPNP_GetExternalIPAddress(urls->controlURL, data->first.servicetype, extIpAddr) == 0)) (UPNP_GetExternalIPAddress(urls->controlURL, data->first.servicetype, extIpAddr) == 0)) {
goto free_and_return; if(!is_rfc1918addr(extIpAddr) && (extIpAddr[0] != '\0')
&& (0 != strcmp(extIpAddr, "0.0.0.0")))
goto free_and_return;
}
FreeUPNPUrls(urls); FreeUPNPUrls(urls);
} }
} }
@@ -668,8 +706,9 @@ UPNP_GetIGDFromUrl(const char * rootdescurl,
{ {
char * descXML; char * descXML;
int descXMLsize = 0; int descXMLsize = 0;
descXML = miniwget_getaddr(rootdescurl, &descXMLsize, descXML = miniwget_getaddr(rootdescurl, &descXMLsize,
lanaddr, lanaddrlen, 0); lanaddr, lanaddrlen, 0, NULL);
if(descXML) { if(descXML) {
memset(data, 0, sizeof(struct IGDdatas)); memset(data, 0, sizeof(struct IGDdatas));
memset(urls, 0, sizeof(struct UPNPUrls)); memset(urls, 0, sizeof(struct UPNPUrls));

View File

@@ -1,8 +1,8 @@
/* $Id: miniupnpc.h,v 1.48 2015/10/08 16:19:40 nanard Exp $ */ /* $Id: miniupnpc.h,v 1.50 2016/04/19 21:06:21 nanard Exp $ */
/* Project: miniupnp /* Project: miniupnp
* http://miniupnp.free.fr/ * http://miniupnp.free.fr/
* Author: Thomas Bernard * Author: Thomas Bernard
* Copyright (c) 2005-2015 Thomas Bernard * Copyright (c) 2005-2016 Thomas Bernard
* This software is subjects to the conditions detailed * This software is subjects to the conditions detailed
* in the LICENCE file provided within this distribution */ * in the LICENCE file provided within this distribution */
#ifndef MINIUPNPC_H_INCLUDED #ifndef MINIUPNPC_H_INCLUDED
@@ -19,8 +19,8 @@
#define UPNPDISCOVER_MEMORY_ERROR (-102) #define UPNPDISCOVER_MEMORY_ERROR (-102)
/* versions : */ /* versions : */
#define MINIUPNPC_VERSION "1.9.20151026" #define MINIUPNPC_VERSION "2.0"
#define MINIUPNPC_API_VERSION 15 #define MINIUPNPC_API_VERSION 16
/* Source port: /* Source port:
Using "1" as an alias for 1900 for backwards compatability Using "1" as an alias for 1900 for backwards compatability

View File

@@ -1,9 +1,10 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
/* $Id: miniwget.c,v 1.72 2015/10/26 17:05:08 nanard Exp $ */
/* $Id: miniwget.c,v 1.75 2016/01/24 17:24:36 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Website : http://miniupnp.free.fr/ * Website : http://miniupnp.free.fr/
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2005-2015 Thomas Bernard * Copyright (c) 2005-2016 Thomas Bernard
* This software is subject to the conditions detailed in the * This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. */ * LICENCE file provided in this distribution. */
@@ -49,12 +50,12 @@
#define MIN(x,y) (((x)<(y))?(x):(y)) #define MIN(x,y) (((x)<(y))?(x):(y))
#endif /* MIN */ #endif /* MIN */
#ifdef _WIN32 #ifdef _WIN32
#define OS_STRING "Win32" #define OS_STRING "Win32"
#define MINIUPNPC_VERSION_STRING "1.9" #define MINIUPNPC_VERSION_STRING "2.0"
#define UPNP_VERSION_STRING "UPnP/1.1" #define UPNP_VERSION_STRING "UPnP/1.1"
#endif #endif
#include "miniwget.h" #include "miniwget.h"
#include "connecthostport.h" #include "connecthostport.h"
#include "receivedata.h" #include "receivedata.h"
@@ -70,7 +71,7 @@
* to the length parameter. * to the length parameter.
*/ */
void * void *
getHTTPResponse(int s, int * size) getHTTPResponse(int s, int * size, int * status_code)
{ {
char buf[2048]; char buf[2048];
int n; int n;
@@ -88,7 +89,10 @@ getHTTPResponse(int s, int * size)
unsigned int content_buf_used = 0; unsigned int content_buf_used = 0;
char chunksize_buf[32]; char chunksize_buf[32];
unsigned int chunksize_buf_index; unsigned int chunksize_buf_index;
char * reason_phrase = NULL;
int reason_phrase_len = 0;
if(status_code) *status_code = -1;
header_buf = malloc(header_buf_len); header_buf = malloc(header_buf_len);
if(header_buf == NULL) if(header_buf == NULL)
{ {
@@ -160,7 +164,7 @@ getHTTPResponse(int s, int * size)
continue; continue;
/* parse header lines */ /* parse header lines */
for(i = 0; i < endofheaders - 1; i++) { for(i = 0; i < endofheaders - 1; i++) {
if(colon <= linestart && header_buf[i]==':') if(linestart > 0 && colon <= linestart && header_buf[i]==':')
{ {
colon = i; colon = i;
while(i < (endofheaders-1) while(i < (endofheaders-1)
@@ -171,7 +175,29 @@ getHTTPResponse(int s, int * size)
/* detecting end of line */ /* detecting end of line */
else if(header_buf[i]=='\r' || header_buf[i]=='\n') else if(header_buf[i]=='\r' || header_buf[i]=='\n')
{ {
if(colon > linestart && valuestart > colon) if(linestart == 0 && status_code)
{
/* Status line
* HTTP-Version SP Status-Code SP Reason-Phrase CRLF */
int sp;
for(sp = 0; sp < i; sp++)
if(header_buf[sp] == ' ')
{
if(*status_code < 0)
*status_code = atoi(header_buf + sp + 1);
else
{
reason_phrase = header_buf + sp + 1;
reason_phrase_len = i - sp - 1;
break;
}
}
#ifdef DEBUG
printf("HTTP status code = %d, Reason phrase = %.*s\n",
*status_code, reason_phrase_len, reason_phrase);
#endif
}
else if(colon > linestart && valuestart > colon)
{ {
#ifdef DEBUG #ifdef DEBUG
printf("header='%.*s', value='%.*s'\n", printf("header='%.*s', value='%.*s'\n",
@@ -342,7 +368,8 @@ static void *
miniwget3(const char * host, miniwget3(const char * host,
unsigned short port, const char * path, unsigned short port, const char * path,
int * size, char * addr_str, int addr_str_len, int * size, char * addr_str, int addr_str_len,
const char * httpversion, unsigned int scope_id) const char * httpversion, unsigned int scope_id,
int * status_code)
{ {
char buf[2048]; char buf[2048];
int s; int s;
@@ -440,7 +467,7 @@ miniwget3(const char * host,
sent += n; sent += n;
} }
} }
content = getHTTPResponse(s, size); content = getHTTPResponse(s, size, status_code);
closesocket(s); closesocket(s);
return content; return content;
} }
@@ -449,18 +476,20 @@ miniwget3(const char * host,
* Call miniwget3(); retry with HTTP/1.1 if 1.0 fails. */ * Call miniwget3(); retry with HTTP/1.1 if 1.0 fails. */
static void * static void *
miniwget2(const char * host, miniwget2(const char * host,
unsigned short port, const char * path, unsigned short port, const char * path,
int * size, char * addr_str, int addr_str_len, int * size, char * addr_str, int addr_str_len,
unsigned int scope_id) unsigned int scope_id, int * status_code)
{ {
char * respbuffer; char * respbuffer;
#if 1 #if 1
respbuffer = miniwget3(host, port, path, size, respbuffer = miniwget3(host, port, path, size,
addr_str, addr_str_len, "1.1", scope_id); addr_str, addr_str_len, "1.1",
scope_id, status_code);
#else #else
respbuffer = miniwget3(host, port, path, size, respbuffer = miniwget3(host, port, path, size,
addr_str, addr_str_len, "1.0", scope_id); addr_str, addr_str_len, "1.0",
scope_id, status_code);
if (*size == 0) if (*size == 0)
{ {
#ifdef DEBUG #ifdef DEBUG
@@ -468,7 +497,8 @@ miniwget2(const char * host,
#endif #endif
free(respbuffer); free(respbuffer);
respbuffer = miniwget3(host, port, path, size, respbuffer = miniwget3(host, port, path, size,
addr_str, addr_str_len, "1.1", scope_id); addr_str, addr_str_len, "1.1",
scope_id, status_code);
} }
#endif #endif
return respbuffer; return respbuffer;
@@ -593,7 +623,8 @@ parseURL(const char * url,
} }
void * void *
miniwget(const char * url, int * size, unsigned int scope_id) miniwget(const char * url, int * size,
unsigned int scope_id, int * status_code)
{ {
unsigned short port; unsigned short port;
char * path; char * path;
@@ -606,12 +637,13 @@ miniwget(const char * url, int * size, unsigned int scope_id)
printf("parsed url : hostname='%s' port=%hu path='%s' scope_id=%u\n", printf("parsed url : hostname='%s' port=%hu path='%s' scope_id=%u\n",
hostname, port, path, scope_id); hostname, port, path, scope_id);
#endif #endif
return miniwget2(hostname, port, path, size, 0, 0, scope_id); return miniwget2(hostname, port, path, size, 0, 0, scope_id, status_code);
} }
void * void *
miniwget_getaddr(const char * url, int * size, miniwget_getaddr(const char * url, int * size,
char * addr, int addrlen, unsigned int scope_id) char * addr, int addrlen, unsigned int scope_id,
int * status_code)
{ {
unsigned short port; unsigned short port;
char * path; char * path;
@@ -626,5 +658,6 @@ miniwget_getaddr(const char * url, int * size,
printf("parsed url : hostname='%s' port=%hu path='%s' scope_id=%u\n", printf("parsed url : hostname='%s' port=%hu path='%s' scope_id=%u\n",
hostname, port, path, scope_id); hostname, port, path, scope_id);
#endif #endif
return miniwget2(hostname, port, path, size, addr, addrlen, scope_id); return miniwget2(hostname, port, path, size, addr, addrlen, scope_id, status_code);
} }

View File

@@ -1,7 +1,7 @@
/* $Id: miniwget.h,v 1.10 2015/07/21 13:16:55 nanard Exp $ */ /* $Id: miniwget.h,v 1.12 2016/01/24 17:24:36 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2005-2015 Thomas Bernard * Copyright (c) 2005-2016 Thomas Bernard
* This software is subject to the conditions detailed in the * This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. * LICENCE file provided in this distribution.
* */ * */
@@ -14,11 +14,11 @@
extern "C" { extern "C" {
#endif #endif
MINIUPNP_LIBSPEC void * getHTTPResponse(int s, int * size); MINIUPNP_LIBSPEC void * getHTTPResponse(int s, int * size, int * status_code);
MINIUPNP_LIBSPEC void * miniwget(const char *, int *, unsigned int); MINIUPNP_LIBSPEC void * miniwget(const char *, int *, unsigned int, int *);
MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int); MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int, int *);
int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *);

View File

@@ -1,4 +1,4 @@
/* $Id: receivedata.c,v 1.6 2014/11/13 13:51:52 nanard Exp $ */ /* $Id: receivedata.c,v 1.7 2015/11/09 21:51:41 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Website : http://miniupnp.free.fr/ * Website : http://miniupnp.free.fr/
* Author : Thomas Bernard * Author : Thomas Bernard
@@ -40,7 +40,7 @@ receivedata(int socket,
char * data, int length, char * data, int length,
int timeout, unsigned int * scope_id) int timeout, unsigned int * scope_id)
{ {
#if MINIUPNPC_GET_SRC_ADDR #ifdef MINIUPNPC_GET_SRC_ADDR
struct sockaddr_storage src_addr; struct sockaddr_storage src_addr;
socklen_t src_addr_len = sizeof(src_addr); socklen_t src_addr_len = sizeof(src_addr);
#endif /* MINIUPNPC_GET_SRC_ADDR */ #endif /* MINIUPNPC_GET_SRC_ADDR */
@@ -80,7 +80,7 @@ receivedata(int socket,
return 0; return 0;
} }
#endif /* !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) */ #endif /* !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) */
#if MINIUPNPC_GET_SRC_ADDR #ifdef MINIUPNPC_GET_SRC_ADDR
memset(&src_addr, 0, sizeof(src_addr)); memset(&src_addr, 0, sizeof(src_addr));
n = recvfrom(socket, data, length, 0, n = recvfrom(socket, data, length, 0,
(struct sockaddr *)&src_addr, &src_addr_len); (struct sockaddr *)&src_addr, &src_addr_len);
@@ -90,7 +90,7 @@ receivedata(int socket,
if(n<0) { if(n<0) {
PRINT_SOCKET_ERROR("recv"); PRINT_SOCKET_ERROR("recv");
} }
#if MINIUPNPC_GET_SRC_ADDR #ifdef MINIUPNPC_GET_SRC_ADDR
if (src_addr.ss_family == AF_INET6) { if (src_addr.ss_family == AF_INET6) {
const struct sockaddr_in6 * src_addr6 = (struct sockaddr_in6 *)&src_addr; const struct sockaddr_in6 * src_addr6 = (struct sockaddr_in6 *)&src_addr;
#ifdef DEBUG #ifdef DEBUG

View File

@@ -1,7 +1,7 @@
/* $Id: testminiwget.c,v 1.4 2012/06/23 22:35:59 nanard Exp $ */ /* $Id: testminiwget.c,v 1.5 2016/01/24 17:24:36 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2005-2012 Thomas Bernard * Copyright (c) 2005-2016 Thomas Bernard
* This software is subject to the conditions detailed in the * This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. * LICENCE file provided in this distribution.
* */ * */
@@ -20,15 +20,17 @@ int main(int argc, char * * argv)
int size, writtensize; int size, writtensize;
FILE *f; FILE *f;
char addr[64]; char addr[64];
int status_code = -1;
if(argc < 3) { if(argc < 3) {
fprintf(stderr, "Usage:\t%s url file\n", argv[0]); fprintf(stderr, "Usage:\t%s url file\n", argv[0]);
fprintf(stderr, "Example:\t%s http://www.google.com/ out.html\n", argv[0]); fprintf(stderr, "Example:\t%s http://www.google.com/ out.html\n", argv[0]);
return 1; return 1;
} }
data = miniwget_getaddr(argv[1], &size, addr, sizeof(addr), 0); data = miniwget_getaddr(argv[1], &size, addr, sizeof(addr), 0, &status_code);
if(!data) { if(!data || (status_code != 200)) {
fprintf(stderr, "Error fetching %s\n", argv[1]); if(data) free(data);
fprintf(stderr, "Error %d fetching %s\n", status_code, argv[1]);
return 1; return 1;
} }
printf("local address : %s\n", addr); printf("local address : %s\n", addr);

View File

@@ -1,7 +1,7 @@
/* $Id: upnpc.c,v 1.112 2015/10/08 16:15:48 nanard Exp $ */ /* $Id: upnpc.c,v 1.114 2016/01/22 15:04:23 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2005-2015 Thomas Bernard * Copyright (c) 2005-2016 Thomas Bernard
* This software is subject to the conditions detailed in the * This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. */ * LICENCE file provided in this distribution. */
@@ -66,7 +66,7 @@ static void DisplayInfos(struct UPNPUrls * urls,
char connectionType[64]; char connectionType[64];
char status[64]; char status[64];
char lastconnerr[64]; char lastconnerr[64];
unsigned int uptime; unsigned int uptime = 0;
unsigned int brUp, brDown; unsigned int brUp, brDown;
time_t timenow, timestarted; time_t timenow, timestarted;
int r; int r;
@@ -82,9 +82,11 @@ static void DisplayInfos(struct UPNPUrls * urls,
else else
printf("Status : %s, uptime=%us, LastConnectionError : %s\n", printf("Status : %s, uptime=%us, LastConnectionError : %s\n",
status, uptime, lastconnerr); status, uptime, lastconnerr);
timenow = time(NULL); if(uptime > 0) {
timestarted = timenow - uptime; timenow = time(NULL);
printf(" Time started : %s", ctime(&timestarted)); timestarted = timenow - uptime;
printf(" Time started : %s", ctime(&timestarted));
}
if(UPNP_GetLinkLayerMaxBitRates(urls->controlURL_CIF, data->CIF.servicetype, if(UPNP_GetLinkLayerMaxBitRates(urls->controlURL_CIF, data->CIF.servicetype,
&brDown, &brUp) != UPNPCOMMAND_SUCCESS) { &brDown, &brUp) != UPNPCOMMAND_SUCCESS) {
printf("GetLinkLayerMaxBitRates failed.\n"); printf("GetLinkLayerMaxBitRates failed.\n");
@@ -538,7 +540,7 @@ int main(int argc, char ** argv)
char ** commandargv = 0; char ** commandargv = 0;
int commandargc = 0; int commandargc = 0;
struct UPNPDev * devlist = 0; struct UPNPDev * devlist = 0;
char lanaddr[64]; /* my ip address on the LAN */ char lanaddr[64] = "unset"; /* my ip address on the LAN */
int i; int i;
const char * rootdescurl = 0; const char * rootdescurl = 0;
const char * multicastif = 0; const char * multicastif = 0;
@@ -560,7 +562,7 @@ int main(int argc, char ** argv)
} }
#endif #endif
printf("upnpc : miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING); printf("upnpc : miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING);
printf(" (c) 2005-2015 Thomas Bernard.\n"); printf(" (c) 2005-2016 Thomas Bernard.\n");
printf("Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/\n" printf("Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/\n"
"for more information.\n"); "for more information.\n");
/* command line processing */ /* command line processing */

View File

@@ -1,5 +1,6 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
/* $Id: upnpcommands.c,v 1.46 2015/07/15 12:19:00 nanard Exp $ */
/* $Id: upnpcommands.c,v 1.47 2016/03/07 12:26:48 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2005-2015 Thomas Bernard * Copyright (c) 2005-2015 Thomas Bernard
@@ -617,14 +618,14 @@ UPNP_GetGenericPortMappingEntry(const char * controlURL,
protocol[3] = '\0'; protocol[3] = '\0';
} }
p = GetValueFromNameValueList(&pdata, "NewInternalClient"); p = GetValueFromNameValueList(&pdata, "NewInternalClient");
if(p && intClient) if(p)
{ {
strncpy(intClient, p, 16); strncpy(intClient, p, 16);
intClient[15] = '\0'; intClient[15] = '\0';
r = 0; r = 0;
} }
p = GetValueFromNameValueList(&pdata, "NewInternalPort"); p = GetValueFromNameValueList(&pdata, "NewInternalPort");
if(p && intPort) if(p)
{ {
strncpy(intPort, p, 6); strncpy(intPort, p, 6);
intPort[5] = '\0'; intPort[5] = '\0';

View File

@@ -91,21 +91,21 @@ static void cliPrintHelp(const char *pn,FILE *out)
fprintf(out, fprintf(out,
COPYRIGHT_NOTICE ZT_EOL_S COPYRIGHT_NOTICE ZT_EOL_S
LICENSE_GRANT ZT_EOL_S); LICENSE_GRANT ZT_EOL_S);
fprintf(out,"Usage: %s [-switches] <command/path> [<args>]"ZT_EOL_S""ZT_EOL_S,pn); fprintf(out,"Usage: %s [-switches] <command/path> [<args>]" ZT_EOL_S"" ZT_EOL_S,pn);
fprintf(out,"Available switches:"ZT_EOL_S); fprintf(out,"Available switches:" ZT_EOL_S);
fprintf(out," -h - Display this help"ZT_EOL_S); fprintf(out," -h - Display this help" ZT_EOL_S);
fprintf(out," -v - Show version"ZT_EOL_S); fprintf(out," -v - Show version" ZT_EOL_S);
fprintf(out," -j - Display full raw JSON output"ZT_EOL_S); fprintf(out," -j - Display full raw JSON output" ZT_EOL_S);
fprintf(out," -D<path> - ZeroTier home path for parameter auto-detect"ZT_EOL_S); fprintf(out," -D<path> - ZeroTier home path for parameter auto-detect" ZT_EOL_S);
fprintf(out," -p<port> - HTTP port (default: auto)"ZT_EOL_S); fprintf(out," -p<port> - HTTP port (default: auto)" ZT_EOL_S);
fprintf(out," -T<token> - Authentication token (default: auto)"ZT_EOL_S); fprintf(out," -T<token> - Authentication token (default: auto)" ZT_EOL_S);
//fprintf(out," -H<ip> - HTTP server bind address (default: 127.0.0.1)"ZT_EOL_S); //fprintf(out," -H<ip> - HTTP server bind address (default: 127.0.0.1)" ZT_EOL_S);
fprintf(out,ZT_EOL_S"Available commands:"ZT_EOL_S); fprintf(out,ZT_EOL_S"Available commands:" ZT_EOL_S);
fprintf(out," info - Display status info"ZT_EOL_S); fprintf(out," info - Display status info" ZT_EOL_S);
fprintf(out," listpeers - List all peers"ZT_EOL_S); fprintf(out," listpeers - List all peers" ZT_EOL_S);
fprintf(out," listnetworks - List all networks"ZT_EOL_S); fprintf(out," listnetworks - List all networks" ZT_EOL_S);
fprintf(out," join <network> - Join a network"ZT_EOL_S); fprintf(out," join <network> - Join a network" ZT_EOL_S);
fprintf(out," leave <network> - Leave a network"ZT_EOL_S); fprintf(out," leave <network> - Leave a network" ZT_EOL_S);
} }
static std::string cliFixJsonCRs(const std::string &s) static std::string cliFixJsonCRs(const std::string &s)
@@ -191,7 +191,7 @@ static int cli(int argc,char **argv)
cliPrintHelp(argv[0],stdout); cliPrintHelp(argv[0],stdout);
return 1; return 1;
} }
printf("%d.%d.%d"ZT_EOL_S,ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION); printf("%d.%d.%d" ZT_EOL_S,ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION);
return 0; return 0;
case 'h': case 'h':
@@ -211,7 +211,7 @@ static int cli(int argc,char **argv)
if ((!port)||(!authToken.length())) { if ((!port)||(!authToken.length())) {
if (!homeDir.length()) { if (!homeDir.length()) {
fprintf(stderr,"%s: missing port or authentication token and no home directory specified to auto-detect"ZT_EOL_S,argv[0]); fprintf(stderr,"%s: missing port or authentication token and no home directory specified to auto-detect" ZT_EOL_S,argv[0]);
return 2; return 2;
} }
@@ -220,7 +220,7 @@ static int cli(int argc,char **argv)
OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "zerotier-one.port").c_str(),portStr); OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "zerotier-one.port").c_str(),portStr);
port = Utils::strToUInt(portStr.c_str()); port = Utils::strToUInt(portStr.c_str());
if ((port == 0)||(port > 0xffff)) { if ((port == 0)||(port > 0xffff)) {
fprintf(stderr,"%s: missing port and zerotier-one.port not found in %s"ZT_EOL_S,argv[0],homeDir.c_str()); fprintf(stderr,"%s: missing port and zerotier-one.port not found in %s" ZT_EOL_S,argv[0],homeDir.c_str());
return 2; return 2;
} }
} }
@@ -242,7 +242,7 @@ static int cli(int argc,char **argv)
} }
#endif #endif
if (!authToken.length()) { if (!authToken.length()) {
fprintf(stderr,"%s: missing authentication token and authtoken.secret not found (or readable) in %s"ZT_EOL_S,argv[0],homeDir.c_str()); fprintf(stderr,"%s: missing authentication token and authtoken.secret not found (or readable) in %s" ZT_EOL_S,argv[0],homeDir.c_str());
return 2; return 2;
} }
} }
@@ -274,7 +274,7 @@ static int cli(int argc,char **argv)
printf("%s",cliFixJsonCRs(responseBody).c_str()); printf("%s",cliFixJsonCRs(responseBody).c_str());
return 0; return 0;
} else { } else {
printf("%u %s %s"ZT_EOL_S,scode,command.c_str(),responseBody.c_str()); printf("%u %s %s" ZT_EOL_S,scode,command.c_str(),responseBody.c_str());
return 1; return 1;
} }
} else if ((command == "info")||(command == "status")) { } else if ((command == "info")||(command == "status")) {
@@ -307,7 +307,7 @@ static int cli(int argc,char **argv)
online = (j->u.object.values[k].value->u.boolean != 0); online = (j->u.object.values[k].value->u.boolean != 0);
} }
if ((address)&&(version)) { if ((address)&&(version)) {
printf("200 info %s %s %s"ZT_EOL_S,address,(online ? "ONLINE" : "OFFLINE"),version); printf("200 info %s %s %s" ZT_EOL_S,address,(online ? "ONLINE" : "OFFLINE"),version);
good = true; good = true;
} }
} }
@@ -316,12 +316,12 @@ static int cli(int argc,char **argv)
if (good) { if (good) {
return 0; return 0;
} else { } else {
printf("%u %s invalid JSON response"ZT_EOL_S,scode,command.c_str()); printf("%u %s invalid JSON response" ZT_EOL_S,scode,command.c_str());
return 1; return 1;
} }
} }
} else { } else {
printf("%u %s %s"ZT_EOL_S,scode,command.c_str(),responseBody.c_str()); printf("%u %s %s" ZT_EOL_S,scode,command.c_str(),responseBody.c_str());
return 1; return 1;
} }
} else if (command == "listpeers") { } else if (command == "listpeers") {
@@ -338,7 +338,7 @@ static int cli(int argc,char **argv)
printf("%s",cliFixJsonCRs(responseBody).c_str()); printf("%s",cliFixJsonCRs(responseBody).c_str());
return 0; return 0;
} else { } else {
printf("200 listpeers <ztaddr> <paths> <latency> <version> <role>"ZT_EOL_S); printf("200 listpeers <ztaddr> <paths> <latency> <version> <role>" ZT_EOL_S);
json_value *j = json_parse(responseBody.c_str(),responseBody.length()); json_value *j = json_parse(responseBody.c_str(),responseBody.length());
if (j) { if (j) {
if (j->type == json_array) { if (j->type == json_array) {
@@ -412,7 +412,7 @@ static int cli(int argc,char **argv)
verstr[0] = '-'; verstr[0] = '-';
verstr[1] = (char)0; verstr[1] = (char)0;
} }
printf("200 listpeers %s %s %lld %s %s"ZT_EOL_S,address,(paths.length()) ? paths.c_str() : "-",(long long)latency,verstr,role); printf("200 listpeers %s %s %lld %s %s" ZT_EOL_S,address,(paths.length()) ? paths.c_str() : "-",(long long)latency,verstr,role);
} }
} }
} }
@@ -422,7 +422,7 @@ static int cli(int argc,char **argv)
return 0; return 0;
} }
} else { } else {
printf("%u %s %s"ZT_EOL_S,scode,command.c_str(),responseBody.c_str()); printf("%u %s %s" ZT_EOL_S,scode,command.c_str(),responseBody.c_str());
return 1; return 1;
} }
} else if (command == "listnetworks") { } else if (command == "listnetworks") {
@@ -439,7 +439,7 @@ static int cli(int argc,char **argv)
printf("%s",cliFixJsonCRs(responseBody).c_str()); printf("%s",cliFixJsonCRs(responseBody).c_str());
return 0; return 0;
} else { } else {
printf("200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>"ZT_EOL_S); printf("200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>" ZT_EOL_S);
json_value *j = json_parse(responseBody.c_str(),responseBody.length()); json_value *j = json_parse(responseBody.c_str(),responseBody.length());
if (j) { if (j) {
if (j->type == json_array) { if (j->type == json_array) {
@@ -478,7 +478,7 @@ static int cli(int argc,char **argv)
} }
} }
if ((nwid)&&(mac)&&(status)&&(type)) { if ((nwid)&&(mac)&&(status)&&(type)) {
printf("200 listnetworks %s %s %s %s %s %s %s"ZT_EOL_S, printf("200 listnetworks %s %s %s %s %s %s %s" ZT_EOL_S,
nwid, nwid,
(((name)&&(name[0])) ? name : "-"), (((name)&&(name[0])) ? name : "-"),
mac, mac,
@@ -494,7 +494,7 @@ static int cli(int argc,char **argv)
} }
} }
} else { } else {
printf("%u %s %s"ZT_EOL_S,scode,command.c_str(),responseBody.c_str()); printf("%u %s %s" ZT_EOL_S,scode,command.c_str(),responseBody.c_str());
return 1; return 1;
} }
} else if (command == "join") { } else if (command == "join") {
@@ -518,11 +518,11 @@ static int cli(int argc,char **argv)
if (json) { if (json) {
printf("%s",cliFixJsonCRs(responseBody).c_str()); printf("%s",cliFixJsonCRs(responseBody).c_str());
} else { } else {
printf("200 join OK"ZT_EOL_S); printf("200 join OK" ZT_EOL_S);
} }
return 0; return 0;
} else { } else {
printf("%u %s %s"ZT_EOL_S,scode,command.c_str(),responseBody.c_str()); printf("%u %s %s" ZT_EOL_S,scode,command.c_str(),responseBody.c_str());
return 1; return 1;
} }
} else if (command == "leave") { } else if (command == "leave") {
@@ -542,11 +542,11 @@ static int cli(int argc,char **argv)
if (json) { if (json) {
printf("%s",cliFixJsonCRs(responseBody).c_str()); printf("%s",cliFixJsonCRs(responseBody).c_str());
} else { } else {
printf("200 leave OK"ZT_EOL_S); printf("200 leave OK" ZT_EOL_S);
} }
return 0; return 0;
} else { } else {
printf("%u %s %s"ZT_EOL_S,scode,command.c_str(),responseBody.c_str()); printf("%u %s %s" ZT_EOL_S,scode,command.c_str(),responseBody.c_str());
return 1; return 1;
} }
} else { } else {
@@ -570,13 +570,13 @@ static void idtoolPrintHelp(FILE *out,const char *pn)
fprintf(out, fprintf(out,
COPYRIGHT_NOTICE ZT_EOL_S COPYRIGHT_NOTICE ZT_EOL_S
LICENSE_GRANT ZT_EOL_S); LICENSE_GRANT ZT_EOL_S);
fprintf(out,"Usage: %s <command> [<args>]"ZT_EOL_S""ZT_EOL_S"Commands:"ZT_EOL_S,pn); fprintf(out,"Usage: %s <command> [<args>]" ZT_EOL_S"" ZT_EOL_S"Commands:" ZT_EOL_S,pn);
fprintf(out," generate [<identity.secret>] [<identity.public>] [<vanity>]"ZT_EOL_S); fprintf(out," generate [<identity.secret>] [<identity.public>] [<vanity>]" ZT_EOL_S);
fprintf(out," validate <identity.secret/public>"ZT_EOL_S); fprintf(out," validate <identity.secret/public>" ZT_EOL_S);
fprintf(out," getpublic <identity.secret>"ZT_EOL_S); fprintf(out," getpublic <identity.secret>" ZT_EOL_S);
fprintf(out," sign <identity.secret> <file>"ZT_EOL_S); fprintf(out," sign <identity.secret> <file>" ZT_EOL_S);
fprintf(out," verify <identity.secret/public> <file> <signature>"ZT_EOL_S); fprintf(out," verify <identity.secret/public> <file> <signature>" ZT_EOL_S);
fprintf(out," mkcom <identity.secret> [<id,value,maxDelta> ...] (hexadecimal integers)"ZT_EOL_S); fprintf(out," mkcom <identity.secret> [<id,value,maxDelta> ...] (hexadecimal integers)" ZT_EOL_S);
} }
static Identity getIdFromArg(char *arg) static Identity getIdFromArg(char *arg)
@@ -632,15 +632,15 @@ static int idtool(int argc,char **argv)
std::string idser = id.toString(true); std::string idser = id.toString(true);
if (argc >= 3) { if (argc >= 3) {
if (!OSUtils::writeFile(argv[2],idser)) { if (!OSUtils::writeFile(argv[2],idser)) {
fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[2]); fprintf(stderr,"Error writing to %s" ZT_EOL_S,argv[2]);
return 1; return 1;
} else printf("%s written"ZT_EOL_S,argv[2]); } else printf("%s written" ZT_EOL_S,argv[2]);
if (argc >= 4) { if (argc >= 4) {
idser = id.toString(false); idser = id.toString(false);
if (!OSUtils::writeFile(argv[3],idser)) { if (!OSUtils::writeFile(argv[3],idser)) {
fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[3]); fprintf(stderr,"Error writing to %s" ZT_EOL_S,argv[3]);
return 1; return 1;
} else printf("%s written"ZT_EOL_S,argv[3]); } else printf("%s written" ZT_EOL_S,argv[3]);
} }
} else printf("%s",idser.c_str()); } else printf("%s",idser.c_str());
} else if (!strcmp(argv[1],"validate")) { } else if (!strcmp(argv[1],"validate")) {
@@ -651,14 +651,14 @@ static int idtool(int argc,char **argv)
Identity id = getIdFromArg(argv[2]); Identity id = getIdFromArg(argv[2]);
if (!id) { if (!id) {
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]); fprintf(stderr,"Identity argument invalid or file unreadable: %s" ZT_EOL_S,argv[2]);
return 1; return 1;
} }
if (!id.locallyValidate()) { if (!id.locallyValidate()) {
fprintf(stderr,"%s FAILED validation."ZT_EOL_S,argv[2]); fprintf(stderr,"%s FAILED validation." ZT_EOL_S,argv[2]);
return 1; return 1;
} else printf("%s is a valid identity"ZT_EOL_S,argv[2]); } else printf("%s is a valid identity" ZT_EOL_S,argv[2]);
} else if (!strcmp(argv[1],"getpublic")) { } else if (!strcmp(argv[1],"getpublic")) {
if (argc < 3) { if (argc < 3) {
idtoolPrintHelp(stdout,argv[0]); idtoolPrintHelp(stdout,argv[0]);
@@ -667,7 +667,7 @@ static int idtool(int argc,char **argv)
Identity id = getIdFromArg(argv[2]); Identity id = getIdFromArg(argv[2]);
if (!id) { if (!id) {
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]); fprintf(stderr,"Identity argument invalid or file unreadable: %s" ZT_EOL_S,argv[2]);
return 1; return 1;
} }
@@ -680,18 +680,18 @@ static int idtool(int argc,char **argv)
Identity id = getIdFromArg(argv[2]); Identity id = getIdFromArg(argv[2]);
if (!id) { if (!id) {
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]); fprintf(stderr,"Identity argument invalid or file unreadable: %s" ZT_EOL_S,argv[2]);
return 1; return 1;
} }
if (!id.hasPrivate()) { if (!id.hasPrivate()) {
fprintf(stderr,"%s does not contain a private key (must use private to sign)"ZT_EOL_S,argv[2]); fprintf(stderr,"%s does not contain a private key (must use private to sign)" ZT_EOL_S,argv[2]);
return 1; return 1;
} }
std::string inf; std::string inf;
if (!OSUtils::readFile(argv[3],inf)) { if (!OSUtils::readFile(argv[3],inf)) {
fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]); fprintf(stderr,"%s is not readable" ZT_EOL_S,argv[3]);
return 1; return 1;
} }
C25519::Signature signature = id.sign(inf.data(),(unsigned int)inf.length()); C25519::Signature signature = id.sign(inf.data(),(unsigned int)inf.length());
@@ -704,21 +704,21 @@ static int idtool(int argc,char **argv)
Identity id = getIdFromArg(argv[2]); Identity id = getIdFromArg(argv[2]);
if (!id) { if (!id) {
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]); fprintf(stderr,"Identity argument invalid or file unreadable: %s" ZT_EOL_S,argv[2]);
return 1; return 1;
} }
std::string inf; std::string inf;
if (!OSUtils::readFile(argv[3],inf)) { if (!OSUtils::readFile(argv[3],inf)) {
fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]); fprintf(stderr,"%s is not readable" ZT_EOL_S,argv[3]);
return 1; return 1;
} }
std::string signature(Utils::unhex(argv[4])); std::string signature(Utils::unhex(argv[4]));
if ((signature.length() > ZT_ADDRESS_LENGTH)&&(id.verify(inf.data(),(unsigned int)inf.length(),signature.data(),(unsigned int)signature.length()))) { if ((signature.length() > ZT_ADDRESS_LENGTH)&&(id.verify(inf.data(),(unsigned int)inf.length(),signature.data(),(unsigned int)signature.length()))) {
printf("%s signature valid"ZT_EOL_S,argv[3]); printf("%s signature valid" ZT_EOL_S,argv[3]);
} else { } else {
fprintf(stderr,"%s signature check FAILED"ZT_EOL_S,argv[3]); fprintf(stderr,"%s signature check FAILED" ZT_EOL_S,argv[3]);
return 1; return 1;
} }
} else if (!strcmp(argv[1],"mkcom")) { } else if (!strcmp(argv[1],"mkcom")) {
@@ -729,7 +729,7 @@ static int idtool(int argc,char **argv)
Identity id = getIdFromArg(argv[2]); Identity id = getIdFromArg(argv[2]);
if ((!id)||(!id.hasPrivate())) { if ((!id)||(!id.hasPrivate())) {
fprintf(stderr,"Identity argument invalid, does not include private key, or file unreadable: %s"ZT_EOL_S,argv[2]); fprintf(stderr,"Identity argument invalid, does not include private key, or file unreadable: %s" ZT_EOL_S,argv[2]);
return 1; return 1;
} }
@@ -744,7 +744,7 @@ static int idtool(int argc,char **argv)
} }
} }
if (!com.sign(id)) { if (!com.sign(id)) {
fprintf(stderr,"Signature of certificate of membership failed."ZT_EOL_S); fprintf(stderr,"Signature of certificate of membership failed." ZT_EOL_S);
return 1; return 1;
} }
@@ -938,27 +938,27 @@ static void printHelp(const char *cn,FILE *out)
LICENSE_GRANT ZT_EOL_S); LICENSE_GRANT ZT_EOL_S);
std::string updateUrl(OneService::autoUpdateUrl()); std::string updateUrl(OneService::autoUpdateUrl());
if (updateUrl.length()) if (updateUrl.length())
fprintf(out,"Automatic updates enabled:"ZT_EOL_S" %s"ZT_EOL_S" (all updates are securely authenticated by 256-bit ECDSA signature)"ZT_EOL_S""ZT_EOL_S,updateUrl.c_str()); fprintf(out,"Automatic updates enabled:" ZT_EOL_S" %s" ZT_EOL_S" (all updates are securely authenticated by 256-bit ECDSA signature)" ZT_EOL_S"" ZT_EOL_S,updateUrl.c_str());
fprintf(out,"Usage: %s [-switches] [home directory]"ZT_EOL_S""ZT_EOL_S,cn); fprintf(out,"Usage: %s [-switches] [home directory]" ZT_EOL_S"" ZT_EOL_S,cn);
fprintf(out,"Available switches:"ZT_EOL_S); fprintf(out,"Available switches:" ZT_EOL_S);
fprintf(out," -h - Display this help"ZT_EOL_S); fprintf(out," -h - Display this help" ZT_EOL_S);
fprintf(out," -v - Show version"ZT_EOL_S); fprintf(out," -v - Show version" ZT_EOL_S);
fprintf(out," -U - Run as unprivileged user (skip privilege check)"ZT_EOL_S); fprintf(out," -U - Run as unprivileged user (skip privilege check)" ZT_EOL_S);
fprintf(out," -p<port> - Port for UDP and TCP/HTTP (default: 9993, 0 for random)"ZT_EOL_S); fprintf(out," -p<port> - Port for UDP and TCP/HTTP (default: 9993, 0 for random)" ZT_EOL_S);
#ifdef __UNIX_LIKE__ #ifdef __UNIX_LIKE__
fprintf(out," -d - Fork and run as daemon (Unix-ish OSes)"ZT_EOL_S); fprintf(out," -d - Fork and run as daemon (Unix-ish OSes)" ZT_EOL_S);
#endif // __UNIX_LIKE__ #endif // __UNIX_LIKE__
#ifdef __WINDOWS__ #ifdef __WINDOWS__
fprintf(out," -C - Run from command line instead of as service (Windows)"ZT_EOL_S); fprintf(out," -C - Run from command line instead of as service (Windows)" ZT_EOL_S);
fprintf(out," -I - Install Windows service (Windows)"ZT_EOL_S); fprintf(out," -I - Install Windows service (Windows)" ZT_EOL_S);
fprintf(out," -R - Uninstall Windows service (Windows)"ZT_EOL_S); fprintf(out," -R - Uninstall Windows service (Windows)" ZT_EOL_S);
fprintf(out," -D - Remove all instances of Windows tap device (Windows)"ZT_EOL_S); fprintf(out," -D - Remove all instances of Windows tap device (Windows)" ZT_EOL_S);
#endif // __WINDOWS__ #endif // __WINDOWS__
fprintf(out," -i - Generate and manage identities (zerotier-idtool)"ZT_EOL_S); fprintf(out," -i - Generate and manage identities (zerotier-idtool)" ZT_EOL_S);
fprintf(out," -q - Query API (zerotier-cli)"ZT_EOL_S); fprintf(out," -q - Query API (zerotier-cli)" ZT_EOL_S);
} }
#ifdef __WINDOWS__ #ifdef __WINDOWS__
@@ -1036,7 +1036,7 @@ int main(int argc,char **argv)
break; break;
case 'v': // Display version case 'v': // Display version
printf("%d.%d.%d"ZT_EOL_S,ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION); printf("%d.%d.%d" ZT_EOL_S,ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION);
return 0; return 0;
case 'i': // Invoke idtool personality case 'i': // Invoke idtool personality
@@ -1058,12 +1058,12 @@ int main(int argc,char **argv)
case 'I': { // Install this binary as a Windows service case 'I': { // Install this binary as a Windows service
if (IsCurrentUserLocalAdministrator() != TRUE) { if (IsCurrentUserLocalAdministrator() != TRUE) {
fprintf(stderr,"%s: must be run as a local administrator."ZT_EOL_S,argv[0]); fprintf(stderr,"%s: must be run as a local administrator." ZT_EOL_S,argv[0]);
return 1; return 1;
} }
std::string ret(InstallService(ZT_SERVICE_NAME,ZT_SERVICE_DISPLAY_NAME,ZT_SERVICE_START_TYPE,ZT_SERVICE_DEPENDENCIES,ZT_SERVICE_ACCOUNT,ZT_SERVICE_PASSWORD)); std::string ret(InstallService(ZT_SERVICE_NAME,ZT_SERVICE_DISPLAY_NAME,ZT_SERVICE_START_TYPE,ZT_SERVICE_DEPENDENCIES,ZT_SERVICE_ACCOUNT,ZT_SERVICE_PASSWORD));
if (ret.length()) { if (ret.length()) {
fprintf(stderr,"%s: unable to install service: %s"ZT_EOL_S,argv[0],ret.c_str()); fprintf(stderr,"%s: unable to install service: %s" ZT_EOL_S,argv[0],ret.c_str());
return 3; return 3;
} }
return 0; return 0;
@@ -1071,12 +1071,12 @@ int main(int argc,char **argv)
case 'R': { // Uninstall this binary as Windows service case 'R': { // Uninstall this binary as Windows service
if (IsCurrentUserLocalAdministrator() != TRUE) { if (IsCurrentUserLocalAdministrator() != TRUE) {
fprintf(stderr,"%s: must be run as a local administrator."ZT_EOL_S,argv[0]); fprintf(stderr,"%s: must be run as a local administrator." ZT_EOL_S,argv[0]);
return 1; return 1;
} }
std::string ret(UninstallService(ZT_SERVICE_NAME)); std::string ret(UninstallService(ZT_SERVICE_NAME));
if (ret.length()) { if (ret.length()) {
fprintf(stderr,"%s: unable to uninstall service: %s"ZT_EOL_S,argv[0],ret.c_str()); fprintf(stderr,"%s: unable to uninstall service: %s" ZT_EOL_S,argv[0],ret.c_str());
return 3; return 3;
} }
return 0; return 0;
@@ -1085,7 +1085,7 @@ int main(int argc,char **argv)
case 'D': { case 'D': {
std::string err = WindowsEthernetTap::destroyAllPersistentTapDevices(); std::string err = WindowsEthernetTap::destroyAllPersistentTapDevices();
if (err.length() > 0) { if (err.length() > 0) {
fprintf(stderr,"%s: unable to uninstall one or more persistent tap devices: %s"ZT_EOL_S,argv[0],err.c_str()); fprintf(stderr,"%s: unable to uninstall one or more persistent tap devices: %s" ZT_EOL_S,argv[0],err.c_str());
return 3; return 3;
} }
return 0; return 0;
@@ -1111,7 +1111,7 @@ int main(int argc,char **argv)
if (!homeDir.length()) if (!homeDir.length())
homeDir = OneService::platformDefaultHomePath(); homeDir = OneService::platformDefaultHomePath();
if (!homeDir.length()) { if (!homeDir.length()) {
fprintf(stderr,"%s: no home path specified and no platform default available"ZT_EOL_S,argv[0]); fprintf(stderr,"%s: no home path specified and no platform default available" ZT_EOL_S,argv[0]);
return 1; return 1;
} else { } else {
std::vector<std::string> hpsp(Utils::split(homeDir.c_str(),ZT_PATH_SEPARATOR_S,"","")); std::vector<std::string> hpsp(Utils::split(homeDir.c_str(),ZT_PATH_SEPARATOR_S,"",""));
@@ -1132,14 +1132,14 @@ int main(int argc,char **argv)
#ifdef __UNIX_LIKE__ #ifdef __UNIX_LIKE__
#ifndef ZT_ONE_NO_ROOT_CHECK #ifndef ZT_ONE_NO_ROOT_CHECK
if ((!skipRootCheck)&&(getuid() != 0)) { if ((!skipRootCheck)&&(getuid() != 0)) {
fprintf(stderr,"%s: must be run as root (uid 0)"ZT_EOL_S,argv[0]); fprintf(stderr,"%s: must be run as root (uid 0)" ZT_EOL_S,argv[0]);
return 1; return 1;
} }
#endif // !ZT_ONE_NO_ROOT_CHECK #endif // !ZT_ONE_NO_ROOT_CHECK
if (runAsDaemon) { if (runAsDaemon) {
long p = (long)fork(); long p = (long)fork();
if (p < 0) { if (p < 0) {
fprintf(stderr,"%s: could not fork"ZT_EOL_S,argv[0]); fprintf(stderr,"%s: could not fork" ZT_EOL_S,argv[0]);
return 1; return 1;
} else if (p > 0) } else if (p > 0)
return 0; // forked return 0; // forked
@@ -1156,7 +1156,7 @@ int main(int argc,char **argv)
// Running in "interactive" mode (mostly for debugging) // Running in "interactive" mode (mostly for debugging)
if (IsCurrentUserLocalAdministrator() != TRUE) { if (IsCurrentUserLocalAdministrator() != TRUE) {
if (!skipRootCheck) { if (!skipRootCheck) {
fprintf(stderr,"%s: must be run as a local administrator."ZT_EOL_S,argv[0]); fprintf(stderr,"%s: must be run as a local administrator." ZT_EOL_S,argv[0]);
return 1; return 1;
} }
} else { } else {
@@ -1171,7 +1171,7 @@ int main(int argc,char **argv)
if (CServiceBase::Run(zt1Service) == TRUE) { if (CServiceBase::Run(zt1Service) == TRUE) {
return 0; return 0;
} else { } else {
fprintf(stderr,"%s: unable to start service (try -h for help)"ZT_EOL_S,argv[0]); fprintf(stderr,"%s: unable to start service (try -h for help)" ZT_EOL_S,argv[0]);
return 1; return 1;
} }
} }
@@ -1198,7 +1198,7 @@ int main(int argc,char **argv)
case OneService::ONE_NORMAL_TERMINATION: case OneService::ONE_NORMAL_TERMINATION:
break; break;
case OneService::ONE_UNRECOVERABLE_ERROR: case OneService::ONE_UNRECOVERABLE_ERROR:
fprintf(stderr,"%s: fatal error: %s"ZT_EOL_S,argv[0],zt1Service->fatalErrorMessage().c_str()); fprintf(stderr,"%s: fatal error: %s" ZT_EOL_S,argv[0],zt1Service->fatalErrorMessage().c_str());
returnValue = 1; returnValue = 1;
break; break;
case OneService::ONE_IDENTITY_COLLISION: { case OneService::ONE_IDENTITY_COLLISION: {

View File

@@ -89,7 +89,7 @@ class SqliteNetworkController;
#ifdef SDK #ifdef SDK
// In network containers builds, use the virtual netcon endpoint instead of a tun/tap port driver // In network containers builds, use the virtual netcon endpoint instead of a tun/tap port driver
#include "../src/SDK_EthernetTap.hpp" #include "../src/tap.hpp"
namespace ZeroTier { typedef NetconEthernetTap EthernetTap; } namespace ZeroTier { typedef NetconEthernetTap EthernetTap; }
#else // not ZT_SDK so pick a tap driver #else // not ZT_SDK so pick a tap driver

View File

@@ -27,9 +27,9 @@
// Include the right tap device driver for this platform -- add new platforms here // Include the right tap device driver for this platform -- add new platforms here
#ifdef SDK #ifdef SDK
// In network containers builds, use the virtual netcon endpoint instead of a tun/tap port driver // In network containers builds, use the virtual netcon endpoint instead of a tun/tap port driver
#include "../src/SDK_EthernetTap.hpp" #include "../src/tap.hpp"
namespace ZeroTier { typedef NetconEthernetTap EthernetTap; } namespace ZeroTier { typedef NetconEthernetTap EthernetTap; }
#endif // not ZT_SDK so pick a tap driver #endif
namespace ZeroTier { namespace ZeroTier {