diff options
| author | 2009-07-07 21:02:00 +0200 | |
|---|---|---|
| committer | 2009-07-18 10:39:42 -0700 | |
| commit | b8ce722ffaeab22e141e18907c46bbed4659d857 (patch) | |
| tree | b30563dacd1ef2699fe79af9695bf237e1e688aa /dev/iphoneinfo.c | |
| parent | ab8e29dafc0577203e6867329b1d3ff9095a4fb2 (diff) | |
| download | libimobiledevice-b8ce722ffaeab22e141e18907c46bbed4659d857.tar.gz libimobiledevice-b8ce722ffaeab22e141e18907c46bbed4659d857.tar.bz2 | |
Cleanup lockdown request API and fix docs, tools, bindings and exports
Diffstat (limited to 'dev/iphoneinfo.c')
| -rw-r--r-- | dev/iphoneinfo.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/dev/iphoneinfo.c b/dev/iphoneinfo.c index 18ee055..7c823e6 100644 --- a/dev/iphoneinfo.c +++ b/dev/iphoneinfo.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
| 26 | 26 | ||
| 27 | #include <libiphone/libiphone.h> | 27 | #include <libiphone/libiphone.h> |
| 28 | #include <libiphone/lockdown.h> | ||
| 28 | 29 | ||
| 29 | #define FORMAT_KEY_VALUE 1 | 30 | #define FORMAT_KEY_VALUE 1 |
| 30 | #define FORMAT_XML 2 | 31 | #define FORMAT_XML 2 |
| @@ -45,13 +46,13 @@ static const char *domains[] = { | |||
| 45 | 46 | ||
| 46 | int is_domain_known(char *domain); | 47 | int is_domain_known(char *domain); |
| 47 | void print_usage(int argc, char **argv); | 48 | void print_usage(int argc, char **argv); |
| 48 | void print_lckd_request_result(iphone_lckd_client_t control, const char *domain, const char *request, const char *key, int format); | 49 | void print_lckd_request_result(lockdownd_client_t client, const char *domain, const char *request, const char *key, int format); |
| 49 | void plist_node_to_string(plist_t *node); | 50 | void plist_node_to_string(plist_t *node); |
| 50 | void plist_children_to_string(plist_t *node); | 51 | void plist_children_to_string(plist_t *node); |
| 51 | 52 | ||
| 52 | int main(int argc, char *argv[]) | 53 | int main(int argc, char *argv[]) |
| 53 | { | 54 | { |
| 54 | iphone_lckd_client_t control = NULL; | 55 | lockdownd_client_t client = NULL; |
| 55 | iphone_device_t phone = NULL; | 56 | iphone_device_t phone = NULL; |
| 56 | iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; | 57 | iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; |
| 57 | int i; | 58 | int i; |
| @@ -128,17 +129,17 @@ int main(int argc, char *argv[]) | |||
| 128 | } | 129 | } |
| 129 | } | 130 | } |
| 130 | 131 | ||
| 131 | if (IPHONE_E_SUCCESS != iphone_lckd_new_client(phone, &control)) { | 132 | if (IPHONE_E_SUCCESS != lockdownd_new_client(phone, &client)) { |
| 132 | iphone_free_device(phone); | 133 | iphone_free_device(phone); |
| 133 | return -1; | 134 | return -1; |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | /* run query and output information */ | 137 | /* run query and output information */ |
| 137 | print_lckd_request_result(control, domain, "GetValue", key, format); | 138 | print_lckd_request_result(client, domain, "GetValue", key, format); |
| 138 | 139 | ||
| 139 | if (domain != NULL) | 140 | if (domain != NULL) |
| 140 | free(domain); | 141 | free(domain); |
| 141 | iphone_lckd_free_client(control); | 142 | lockdownd_free_client(client); |
| 142 | iphone_free_device(phone); | 143 | iphone_free_device(phone); |
| 143 | 144 | ||
| 144 | return 0; | 145 | return 0; |
| @@ -248,7 +249,7 @@ void plist_children_to_string(plist_t *node) | |||
| 248 | } | 249 | } |
| 249 | } | 250 | } |
| 250 | 251 | ||
| 251 | void print_lckd_request_result(iphone_lckd_client_t control, const char *domain, const char *request, const char *key, int format) { | 252 | void print_lckd_request_result(lockdownd_client_t client, const char *domain, const char *request, const char *key, int format) { |
| 252 | char *xml_doc = NULL; | 253 | char *xml_doc = NULL; |
| 253 | char *s = NULL; | 254 | char *s = NULL; |
| 254 | uint32_t xml_length = 0; | 255 | uint32_t xml_length = 0; |
| @@ -266,11 +267,11 @@ void print_lckd_request_result(iphone_lckd_client_t control, const char *domain, | |||
| 266 | plist_add_sub_key_el(node, "Request"); | 267 | plist_add_sub_key_el(node, "Request"); |
| 267 | plist_add_sub_string_el(node, request); | 268 | plist_add_sub_string_el(node, request); |
| 268 | 269 | ||
| 269 | ret = iphone_lckd_send(control, node); | 270 | ret = lockdownd_send(client, node); |
| 270 | if (ret == IPHONE_E_SUCCESS) { | 271 | if (ret == IPHONE_E_SUCCESS) { |
| 271 | plist_free(node); | 272 | plist_free(node); |
| 272 | node = NULL; | 273 | node = NULL; |
| 273 | ret = iphone_lckd_recv(control, &node); | 274 | ret = lockdownd_recv(client, &node); |
| 274 | if (ret == IPHONE_E_SUCCESS) { | 275 | if (ret == IPHONE_E_SUCCESS) { |
| 275 | /* seek to value node */ | 276 | /* seek to value node */ |
| 276 | for ( | 277 | for ( |
