diff options
Diffstat (limited to 'include/libiphone')
| -rw-r--r-- | include/libiphone/afc.h | 2 | ||||
| -rw-r--r-- | include/libiphone/installation_proxy.h | 2 | ||||
| -rw-r--r-- | include/libiphone/libiphone.h | 12 | ||||
| -rw-r--r-- | include/libiphone/lockdown.h | 37 | ||||
| -rw-r--r-- | include/libiphone/mobilesync.h | 2 | ||||
| -rw-r--r-- | include/libiphone/notification_proxy.h | 39 | ||||
| -rw-r--r-- | include/libiphone/sbservices.h | 2 |
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; | |||
| 87 | typedef struct afc_client_int *afc_client_t; | 87 | typedef struct afc_client_int *afc_client_t; |
| 88 | 88 | ||
| 89 | /* Interface */ | 89 | /* Interface */ |
| 90 | afc_error_t afc_client_new(iphone_device_t device, int dst_port, afc_client_t *client); | 90 | afc_error_t afc_client_new(iphone_device_t device, uint16_t port, afc_client_t *client); |
| 91 | afc_error_t afc_client_free(afc_client_t client); | 91 | afc_error_t afc_client_free(afc_client_t client); |
| 92 | afc_error_t afc_get_device_info(afc_client_t client, char ***infos); | 92 | afc_error_t afc_get_device_info(afc_client_t client, char ***infos); |
| 93 | afc_error_t afc_read_directory(afc_client_t client, const char *dir, char ***list); | 93 | 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; | |||
| 56 | typedef void (*instproxy_status_cb_t) (const char *operation, plist_t status); | 56 | typedef void (*instproxy_status_cb_t) (const char *operation, plist_t status); |
| 57 | 57 | ||
| 58 | /* Interface */ | 58 | /* Interface */ |
| 59 | instproxy_error_t instproxy_client_new(iphone_device_t device, int dst_port, instproxy_client_t *client); | 59 | instproxy_error_t instproxy_client_new(iphone_device_t device, uint16_t port, instproxy_client_t *client); |
| 60 | instproxy_error_t instproxy_client_free(instproxy_client_t client); | 60 | instproxy_error_t instproxy_client_free(instproxy_client_t client); |
| 61 | 61 | ||
| 62 | instproxy_error_t instproxy_browse(instproxy_client_t client, instproxy_apptype_t apptype, plist_t *result); | 62 | 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" { | |||
| 39 | #define IPHONE_E_NO_DEVICE -3 | 39 | #define IPHONE_E_NO_DEVICE -3 |
| 40 | #define IPHONE_E_NOT_ENOUGH_DATA -4 | 40 | #define IPHONE_E_NOT_ENOUGH_DATA -4 |
| 41 | #define IPHONE_E_BAD_HEADER -5 | 41 | #define IPHONE_E_BAD_HEADER -5 |
| 42 | #define IPHONE_E_PLIST_ERROR -6 | 42 | #define IPHONE_E_SSL_ERROR -6 |
| 43 | 43 | ||
| 44 | typedef int16_t iphone_error_t; | 44 | typedef int16_t iphone_error_t; |
| 45 | 45 | ||
| @@ -49,15 +49,7 @@ typedef struct iphone_device_int *iphone_device_t; | |||
| 49 | struct iphone_connection_int; | 49 | struct iphone_connection_int; |
| 50 | typedef struct iphone_connection_int *iphone_connection_t; | 50 | typedef struct iphone_connection_int *iphone_connection_t; |
| 51 | 51 | ||
| 52 | /* Debugging */ | ||
| 53 | #define DBGMASK_ALL 0xFFFF | ||
| 54 | #define DBGMASK_NONE 0x0000 | ||
| 55 | #define DBGMASK_LOCKDOWND (1 << 1) | ||
| 56 | #define DBGMASK_MOBILESYNC (1 << 2) | ||
| 57 | #define DBGMASK_INSTPROXY (1 << 3) | ||
| 58 | |||
| 59 | /* generic */ | 52 | /* generic */ |
| 60 | void iphone_set_debug_mask(uint16_t mask); | ||
| 61 | void iphone_set_debug_level(int level); | 53 | void iphone_set_debug_level(int level); |
| 62 | 54 | ||
| 63 | /* discovery (events/asynchronous) */ | 55 | /* discovery (events/asynchronous) */ |
| @@ -90,7 +82,7 @@ iphone_error_t iphone_device_new(iphone_device_t *device, const char *uuid); | |||
| 90 | iphone_error_t iphone_device_free(iphone_device_t device); | 82 | iphone_error_t iphone_device_free(iphone_device_t device); |
| 91 | 83 | ||
| 92 | /* connection/disconnection and communication */ | 84 | /* connection/disconnection and communication */ |
| 93 | iphone_error_t iphone_device_connect(iphone_device_t device, uint16_t dst_port, iphone_connection_t *connection); | 85 | iphone_error_t iphone_device_connect(iphone_device_t device, uint16_t port, iphone_connection_t *connection); |
| 94 | iphone_error_t iphone_device_disconnect(iphone_connection_t connection); | 86 | iphone_error_t iphone_device_disconnect(iphone_connection_t connection); |
| 95 | iphone_error_t iphone_device_send(iphone_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); | 87 | iphone_error_t iphone_device_send(iphone_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); |
| 96 | iphone_error_t iphone_device_recv_timeout(iphone_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout); | 88 | 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" { | |||
| 44 | #define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 | 44 | #define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 |
| 45 | #define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 | 45 | #define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 |
| 46 | #define LOCKDOWN_E_MUX_ERROR -12 | 46 | #define LOCKDOWN_E_MUX_ERROR -12 |
| 47 | #define LOCKDOWN_E_ACTIVATION_FAILED -13 | ||
| 48 | #define LOCKDOWN_E_PASSWORD_PROTECTED -14 | ||
| 49 | #define LOCKDOWN_E_NO_RUNNING_SESSION -15 | ||
| 50 | #define LOCKDOWN_E_INVALID_HOST_ID -16 | ||
| 47 | 51 | ||
| 48 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 | 52 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 |
| 49 | 53 | ||
| @@ -52,24 +56,41 @@ typedef int16_t lockdownd_error_t; | |||
| 52 | struct lockdownd_client_int; | 56 | struct lockdownd_client_int; |
| 53 | typedef struct lockdownd_client_int *lockdownd_client_t; | 57 | typedef struct lockdownd_client_int *lockdownd_client_t; |
| 54 | 58 | ||
| 59 | struct lockdownd_pair_record { | ||
| 60 | char *device_certificate; | ||
| 61 | char *host_certificate; | ||
| 62 | char *host_id; | ||
| 63 | char *root_certificate; | ||
| 64 | }; | ||
| 65 | typedef struct lockdownd_pair_record *lockdownd_pair_record_t; | ||
| 66 | |||
| 55 | /* Interface */ | 67 | /* Interface */ |
| 56 | lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client); | 68 | lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client, const char *label); |
| 69 | lockdownd_error_t lockdownd_client_new_with_handshake(iphone_device_t device, lockdownd_client_t *client, const char *label); | ||
| 57 | lockdownd_error_t lockdownd_client_free(lockdownd_client_t client); | 70 | lockdownd_error_t lockdownd_client_free(lockdownd_client_t client); |
| 58 | lockdownd_error_t lockdownd_query_type(lockdownd_client_t client); | 71 | |
| 72 | lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type); | ||
| 59 | lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value); | 73 | lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value); |
| 60 | lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); | 74 | lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); |
| 61 | lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); | 75 | lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); |
| 62 | lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, int *port); | 76 | lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, uint16_t *port); |
| 63 | lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client); | 77 | lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled); |
| 78 | lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id); | ||
| 64 | lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); | 79 | lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); |
| 65 | lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist); | 80 | lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist); |
| 66 | lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *host_id); | 81 | lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record); |
| 67 | lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, char *host_id); | 82 | lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record); |
| 68 | lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); | 83 | lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record); |
| 69 | lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); | 84 | lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record); |
| 85 | lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client); | ||
| 70 | lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client); | 86 | lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client); |
| 71 | lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client); | 87 | lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client); |
| 72 | 88 | ||
| 89 | /* Helper */ | ||
| 90 | void lockdownd_client_set_label(lockdownd_client_t client, const char *label); | ||
| 91 | lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); | ||
| 92 | lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); | ||
| 93 | |||
| 73 | #ifdef __cplusplus | 94 | #ifdef __cplusplus |
| 74 | } | 95 | } |
| 75 | #endif | 96 | #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; | |||
| 43 | struct mobilesync_client_int; | 43 | struct mobilesync_client_int; |
| 44 | typedef struct mobilesync_client_int *mobilesync_client_t; | 44 | typedef struct mobilesync_client_int *mobilesync_client_t; |
| 45 | 45 | ||
| 46 | mobilesync_error_t mobilesync_client_new(iphone_device_t device, int dst_port, mobilesync_client_t * client); | 46 | mobilesync_error_t mobilesync_client_new(iphone_device_t device, uint16_t port, mobilesync_client_t * client); |
| 47 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client); | 47 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client); |
| 48 | mobilesync_error_t mobilesync_recv(mobilesync_client_t client, plist_t *plist); | 48 | mobilesync_error_t mobilesync_recv(mobilesync_client_t client, plist_t *plist); |
| 49 | mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist); | 49 | 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" { | |||
| 40 | typedef int16_t np_error_t; | 40 | typedef int16_t np_error_t; |
| 41 | 41 | ||
| 42 | /* Notification IDs for use with post_notification (client --> device) */ | 42 | /* Notification IDs for use with post_notification (client --> device) */ |
| 43 | #define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" | 43 | #define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" |
| 44 | #define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" | 44 | #define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" |
| 45 | #define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" | 45 | #define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" |
| 46 | 46 | ||
| 47 | /* Notification IDs for use with observe_notification (device --> client) */ | 47 | /* Notification IDs for use with observe_notification (device --> client) */ |
| 48 | #define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" | 48 | #define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" |
| 49 | #define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" | 49 | #define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" |
| 50 | #define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" | 50 | #define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" |
| 51 | #define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed" | 51 | #define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed" |
| 52 | #define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed" | 52 | #define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed" |
| 53 | #define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation" | 53 | #define NP_TIMEZONE_CHANGED "com.apple.mobile.lockdown.timezone_changed" |
| 54 | #define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed" | 54 | #define NP_TRUSTED_HOST_ATTACHED "com.apple.mobile.lockdown.trusted_host_attached" |
| 55 | #define NP_APP_INSTALLED "com.apple.mobile.application_installed" | 55 | #define NP_HOST_DETACHED "com.apple.mobile.lockdown.host_detached" |
| 56 | #define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" | 56 | #define NP_HOST_ATTACHED "com.apple.mobile.lockdown.host_attached" |
| 57 | #define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd" | 57 | #define NP_REGISTRATION_FAILED "com.apple.mobile.lockdown.registration_failed" |
| 58 | #define NP_ACTIVATION_STATE "com.apple.mobile.lockdown.activation_state" | ||
| 59 | #define NP_BRICK_STATE "com.apple.mobile.lockdown.brick_state" | ||
| 60 | #define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed" | ||
| 61 | #define NP_BACKUP_DOMAIN_CHANGED "com.apple.mobile.backup.domain_changed" | ||
| 62 | #define NP_APP_INSTALLED "com.apple.mobile.application_installed" | ||
| 63 | #define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" | ||
| 64 | #define NP_DEV_IMAGE_MOUNTED "com.apple.mobile.developer_image_mounted" | ||
| 65 | #define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation" | ||
| 66 | #define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd" | ||
| 67 | #define NP_LANGUAGE_CHANGED "com.apple.language.changed" | ||
| 68 | #define NP_ADDRESS_BOOK_PREF_CHANGED "com.apple.AddressBook.PreferenceChanged" | ||
| 58 | 69 | ||
| 59 | struct np_client_int; | 70 | struct np_client_int; |
| 60 | typedef struct np_client_int *np_client_t; | 71 | typedef struct np_client_int *np_client_t; |
| @@ -62,7 +73,7 @@ typedef struct np_client_int *np_client_t; | |||
| 62 | typedef void (*np_notify_cb_t) (const char *notification); | 73 | typedef void (*np_notify_cb_t) (const char *notification); |
| 63 | 74 | ||
| 64 | /* Interface */ | 75 | /* Interface */ |
| 65 | np_error_t np_client_new(iphone_device_t device, int dst_port, np_client_t *client); | 76 | np_error_t np_client_new(iphone_device_t device, uint16_t port, np_client_t *client); |
| 66 | np_error_t np_client_free(np_client_t client); | 77 | np_error_t np_client_free(np_client_t client); |
| 67 | np_error_t np_post_notification(np_client_t client, const char *notification); | 78 | np_error_t np_post_notification(np_client_t client, const char *notification); |
| 68 | np_error_t np_observe_notification(np_client_t client, const char *notification); | 79 | 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; | |||
| 43 | typedef struct sbservices_client_int *sbservices_client_t; | 43 | typedef struct sbservices_client_int *sbservices_client_t; |
| 44 | 44 | ||
| 45 | /* Interface */ | 45 | /* Interface */ |
| 46 | sbservices_error_t sbservices_client_new(iphone_device_t device, int dst_port, sbservices_client_t *client); | 46 | sbservices_error_t sbservices_client_new(iphone_device_t device, uint16_t port, sbservices_client_t *client); |
| 47 | sbservices_error_t sbservices_client_free(sbservices_client_t client); | 47 | sbservices_error_t sbservices_client_free(sbservices_client_t client); |
| 48 | sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state); | 48 | sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state); |
| 49 | sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate); | 49 | sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate); |
