summaryrefslogtreecommitdiffstats
path: root/src/usbmux.c
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2009-01-04 22:21:15 +0100
committerGravatar Jonathan Beck2009-01-04 22:21:15 +0100
commit5514a3b2a9734d311e4f6014585f922e0b748cab (patch)
treeca88a32519d6a07da72d15632de7af04461f7ba8 /src/usbmux.c
parent4301ef9bb8e9d06ffa4e9172191d58ede5e16f5d (diff)
parent5cde55426112a8cb79d809dae5f61e347c007212 (diff)
downloadlibimobiledevice-5514a3b2a9734d311e4f6014585f922e0b748cab.tar.gz
libimobiledevice-5514a3b2a9734d311e4f6014585f922e0b748cab.tar.bz2
Merge branch 'master' into plist
Conflicts: src/AFC.c src/lockdown.c src/lockdown.h src/plist.c src/plist.h
Diffstat (limited to 'src/usbmux.c')
-rw-r--r--src/usbmux.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/usbmux.c b/src/usbmux.c
index f0499fa..427b880 100644
--- a/src/usbmux.c
+++ b/src/usbmux.c
@@ -26,6 +26,7 @@
26#include <string.h> 26#include <string.h>
27 27
28#include "usbmux.h" 28#include "usbmux.h"
29#include "utils.h"
29 30
30static iphone_umux_client_t *connlist = NULL; 31static iphone_umux_client_t *connlist = NULL;
31static int clients = 0; 32static int clients = 0;
@@ -57,7 +58,7 @@ usbmux_tcp_header *new_mux_packet(uint16_t s_port, uint16_t d_port)
57 * 58 *
58 * @return A USBMux header 59 * @return A USBMux header
59 */ 60 */
60usbmux_version_header *version_header() 61usbmux_version_header *version_header(void)
61{ 62{
62 usbmux_version_header *version = (usbmux_version_header *) malloc(sizeof(usbmux_version_header)); 63 usbmux_version_header *version = (usbmux_version_header *) malloc(sizeof(usbmux_version_header));
63 version->type = 0; 64 version->type = 0;
@@ -76,7 +77,7 @@ usbmux_version_header *version_header()
76 * 77 *
77 * @param connection The connection to delete from the tracking list. 78 * @param connection The connection to delete from the tracking list.
78 */ 79 */
79void delete_connection(iphone_umux_client_t connection) 80static void delete_connection(iphone_umux_client_t connection)
80{ 81{
81 iphone_umux_client_t *newlist = (iphone_umux_client_t *) malloc(sizeof(iphone_umux_client_t) * (clients - 1)); 82 iphone_umux_client_t *newlist = (iphone_umux_client_t *) malloc(sizeof(iphone_umux_client_t) * (clients - 1));
82 int i = 0, j = 0; 83 int i = 0, j = 0;
@@ -105,7 +106,7 @@ void delete_connection(iphone_umux_client_t connection)
105 * @param connection The connection to add to the global list of connections. 106 * @param connection The connection to add to the global list of connections.
106 */ 107 */
107 108
108void add_connection(iphone_umux_client_t connection) 109static void add_connection(iphone_umux_client_t connection)
109{ 110{
110 iphone_umux_client_t *newlist = 111 iphone_umux_client_t *newlist =
111 (iphone_umux_client_t *) realloc(connlist, sizeof(iphone_umux_client_t) * (clients + 1)); 112 (iphone_umux_client_t *) realloc(connlist, sizeof(iphone_umux_client_t) * (clients + 1));
@@ -178,7 +179,7 @@ iphone_error_t iphone_mux_new_client(iphone_device_t device, uint16_t src_port,
178iphone_error_t iphone_mux_free_client(iphone_umux_client_t client) 179iphone_error_t iphone_mux_free_client(iphone_umux_client_t client)
179{ 180{
180 if (!client || !client->phone) 181 if (!client || !client->phone)
181 return; 182 return IPHONE_E_INVALID_ARG;
182 183
183 client->header->tcp_flags = 0x04; 184 client->header->tcp_flags = 0x04;
184 client->header->scnt = htonl(client->header->scnt); 185 client->header->scnt = htonl(client->header->scnt);