summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice
diff options
context:
space:
mode:
authorGravatar DanyL2019-06-13 02:01:04 +0300
committerGravatar Nikias Bassen2019-06-13 01:41:20 +0200
commit4d8b89223cbc9f530cc650ab5131c09eab1af258 (patch)
treee63216393208c07ae83c7b8eba5e0a9546de4fef /include/libimobiledevice
parent6edc36fccb52a963c9ebfbb44ba7b91570e0fd06 (diff)
downloadlibimobiledevice-4d8b89223cbc9f530cc650ab5131c09eab1af258.tar.gz
libimobiledevice-4d8b89223cbc9f530cc650ab5131c09eab1af258.tar.bz2
Timeout support for SSL connections and better timeout handeling.
Diffstat (limited to 'include/libimobiledevice')
-rw-r--r--include/libimobiledevice/heartbeat.h16
-rw-r--r--include/libimobiledevice/libimobiledevice.h4
-rw-r--r--include/libimobiledevice/property_list_service.h3
-rw-r--r--include/libimobiledevice/service.h10
-rw-r--r--include/libimobiledevice/webinspector.h14
5 files changed, 31 insertions, 16 deletions
diff --git a/include/libimobiledevice/heartbeat.h b/include/libimobiledevice/heartbeat.h
index 00734b5..1f5344a 100644
--- a/include/libimobiledevice/heartbeat.h
+++ b/include/libimobiledevice/heartbeat.h
@@ -34,12 +34,14 @@ extern "C" {
34 34
35/** Error Codes */ 35/** Error Codes */
36typedef enum { 36typedef enum {
37 HEARTBEAT_E_SUCCESS = 0, 37 HEARTBEAT_E_SUCCESS = 0,
38 HEARTBEAT_E_INVALID_ARG = -1, 38 HEARTBEAT_E_INVALID_ARG = -1,
39 HEARTBEAT_E_PLIST_ERROR = -2, 39 HEARTBEAT_E_PLIST_ERROR = -2,
40 HEARTBEAT_E_MUX_ERROR = -3, 40 HEARTBEAT_E_MUX_ERROR = -3,
41 HEARTBEAT_E_SSL_ERROR = -4, 41 HEARTBEAT_E_SSL_ERROR = -4,
42 HEARTBEAT_E_UNKNOWN_ERROR = -256 42 HEARTBEAT_E_NOT_ENOUGH_DATA = -5,
43 HEARTBEAT_E_TIMEOUT = -6,
44 HEARTBEAT_E_UNKNOWN_ERROR = -256
43} heartbeat_error_t; 45} heartbeat_error_t;
44 46
45typedef struct heartbeat_client_private heartbeat_client_private; 47typedef struct heartbeat_client_private heartbeat_client_private;
@@ -118,6 +120,8 @@ heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist);
118 * 120 *
119 * @return HEARTBEAT_E_SUCCESS on success, 121 * @return HEARTBEAT_E_SUCCESS on success,
120 * HEARTBEAT_E_INVALID_ARG when client or *plist is NULL, 122 * HEARTBEAT_E_INVALID_ARG when client or *plist is NULL,
123 * HEARTBEAT_E_NOT_ENOUGH_DATA when not enough data
124 * received, HEARTBEAT_E_TIMEOUT when the connection times out,
121 * HEARTBEAT_E_PLIST_ERROR when the received data cannot be 125 * HEARTBEAT_E_PLIST_ERROR when the received data cannot be
122 * converted to a plist, HEARTBEAT_E_MUX_ERROR when a 126 * converted to a plist, HEARTBEAT_E_MUX_ERROR when a
123 * communication error occurs, or HEARTBEAT_E_UNKNOWN_ERROR 127 * communication error occurs, or HEARTBEAT_E_UNKNOWN_ERROR
diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h
index 5ec1a6d..729bc89 100644
--- a/include/libimobiledevice/libimobiledevice.h
+++ b/include/libimobiledevice/libimobiledevice.h
@@ -41,8 +41,8 @@ typedef enum {
41 IDEVICE_E_UNKNOWN_ERROR = -2, 41 IDEVICE_E_UNKNOWN_ERROR = -2,
42 IDEVICE_E_NO_DEVICE = -3, 42 IDEVICE_E_NO_DEVICE = -3,
43 IDEVICE_E_NOT_ENOUGH_DATA = -4, 43 IDEVICE_E_NOT_ENOUGH_DATA = -4,
44 IDEVICE_E_BAD_HEADER = -5, 44 IDEVICE_E_SSL_ERROR = -6,
45 IDEVICE_E_SSL_ERROR = -6 45 IDEVICE_E_TIMEOUT = -7
46} idevice_error_t; 46} idevice_error_t;
47 47
48typedef struct idevice_private idevice_private; 48typedef struct idevice_private idevice_private;
diff --git a/include/libimobiledevice/property_list_service.h b/include/libimobiledevice/property_list_service.h
index 5d5b835..aca966d 100644
--- a/include/libimobiledevice/property_list_service.h
+++ b/include/libimobiledevice/property_list_service.h
@@ -38,6 +38,7 @@ typedef enum {
38 PROPERTY_LIST_SERVICE_E_MUX_ERROR = -3, 38 PROPERTY_LIST_SERVICE_E_MUX_ERROR = -3,
39 PROPERTY_LIST_SERVICE_E_SSL_ERROR = -4, 39 PROPERTY_LIST_SERVICE_E_SSL_ERROR = -4,
40 PROPERTY_LIST_SERVICE_E_RECEIVE_TIMEOUT = -5, 40 PROPERTY_LIST_SERVICE_E_RECEIVE_TIMEOUT = -5,
41 PROPERTY_LIST_SERVICE_E_NOT_ENOUGH_DATA = -6,
41 PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR = -256 42 PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR = -256
42} property_list_service_error_t; 43} property_list_service_error_t;
43 44
@@ -130,6 +131,8 @@ property_list_service_error_t property_list_service_receive_plist_with_timeout(p
130 * 131 *
131 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success, 132 * @return PROPERTY_LIST_SERVICE_E_SUCCESS on success,
132 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when client or *plist is NULL, 133 * PROPERTY_LIST_SERVICE_E_INVALID_ARG when client or *plist is NULL,
134 * PROPERTY_LIST_SERVICE_E_NOT_ENOUGH_DATA when not enough data
135 * received, PROPERTY_LIST_SERVICE_E_RECEIVE_TIMEOUT when the connection times out,
133 * PROPERTY_LIST_SERVICE_E_PLIST_ERROR when the received data cannot be 136 * PROPERTY_LIST_SERVICE_E_PLIST_ERROR when the received data cannot be
134 * converted to a plist, PROPERTY_LIST_SERVICE_E_MUX_ERROR when a 137 * converted to a plist, PROPERTY_LIST_SERVICE_E_MUX_ERROR when a
135 * communication error occurs, or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when 138 * communication error occurs, or PROPERTY_LIST_SERVICE_E_UNKNOWN_ERROR when
diff --git a/include/libimobiledevice/service.h b/include/libimobiledevice/service.h
index 13c5df1..5c43e29 100644
--- a/include/libimobiledevice/service.h
+++ b/include/libimobiledevice/service.h
@@ -37,6 +37,8 @@ typedef enum {
37 SERVICE_E_MUX_ERROR = -3, 37 SERVICE_E_MUX_ERROR = -3,
38 SERVICE_E_SSL_ERROR = -4, 38 SERVICE_E_SSL_ERROR = -4,
39 SERVICE_E_START_SERVICE_ERROR = -5, 39 SERVICE_E_START_SERVICE_ERROR = -5,
40 SERIVCE_E_NOT_ENOUGH_DATA = -6,
41 SERVICE_E_TIMEOUT = -7,
40 SERVICE_E_UNKNOWN_ERROR = -256 42 SERVICE_E_UNKNOWN_ERROR = -256
41} service_error_t; 43} service_error_t;
42 44
@@ -132,7 +134,9 @@ service_error_t service_receive_with_timeout(service_client_t client, char *data
132 * 134 *
133 * @return SERVICE_E_SUCCESS on success, 135 * @return SERVICE_E_SUCCESS on success,
134 * SERVICE_E_INVALID_ARG when one or more parameters are 136 * SERVICE_E_INVALID_ARG when one or more parameters are
135 * invalid, SERVICE_E_MUX_ERROR when a communication error 137 * invalid, SERIVCE_E_NOT_ENOUGH_DATA when not enough data
138 * received, SERVICE_E_TIMEOUT when the connection times out,
139 * SERVICE_E_MUX_ERROR when a communication error
136 * occurs, or SERVICE_E_UNKNOWN_ERROR when an unspecified 140 * occurs, or SERVICE_E_UNKNOWN_ERROR when an unspecified
137 * error occurs. 141 * error occurs.
138 */ 142 */
@@ -146,7 +150,9 @@ service_error_t service_receive(service_client_t client, char *data, uint32_t si
146 * 150 *
147 * @return SERVICE_E_SUCCESS on success, 151 * @return SERVICE_E_SUCCESS on success,
148 * SERVICE_E_INVALID_ARG if client or client->connection is 152 * SERVICE_E_INVALID_ARG if client or client->connection is
149 * NULL, SERVICE_E_SSL_ERROR when SSL could not be enabled, 153 * NULL, SERIVCE_E_NOT_ENOUGH_DATA when not enough data
154 * received, SERVICE_E_TIMEOUT when the connection times out,
155 * SERVICE_E_SSL_ERROR when SSL could not be enabled,
150 * or SERVICE_E_UNKNOWN_ERROR otherwise. 156 * or SERVICE_E_UNKNOWN_ERROR otherwise.
151 */ 157 */
152service_error_t service_enable_ssl(service_client_t client); 158service_error_t service_enable_ssl(service_client_t client);
diff --git a/include/libimobiledevice/webinspector.h b/include/libimobiledevice/webinspector.h
index d2a99c9..da0759c 100644
--- a/include/libimobiledevice/webinspector.h
+++ b/include/libimobiledevice/webinspector.h
@@ -35,12 +35,14 @@ extern "C" {
35 35
36/** Error Codes */ 36/** Error Codes */
37typedef enum { 37typedef enum {
38 WEBINSPECTOR_E_SUCCESS = 0, 38 WEBINSPECTOR_E_SUCCESS = 0,
39 WEBINSPECTOR_E_INVALID_ARG = -1, 39 WEBINSPECTOR_E_INVALID_ARG = -1,
40 WEBINSPECTOR_E_PLIST_ERROR = -2, 40 WEBINSPECTOR_E_PLIST_ERROR = -2,
41 WEBINSPECTOR_E_MUX_ERROR = -3, 41 WEBINSPECTOR_E_MUX_ERROR = -3,
42 WEBINSPECTOR_E_SSL_ERROR = -4, 42 WEBINSPECTOR_E_SSL_ERROR = -4,
43 WEBINSPECTOR_E_UNKNOWN_ERROR = -256 43 WEBINSPECTOR_E_RECEIVE_TIMEOUT = -5,
44 WEBINSPECTOR_E_NOT_ENOUGH_DATA = -6,
45 WEBINSPECTOR_E_UNKNOWN_ERROR = -256
44} webinspector_error_t; 46} webinspector_error_t;
45 47
46typedef struct webinspector_client_private webinspector_client_private; 48typedef struct webinspector_client_private webinspector_client_private;