diff options
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/service.c b/src/service.c index 6c9d109..9474021 100644 --- a/src/service.c +++ b/src/service.c | |||
@@ -56,7 +56,7 @@ static service_error_t idevice_to_service_error(idevice_error_t err) | |||
56 | return SERVICE_E_UNKNOWN_ERROR; | 56 | return SERVICE_E_UNKNOWN_ERROR; |
57 | } | 57 | } |
58 | 58 | ||
59 | LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client) | 59 | service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client) |
60 | { | 60 | { |
61 | if (!device || !service || service->port == 0 || !client || *client) | 61 | if (!device || !service || service->port == 0 || !client || *client) |
62 | return SERVICE_E_INVALID_ARG; | 62 | return SERVICE_E_INVALID_ARG; |
@@ -80,7 +80,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdo | |||
80 | return SERVICE_E_SUCCESS; | 80 | return SERVICE_E_SUCCESS; |
81 | } | 81 | } |
82 | 82 | ||
83 | LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int32_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int32_t *error_code) | 83 | service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int32_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int32_t *error_code) |
84 | { | 84 | { |
85 | *client = NULL; | 85 | *client = NULL; |
86 | 86 | ||
@@ -119,7 +119,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevic | |||
119 | return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR; | 119 | return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR; |
120 | } | 120 | } |
121 | 121 | ||
122 | LIBIMOBILEDEVICE_API service_error_t service_client_free(service_client_t client) | 122 | service_error_t service_client_free(service_client_t client) |
123 | { | 123 | { |
124 | if (!client) | 124 | if (!client) |
125 | return SERVICE_E_INVALID_ARG; | 125 | return SERVICE_E_INVALID_ARG; |
@@ -132,7 +132,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_free(service_client_t client | |||
132 | return err; | 132 | return err; |
133 | } | 133 | } |
134 | 134 | ||
135 | LIBIMOBILEDEVICE_API service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent) | 135 | service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent) |
136 | { | 136 | { |
137 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; | 137 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; |
138 | uint32_t bytes = 0; | 138 | uint32_t bytes = 0; |
@@ -153,7 +153,7 @@ LIBIMOBILEDEVICE_API service_error_t service_send(service_client_t client, const | |||
153 | return res; | 153 | return res; |
154 | } | 154 | } |
155 | 155 | ||
156 | LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) | 156 | service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) |
157 | { | 157 | { |
158 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; | 158 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; |
159 | uint32_t bytes = 0; | 159 | uint32_t bytes = 0; |
@@ -174,31 +174,31 @@ LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client | |||
174 | return res; | 174 | return res; |
175 | } | 175 | } |
176 | 176 | ||
177 | LIBIMOBILEDEVICE_API service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received) | 177 | service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received) |
178 | { | 178 | { |
179 | return service_receive_with_timeout(client, data, size, received, 30000); | 179 | return service_receive_with_timeout(client, data, size, received, 30000); |
180 | } | 180 | } |
181 | 181 | ||
182 | LIBIMOBILEDEVICE_API service_error_t service_enable_ssl(service_client_t client) | 182 | service_error_t service_enable_ssl(service_client_t client) |
183 | { | 183 | { |
184 | if (!client || !client->connection) | 184 | if (!client || !client->connection) |
185 | return SERVICE_E_INVALID_ARG; | 185 | return SERVICE_E_INVALID_ARG; |
186 | return idevice_to_service_error(idevice_connection_enable_ssl(client->connection)); | 186 | return idevice_to_service_error(idevice_connection_enable_ssl(client->connection)); |
187 | } | 187 | } |
188 | 188 | ||
189 | LIBIMOBILEDEVICE_API service_error_t service_disable_ssl(service_client_t client) | 189 | service_error_t service_disable_ssl(service_client_t client) |
190 | { | 190 | { |
191 | return service_disable_bypass_ssl(client, 0); | 191 | return service_disable_bypass_ssl(client, 0); |
192 | } | 192 | } |
193 | 193 | ||
194 | LIBIMOBILEDEVICE_API service_error_t service_disable_bypass_ssl(service_client_t client, uint8_t sslBypass) | 194 | service_error_t service_disable_bypass_ssl(service_client_t client, uint8_t sslBypass) |
195 | { | 195 | { |
196 | if (!client || !client->connection) | 196 | if (!client || !client->connection) |
197 | return SERVICE_E_INVALID_ARG; | 197 | return SERVICE_E_INVALID_ARG; |
198 | return idevice_to_service_error(idevice_connection_disable_bypass_ssl(client->connection, sslBypass)); | 198 | return idevice_to_service_error(idevice_connection_disable_bypass_ssl(client->connection, sslBypass)); |
199 | } | 199 | } |
200 | 200 | ||
201 | LIBIMOBILEDEVICE_API service_error_t service_get_connection(service_client_t client, idevice_connection_t *connection) | 201 | service_error_t service_get_connection(service_client_t client, idevice_connection_t *connection) |
202 | { | 202 | { |
203 | if (!client || !client->connection || !connection) | 203 | if (!client || !client->connection || !connection) |
204 | return SERVICE_E_INVALID_ARG; | 204 | return SERVICE_E_INVALID_ARG; |