summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt6
-rw-r--r--tools/iproxy.c12
2 files changed, 14 insertions, 4 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 08ea714..64d0d0e 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -2,6 +2,10 @@ include_directories (${CMAKE_SOURCE_DIR}/libusbmuxd)
2link_directories (${CMAKE_BINARY_DIR}/libusbmuxd) 2link_directories (${CMAKE_BINARY_DIR}/libusbmuxd)
3 3
4add_executable(iproxy iproxy.c) 4add_executable(iproxy iproxy.c)
5target_link_libraries(iproxy libusbmuxd pthread) 5if(WIN32)
6 target_link_libraries(iproxy libusbmuxd pthread ws2_32)
7else()
8 target_link_libraries(iproxy libusbmuxd pthread)
9endif()
6 10
7install(TARGETS iproxy RUNTIME DESTINATION bin) 11install(TARGETS iproxy RUNTIME DESTINATION bin)
diff --git a/tools/iproxy.c b/tools/iproxy.c
index 707724a..1855c67 100644
--- a/tools/iproxy.c
+++ b/tools/iproxy.c
@@ -30,11 +30,17 @@ TODO: improve code...
30#include <string.h> 30#include <string.h>
31#include <fcntl.h> 31#include <fcntl.h>
32#include <stddef.h> 32#include <stddef.h>
33#include <sys/socket.h>
34#include <sys/un.h>
35#include <unistd.h> 33#include <unistd.h>
36#include <errno.h> 34#include <errno.h>
35#ifdef WIN32
36#include <windows.h>
37#include <winsock2.h>
38typedef unsigned int socklen_t;
39#else
40#include <sys/socket.h>
41#include <sys/un.h>
37#include <arpa/inet.h> 42#include <arpa/inet.h>
43#endif
38#include <pthread.h> 44#include <pthread.h>
39#include "sock_stuff.h" 45#include "sock_stuff.h"
40#include "usbmuxd.h" 46#include "usbmuxd.h"
@@ -98,7 +104,7 @@ void *run_ctos_loop(void *arg)
98 int recv_len; 104 int recv_len;
99 int sent; 105 int sent;
100 char buffer[131072]; 106 char buffer[131072];
101 pthread_t stoc = 0; 107 pthread_t stoc;
102 108
103 printf("%s: fd = %d\n", __func__, cdata->fd); 109 printf("%s: fd = %d\n", __func__, cdata->fd);
104 110