move contents of signitures.h into sdk.h

This commit is contained in:
Joseph Henry
2017-03-02 13:41:54 -08:00
parent 889430e820
commit 92a0cd2cac
7 changed files with 33 additions and 68 deletions

View File

@@ -30,7 +30,6 @@
7C7D528C1DBEADE600896C93 /* proxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527A1DBEADD200896C93 /* proxy.cpp */; };
7C7D528D1DBEADE600896C93 /* rpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527B1DBEADD200896C93 /* rpc.c */; };
7C7D528F1DBEADE600896C93 /* service.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527D1DBEADD200896C93 /* service.cpp */; };
7C7D52901DBEADE600896C93 /* signatures.h in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527E1DBEADD200896C93 /* signatures.h */; };
7C7D52911DBEADE600896C93 /* sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D527F1DBEADD200896C93 /* sockets.c */; };
7C7D52921DBEADE600896C93 /* tap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52801DBEADD200896C93 /* tap.cpp */; };
7C7D52931DBEADE600896C93 /* tap.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7D52811DBEADD200896C93 /* tap.hpp */; };
@@ -302,7 +301,6 @@
7C7D527B1DBEADD200896C93 /* rpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rpc.c; path = ../../../src/rpc.c; sourceTree = "<group>"; };
7C7D527C1DBEADD200896C93 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rpc.h; path = ../../../src/rpc.h; sourceTree = "<group>"; };
7C7D527D1DBEADD200896C93 /* service.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = service.cpp; path = ../../../src/service.cpp; sourceTree = "<group>"; };
7C7D527E1DBEADD200896C93 /* signatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = signatures.h; path = ../../../src/signatures.h; sourceTree = "<group>"; };
7C7D527F1DBEADD200896C93 /* sockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sockets.c; path = ../../../src/sockets.c; sourceTree = "<group>"; };
7C7D52801DBEADD200896C93 /* tap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tap.cpp; path = ../../../src/tap.cpp; sourceTree = "<group>"; };
7C7D52811DBEADD200896C93 /* tap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = tap.hpp; path = ../../../src/tap.hpp; sourceTree = "<group>"; };
@@ -769,7 +767,6 @@
7C7D527B1DBEADD200896C93 /* rpc.c */,
7C7D527C1DBEADD200896C93 /* rpc.h */,
7C7D527D1DBEADD200896C93 /* service.cpp */,
7C7D527E1DBEADD200896C93 /* signatures.h */,
7C7D527F1DBEADD200896C93 /* sockets.c */,
7C7D52801DBEADD200896C93 /* tap.cpp */,
7C7D52811DBEADD200896C93 /* tap.hpp */,
@@ -1143,7 +1140,6 @@
7C7D528C1DBEADE600896C93 /* proxy.cpp in Sources */,
7C7D528D1DBEADE600896C93 /* rpc.c in Sources */,
7C7D528F1DBEADE600896C93 /* service.cpp in Sources */,
7C7D52901DBEADE600896C93 /* signatures.h in Sources */,
7C7D52911DBEADE600896C93 /* sockets.c in Sources */,
7C7D52921DBEADE600896C93 /* tap.cpp in Sources */,
7C7D52931DBEADE600896C93 /* tap.hpp in Sources */,

View File

