diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | tools/iproxy.c | 12 |
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) | |||
| 2 | link_directories (${CMAKE_BINARY_DIR}/libusbmuxd) | 2 | link_directories (${CMAKE_BINARY_DIR}/libusbmuxd) |
| 3 | 3 | ||
| 4 | add_executable(iproxy iproxy.c) | 4 | add_executable(iproxy iproxy.c) |
| 5 | target_link_libraries(iproxy libusbmuxd pthread) | 5 | if(WIN32) |
| 6 | target_link_libraries(iproxy libusbmuxd pthread ws2_32) | ||
| 7 | else() | ||
| 8 | target_link_libraries(iproxy libusbmuxd pthread) | ||
| 9 | endif() | ||
| 6 | 10 | ||
| 7 | install(TARGETS iproxy RUNTIME DESTINATION bin) | 11 | install(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> | ||
| 38 | typedef 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 | ||
