diff options
| author | 2014-03-27 10:07:09 -0400 | |
|---|---|---|
| committer | 2014-03-27 21:40:43 -0400 | |
| commit | 2342dc5b4ef148b993fbe3816f3facdef8365546 (patch) | |
| tree | 69f812d91b2fc07db0fad5dcba6c80d2f8b6849e /src/file_relay.c | |
| parent | ee82e861a8c942b5013accd7589cf898d1f97167 (diff) | |
| download | libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.gz libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.bz2 | |
Moved Doxygen comments from source files to public headers.
Conflicts:
include/libimobiledevice/afc.h
Diffstat (limited to 'src/file_relay.c')
| -rw-r--r-- | src/file_relay.c | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/src/file_relay.c b/src/file_relay.c index fb802a8..3d1eb12 100644 --- a/src/file_relay.c +++ b/src/file_relay.c | |||
| @@ -24,18 +24,6 @@ | |||
| 24 | #include "property_list_service.h" | 24 | #include "property_list_service.h" |
| 25 | #include "common/debug.h" | 25 | #include "common/debug.h" |
| 26 | 26 | ||
| 27 | /** | ||
| 28 | * Connects to the file_relay service on the specified device. | ||
| 29 | * | ||
| 30 | * @param device The device to connect to. | ||
| 31 | * @param service The service descriptor returned by lockdownd_start_service. | ||
| 32 | * @param client Reference that will point to a newly allocated | ||
| 33 | * file_relay_client_t upon successful return. | ||
| 34 | * | ||
| 35 | * @return FILE_RELAY_E_SUCCESS on success, | ||
| 36 | * FILE_RELAY_E_INVALID_ARG when one of the parameters is invalid, | ||
| 37 | * or FILE_RELAY_E_MUX_ERROR when the connection failed. | ||
| 38 | */ | ||
| 39 | file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client) | 27 | file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client) |
| 40 | { | 28 | { |
| 41 | if (!device || !service || service->port == 0 || !client || *client) { | 29 | if (!device || !service || service->port == 0 || !client || *client) { |
| @@ -56,19 +44,6 @@ file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_des | |||
| 56 | return FILE_RELAY_E_SUCCESS; | 44 | return FILE_RELAY_E_SUCCESS; |
| 57 | } | 45 | } |
| 58 | 46 | ||
| 59 | /** | ||
| 60 | * Starts a new file_relay service on the specified device and connects to it. | ||
| 61 | * | ||
| 62 | * @param device The device to connect to. | ||
| 63 | * @param client Pointer that will point to a newly allocated | ||
| 64 | * file_relay_client_t upon successful return. Must be freed using | ||
| 65 | * file_relay_client_free() after use. | ||
| 66 | * @param label The label to use for communication. Usually the program name. | ||
| 67 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 68 | * | ||
| 69 | * @return FILE_RELAY_E_SUCCESS on success, or an FILE_RELAY_E_* error | ||
| 70 | * code otherwise. | ||
| 71 | */ | ||
| 72 | file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t * client, const char* label) | 47 | file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t * client, const char* label) |
| 73 | { | 48 | { |
| 74 | file_relay_error_t err = FILE_RELAY_E_UNKNOWN_ERROR; | 49 | file_relay_error_t err = FILE_RELAY_E_UNKNOWN_ERROR; |
| @@ -76,17 +51,6 @@ file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_ | |||
| 76 | return err; | 51 | return err; |
| 77 | } | 52 | } |
| 78 | 53 | ||
| 79 | /** | ||
| 80 | * Disconnects a file_relay client from the device and frees up the file_relay | ||
| 81 | * client data. | ||
| 82 | * | ||
| 83 | * @param client The file_relay client to disconnect and free. | ||
| 84 | * | ||
| 85 | * @return FILE_RELAY_E_SUCCESS on success, | ||
| 86 | * FILE_RELAY_E_INVALID_ARG when one of client or client->parent | ||
| 87 | * is invalid, or FILE_RELAY_E_UNKNOWN_ERROR when the was an error | ||
| 88 | * freeing the parent property_list_service client. | ||
| 89 | */ | ||
| 90 | file_relay_error_t file_relay_client_free(file_relay_client_t client) | 54 | file_relay_error_t file_relay_client_free(file_relay_client_t client) |
| 91 | { | 55 | { |
| 92 | if (!client) | 56 | if (!client) |
| @@ -98,37 +62,6 @@ file_relay_error_t file_relay_client_free(file_relay_client_t client) | |||
| 98 | return FILE_RELAY_E_SUCCESS; | 62 | return FILE_RELAY_E_SUCCESS; |
| 99 | } | 63 | } |
| 100 | 64 | ||
| 101 | /** | ||
| 102 | * Request data for the given sources. | ||
| 103 | * | ||
| 104 | * @param client The connected file_relay client. | ||
| 105 | * @param sources A NULL-terminated list of sources to retrieve. | ||
| 106 | * Valid sources are: | ||
| 107 | * - AppleSupport | ||
| 108 | * - Network | ||
| 109 | * - VPN | ||
| 110 | * - WiFi | ||
| 111 | * - UserDatabases | ||
| 112 | * - CrashReporter | ||
| 113 | * - tmp | ||
| 114 | * - SystemConfiguration | ||
| 115 | * @param connection The connection that has to be used for receiving the | ||
| 116 | * data using idevice_connection_receive(). The connection will be closed | ||
| 117 | * automatically by the device, but use file_relay_client_free() to clean | ||
| 118 | * up properly. | ||
| 119 | * @param timeout Maximum time in milliseconds to wait for data. | ||
| 120 | * | ||
| 121 | * @note WARNING: Don't call this function without reading the data afterwards. | ||
| 122 | * A directory mobile_file_relay.XXXX used for creating the archive will | ||
| 123 | * remain in the /tmp directory otherwise. | ||
| 124 | * | ||
| 125 | * @return FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or | ||
| 126 | * more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication | ||
| 127 | * error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL | ||
| 128 | * or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more | ||
| 129 | * sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available | ||
| 130 | * for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise. | ||
| 131 | */ | ||
| 132 | file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout) | 65 | file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout) |
| 133 | { | 66 | { |
| 134 | if (!client || !client->parent || !sources || !sources[0]) { | 67 | if (!client || !client->parent || !sources || !sources[0]) { |
| @@ -218,37 +151,6 @@ leave: | |||
| 218 | return err; | 151 | return err; |
| 219 | } | 152 | } |
| 220 | 153 | ||
| 221 | /** | ||
| 222 | * Request data for the given sources. Calls file_relay_request_sources_timeout() with | ||
| 223 | * a timeout of 60000 milliseconds (60 seconds). | ||
| 224 | * | ||
| 225 | * @param client The connected file_relay client. | ||
| 226 | * @param sources A NULL-terminated list of sources to retrieve. | ||
| 227 | * Valid sources are: | ||
| 228 | * - AppleSupport | ||
| 229 | * - Network | ||
| 230 | * - VPN | ||
| 231 | * - WiFi | ||
| 232 | * - UserDatabases | ||
| 233 | * - CrashReporter | ||
| 234 | * - tmp | ||
| 235 | * - SystemConfiguration | ||
| 236 | * @param connection The connection that has to be used for receiving the | ||
| 237 | * data using idevice_connection_receive(). The connection will be closed | ||
| 238 | * automatically by the device, but use file_relay_client_free() to clean | ||
| 239 | * up properly. | ||
| 240 | * | ||
| 241 | * @note WARNING: Don't call this function without reading the data afterwards. | ||
| 242 | * A directory mobile_file_relay.XXXX used for creating the archive will | ||
| 243 | * remain in the /tmp directory otherwise. | ||
| 244 | * | ||
| 245 | * @return FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or | ||
| 246 | * more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication | ||
| 247 | * error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL | ||
| 248 | * or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more | ||
| 249 | * sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available | ||
| 250 | * for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise. | ||
| 251 | */ | ||
| 252 | file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection) | 154 | file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection) |
| 253 | { | 155 | { |
| 254 | return file_relay_request_sources_timeout(client, sources, connection, 60000); | 156 | return file_relay_request_sources_timeout(client, sources, connection, 60000); |
