summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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;
87typedef struct afc_client_int *afc_client_t; 87typedef struct afc_client_int *afc_client_t;
88 88
89/* Interface */ 89/* Interface */
90afc_error_t afc_client_new(iphone_device_t device, int dst_port, afc_client_t *client); 90afc_error_t afc_client_new(iphone_device_t device, uint16_t port, afc_client_t *client);
91afc_error_t afc_client_free(afc_client_t client); 91afc_error_t afc_client_free(afc_client_t client);
92afc_error_t afc_get_device_info(afc_client_t client, char ***infos); 92afc_error_t afc_get_device_info(afc_client_t client, char ***infos);
93afc_error_t afc_read_directory(afc_client_t client, const char *dir, char ***list); 93afc_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;
56typedef void (*instproxy_status_cb_t) (const char *operation, plist_t status); 56typedef void (*instproxy_status_cb_t) (const char *operation, plist_t status);
57 57
58/* Interface */ 58/* Interface */
59instproxy_error_t instproxy_client_new(iphone_device_t device, int dst_port, instproxy_client_t *client); 59instproxy_error_t instproxy_client_new(iphone_device_t device, uint16_t port, instproxy_client_t *client);
60instproxy_error_t instproxy_client_free(instproxy_client_t client); 60instproxy_error_t instproxy_client_free(instproxy_client_t client);
61 61
62instproxy_error_t instproxy_browse(instproxy_client_t client, instproxy_apptype_t apptype, plist_t *result); 62instproxy_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
44typedef int16_t iphone_error_t; 44typedef int16_t iphone_error_t;
45 45
@@ -49,15 +49,7 @@ typedef struct iphone_device_int *iphone_device_t;
49struct iphone_connection_int; 49struct iphone_connection_int;
50typedef struct iphone_connection_int *iphone_connection_t; 50typedef 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 */
60void iphone_set_debug_mask(uint16_t mask);
61void iphone_set_debug_level(int level); 53void 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);
90iphone_error_t iphone_device_free(iphone_device_t device); 82iphone_error_t iphone_device_free(iphone_device_t device);
91 83
92/* connection/disconnection and communication */ 84/* connection/disconnection and communication */
93iphone_error_t iphone_device_connect(iphone_device_t device, uint16_t dst_port, iphone_connection_t *connection); 85iphone_error_t iphone_device_connect(iphone_device_t device, uint16_t port, iphone_connection_t *connection);
94iphone_error_t iphone_device_disconnect(iphone_connection_t connection); 86iphone_error_t iphone_device_disconnect(iphone_connection_t connection);
95iphone_error_t iphone_device_send(iphone_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes); 87iphone_error_t iphone_device_send(iphone_connection_t connection, const char *data, uint32_t len, uint32_t *sent_bytes);
96iphone_error_t iphone_device_recv_timeout(iphone_connection_t connection, char *data, uint32_t len, uint32_t *recv_bytes, unsigned int timeout); 88iphone_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;
52struct lockdownd_client_int; 56struct lockdownd_client_int;
53typedef struct lockdownd_client_int *lockdownd_client_t; 57typedef struct lockdownd_client_int *lockdownd_client_t;
54 58
59struct lockdownd_pair_record {
60 char *device_certificate;
61 char *host_certificate;
62 char *host_id;
63 char *root_certificate;
64};
65typedef struct lockdownd_pair_record *lockdownd_pair_record_t;
66
55/* Interface */ 67/* Interface */
56lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client); 68lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client, const char *label);
69lockdownd_error_t lockdownd_client_new_with_handshake(iphone_device_t device, lockdownd_client_t *client, const char *label);
57lockdownd_error_t lockdownd_client_free(lockdownd_client_t client); 70lockdownd_error_t lockdownd_client_free(lockdownd_client_t client);
58lockdownd_error_t lockdownd_query_type(lockdownd_client_t client); 71
72lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type);
59lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value); 73lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value);
60lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); 74lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value);
61lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); 75lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key);
62lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, int *port); 76lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, uint16_t *port);
63lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client); 77lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled);
78lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id);
64lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); 79lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist);
65lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist); 80lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist);
66lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *host_id); 81lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record);
67lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, char *host_id); 82lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record);
68lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); 83lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record);
69lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); 84lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record);
85lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client);
70lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client); 86lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client);
71lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client); 87lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client);
72 88
89/* Helper */
90void lockdownd_client_set_label(lockdownd_client_t client, const char *label);
91lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid);
92lockdownd_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;
43struct mobilesync_client_int; 43struct mobilesync_client_int;
44typedef struct mobilesync_client_int *mobilesync_client_t; 44typedef struct mobilesync_client_int *mobilesync_client_t;
45 45
46mobilesync_error_t mobilesync_client_new(iphone_device_t device, int dst_port, mobilesync_client_t * client); 46mobilesync_error_t mobilesync_client_new(iphone_device_t device, uint16_t port, mobilesync_client_t * client);
47mobilesync_error_t mobilesync_client_free(mobilesync_client_t client); 47mobilesync_error_t mobilesync_client_free(mobilesync_client_t client);
48mobilesync_error_t mobilesync_recv(mobilesync_client_t client, plist_t *plist); 48mobilesync_error_t mobilesync_recv(mobilesync_client_t client, plist_t *plist);
49mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist); 49mobilesync_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" {
40typedef int16_t np_error_t; 40typedef 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
59struct np_client_int; 70struct np_client_int;
60typedef struct np_client_int *np_client_t; 71typedef struct np_client_int *np_client_t;
@@ -62,7 +73,7 @@ typedef struct np_client_int *np_client_t;
62typedef void (*np_notify_cb_t) (const char *notification); 73typedef void (*np_notify_cb_t) (const char *notification);
63 74
64/* Interface */ 75/* Interface */
65np_error_t np_client_new(iphone_device_t device, int dst_port, np_client_t *client); 76np_error_t np_client_new(iphone_device_t device, uint16_t port, np_client_t *client);
66np_error_t np_client_free(np_client_t client); 77np_error_t np_client_free(np_client_t client);
67np_error_t np_post_notification(np_client_t client, const char *notification); 78np_error_t np_post_notification(np_client_t client, const char *notification);
68np_error_t np_observe_notification(np_client_t client, const char *notification); 79np_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;
43typedef struct sbservices_client_int *sbservices_client_t; 43typedef struct sbservices_client_int *sbservices_client_t;
44 44
45/* Interface */ 45/* Interface */
46sbservices_error_t sbservices_client_new(iphone_device_t device, int dst_port, sbservices_client_t *client); 46sbservices_error_t sbservices_client_new(iphone_device_t device, uint16_t port, sbservices_client_t *client);
47sbservices_error_t sbservices_client_free(sbservices_client_t client); 47sbservices_error_t sbservices_client_free(sbservices_client_t client);
48sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state); 48sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state);
49sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate); 49sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate);