libiphone/lockdown.h File Reference

Communcation with the lockdown device daemon. More...


Defines

#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

Typedefs

typedef int16_t lockdownd_error_t
typedef struct
lockdownd_client_int * 
lockdownd_client_t

Functions

lockdownd_error_t lockdownd_client_new (iphone_device_t device, lockdownd_client_t *client)
 Creates a lockdownd client for the give iPhone.
lockdownd_error_t lockdownd_client_free (lockdownd_client_t client)
 Closes the lockdownd client and does the necessary housekeeping.
lockdownd_error_t lockdownd_query_type (lockdownd_client_t client)
 Initiates the handshake for the lockdown session.
lockdownd_error_t lockdownd_get_value (lockdownd_client_t client, const char *domain, const char *key, plist_t *value)
 Retrieves a preferences plist using an optional domain and/or key name.
lockdownd_error_t lockdownd_set_value (lockdownd_client_t client, const char *domain, const char *key, plist_t value)
 Sets a preferences value using a plist and optional domain and/or key name.
lockdownd_error_t lockdownd_remove_value (lockdownd_client_t client, const char *domain, const char *key)
 Removes a preference node on the device by domain and/or key name.
lockdownd_error_t lockdownd_start_service (lockdownd_client_t client, const char *service, int *port)
 Command to start the desired service.
lockdownd_error_t lockdownd_stop_session (lockdownd_client_t client, const char *session_id)
 Closes the lockdownd communication session, by sending the StopSession Request to the device.
lockdownd_error_t lockdownd_send (lockdownd_client_t client, plist_t plist)
 Sends lockdownd data to the iPhone.
lockdownd_error_t lockdownd_recv (lockdownd_client_t client, plist_t *plist)
 Polls the iPhone for lockdownd data.
lockdownd_error_t lockdownd_pair (lockdownd_client_t client, char *uuid, char *host_id)
 Generates the appropriate keys and pairs the device.
lockdownd_error_t lockdownd_get_device_uuid (lockdownd_client_t control, char **uuid)
 Asks for the device's unique id.
lockdownd_error_t lockdownd_get_device_name (lockdownd_client_t client, char **device_name)
 Askes for the device's name.
lockdownd_error_t lockdownd_enter_recovery (lockdownd_client_t client)
 Tells the device to immediately enter recovery mode.
lockdownd_error_t lockdownd_goodbye (lockdownd_client_t client)
 Performs the Goodbye Request to tell the device the communication session is now closed.


Detailed Description

Communcation with the lockdown device daemon.


Function Documentation

lockdownd_error_t lockdownd_client_free ( lockdownd_client_t  client  ) 

Closes the lockdownd client and does the necessary housekeeping.

Parameters:
client The lockdown client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_client_new ( iphone_device_t  device,
lockdownd_client_t *  client 
)

Creates a lockdownd client for the give iPhone.

Parameters:
phone The iPhone to create a lockdownd client for
client The pointer to the location of the new lockdownd_client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_enter_recovery ( lockdownd_client_t  client  ) 

Tells the device to immediately enter recovery mode.

Parameters:
client The lockdown client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_get_device_name ( lockdownd_client_t  client,
char **  device_name 
)

Askes for the device's name.

Parameters:
client The pointer to the location of the new lockdownd_client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_get_device_uuid ( lockdownd_client_t  client,
char **  uuid 
)

Asks for the device's unique id.

Part of the lockdownd handshake.

Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_get_value ( lockdownd_client_t  client,
const char *  domain,
const char *  key,
plist_t *  value 
)

Retrieves a preferences plist using an optional domain and/or key name.

Parameters:
client an initialized lockdownd client.
domain the domain to query on or NULL for global domain
key the key name to request or NULL to query for all keys
value a plist node representing the result value node
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_goodbye ( lockdownd_client_t  client  ) 

Performs the Goodbye Request to tell the device the communication session is now closed.

Parameters:
client The lockdown client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_pair ( lockdownd_client_t  client,
char *  uuid,
char *  host_id 
)

Generates the appropriate keys and pairs the device.

It's part of the lockdownd handshake.

Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_query_type ( lockdownd_client_t  client  ) 

Initiates the handshake for the lockdown session.

Part of the lockdownd handshake.

Parameters:
client The lockdownd client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_recv ( lockdownd_client_t  client,
plist_t *  plist 
)

Polls the iPhone for lockdownd data.

Parameters:
control The lockdownd client
plist The plist to store the received data
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_remove_value ( lockdownd_client_t  client,
const char *  domain,
const char *  key 
)

Removes a preference node on the device by domain and/or key name.

Note:
: Use with caution as this could remove vital information on the device
Parameters:
client an initialized lockdownd client.
domain the domain to query on or NULL for global domain
key the key name to remove or NULL remove all keys for the current domain
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_send ( lockdownd_client_t  client,
plist_t  plist 
)

Sends lockdownd data to the iPhone.

Note:
This function is low-level and should only be used if you need to send a new type of message.
Parameters:
client The lockdownd client
plist The plist to send
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_set_value ( lockdownd_client_t  client,
const char *  domain,
const char *  key,
plist_t  value 
)

Sets a preferences value using a plist and optional domain and/or key name.

Parameters:
client an initialized lockdownd client.
domain the domain to query on or NULL for global domain
key the key name to set the value or NULL to set a value dict plist
value a plist node of any node type representing the value to set
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_start_service ( lockdownd_client_t  client,
const char *  service,
int *  port 
)

Command to start the desired service.

Parameters:
client The lockdownd client
service The name of the service to start
port The port number the service was started on
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)

lockdownd_error_t lockdownd_stop_session ( lockdownd_client_t  client,
const char *  session_id 
)

Closes the lockdownd communication session, by sending the StopSession Request to the device.

Parameters:
control The lockdown client
Returns:
an error code (LOCKDOWN_E_SUCCESS on success)


Generated on Mon Jul 27 08:42:31 2009 for libiphone by  doxygen 1.5.6