mirror of
https://github.com/zerotier/libzt.git
synced 2026-09-22 15:29:08 -07:00
Removed old attic files. Updated test checks
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
var http = require('http');
|
||||
var server = http.createServer(function (request, response) {
|
||||
response.writeHead(200, {"Content-Type": "text/plain"});
|
||||
response.end("\n\nWelcome to the machine!\n\n");
|
||||
});
|
||||
server.listen(80);
|
||||
console.log("Server running!");
|
||||
-603
File diff suppressed because it is too large
Load Diff
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 1999
|
||||
* Berkeley Software Design, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
|
||||
*/
|
||||
|
||||
#ifndef _IFADDRS_H_
|
||||
#define _IFADDRS_H_
|
||||
|
||||
struct ifaddrs {
|
||||
struct ifaddrs *ifa_next;
|
||||
char *ifa_name;
|
||||
unsigned int ifa_flags;
|
||||
struct sockaddr *ifa_addr;
|
||||
struct sockaddr *ifa_netmask;
|
||||
struct sockaddr *ifa_dstaddr;
|
||||
void *ifa_data;
|
||||
};
|
||||
|
||||
/*
|
||||
* This may have been defined in <net/if.h>. Note that if <net/if.h> is
|
||||
* to be included it must be included before this header file.
|
||||
*/
|
||||
#ifndef ifa_broadaddr
|
||||
#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern int getifaddrs(struct ifaddrs **ifap);
|
||||
extern void freeifaddrs(struct ifaddrs *ifa);
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
# This script is only needed for debugging purposes
|
||||
|
||||
cp libzerotierintercept.so /lib/libzerotierintercept.so
|
||||
ln -sf /lib/libzerotierintercept.so /lib/libzerotierintercept
|
||||
/usr/bin/install -c zerotier-intercept /usr/bin
|
||||
|
||||
# rm -r /lib/libzerotierintercept.so
|
||||
# rm -r /lib/libzerotierintercept
|
||||
# rm -r /usr/bin/zerotier-intercept
|
||||
-270
@@ -1,270 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/time.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#include "netcon.h"
|
||||
#include "RPC.h"
|
||||
|
||||
void monitor_fds();
|
||||
void test_poll_loop();
|
||||
|
||||
#define MIN_FD 3
|
||||
#define SET_SZ 10
|
||||
|
||||
void die(const char *str) {
|
||||
perror(str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int make_nonblocking(int fd) {
|
||||
int flags;
|
||||
if (-1 == (flags = fcntl(fd, F_GETFL)))
|
||||
return -1;
|
||||
flags |= O_NONBLOCK;
|
||||
if (-1 == fcntl(fd, F_SETFL, flags))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void changeling()
|
||||
{
|
||||
set_netpath("/root/dev/ztest/nc_e5cd7a9e1c7d408c");
|
||||
pthread_t monitor_thread;
|
||||
pthread_t poll_thread;
|
||||
int i = 7;
|
||||
// Socket monitor and swap thread
|
||||
if(pthread_create(&monitor_thread, NULL, monitor_fds, (void *)i)) {
|
||||
die("unable to start changeling thread\n");
|
||||
}
|
||||
// Test poll loop thread
|
||||
if(pthread_create(&poll_thread, NULL, test_poll_loop, (void *)i)) {
|
||||
die("unable to start test poll loop thread\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void test_poll_loop()
|
||||
{
|
||||
printf("[POLL test thread]\n");
|
||||
fd_set in_set, rfds, wfds, efds;
|
||||
struct timeval tmout;
|
||||
//tmout.tv_usec = 8000000;
|
||||
int ev;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
//printf("polling...\n");
|
||||
FD_ZERO(&in_set);
|
||||
FD_SET(4, &in_set);
|
||||
ev = select(4+1, &rfds, &wfds, &efds, NULL);
|
||||
if(ev == -1)
|
||||
{
|
||||
// perror("select");
|
||||
}
|
||||
if(ev > 0) {
|
||||
printf("ev = %d\n", ev);
|
||||
if(FD_ISSET(4, &rfds)) {
|
||||
printf("[Read] event detected!, ev = %d\n", ev);
|
||||
}
|
||||
if(FD_ISSET(4, &wfds)) {
|
||||
printf("[Write] event detected!, ev = %d\n", ev);
|
||||
}
|
||||
if(FD_ISSET(4, &efds)) {
|
||||
printf("[Exception] event detected!, ev = %d\n", ev);
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int vnode_events = NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | NOTE_LINK | NOTE_RENAME | NOTE_REVOKE;
|
||||
|
||||
char *flagstring(int flags)
|
||||
{
|
||||
static char ret[512];
|
||||
char *or = "";
|
||||
|
||||
ret[0]='\0'; // clear the string.
|
||||
if (flags & NOTE_DELETE) {strcat(ret,or);strcat(ret,"NOTE_DELETE");or="|";}
|
||||
if (flags & NOTE_WRITE) {strcat(ret,or);strcat(ret,"NOTE_WRITE");or="|";}
|
||||
if (flags & NOTE_EXTEND) {strcat(ret,or);strcat(ret,"NOTE_EXTEND");or="|";}
|
||||
if (flags & NOTE_ATTRIB) {strcat(ret,or);strcat(ret,"NOTE_ATTRIB");or="|";}
|
||||
if (flags & NOTE_LINK) {strcat(ret,or);strcat(ret,"NOTE_LINK");or="|";}
|
||||
if (flags & NOTE_RENAME) {strcat(ret,or);strcat(ret,"NOTE_RENAME");or="|";}
|
||||
if (flags & NOTE_REVOKE) {strcat(ret,or);strcat(ret,"NOTE_REVOKE");or="|";}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void monitor_fds(){
|
||||
printf("[MONITOR thread]\n");
|
||||
struct timespec tmout = { 0, /* s */ 500000 /* ns */ };
|
||||
struct kevent evSet[SET_SZ];
|
||||
struct kevent evList[32];
|
||||
int fd, kq, nev, i;
|
||||
struct sockaddr_storage addr;
|
||||
socklen_t socklen = sizeof(addr);
|
||||
|
||||
int s = 3;
|
||||
|
||||
// Get new kernel event queue
|
||||
kq = kqueue();
|
||||
|
||||
// For tracking changes in open fds
|
||||
int watch_list_sz = SET_SZ;
|
||||
int registered_sz = 0;
|
||||
int last_registered_sz = 0;
|
||||
|
||||
int swap = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
registered_sz=0;
|
||||
/* Register range of idents */
|
||||
for(int i=MIN_FD; i<SET_SZ; i++)
|
||||
{
|
||||
//printf("EV_SET fd = %d\n", i);
|
||||
//EV_SET(&evSet[i-MIN_FD], i, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
|
||||
EV_SET(&evSet[i-MIN_FD], i, EVFILT_VNODE, EV_ADD | EV_CLEAR, vnode_events, 0, NULL);
|
||||
//if(kevent(kq, &evSet[i-MIN_FD], 1, NULL, 0, NULL) == -1) {
|
||||
//printf("\tunable to register (fd = %d)\n", i);
|
||||
//}
|
||||
//else {
|
||||
// registered_sz++;
|
||||
//}
|
||||
}
|
||||
|
||||
/* Check for events */
|
||||
if (-1 == (nev = kevent(kq, evSet, SET_SZ-MIN_FD, evList, 32, &tmout))) {
|
||||
perror("kevent()");
|
||||
//die("kevent()");
|
||||
}
|
||||
|
||||
int fd_delta = registered_sz > last_registered_sz;
|
||||
if(fd_delta) {
|
||||
printf("NEW fd registered!\n");
|
||||
}
|
||||
last_registered_sz = registered_sz;
|
||||
|
||||
|
||||
|
||||
int s=4;
|
||||
|
||||
// Check on newly created sockets
|
||||
if(!swap && fd_delta && true==false)
|
||||
{
|
||||
swap = 1;
|
||||
printf("new socket detected zt_socket = %p\n", (void*)&zt_socket);
|
||||
|
||||
int opt;
|
||||
socklen_t opt_len;
|
||||
int err;
|
||||
|
||||
int newsock = zt_socket(AF_INET, SOCK_STREAM, 0);
|
||||
printf("newsock = %d\n", newsock);
|
||||
err = dup2(newsock, s);
|
||||
//printf("dup2() = %d\n", err);
|
||||
sleep(5);
|
||||
|
||||
/*
|
||||
if((err = getsockopt(s, SOL_SOCKET, SO_TYPE, (void*)&opt, &opt_len)) < 0) {
|
||||
printf("getsockopt(): err = %d\n", err);
|
||||
}
|
||||
if(opt && SOCK_STREAM) {
|
||||
printf("SOCK_STREAM socket detected!\n");
|
||||
sleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("opt = %d\n", opt);
|
||||
}*/
|
||||
}
|
||||
//printf("Complete\n");
|
||||
|
||||
// Check on incoming connections
|
||||
if(fd_delta && true == false)
|
||||
{
|
||||
// Peer name check
|
||||
socklen_t len;
|
||||
struct sockaddr_storage addr;
|
||||
char ipstr[INET6_ADDRSTRLEN];
|
||||
int port;
|
||||
|
||||
len = sizeof(addr);
|
||||
getpeername(s, (struct sockaddr *)&addr, &len);
|
||||
|
||||
if (addr.ss_family == AF_INET) {
|
||||
struct sockaddr_in *s = (struct sockaddr_in *)&addr;
|
||||
port = ntohs(s->sin_port);
|
||||
inet_ntop(AF_INET, &s->sin_addr, ipstr, sizeof ipstr);
|
||||
}
|
||||
/* else { // AF_INET6
|
||||
struct sockaddr_in6 *s = (struct sockaddr_in6 *)&addr;
|
||||
port = ntohs(s->sin6_port);
|
||||
inet_ntop(AF_INET6, &s->sin6_addr, ipstr, sizeof ipstr);
|
||||
}
|
||||
*/
|
||||
|
||||
printf("Peer IP address: %s\n", ipstr);
|
||||
printf("Peer port : %d\n", port);
|
||||
|
||||
sleep(10);
|
||||
|
||||
printf("calling zt_socket()...\n");
|
||||
int intercepted_fd = zt_socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(-1 == dup2(evList[i].ident, intercepted_fd)) {
|
||||
perror("dup2():");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Process events */
|
||||
if(nev /*&& fd_delta*/)
|
||||
{
|
||||
printf("kevent() = %d\n", nev);
|
||||
for (int i = 0; i < nev; i++) {
|
||||
|
||||
/*
|
||||
if(evList[i].ident == 4)
|
||||
{
|
||||
printf("calling zt_socket()...\n");
|
||||
int intercepted_fd = zt_socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(-1 == dup2(evList[i].ident, intercepted_fd)) {
|
||||
perror("dup2():");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
printf("\tEVENT on (%d)\n", evList[i].ident);
|
||||
printf("\t\tevent[%d].ident = %d\n", i, evList[i].ident);
|
||||
printf("\t\tevent[%d].filter = %d\n", i, evList[i].filter);
|
||||
printf("\t\tevent[%d].flags = %d\n", i, evList[i].flags);
|
||||
if(evList[i].flags & EVFILT_READ) { printf("\t\t\tEVFILT_READ\n"); }
|
||||
if(evList[i].flags & EVFILT_WRITE) { printf("\t\t\tEVFILT_WRITE\n"); }
|
||||
if(evList[i].flags & EVFILT_AIO) { printf("\t\t\tEVFILT_AIO\n"); }
|
||||
if(evList[i].flags & EVFILT_VNODE) { printf("\t\t\tEVFILT_VNODE\n"); }
|
||||
if(evList[i].flags & EVFILT_PROC) { printf("\t\t\tEVFILT_PROC\n"); }
|
||||
printf("\t\tevent[%d].fflags = %d\n", i, evList[i].fflags);
|
||||
if(evList[i].fflags > 0)
|
||||
printf("\t\t\tfflags = %s\n", flagstring(evList[i].fflags));
|
||||
printf("\t\tevent[%d].data = %d\n", i, evList[i].data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
int changeling();
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/time.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
|
||||
void monitor_fds();
|
||||
|
||||
#define MIN_FD 0
|
||||
#define SET_SZ 10
|
||||
|
||||
void die(const char *str) {
|
||||
perror(str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int make_nonblocking(int fd) {
|
||||
int flags;
|
||||
if (-1 == (flags = fcntl(fd, F_GETFL)))
|
||||
return -1;
|
||||
flags |= O_NONBLOCK;
|
||||
if (-1 == fcntl(fd, F_SETFL, flags))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void changeling()
|
||||
{
|
||||
pthread_t thread;
|
||||
int i = 7;
|
||||
if(pthread_create(&thread, NULL, monitor_fds, (void *)i)) {
|
||||
die("unable to start changeling thread\n");
|
||||
}
|
||||
}
|
||||
|
||||
struct timespec tmout = { 0, /* s */ 500000 /* ns */ };
|
||||
|
||||
void monitor_fds(){
|
||||
sleep(5);
|
||||
printf("monitor_fds()...\n");
|
||||
/*
|
||||
struct kevent changeList[SET_SZ];
|
||||
struct kevent eventList[SET_SZ];
|
||||
int sockfd, nev, kq;
|
||||
ssize_t nbytes;
|
||||
int error;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
if (-1 == (kq = kqueue()))
|
||||
die("kqueue()");
|
||||
for(int i=MIN_FD;i<SET_SZ; i++)
|
||||
{
|
||||
printf("registering (%d)\n", i);
|
||||
EV_SET(&changeList[i-MIN_FD], i, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0);
|
||||
//if (-1 == kevent(kq, change, 2, NULL, 0, NULL))
|
||||
// printf(" unable to register (%d)\n", i);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
struct kevent evSet;
|
||||
struct kevent evList[32];
|
||||
int nev, i;
|
||||
struct sockaddr_storage addr;
|
||||
socklen_t socklen = sizeof(addr);
|
||||
int fd;
|
||||
|
||||
int local_s = 3;
|
||||
int kq;
|
||||
|
||||
kq = kqueue();
|
||||
|
||||
EV_SET(&evSet, local_s, EVFILT_READ, EV_ADD, 0, 0, NULL);
|
||||
if (kevent(kq, &evSet, 1, NULL, 0, NULL) == -1)
|
||||
err(1, "1kevent");
|
||||
|
||||
|
||||
printf("watching...\n");
|
||||
for (;;)
|
||||
{
|
||||
if (-1 == (nev = kevent(kq, NULL, 0, evList, 32, NULL)))
|
||||
die("2kevent()");
|
||||
if(nev)
|
||||
{
|
||||
printf("kevent() = %d\n", nev);
|
||||
for (int i = 0; i < nev; i++) {
|
||||
printf("\tevent[%d].ident = %d\n", i, evList[i].ident);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "RPC.h"
|
||||
#include "netcon.h"
|
||||
#include "ztproxy.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("hello from proxy\n");
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
CC=cc
|
||||
CXX=c++
|
||||
|
||||
INCLUDES=
|
||||
DEFS=
|
||||
LIBS=
|
||||
|
||||
include objects.mk
|
||||
OBJS+=osdep/BSDEthernetTap.o
|
||||
|
||||
# "make official" is a shortcut for this
|
||||
ifeq ($(ZT_OFFICIAL_RELEASE),1)
|
||||
DEFS+=-DZT_OFFICIAL_RELEASE
|
||||
endif
|
||||
|
||||
# Build with ZT_ENABLE_CLUSTER=1 to build with cluster support
|
||||
ifeq ($(ZT_ENABLE_CLUSTER),1)
|
||||
DEFS+=-DZT_ENABLE_CLUSTER
|
||||
endif
|
||||
|
||||
# "make debug" is a shortcut for this
|
||||
ifeq ($(ZT_DEBUG),1)
|
||||
DEFS+=-DZT_TRACE
|
||||
CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
||||
LDFLAGS+=
|
||||
STRIP=echo
|
||||
# The following line enables optimization for the crypto code, since
|
||||
# C25519 in particular is almost UNUSABLE in heavy testing without it.
|
||||
ext/lz4/lz4.o node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
|
||||
else
|
||||
CFLAGS?=-O3 -fstack-protector
|
||||
CFLAGS+=-Wall -fPIE -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
LDFLAGS+=-pie -Wl,-z,relro,-z,now
|
||||
STRIP=strip --strip-all
|
||||
endif
|
||||
|
||||
CXXFLAGS+=$(CFLAGS) -fno-rtti
|
||||
|
||||
all: one
|
||||
|
||||
one: $(OBJS) service/OneService.o one.o
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one $(OBJS) service/OneService.o one.o $(LIBS)
|
||||
$(STRIP) zerotier-one
|
||||
ln -sf zerotier-one zerotier-idtool
|
||||
ln -sf zerotier-one zerotier-cli
|
||||
|
||||
selftest: $(OBJS) selftest.o
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
|
||||
$(STRIP) zerotier-selftest
|
||||
|
||||
# No installer on FreeBSD yet
|
||||
#installer: one FORCE
|
||||
# ./buildinstaller.sh
|
||||
|
||||
clean:
|
||||
rm -rf *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-*
|
||||
|
||||
debug: FORCE
|
||||
make -j 4 ZT_DEBUG=1
|
||||
|
||||
#official: FORCE
|
||||
# make -j 4 ZT_OFFICIAL_RELEASE=1
|
||||
# ./buildinstaller.sh
|
||||
|
||||
FORCE:
|
||||
+28
-7
@@ -87,18 +87,39 @@ linux_shared_lib: $(OBJS)
|
||||
ln -sf zerotier-sdk-service zerotier-cli
|
||||
ln -sf zerotier-sdk-service zerotier-idtool
|
||||
|
||||
# Check for the presence of built frameworks/bundles/libaries
|
||||
check:
|
||||
./check.sh build/lwip/liblwip.so
|
||||
./check.sh build/linux_shared_lib/libztintercept.so
|
||||
./check.sh build/lwip/liblwip.so
|
||||
./check.sh build/linux_shared_lib/libztintercept.so
|
||||
|
||||
./check.sh build/
|
||||
./check.sh build/android_jni_lib/arm64-v8a/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/armeabi/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/armeabi-v7a/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/mips/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/mips64/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/x86/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/x86_64/libZeroTierJNI.so
|
||||
|
||||
|
||||
# Tests
|
||||
TEST_OBJDIR := build/tests
|
||||
TEST_SOURCES := $(wildcard tests/*.c)
|
||||
TEST_TARGETS := $(addprefix build/tests/,$(notdir $(TEST_SOURCES:.c=.out)))
|
||||
|
||||
build/tests/%.out: tests/%.c
|
||||
-$(CC) $(CC_FLAGS) -c -o $@ $<
|
||||
|
||||
$(TEST_OBJDIR):
|
||||
mkdir -p $(TEST_OBJDIR)
|
||||
|
||||
tests: $(TEST_OBJDIR) $(TEST_TARGETS)
|
||||
mkdir -p build/tests;
|
||||
|
||||
clean:
|
||||
rm -rf ${GENERATED_FILES}
|
||||
rm -rf zerotier-cli zerotier-idtool
|
||||
rm -rf build/*
|
||||
find . -type f -name '*.a' -delete
|
||||
find . -type f -name '*.o' -delete
|
||||
find . -type f -name '*.so' -delete
|
||||
find . -type f -name '*.o.d' -delete
|
||||
find . -type f \( -name '*.o' -o -name '*.so' -o -name '*.o.d' -o -name '*.out' \) -delete
|
||||
# Remove junk generated by Android builds
|
||||
cd integrations/Android/proj; ./gradlew clean
|
||||
rm -rf integrations/Android/proj/.gradle
|
||||
|
||||
+21
-18
@@ -96,6 +96,7 @@ osx_shared_lib: $(OBJS)
|
||||
prep:
|
||||
cp integrations/android/android_jni_lib/java/libs/* build
|
||||
|
||||
# Check for the presence of built frameworks/bundles/libaries
|
||||
check:
|
||||
./check.sh build/lwip/liblwip.so
|
||||
|
||||
@@ -107,37 +108,39 @@ check:
|
||||
./check.sh build/ios_unity3d_bundle/Debug-iphoneos/ZeroTierSDK_Unity3D_iOS.bundle
|
||||
|
||||
./check.sh build/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/
|
||||
./check.sh build/android_jni_lib/arm64-v8a/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/armeabi/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/armeabi-v7a/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/mips/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/mips64/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/x86/libZeroTierJNI.so
|
||||
./check.sh build/android_jni_lib/x86_64/libZeroTierJNI.so
|
||||
|
||||
./check.sh build/
|
||||
./check.sh build/
|
||||
|
||||
selftest:
|
||||
# Tests
|
||||
TEST_OBJDIR := build/tests
|
||||
TEST_SOURCES := $(wildcard tests/*.c)
|
||||
TEST_TARGETS := $(addprefix build/tests/,$(notdir $(TEST_SOURCES:.c=.out)))
|
||||
|
||||
build/tests/%.out: tests/%.c
|
||||
-$(CC) $(CC_FLAGS) -c -o $@ $<
|
||||
|
||||
$(TEST_OBJDIR):
|
||||
mkdir -p $(TEST_OBJDIR)
|
||||
|
||||
tests: $(TEST_OBJDIR) $(TEST_TARGETS)
|
||||
mkdir -p build/tests;
|
||||
|
||||
clean:
|
||||
rm -rf zerotier-cli zerotier-idtool
|
||||
|
||||
rm -rf build/*
|
||||
find . -type f -name '*.o' -delete
|
||||
find . -type f -name '*.so' -delete
|
||||
find . -type f -name '*.o.d' -delete
|
||||
|
||||
find . -type f \( -name '*.o' -o -name '*.so' -o -name '*.o.d' -o -name '*.out' \) -delete
|
||||
# android JNI lib project
|
||||
cd integrations/android/android_jni_lib/proj; ./gradlew clean
|
||||
rm -rf integrations/android/android_jni_lib/proj/.gradle
|
||||
rm -rf integrations/android/android_jni_lib/proj/.idea
|
||||
rm -rf integrations/android/android_jni_lib/proj/build
|
||||
|
||||
# example android app project
|
||||
cd integrations/android/example_app; ./gradlew clean
|
||||
rm -rf integrations/android/example_app/.idea
|
||||
rm -rf integrations/android/example_app/.gradle
|
||||
FORCE:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user