|
libimobiledevice 1.1.1
|
Backup and restore of all device data (mobilebackup2, iOS4+ only) More...
Typedefs | |
| typedef int16_t | mobilebackup2_error_t |
| Represents an error code. | |
| typedef mobilebackup2_client_private * | mobilebackup2_client_t |
| The client handle. | |
Functions | |
| mobilebackup2_error_t | mobilebackup2_client_new (idevice_t device, uint16_t port, mobilebackup2_client_t *client) |
| Connects to the mobilebackup2 service on the specified device. | |
| mobilebackup2_error_t | mobilebackup2_client_free (mobilebackup2_client_t client) |
| Disconnects a mobilebackup2 client from the device and frees up the mobilebackup2 client data. | |
| mobilebackup2_error_t | mobilebackup2_receive_message (mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage) |
| Receives a DL* message plist from the device. | |
| mobilebackup2_error_t | mobilebackup2_send_raw (mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes) |
| Send binary data to the device. | |
| mobilebackup2_error_t | mobilebackup2_receive_raw (mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes) |
| Receive binary from the device. | |
| mobilebackup2_error_t | mobilebackup2_version_exchange (mobilebackup2_client_t client, double local_versions[], char count, double *remote_version) |
| Performs the mobilebackup2 protocol version exchange. | |
| mobilebackup2_error_t | mobilebackup2_send_request (mobilebackup2_client_t client, const char *request, const char *target_identifier, const char *source_identifier, plist_t options) |
| Send a request to the connected mobilebackup2 service. | |
| mobilebackup2_error_t | mobilebackup2_send_status_response (mobilebackup2_client_t client, int status_code, const char *status1, plist_t status2) |
| Sends a DLMessageStatusResponse to the device. | |
Error Codes | |
| #define | MOBILEBACKUP2_E_SUCCESS 0 |
| #define | MOBILEBACKUP2_E_INVALID_ARG -1 |
| #define | MOBILEBACKUP2_E_PLIST_ERROR -2 |
| #define | MOBILEBACKUP2_E_MUX_ERROR -3 |
| #define | MOBILEBACKUP2_E_BAD_VERSION -4 |
| #define | MOBILEBACKUP2_E_REPLY_NOT_OK -5 |
| #define | MOBILEBACKUP2_E_NO_COMMON_VERSION -6 |
| #define | MOBILEBACKUP2_E_UNKNOWN_ERROR -256 |
Backup and restore of all device data (mobilebackup2, iOS4+ only)
The client handle.
| typedef int16_t mobilebackup2_error_t |
Represents an error code.
| mobilebackup2_error_t mobilebackup2_client_free | ( | mobilebackup2_client_t | client | ) |
Disconnects a mobilebackup2 client from the device and frees up the mobilebackup2 client data.
| client | The mobilebackup2 client to disconnect and free. |
| mobilebackup2_error_t mobilebackup2_client_new | ( | idevice_t | device, |
| uint16_t | port, | ||
| mobilebackup2_client_t * | client | ||
| ) |
Connects to the mobilebackup2 service on the specified device.
| device | The device to connect to. |
| port | Destination port (usually given by lockdownd_start_service). |
| client | Pointer that will be set to a newly allocated mobilebackup2_client_t upon successful return. |
| mobilebackup2_error_t mobilebackup2_receive_message | ( | mobilebackup2_client_t | client, |
| plist_t * | msg_plist, | ||
| char ** | dlmessage | ||
| ) |
Receives a DL* message plist from the device.
This function is a wrapper around device_link_service_receive_message.
| client | The connected MobileBackup client to use. |
| msg_plist | Pointer to a plist that will be set to the contents of the message plist upon successful return. |
| dlmessage | A pointer that will be set to a newly allocated char* containing the DL* string from the given plist. It is up to the caller to free the allocated memory. If this parameter is NULL it will be ignored. |
| mobilebackup2_error_t mobilebackup2_receive_raw | ( | mobilebackup2_client_t | client, |
| char * | data, | ||
| uint32_t | length, | ||
| uint32_t * | bytes | ||
| ) |
Receive binary from the device.
| client | The MobileBackup client to receive from. |
| data | Pointer to a buffer that will be filled with the received data. |
| length | Number of bytes to receive. The data buffer needs to be large enough to store this amount of data. bytes Number of bytes actually received. |
| mobilebackup2_error_t mobilebackup2_send_raw | ( | mobilebackup2_client_t | client, |
| const char * | data, | ||
| uint32_t | length, | ||
| uint32_t * | bytes | ||
| ) |
Send binary data to the device.
| client | The MobileBackup client to send to. |
| data | Pointer to the data to send |
| length | Number of bytes to send |
| bytes | Number of bytes actually sent |
| mobilebackup2_error_t mobilebackup2_send_request | ( | mobilebackup2_client_t | client, |
| const char * | request, | ||
| const char * | target_identifier, | ||
| const char * | source_identifier, | ||
| plist_t | options | ||
| ) |
Send a request to the connected mobilebackup2 service.
| client | |
| request | The request to send to the backup service. Currently, this is one of "Backup", "Restore", "Info", or "List". |
| target_identifier | UUID of the target device. |
| source_identifier | UUID of backup data? |
| options | Additional options in a plist of type PLIST_DICT. |
| mobilebackup2_error_t mobilebackup2_send_status_response | ( | mobilebackup2_client_t | client, |
| int | status_code, | ||
| const char * | status1, | ||
| plist_t | status2 | ||
| ) |
Sends a DLMessageStatusResponse to the device.
| client | The MobileBackup client to use. |
| status_code | The status code to send. |
| status1 | A status message to send. Can be NULL if not required. |
| status2 | An additional status plist to attach to the response. Can be NULL if not required. |
| mobilebackup2_error_t mobilebackup2_version_exchange | ( | mobilebackup2_client_t | client, |
| double | local_versions[], | ||
| char | count, | ||
| double * | remote_version | ||
| ) |
Performs the mobilebackup2 protocol version exchange.
| client | The MobileBackup client to use. |
| local_versions | An array of supported versions to send to the remote. |
| count | The number of items in local_versions. |
| remote_version | Holds the protocol version of the remote on success. |
1.7.3