From 62a6f558ac7ca7a9b83c2ed810929732c02bbc9d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 7 Jul 2009 21:02:00 +0200 Subject: Cleanup lockdown request API and fix docs, tools, bindings and exports --- include/libiphone/lockdown.h | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 include/libiphone/lockdown.h (limited to 'include/libiphone/lockdown.h') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h new file mode 100644 index 0000000..805c90b --- /dev/null +++ b/include/libiphone/lockdown.h @@ -0,0 +1,51 @@ +/* + * lockdownd.h + * + * Copyright (c) 2009 Martin S. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LOCKDOWN_H +#define LOCKDOWN_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct lockdownd_client_int; +typedef struct lockdownd_client_int *lockdownd_client_t; + +//lockdownd related functions +iphone_error_t lockdownd_new_client (iphone_device_t device, lockdownd_client_t *client); +iphone_error_t lockdownd_free_client(lockdownd_client_t client); +iphone_error_t lockdownd_query_type(lockdownd_client_t client); +iphone_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value_node); +iphone_error_t lockdownd_start_service (lockdownd_client_t client, const char *service, int *port); +iphone_error_t lockdownd_stop_session(lockdownd_client_t client); +iphone_error_t lockdownd_send (lockdownd_client_t client, plist_t plist); +iphone_error_t lockdownd_recv (lockdownd_client_t client, plist_t *plist); +iphone_error_t lockdownd_pair(lockdownd_client_t client, char *uid, char *host_id); +iphone_error_t lockdownd_get_device_uid (lockdownd_client_t control, char **uid); +iphone_error_t lockdownd_get_device_name (lockdownd_client_t client, char **device_name); +iphone_error_t lockdownd_goodbye(lockdownd_client_t client); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.1-32-gdbae From 654e58d4526f48d44361dcc81d6d0a1b79663b1d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 15 Jul 2009 16:16:40 +0200 Subject: Implement lockdown set_value, remove_value and enter_recovery request API --- include/libiphone/lockdown.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/libiphone/lockdown.h') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index 805c90b..20ccf77 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -34,7 +34,9 @@ typedef struct lockdownd_client_int *lockdownd_client_t; iphone_error_t lockdownd_new_client (iphone_device_t device, lockdownd_client_t *client); iphone_error_t lockdownd_free_client(lockdownd_client_t client); iphone_error_t lockdownd_query_type(lockdownd_client_t client); -iphone_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value_node); +iphone_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value); +iphone_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); +iphone_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); iphone_error_t lockdownd_start_service (lockdownd_client_t client, const char *service, int *port); iphone_error_t lockdownd_stop_session(lockdownd_client_t client); iphone_error_t lockdownd_send (lockdownd_client_t client, plist_t plist); @@ -42,6 +44,7 @@ iphone_error_t lockdownd_recv (lockdownd_client_t client, plist_t *plist); iphone_error_t lockdownd_pair(lockdownd_client_t client, char *uid, char *host_id); iphone_error_t lockdownd_get_device_uid (lockdownd_client_t control, char **uid); iphone_error_t lockdownd_get_device_name (lockdownd_client_t client, char **device_name); +iphone_error_t lockdownd_enter_recovery(lockdownd_client_t client); iphone_error_t lockdownd_goodbye(lockdownd_client_t client); #ifdef __cplusplus -- cgit v1.1-32-gdbae From f5e9d76ebd74999512ab73f44fabba86879b1c1f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 02:40:25 +0200 Subject: Update lockdown API and introduce new error codes --- include/libiphone/lockdown.h | 51 ++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 16 deletions(-) (limited to 'include/libiphone/lockdown.h') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index 20ccf77..55c0cb7 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -27,25 +27,44 @@ extern "C" { #include +/* Error Codes */ +#define LOCKDOWN_E_SUCCESS 0 +#define LOCKDOWN_E_INVALID_ARG -1 +#define LOCKDOWN_E_INVALID_CONF -2 +#define LOCKDOWN_E_PLIST_ERROR -3 +#define LOCKDOWN_E_PAIRING_FAILED -4 +#define LOCKDOWN_E_SSL_ERROR -5 +#define LOCKDOWN_E_DICT_ERROR -6 +#define LOCKDOWN_E_START_SERVICE_FAILED -7 +#define LOCKDOWN_E_NOT_ENOUGH_DATA -8 +#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9 +#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 +#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 +#define LOCKDOWN_E_MUX_ERROR -12 + +#define LOCKDOWN_E_UNKNOWN_ERROR -256 + +typedef int16_t lockdownd_error_t; + struct lockdownd_client_int; typedef struct lockdownd_client_int *lockdownd_client_t; -//lockdownd related functions -iphone_error_t lockdownd_new_client (iphone_device_t device, lockdownd_client_t *client); -iphone_error_t lockdownd_free_client(lockdownd_client_t client); -iphone_error_t lockdownd_query_type(lockdownd_client_t client); -iphone_error_t lockdownd_get_value(lockdownd_client_t client, const char *domain, const char *key, plist_t *value); -iphone_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value); -iphone_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key); -iphone_error_t lockdownd_start_service (lockdownd_client_t client, const char *service, int *port); -iphone_error_t lockdownd_stop_session(lockdownd_client_t client); -iphone_error_t lockdownd_send (lockdownd_client_t client, plist_t plist); -iphone_error_t lockdownd_recv (lockdownd_client_t client, plist_t *plist); -iphone_error_t lockdownd_pair(lockdownd_client_t client, char *uid, char *host_id); -iphone_error_t lockdownd_get_device_uid (lockdownd_client_t control, char **uid); -iphone_error_t lockdownd_get_device_name (lockdownd_client_t client, char **device_name); -iphone_error_t lockdownd_enter_recovery(lockdownd_client_t client); -iphone_error_t lockdownd_goodbye(lockdownd_client_t client); +/* Interface */ +lockdownd_error_t lockdownd_client_new(iphone_device_t device, lockdownd_client_t *client); +lockdownd_error_t lockdownd_client_free(lockdownd_client_t client); +lockdownd_error_t lockdownd_query_type(lockdownd_client_t client); +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_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 *uuid, 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_enter_recovery(lockdownd_client_t client); +lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client); #ifdef __cplusplus } -- cgit v1.1-32-gdbae From da94f0ebc7232e8e9d0e629fe559b7bc93d9a1c6 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 18:12:49 +0200 Subject: Update doxygen config and allow generation of documentation --- include/libiphone/lockdown.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/libiphone/lockdown.h') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index 55c0cb7..daa5800 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -1,6 +1,9 @@ -/* - * lockdownd.h +/** + * @file libiphone/lockdown.h + * @brief Communcation with the lockdown device daemon + * \internal * + * Copyright (c) 2008 Zach C. All Rights Reserved. * Copyright (c) 2009 Martin S. All Rights Reserved. * * This library is free software; you can redistribute it and/or -- cgit v1.1-32-gdbae From 19c9750d670435ce430f0fc85a55faf127bdfbf9 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 18:23:54 +0200 Subject: Conform to protocol and add session id argument to lockdownd_stop_session() --- include/libiphone/lockdown.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/libiphone/lockdown.h') diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index daa5800..af58190 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h @@ -60,7 +60,7 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom 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_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 *uuid, char *host_id); -- cgit v1.1-32-gdbae