summaryrefslogtreecommitdiffstats
path: root/include/libiphone
diff options
context:
space:
mode:
Diffstat (limited to 'include/libiphone')
-rw-r--r--include/libiphone/afc.h2
-rw-r--r--include/libiphone/installation_proxy.h2
-rw-r--r--include/libiphone/libiphone.h12
-rw-r--r--include/libiphone/lockdown.h37
-rw-r--r--include/libiphone/mobilesync.h2
-rw-r--r--include/libiphone/notification_proxy.h39
-rw-r--r--include/libiphone/sbservices.h2
7 files changed, 60 insertions, 36 deletions
diff --git a/include/libiphone/afc.h b/include/libiphone/afc.h
index 7eff678..5d09b40 100644
--- a/include/libiphone/afc.h
+++ b/include/libiphone/afc.h
@@ -87,7 +87,7 @@ struct afc_client_int;
typedef struct afc_client_int *afc_client_t;
/* Interface */
-afc_error_t afc_client_new(iphone_device_t device, int dst_port, afc_client_t *client);
+afc_error_t afc_client_new(iphone_device_t device, uint16_t port, afc_client_t *client);
afc_error_t afc_client_free(afc_client_t client);
afc_error_t afc_get_device_info(afc_client_t client, char ***infos);
afc_error_t afc_read_directory(afc_client_t client, const char *dir, char ***list);
diff --git a/include/libiphone/installation_proxy.h b/include/libiphone/installation_proxy.h
index f432e8a..f796054 100644
--- a/include/libiphone/installation_proxy.h
+++ b/include/libiphone/installation_proxy.h
@@ -56,7 +56,7 @@ typedef struct instproxy_client_int *instproxy_client_t;
typedef void (*instproxy_status_cb_t) (const char *operation, plist_t status);
/* Interface */
-instproxy_error_t instproxy_client_new(iphone_device_t device, int dst_port, instproxy_client_t *client);
+instproxy_error_t instproxy_client_new(iphone_device_t device, uint16_t port, instproxy_client_t *client);
instproxy_error_t instproxy_client_free(instproxy_client_t client);
instproxy_error_t instproxy_browse(instproxy_client_t client, instproxy_apptype_t apptype, plist_t *result);
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
index eb58d5c..b67fcd4 100644
--- a/include/libiphone/libiphone.h
+++ b/include/libiphone/libiphone.h
@@ -39,7 +39,7 @@ extern "C" {
#define IPHONE_E_NO_DEVICE -3
#define IPHONE_E_NOT_ENOUGH_DATA -4
#define IPHONE_E_BAD_HEADER -5
-#define IPHONE_E_PLIST_ERROR -6
+#define IPHONE_E_SSL_ERROR -6
typedef int16_t iphone_error_t;
@@ -49,15 +49,7 @@ typedef struct iphone_device_int *iphone_device_t;
struct iphone_connection_int;
typedef struct iphone_connection_int *iphone_connection_t;
-/* Debugging */
-#define DBGMASK_ALL 0xFFFF
-#define DBGMASK_NONE 0x0000
-#define DBGMASK_LOCKDOWND (1 << 1)
-#define DBGMASK_MOBILESYNC (1 << 2)
-#define DBGMASK_INSTPROXY (1 << 3)
-
/* generic */
-void iphone_set_debug_mask(uint16_t mask);
void iphone_set_debug_level(int level);
/* discovery (events/asynchronous) */
@@ -90,7 +82,7 @@ iphone_error_t iphone_device_new(iphone_device_t *device, const char *uuid);
iphone_error_t iphone_device_free(iphone_device_t device);
/* connection/disconnection and communication */
-iphone_error_t iphone_device_connect(iphone_device_t device, uint16_t dst_port, iphone_connection_t *connection);
+iphone_error_t iphone_device_connect(iphone_device_t device, uint16_t port, iphone_connection_t *connection);
iphone_error_t iphone_device_disconnect(iphone_connection_t connection);
iphone_error_t iphone_device_send(iphone_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes);
iphone_error_t iphone_device_recv_timeout(iphone_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout);
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h
index 31ffeab..7fa5384 100644
--- a/include/libiphone/lockdown.h
+++ b/include/libiphone/lockdown.h
@@ -44,6 +44,10 @@ extern "C" {
#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10
#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11
#define LOCKDOWN_E_MUX_ERROR -12
+#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
@@ -52,24 +56,41 @@ typedef int16_t lockdownd_error_t;
struct lockdownd_client_int;
typedef struct lockdownd_client_int *lockdownd_client_t;
+struct lockdownd_pair_record {
+ char *device_certificate;
+ char *host_certificate;
+ char *host_id;
+ char *root_certificate;
+};
+typedef struct lockdownd_pair_record *lockdownd_pair_record_t;
+
/* Interface */
-lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client);
+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);
-lockdownd_error_t lockdownd_query_type(lockdownd_client_t client);
+
+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_service(lockdownd_client_t client, const char *service, uint16_t *port);
+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);
-lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, char *host_id);
-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_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record);
+lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record);
+lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record);
+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_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
diff --git a/include/libiphone/mobilesync.h b/include/libiphone/mobilesync.h
index 662036c..94fbedc 100644
--- a/include/libiphone/mobilesync.h
+++ b/include/libiphone/mobilesync.h
@@ -43,7 +43,7 @@ typedef int16_t mobilesync_error_t;
struct mobilesync_client_int;
typedef struct mobilesync_client_int *mobilesync_client_t;
-mobilesync_error_t mobilesync_client_new(iphone_device_t device, int dst_port, mobilesync_client_t * client);
+mobilesync_error_t mobilesync_client_new(iphone_device_t device, uint16_t port, mobilesync_client_t * client);
mobilesync_error_t mobilesync_client_free(mobilesync_client_t client);
mobilesync_error_t mobilesync_recv(mobilesync_client_t client, plist_t *plist);
mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist);
diff --git a/include/libiphone/notification_proxy.h b/include/libiphone/notification_proxy.h
index 96af5fd..b58fc68 100644
--- a/include/libiphone/notification_proxy.h
+++ b/include/libiphone/notification_proxy.h
@@ -40,21 +40,32 @@ extern "C" {
typedef int16_t np_error_t;
/* Notification IDs for use with post_notification (client --> device) */
-#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart"
-#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart"
-#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish"
+#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart"
+#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart"
+#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish"
/* Notification IDs for use with observe_notification (device --> client) */
-#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest"
-#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest"
-#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest"
-#define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed"
-#define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed"
-#define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation"
-#define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed"
-#define NP_APP_INSTALLED "com.apple.mobile.application_installed"
-#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled"
-#define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd"
+#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest"
+#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest"
+#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest"
+#define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed"
+#define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed"
+#define NP_TIMEZONE_CHANGED "com.apple.mobile.lockdown.timezone_changed"
+#define NP_TRUSTED_HOST_ATTACHED "com.apple.mobile.lockdown.trusted_host_attached"
+#define NP_HOST_DETACHED "com.apple.mobile.lockdown.host_detached"
+#define NP_HOST_ATTACHED "com.apple.mobile.lockdown.host_attached"
+#define NP_REGISTRATION_FAILED "com.apple.mobile.lockdown.registration_failed"
+#define NP_ACTIVATION_STATE "com.apple.mobile.lockdown.activation_state"
+#define NP_BRICK_STATE "com.apple.mobile.lockdown.brick_state"
+#define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed"
+#define NP_BACKUP_DOMAIN_CHANGED "com.apple.mobile.backup.domain_changed"
+#define NP_APP_INSTALLED "com.apple.mobile.application_installed"
+#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled"
+#define NP_DEV_IMAGE_MOUNTED "com.apple.mobile.developer_image_mounted"
+#define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation"
+#define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd"
+#define NP_LANGUAGE_CHANGED "com.apple.language.changed"
+#define NP_ADDRESS_BOOK_PREF_CHANGED "com.apple.AddressBook.PreferenceChanged"
struct np_client_int;
typedef struct np_client_int *np_client_t;
@@ -62,7 +73,7 @@ typedef struct np_client_int *np_client_t;
typedef void (*np_notify_cb_t) (const char *notification);
/* Interface */
-np_error_t np_client_new(iphone_device_t device, int dst_port, np_client_t *client);
+np_error_t np_client_new(iphone_device_t device, uint16_t port, np_client_t *client);
np_error_t np_client_free(np_client_t client);
np_error_t np_post_notification(np_client_t client, const char *notification);
np_error_t np_observe_notification(np_client_t client, const char *notification);
diff --git a/include/libiphone/sbservices.h b/include/libiphone/sbservices.h
index 6ea8189..3e4accb 100644
--- a/include/libiphone/sbservices.h
+++ b/include/libiphone/sbservices.h
@@ -43,7 +43,7 @@ struct sbservices_client_int;
typedef struct sbservices_client_int *sbservices_client_t;
/* Interface */
-sbservices_error_t sbservices_client_new(iphone_device_t device, int dst_port, sbservices_client_t *client);
+sbservices_error_t sbservices_client_new(iphone_device_t device, uint16_t port, sbservices_client_t *client);
sbservices_error_t sbservices_client_free(sbservices_client_t client);
sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state);
sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate);