summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/file_relay.h
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2014-03-27 10:07:09 -0400
committerGravatar Aaron Burghardt2014-03-27 21:40:43 -0400
commit2342dc5b4ef148b993fbe3816f3facdef8365546 (patch)
tree69f812d91b2fc07db0fad5dcba6c80d2f8b6849e /include/libimobiledevice/file_relay.h
parentee82e861a8c942b5013accd7589cf898d1f97167 (diff)
downloadlibimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.gz
libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.bz2
Moved Doxygen comments from source files to public headers.
Conflicts: include/libimobiledevice/afc.h
Diffstat (limited to 'include/libimobiledevice/file_relay.h')
-rw-r--r--include/libimobiledevice/file_relay.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/include/libimobiledevice/file_relay.h b/include/libimobiledevice/file_relay.h
index d197f2e..f9318bd 100644
--- a/include/libimobiledevice/file_relay.h
+++ b/include/libimobiledevice/file_relay.h
@@ -50,11 +50,113 @@ typedef int16_t file_relay_error_t;
50typedef struct file_relay_client_private file_relay_client_private; 50typedef struct file_relay_client_private file_relay_client_private;
51typedef file_relay_client_private *file_relay_client_t; /**< The client handle. */ 51typedef file_relay_client_private *file_relay_client_t; /**< The client handle. */
52 52
53/**
54 * Connects to the file_relay service on the specified device.
55 *
56 * @param device The device to connect to.
57 * @param service The service descriptor returned by lockdownd_start_service.
58 * @param client Reference that will point to a newly allocated
59 * file_relay_client_t upon successful return.
60 *
61 * @return FILE_RELAY_E_SUCCESS on success,
62 * FILE_RELAY_E_INVALID_ARG when one of the parameters is invalid,
63 * or FILE_RELAY_E_MUX_ERROR when the connection failed.
64 */
53file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client); 65file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client);
66
67/**
68 * Starts a new file_relay service on the specified device and connects to it.
69 *
70 * @param device The device to connect to.
71 * @param client Pointer that will point to a newly allocated
72 * file_relay_client_t upon successful return. Must be freed using
73 * file_relay_client_free() after use.
74 * @param label The label to use for communication. Usually the program name.
75 * Pass NULL to disable sending the label in requests to lockdownd.
76 *
77 * @return FILE_RELAY_E_SUCCESS on success, or an FILE_RELAY_E_* error
78 * code otherwise.
79 */
54file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t* client, const char* label); 80file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t* client, const char* label);
81
82/**
83 * Disconnects a file_relay client from the device and frees up the file_relay
84 * client data.
85 *
86 * @param client The file_relay client to disconnect and free.
87 *
88 * @return FILE_RELAY_E_SUCCESS on success,
89 * FILE_RELAY_E_INVALID_ARG when one of client or client->parent
90 * is invalid, or FILE_RELAY_E_UNKNOWN_ERROR when the was an error
91 * freeing the parent property_list_service client.
92 */
55file_relay_error_t file_relay_client_free(file_relay_client_t client); 93file_relay_error_t file_relay_client_free(file_relay_client_t client);
56 94
95
96/**
97 * Request data for the given sources.
98 *
99 * @param client The connected file_relay client.
100 * @param sources A NULL-terminated list of sources to retrieve.
101 * Valid sources are:
102 * - AppleSupport
103 * - Network
104 * - VPN
105 * - WiFi
106 * - UserDatabases
107 * - CrashReporter
108 * - tmp
109 * - SystemConfiguration
110 * @param connection The connection that has to be used for receiving the
111 * data using idevice_connection_receive(). The connection will be closed
112 * automatically by the device, but use file_relay_client_free() to clean
113 * up properly.
114 * @param timeout Maximum time in milliseconds to wait for data.
115 *
116 * @note WARNING: Don't call this function without reading the data afterwards.
117 * A directory mobile_file_relay.XXXX used for creating the archive will
118 * remain in the /tmp directory otherwise.
119 *
120 * @return FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or
121 * more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication
122 * error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL
123 * or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more
124 * sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available
125 * for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise.
126 */
57file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection); 127file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection);
128
129/**
130 * Request data for the given sources. Calls file_relay_request_sources_timeout() with
131 * a timeout of 60000 milliseconds (60 seconds).
132 *
133 * @param client The connected file_relay client.
134 * @param sources A NULL-terminated list of sources to retrieve.
135 * Valid sources are:
136 * - AppleSupport
137 * - Network
138 * - VPN
139 * - WiFi
140 * - UserDatabases
141 * - CrashReporter
142 * - tmp
143 * - SystemConfiguration
144 * @param connection The connection that has to be used for receiving the
145 * data using idevice_connection_receive(). The connection will be closed
146 * automatically by the device, but use file_relay_client_free() to clean
147 * up properly.
148 *
149 * @note WARNING: Don't call this function without reading the data afterwards.
150 * A directory mobile_file_relay.XXXX used for creating the archive will
151 * remain in the /tmp directory otherwise.
152 *
153 * @return FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or
154 * more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication
155 * error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL
156 * or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more
157 * sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available
158 * for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise.
159 */
58file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout); 160file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout);
59 161
60#ifdef __cplusplus 162#ifdef __cplusplus