From 854ab9a5d9d04fb884459c5092f6620faa99673b Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 12 Apr 2022 02:56:18 +0200 Subject: Add property_list_client_get_service_client() and service_get_connection() functions This allows for custom service implementations to easier switch to non-plist communication after the service has been started. --- include/libimobiledevice/property_list_service.h | 20 ++++++++++++++++---- include/libimobiledevice/service.h | 10 ++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) (limited to 'include/libimobiledevice') diff --git a/include/libimobiledevice/property_list_service.h b/include/libimobiledevice/property_list_service.h index 5205551..3f6ebad 100644 --- a/include/libimobiledevice/property_list_service.h +++ b/include/libimobiledevice/property_list_service.h @@ -29,6 +29,7 @@ extern "C" { #endif #include +#include /** Error Codes */ typedef enum { @@ -147,8 +148,8 @@ property_list_service_error_t property_list_service_receive_plist(property_list_ * should be enabled. * * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success, - * PROPERTY_LIST_SERVICE_E_INVALID_ARG if client or client->connection is - * NULL, PROPERTY_LIST_SERVICE_E_SSL_ERROR when SSL could not be enabled, + * PROPERTY_LIST_SERVICE_E_INVALID_ARG if one or more of the arguments are invalid, + * PROPERTY_LIST_SERVICE_E_SSL_ERROR when SSL could not be enabled, * or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR otherwise. */ property_list_service_error_t property_list_service_enable_ssl(property_list_service_client_t client); @@ -160,11 +161,22 @@ property_list_service_error_t property_list_service_enable_ssl(property_list_ser * should be disabled. * * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success, - * PROPERTY_LIST_SERVICE_E_INVALID_ARG if client or client->connection is - * NULL, or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR otherwise. + * PROPERTY_LIST_SERVICE_E_INVALID_ARG if one or more of the arguments are invalid, + * or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR otherwise. */ property_list_service_error_t property_list_service_disable_ssl(property_list_service_client_t client); +/** + * Return a handle to the parent #service_client_t of the given property list service client. + * + * @param client The property list service client + * @param service_client Pointer to be assigned to the parent #service_client_t + * + * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success, + * PROPERTY_LIST_SERVICE_E_INVALID_ARG if one or more of the arguments are invalid. + */ +property_list_service_error_t property_list_service_get_service_client(property_list_service_client_t client, service_client_t *service_client); + #ifdef __cplusplus } #endif diff --git a/include/libimobiledevice/service.h b/include/libimobiledevice/service.h index 6842054..28b6db6 100644 --- a/include/libimobiledevice/service.h +++ b/include/libimobiledevice/service.h @@ -184,6 +184,16 @@ service_error_t service_disable_ssl(service_client_t client); */ service_error_t service_disable_bypass_ssl(service_client_t client, uint8_t sslBypass); +/** + * Return a handle to the parent #idevice_connection_t of the given service client. + * + * @param client The service client + * @param connection Pointer to be assigned to the #idevice_connection_t. + * + * @return SERVICE_E_SUCCESS on success, + * SERVICE_E_INVALID_ARG if one or more of the arguments are invalid. + */ +service_error_t service_get_connection(service_client_t client, idevice_connection_t *connection); #ifdef __cplusplus } #endif -- cgit v1.1-32-gdbae