diff options
Diffstat (limited to 'include/libimobiledevice/lockdown.h')
| -rw-r--r-- | include/libimobiledevice/lockdown.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/include/libimobiledevice/lockdown.h b/include/libimobiledevice/lockdown.h new file mode 100644 index 0000000..49c708d --- /dev/null +++ b/include/libimobiledevice/lockdown.h | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /** | ||
| 2 | * @file libimobiledevice/lockdown.h | ||
| 3 | * @brief Communcation with the lockdown device daemon | ||
| 4 | * \internal | ||
| 5 | * | ||
| 6 | * Copyright (c) 2008 Zach C. All Rights Reserved. | ||
| 7 | * Copyright (c) 2009 Martin S. All Rights Reserved. | ||
| 8 | * | ||
| 9 | * This library is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU Lesser General Public | ||
| 11 | * License as published by the Free Software Foundation; either | ||
| 12 | * version 2.1 of the License, or (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This library is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * Lesser General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU Lesser General Public | ||
| 20 | * License along with this library; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef LOCKDOWN_H | ||
| 25 | #define LOCKDOWN_H | ||
| 26 | |||
| 27 | #ifdef __cplusplus | ||
| 28 | extern "C" { | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #include <libimobiledevice/libimobiledevice.h> | ||
| 32 | |||
| 33 | /* Error Codes */ | ||
| 34 | #define LOCKDOWN_E_SUCCESS 0 | ||
| 35 | #define LOCKDOWN_E_INVALID_ARG -1 | ||
| 36 | #define LOCKDOWN_E_INVALID_CONF -2 | ||
| 37 | #define LOCKDOWN_E_PLIST_ERROR -3 | ||
| 38 | #define LOCKDOWN_E_PAIRING_FAILED -4 | ||
| 39 | #define LOCKDOWN_E_SSL_ERROR -5 | ||
| 40 | #define LOCKDOWN_E_DICT_ERROR -6 | ||
| 41 | #define LOCKDOWN_E_START_SERVICE_FAILED -7 | ||
| 42 | #define LOCKDOWN_E_NOT_ENOUGH_DATA -8 | ||
| 43 | #define LOCKDOWN_E_SET_VALUE_PROHIBITED -9 | ||
| 44 | #define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 | ||
| 45 | #define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 | ||
| 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 | ||
| 51 | #define LOCKDOWN_E_INVALID_SERVICE -17 | ||
| 52 | |||
| 53 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 | ||
| 54 | |||
| 55 | typedef int16_t lockdownd_error_t; | ||
| 56 | |||
| 57 | struct lockdownd_client_int; | ||
| 58 | typedef struct lockdownd_client_int *lockdownd_client_t; | ||
| 59 | |||
| 60 | struct lockdownd_pair_record { | ||
| 61 | char *device_certificate; | ||
| 62 | char *host_certificate; | ||
| 63 | char *host_id; | ||
| 64 | char *root_certificate; | ||
| 65 | }; | ||
| 66 | typedef struct lockdownd_pair_record *lockdownd_pair_record_t; | ||
| 67 | |||
| 68 | /* Interface */ | ||
| 69 | lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, const char *label); | ||
| 70 | lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, const char *label); | ||
| 71 | lockdownd_error_t lockdownd_client_free(lockdownd_client_t client); | ||
| 72 | |||
| 73 | lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type); | ||
| 74 | lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value); | ||
| 75 | lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); | ||
| 76 | lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); | ||
| 77 | lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, uint16_t *port); | ||
| 78 | lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled); | ||
| 79 | lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id); | ||
| 80 | lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist); | ||
| 81 | lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist_t *plist); | ||
| 82 | lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record); | ||
| 83 | lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record); | ||
| 84 | lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record); | ||
| 85 | lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activation_record); | ||
| 86 | lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client); | ||
| 87 | lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client); | ||
| 88 | lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client); | ||
| 89 | |||
| 90 | /* Helper */ | ||
| 91 | void lockdownd_client_set_label(lockdownd_client_t client, const char *label); | ||
| 92 | lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); | ||
| 93 | lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); | ||
| 94 | |||
| 95 | #ifdef __cplusplus | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | |||
| 99 | #endif | ||
