summaryrefslogtreecommitdiffstats
path: root/src/property_list_service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/property_list_service.c')
-rw-r--r--src/property_list_service.c100
1 files changed, 0 insertions, 100 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c
index 3f2e6c3..c260d3e 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -54,18 +54,6 @@ static property_list_service_error_t service_to_property_list_service_error(serv
54 return PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR; 54 return PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR;
55} 55}
56 56
57/**
58 * Creates a new property list service for the specified port.
59 *
60 * @param device The device to connect to.
61 * @param service The service descriptor returned by lockdownd_start_service.
62 * @param client Pointer that will be set to a newly allocated
63 * property_list_service_client_t upon successful return.
64 *
65 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
66 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when one of the arguments is invalid,
67 * or PROPERTY_LIST_SERVICE_E_MUX_ERROR when connecting to the device failed.
68 */
69property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client) 57property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client)
70{ 58{
71 if (!device || !service || service->port == 0 || !client || *client) 59 if (!device || !service || service->port == 0 || !client || *client)
@@ -86,15 +74,6 @@ property_list_service_error_t property_list_service_client_new(idevice_t device,
86 return PROPERTY_LIST_SERVICE_E_SUCCESS; 74 return PROPERTY_LIST_SERVICE_E_SUCCESS;
87} 75}
88 76
89/**
90 * Frees a PropertyList service.
91 *
92 * @param client The property list service to free.
93 *
94 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
95 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when client is invalid, or a
96 * PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when another error occured.
97 */
98property_list_service_error_t property_list_service_client_free(property_list_service_client_t client) 77property_list_service_error_t property_list_service_client_free(property_list_service_client_t client)
99{ 78{
100 if (!client) 79 if (!client)
@@ -168,33 +147,11 @@ static property_list_service_error_t internal_plist_send(property_list_service_c
168 return res; 147 return res;
169} 148}
170 149
171/**
172 * Sends an XML plist.
173 *
174 * @param client The property list service client to use for sending.
175 * @param plist plist to send
176 *
177 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
178 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when client or plist is NULL,
179 * PROPERTY_LIST_SERVICE_E_PLIST_ERROR when dict is not a valid plist,
180 * or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when an unspecified error occurs.
181 */
182property_list_service_error_t property_list_service_send_xml_plist(property_list_service_client_t client, plist_t plist) 150property_list_service_error_t property_list_service_send_xml_plist(property_list_service_client_t client, plist_t plist)
183{ 151{
184 return internal_plist_send(client, plist, 0); 152 return internal_plist_send(client, plist, 0);
185} 153}
186 154
187/**
188 * Sends a binary plist.
189 *
190 * @param client The property list service client to use for sending.
191 * @param plist plist to send
192 *
193 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
194 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when client or plist is NULL,
195 * PROPERTY_LIST_SERVICE_E_PLIST_ERROR when dict is not a valid plist,
196 * or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when an unspecified error occurs.
197 */
198property_list_service_error_t property_list_service_send_binary_plist(property_list_service_client_t client, plist_t plist) 155property_list_service_error_t property_list_service_send_binary_plist(property_list_service_client_t client, plist_t plist)
199{ 156{
200 return internal_plist_send(client, plist, 1); 157 return internal_plist_send(client, plist, 1);
@@ -293,63 +250,16 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
293 return res; 250 return res;
294} 251}
295 252
296/**
297 * Receives a plist using the given property list service client with specified
298 * timeout.
299 * Binary or XML plists are automatically handled.
300 *
301 * @param client The property list service client to use for receiving
302 * @param plist pointer to a plist_t that will point to the received plist
303 * upon successful return
304 * @param timeout Maximum time in milliseconds to wait for data.
305 *
306 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
307 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when connection or *plist is NULL,
308 * PROPERTY_LIST_SERVICE_E_PLIST_ERROR when the received data cannot be
309 * converted to a plist, PROPERTY_LIST_SERVICE_E_MUX_ERROR when a
310 * communication error occurs, or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when
311 * an unspecified error occurs.
312 */
313property_list_service_error_t property_list_service_receive_plist_with_timeout(property_list_service_client_t client, plist_t *plist, unsigned int timeout) 253property_list_service_error_t property_list_service_receive_plist_with_timeout(property_list_service_client_t client, plist_t *plist, unsigned int timeout)
314{ 254{
315 return internal_plist_receive_timeout(client, plist, timeout); 255 return internal_plist_receive_timeout(client, plist, timeout);
316} 256}
317 257
318/**
319 * Receives a plist using the given property list service client.
320 * Binary or XML plists are automatically handled.
321 *
322 * This function is like property_list_service_receive_plist_with_timeout
323 * using a timeout of 10 seconds.
324 * @see property_list_service_receive_plist_with_timeout
325 *
326 * @param client The property list service client to use for receiving
327 * @param plist pointer to a plist_t that will point to the received plist
328 * upon successful return
329 *
330 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
331 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when client or *plist is NULL,
332 * PROPERTY_LIST_SERVICE_E_PLIST_ERROR when the received data cannot be
333 * converted to a plist, PROPERTY_LIST_SERVICE_E_MUX_ERROR when a
334 * communication error occurs, or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when
335 * an unspecified error occurs.
336 */
337property_list_service_error_t property_list_service_receive_plist(property_list_service_client_t client, plist_t *plist) 258property_list_service_error_t property_list_service_receive_plist(property_list_service_client_t client, plist_t *plist)
338{ 259{
339 return internal_plist_receive_timeout(client, plist, 10000); 260 return internal_plist_receive_timeout(client, plist, 10000);
340} 261}
341 262
342/**
343 * Enable SSL for the given property list service client.
344 *
345 * @param client The connected property list service client for which SSL
346 * should be enabled.
347 *
348 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
349 * PROPERTY_LIST_SERVICE_E_INVALID_ARG if client or client->connection is
350 * NULL, PROPERTY_LIST_SERVICE_E_SSL_ERROR when SSL could not be enabled,
351 * or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR otherwise.
352 */
353property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client) 263property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client)
354{ 264{
355 if (!client || !client->parent) 265 if (!client || !client->parent)
@@ -357,16 +267,6 @@ property_list_service_error_t property_list_service_enable_ssl(property_list_ser
357 return service_to_property_list_service_error(service_enable_ssl(client->parent)); 267 return service_to_property_list_service_error(service_enable_ssl(client->parent));
358} 268}
359 269
360/**
361 * Disable SSL for the given property list service client.
362 *
363 * @param client The connected property list service client for which SSL
364 * should be disabled.
365 *
366 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
367 * PROPERTY_LIST_SERVICE_E_INVALID_ARG if client or client->connection is
368 * NULL, or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR otherwise.
369 */
370property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client) 270property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client)
371{ 271{
372 if (!client || !client->parent) 272 if (!client || !client->parent)