@@ -46,7 +46,31 @@
#include <sys/socket.h>
#include <stdbool.h>
#include "signatures.h"
#define SETSOCKOPT_SIG int fd, int level, int optname, const void *optval, socklen_t optlen
#define GETSOCKOPT_SIG int fd, int level, int optname, void *optval, socklen_t *optlen
#define SENDMSG_SIG int fd, const struct msghdr *msg, int flags
#define SENDTO_SIG int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t addrlen
#define RECV_SIG int fd, void *buf, size_t len, int flags
#define RECVFROM_SIG int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen
#define RECVMSG_SIG int fd, struct msghdr *msg,int flags
#define SEND_SIG int fd, const void *buf, size_t len, int flags
#define WRITE_SIG int fd, const void *buf, size_t len
#define READ_SIG int fd, void *buf, size_t len
#define SOCKET_SIG int socket_family, int socket_type, int protocol
#define CONNECT_SIG int fd, const struct sockaddr *addr, socklen_t addrlen
#define BIND_SIG int fd, const struct sockaddr *addr, socklen_t addrlen
#define LISTEN_SIG int fd, int backlog
#define ACCEPT4_SIG int fd, struct sockaddr *addr, socklen_t *addrlen, int flags
#define ACCEPT_SIG int fd, struct sockaddr *addr, socklen_t *addrlen
#define CLOSE_SIG int fd
#define GETSOCKNAME_SIG int fd, struct sockaddr *addr, socklen_t *addrlen
#define GETPEERNAME_SIG int fd, struct sockaddr *addr, socklen_t *addrlen
#define FCNTL_SIG int fd, int cmd, int flags
#define SYSCALL_SIG long number, ...
#if defined(__ANDROID__)
#include <jni.h>
@@ -120,6 +144,13 @@ int zts_get_device_id();
bool zts_is_relayed();
char *zts_get_homepath();
// ZT Intercept/RPC Controls
// TODO: Remove any?
//void set_intercept_status(int mode); // TODO: Rethink this
//void init_service(int key, const char * path);
//void init_service_and_rpc(int key, const char * path, const char * nwid);
//void init_intercept(int key);
int zts_socket(SOCKET_SIG);
int zts_connect(CONNECT_SIG);
int zts_bind(BIND_SIG);
@@ -195,7 +226,7 @@ ssize_t zts_recvmsg(RECVMSG_SIG);
// Prototypes for redefinition of syscalls
// - Implemented in intercept.c
// - Implemented in SDK_Intercept.c
#if defined(SDK_INTERCEPT)
int socket(SOCKET_SIG);
int connect(CONNECT_SIG);

View File

@@ -162,7 +162,6 @@ void zts_stop_service() {
bool zts_has_address(const char *nwid)
{
DEBUG_ERROR();
char ipv4_addr[64], ipv6_addr[64];
memset(ipv4_addr, 0, 64);
memset(ipv6_addr, 0, 64);

View File

@@ -1,58 +0,0 @@
/*
* ZeroTier One - Network Virtualization Everywhere
* Copyright (C) 2011-2015 ZeroTier, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --
*
* ZeroTier may be used and distributed under the terms of the GPLv3, which
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
*
* If you would like to embed ZeroTier into a commercial application or
* redistribute it in a modified binary form, please contact ZeroTier Networks
* LLC. Start here: http://www.zerotier.com/
*/
#ifndef _SDK_SIGNATURES_H
#define _SDK_SIGNATURES_H 1
#include <sys/socket.h>
#define SETSOCKOPT_SIG int fd, int level, int optname, const void *optval, socklen_t optlen
#define GETSOCKOPT_SIG int fd, int level, int optname, void *optval, socklen_t *optlen
#define SENDMSG_SIG int fd, const struct msghdr *msg, int flags
#define SENDTO_SIG int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t addrlen
#define RECV_SIG int fd, void *buf, size_t len, int flags
#define RECVFROM_SIG int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen
#define RECVMSG_SIG int fd, struct msghdr *msg,int flags
#define SEND_SIG int fd, const void *buf, size_t len, int flags
#define WRITE_SIG int fd, const void *buf, size_t len
#define READ_SIG int fd, void *buf, size_t len
#define SOCKET_SIG int socket_family, int socket_type, int protocol
#define CONNECT_SIG int fd, const struct sockaddr *addr, socklen_t addrlen
#define BIND_SIG int fd, const struct sockaddr *addr, socklen_t addrlen
#define LISTEN_SIG int fd, int backlog
#define ACCEPT4_SIG int fd, struct sockaddr *addr, socklen_t *addrlen, int flags
#define ACCEPT_SIG int fd, struct sockaddr *addr, socklen_t *addrlen
#define CLOSE_SIG int fd
#define GETSOCKNAME_SIG int fd, struct sockaddr *addr, socklen_t *addrlen
#define GETPEERNAME_SIG int fd, struct sockaddr *addr, socklen_t *addrlen
#define FCNTL_SIG int fd, int cmd, int flags
#define SYSCALL_SIG long number, ...
#endif // _SDK_SIGNATURES_H

View File

@@ -71,7 +71,6 @@
#define SOCK_TYPE_MASK 0xf
#include "sdk.h"
#include "signatures.h"
#include "debug.h"
#include "rpc.h"

View File

@@ -6,7 +6,6 @@
#define Example_OSX_IOS_Bridging_Header_h
#include <sys/socket.h>
#include "signatures.h"
// ZT INTERCEPT/RPC CONTROLS
int zt_init_rpc(const char *path, const char *nwid);

View File

@@ -27,7 +27,6 @@
#include "sdk.h"
#include "XcodeWrapper.hpp"
#include "signatures.h"
#define INTERCEPT_ENABLED 111
#define INTERCEPT_DISABLED 222