summaryrefslogtreecommitdiffstats
path: root/include/libiphone
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-01-12 17:17:48 +0100
committerGravatar Martin Szulecki2010-01-12 17:17:48 +0100
commit219a8db037ec1cc163d2ad4902e6e4578040a2de (patch)
tree2084e1b9bd0b3666042ce0a1cf2c68f6d8650ee5 /include/libiphone
parente7884c40d73e25ee6e6addb3f9d9efc0ffbe068e (diff)
downloadlibimobiledevice-219a8db037ec1cc163d2ad4902e6e4578040a2de.tar.gz
libimobiledevice-219a8db037ec1cc163d2ad4902e6e4578040a2de.tar.bz2
Refactor lockdown session handling and expose it in public API
This splits out SSL code and allows implementations to manually handle session start and stop if needed. Also brings the API closer to the lockdown request protocol.
Diffstat (limited to 'include/libiphone')
-rw-r--r--include/libiphone/lockdown.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h
index e134f5f..f4b3f6a 100644
--- a/include/libiphone/lockdown.h
+++ b/include/libiphone/lockdown.h
@@ -47,6 +47,7 @@ extern "C" {
#define LOCKDOWN_E_ACTIVATION_FAILED -13
#define LOCKDOWN_E_PASSWORD_PROTECTED -14
#define LOCKDOWN_E_NO_RUNNING_SESSION -15
+#define LOCKDOWN_E_INVALID_HOST_ID -16
#define LOCKDOWN_E_UNKNOWN_ERROR -256
@@ -59,13 +60,14 @@ typedef struct lockdownd_client_int *lockdownd_client_t;
lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client, const char *label);
lockdownd_error_t lockdownd_client_new_with_handshake(iphone_device_t device, lockdownd_client_t *client, const char *label);
lockdownd_error_t lockdownd_client_free(lockdownd_client_t client);
-void lockdownd_client_set_label(lockdownd_client_t client, const char *label);
+
lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type);
lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value);
lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value);
lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key);
lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, int *port);
-lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client);
+lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled);
+lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id);
lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist);
lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist);
lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *host_id);
@@ -73,11 +75,14 @@ lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, char *host_
lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, char *host_id);
lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record);
lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client);
-lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid);
-lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name);
lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client);
lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client);
+/* Helper */
+void lockdownd_client_set_label(lockdownd_client_t client, const char *label);
+lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid);
+lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name);
+
#ifdef __cplusplus
}
#endif