summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/misagent.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libimobiledevice/misagent.h')
-rw-r--r--include/libimobiledevice/misagent.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/include/libimobiledevice/misagent.h b/include/libimobiledevice/misagent.h
index fe0acb2..7bb7333 100644
--- a/include/libimobiledevice/misagent.h
+++ b/include/libimobiledevice/misagent.h
@@ -50,13 +50,95 @@ typedef struct misagent_client_private misagent_client_private;
50typedef misagent_client_private *misagent_client_t; /**< The client handle. */ 50typedef misagent_client_private *misagent_client_t; /**< The client handle. */
51 51
52/* Interface */ 52/* Interface */
53
54/**
55 * Connects to the misagent service on the specified device.
56 *
57 * @param device The device to connect to.
58 * @param service The service descriptor returned by lockdownd_start_service.
59 * @param client Pointer that will point to a newly allocated
60 * misagent_client_t upon successful return.
61 *
62 * @return MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
63 * client is NULL, or an MISAGENT_E_* error code otherwise.
64 */
53misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descriptor_t service, misagent_client_t *client); 65misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descriptor_t service, misagent_client_t *client);
66
67/**
68 * Starts a new misagent 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 * misagent_client_t upon successful return. Must be freed using
73 * misagent_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 MISAGENT_E_SUCCESS on success, or an MISAGENT_E_* error
78 * code otherwise.
79 */
54misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t* client, const char* label); 80misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t* client, const char* label);
81
82/**
83 * Disconnects an misagent client from the device and frees up the
84 * misagent client data.
85 *
86 * @param client The misagent client to disconnect and free.
87 *
88 * @return MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
89 * client is NULL, or an MISAGENT_E_* error code otherwise.
90 */
55misagent_error_t misagent_client_free(misagent_client_t client); 91misagent_error_t misagent_client_free(misagent_client_t client);
56 92
93
94/**
95 * Installs the given provisioning profile. Only works with valid profiles.
96 *
97 * @param client The connected misagent to use for installation
98 * @param profile The valid provisioning profile to install. This has to be
99 * passed as a PLIST_DATA, otherwise the function will fail.
100 *
101 * @return MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
102 * client is invalid, or an MISAGENT_E_* error code otherwise.
103 */
57misagent_error_t misagent_install(misagent_client_t client, plist_t profile); 104misagent_error_t misagent_install(misagent_client_t client, plist_t profile);
105
106/**
107 * Retrieves an array of all installed provisioning profiles.
108 *
109 * @param client The connected misagent to use.
110 * @param profiles Pointer to a plist_t that will be set to a PLIST_ARRAY
111 * if the function is successful.
112 *
113 * @return MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
114 * client is invalid, or an MISAGENT_E_* error code otherwise.
115 *
116 * @note If no provisioning profiles are installed on the device, this function
117 * still returns MISAGENT_E_SUCCESS and profiles will just point to an
118 * empty array.
119 */
58misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles); 120misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles);
121
122/**
123 * Removes a given provisioning profile.
124 *
125 * @param client The connected misagent to use.
126 * @param profileID Identifier of the provisioning profile to remove.
127 * This is a UUID that can be obtained from the provisioning profile data.
128 * @see misagent_copy
129 *
130 * @return MISAGENT_E_SUCCESS on success, MISAGENT_E_INVALID_ARG when
131 * client is invalid, or an MISAGENT_E_* error code otherwise.
132 */
59misagent_error_t misagent_remove(misagent_client_t client, const char* profileID); 133misagent_error_t misagent_remove(misagent_client_t client, const char* profileID);
134
135/**
136 * Retrieves the status code from the last operation.
137 *
138 * @param client The misagent to use.
139 *
140 * @return -1 if client is invalid, or the status code from the last operation
141 */
60int misagent_get_status_code(misagent_client_t client); 142int misagent_get_status_code(misagent_client_t client);
61 143
62#ifdef __cplusplus 144#ifdef __cplusplus