2
* @file libimobiledevice/mobilebackup2.h
3
* @brief Backup and restore of all device data (mobilebackup2, iOS4+ only)
6
* Copyright (c) 2010 Nikias Bassen All Rights Reserved.
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
#ifndef IMOBILEBACKUP2_H
24
#define IMOBILEBACKUP2_H
30
#include <libimobiledevice/libimobiledevice.h>
32
/** @name Error Codes */
34
#define MOBILEBACKUP2_E_SUCCESS 0
35
#define MOBILEBACKUP2_E_INVALID_ARG -1
36
#define MOBILEBACKUP2_E_PLIST_ERROR -2
37
#define MOBILEBACKUP2_E_MUX_ERROR -3
38
#define MOBILEBACKUP2_E_BAD_VERSION -4
39
#define MOBILEBACKUP2_E_REPLY_NOT_OK -5
40
#define MOBILEBACKUP2_E_NO_COMMON_VERSION -6
42
#define MOBILEBACKUP2_E_UNKNOWN_ERROR -256
45
/** Represents an error code. */
46
typedef int16_t mobilebackup2_error_t;
48
typedef struct mobilebackup2_client_private mobilebackup2_client_private;
49
typedef mobilebackup2_client_private *mobilebackup2_client_t; /**< The client handle. */
51
mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, uint16_t port, mobilebackup2_client_t * client);
52
mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client);
53
mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage);
54
mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes);
55
mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes);
56
mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t client, double local_versions[], char count, double *remote_version);
57
mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, const char *request, const char *target_identifier, const char *source_identifier, plist_t options);
58
mobilebackup2_error_t mobilebackup2_send_status_response(mobilebackup2_client_t client, int status_code, const char *status1, plist_t status2);