documentation/API update
This commit is contained in:
37
src/SDK_Apple-Bridging-Header.h
Normal file
37
src/SDK_Apple-Bridging-Header.h
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#ifndef Example_OSX_Bridging_Header_h
|
||||
#define Example_OSX_Bridging_Header_h
|
||||
|
||||
int start_intercept();
|
||||
void start_service(const char * path);
|
||||
void join_network(const char * nwid);
|
||||
void disable_intercept();
|
||||
void enable_intercept();
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include "SDK_Signatures.h"
|
||||
|
||||
void zt_join_network(const char *nwid);
|
||||
void zt_leave_network(const char *nwid);
|
||||
|
||||
// Direct Call ZT API
|
||||
// These functions will provide direct access to ZT-enabled sockets with no hassle
|
||||
int zts_init_rpc(const char *path, const char *nwid);
|
||||
int zts_connect(CONNECT_SIG);
|
||||
int zts_bind(BIND_SIG);
|
||||
int zts_accept(ACCEPT_SIG);
|
||||
int zts_listen(LISTEN_SIG);
|
||||
int zts_socket(SOCKET_SIG);
|
||||
int zts_setsockopt(SETSOCKOPT_SIG);
|
||||
int zts_getsockopt(GETSOCKOPT_SIG);
|
||||
int zts_close(CLOSE_SIG);
|
||||
int zts_getsockname(GETSOCKNAME_SIG);
|
||||
|
||||
|
||||
#endif /* Example_OSX_Bridging_Header_h */
|
||||
|
||||
|
||||
|
||||
@@ -90,8 +90,11 @@ void zt_init_rpc(const char * path, const char * nwid);
|
||||
if(!ZeroTier::OSUtils::writeFile(confFile.c_str(), "")) {
|
||||
LOGV("unable to write network conf file: %s\n", confFile.c_str());
|
||||
}
|
||||
zt1Service->join(nwid);
|
||||
zt_init_rpc(homeDir.c_str(), nwid); // This provides the shim API with the RPC information
|
||||
LOGV("zt1Service = %x\n", (void*)zt1Service);
|
||||
|
||||
//zt1Service->join(nwid);
|
||||
LOGV("started up\n");
|
||||
//zt_init_rpc(homeDir.c_str(), nwid); // This provides the shim API with the RPC information
|
||||
}
|
||||
|
||||
void leave_network(const char *nwid) { zt1Service->leave(nwid); }
|
||||
@@ -195,6 +198,7 @@ void zt_init_rpc(const char * path, const char * nwid);
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
homeDir = "/sdcard/zerotier";
|
||||
join_network("565799d8f65063e5");
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
||||
Reference in New Issue
Block a user