<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libimobiledevice: libimobiledevice/mobile_image_mounter.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div class="contents"> <h1>libimobiledevice/mobile_image_mounter.h File Reference</h1> <p>Implementation of the mobile image mounter service. <a href="#_details">More...</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef int16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Represents an error code. <a href="#ae0b7c39de39769f44bba8dd94e9b03a8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/> <a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_private</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae7690ee36890c0c64933107e86c1ab0f">mobile_image_mounter_client_t</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The client handle. <a href="#ae7690ee36890c0c64933107e86c1ab0f"></a><br/></td></tr> <tr><td colspan="2"><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#a44b66755d06202d4b592227106529ce4">mobile_image_mounter_new</a> (<a class="el" href="structidevice__private.html">idevice_t</a> device, uint16_t port, <a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> *client)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Connects to the mobile_image_mounter service on the specified device. <a href="#a44b66755d06202d4b592227106529ce4"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#a840a19c567f46f66f1731babb8c608d1">mobile_image_mounter_free</a> (<a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> client)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Disconnects a mobile_image_mounter client from the device and frees up the mobile_image_mounter client data. <a href="#a840a19c567f46f66f1731babb8c608d1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#a36eaa679c99ce97b4d4101691cee5fc3">mobile_image_mounter_lookup_image</a> (<a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> client, const char *image_type, plist_t *result)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Tells if the image of ImageType is already mounted. <a href="#a36eaa679c99ce97b4d4101691cee5fc3"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#a8b2d5a1a5aca62984095f5a5731ea9cb">mobile_image_mounter_mount_image</a> (<a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> client, const char *image_path, const char *image_signature, uint16_t signature_length, const char *image_type, plist_t *result)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Mounts an image on the device. <a href="#a8b2d5a1a5aca62984095f5a5731ea9cb"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#a0b171083275b80170677f4e7c2b6200a">mobile_image_mounter_hangup</a> (<a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> client)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Hangs up the connection to the mobile_image_mounter service. <a href="#a0b171083275b80170677f4e7c2b6200a"></a><br/></td></tr> <tr><td colspan="2"><h2>Error Codes</h2></td></tr> <tr><td colspan="2"><p><a class="anchor" id="amgrp5c244138ac975df1b1cec1afc71a6c9a"></a> </p> <br/><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a009f8723f2cc02a019de2b15d750abe6"></a><!-- doxytag: member="include/libimobiledevice/mobile_image_mounter.h::MOBILE_IMAGE_MOUNTER_E_SUCCESS" ref="a009f8723f2cc02a019de2b15d750abe6" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>MOBILE_IMAGE_MOUNTER_E_SUCCESS</b> 0</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a217d6ea66fbb8d8759a0e7cb50244072"></a><!-- doxytag: member="include/libimobiledevice/mobile_image_mounter.h::MOBILE_IMAGE_MOUNTER_E_INVALID_ARG" ref="a217d6ea66fbb8d8759a0e7cb50244072" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>MOBILE_IMAGE_MOUNTER_E_INVALID_ARG</b> -1</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4f2241cb27ea2fbd00fe255945c5b33"></a><!-- doxytag: member="include/libimobiledevice/mobile_image_mounter.h::MOBILE_IMAGE_MOUNTER_E_PLIST_ERROR" ref="ad4f2241cb27ea2fbd00fe255945c5b33" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>MOBILE_IMAGE_MOUNTER_E_PLIST_ERROR</b> -2</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad35bff9a902ebb2fdc5d97f1a61dc3c5"></a><!-- doxytag: member="include/libimobiledevice/mobile_image_mounter.h::MOBILE_IMAGE_MOUNTER_E_CONN_FAILED" ref="ad35bff9a902ebb2fdc5d97f1a61dc3c5" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>MOBILE_IMAGE_MOUNTER_E_CONN_FAILED</b> -3</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81d6dc3bb4330021394173d6b5166623"></a><!-- doxytag: member="include/libimobiledevice/mobile_image_mounter.h::MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR" ref="a81d6dc3bb4330021394173d6b5166623" args="" --> #define </td><td class="memItemRight" valign="bottom"><b>MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR</b> -256</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Implementation of the mobile image mounter service. </p> <hr/><h2>Typedef Documentation</h2> <a class="anchor" id="ae7690ee36890c0c64933107e86c1ab0f"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_client_t" ref="ae7690ee36890c0c64933107e86c1ab0f" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_private</a>* <a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a></td> </tr> </table> </div> <div class="memdoc"> <p>The client handle. </p> </div> </div> <a class="anchor" id="ae0b7c39de39769f44bba8dd94e9b03a8"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_error_t" ref="ae0b7c39de39769f44bba8dd94e9b03a8" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int16_t <a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a></td> </tr> </table> </div> <div class="memdoc"> <p>Represents an error code. </p> </div> </div> <hr/><h2>Function Documentation</h2> <a class="anchor" id="a840a19c567f46f66f1731babb8c608d1"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_free" ref="a840a19c567f46f66f1731babb8c608d1" args="(mobile_image_mounter_client_t client)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> mobile_image_mounter_free </td> <td>(</td> <td class="paramtype"><a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> </td> <td class="paramname"> <em>client</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Disconnects a mobile_image_mounter client from the device and frees up the mobile_image_mounter client data. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>client</em> </td><td>The mobile_image_mounter client to disconnect and free.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, or MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if client is NULL. </dd></dl> </div> </div> <a class="anchor" id="a0b171083275b80170677f4e7c2b6200a"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_hangup" ref="a0b171083275b80170677f4e7c2b6200a" args="(mobile_image_mounter_client_t client)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> mobile_image_mounter_hangup </td> <td>(</td> <td class="paramtype"><a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> </td> <td class="paramname"> <em>client</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Hangs up the connection to the mobile_image_mounter service. </p> <p>This functions has to be called before freeing up a mobile_image_mounter instance. If not, errors appear in the device's syslog.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>client</em> </td><td>The client to hang up</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if client is invalid, or another error code otherwise. </dd></dl> </div> </div> <a class="anchor" id="a36eaa679c99ce97b4d4101691cee5fc3"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_lookup_image" ref="a36eaa679c99ce97b4d4101691cee5fc3" args="(mobile_image_mounter_client_t client, const char *image_type, plist_t *result)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> mobile_image_mounter_lookup_image </td> <td>(</td> <td class="paramtype"><a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> </td> <td class="paramname"> <em>client</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>image_type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">plist_t * </td> <td class="paramname"> <em>result</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Tells if the image of ImageType is already mounted. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>client</em> </td><td>The client use </td></tr> <tr><td valign="top"></td><td valign="top"><em>image_type</em> </td><td>The type of the image to look up </td></tr> <tr><td valign="top"></td><td valign="top"><em>result</em> </td><td>Pointer to a plist that will receive the result of the operation.</td></tr> </table> </dd> </dl> <dl class="note"><dt><b>Note:</b></dt><dd>This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the operation has failed. Check the resulting plist for further information.</dd></dl> <dl class="return"><dt><b>Returns:</b></dt><dd>MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, or an error code on error </dd></dl> </div> </div> <a class="anchor" id="a8b2d5a1a5aca62984095f5a5731ea9cb"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_mount_image" ref="a8b2d5a1a5aca62984095f5a5731ea9cb" args="(mobile_image_mounter_client_t client, const char *image_path, const char *image_signature, uint16_t signature_length, const char *image_type, plist_t *result)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> mobile_image_mounter_mount_image </td> <td>(</td> <td class="paramtype"><a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> </td> <td class="paramname"> <em>client</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>image_path</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>image_signature</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>signature_length</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>image_type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">plist_t * </td> <td class="paramname"> <em>result</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Mounts an image on the device. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>client</em> </td><td>The connected mobile_image_mounter client. </td></tr> <tr><td valign="top"></td><td valign="top"><em>image_path</em> </td><td>The absolute path of the image to mount. The image must be present before calling this function. </td></tr> <tr><td valign="top"></td><td valign="top"><em>image_signature</em> </td><td>Pointer to a buffer holding the images' signature </td></tr> <tr><td valign="top"></td><td valign="top"><em>signature_length</em> </td><td>Length of the signature image_signature points to </td></tr> <tr><td valign="top"></td><td valign="top"><em>image_type</em> </td><td>Type of image to mount </td></tr> <tr><td valign="top"></td><td valign="top"><em>result</em> </td><td>Pointer to a plist that will receive the result of the operation.</td></tr> </table> </dd> </dl> <dl class="note"><dt><b>Note:</b></dt><dd>This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the operation has failed. Check the resulting plist for further information. Note that there is no unmounting function. The mount persists until the device is rebooted.</dd></dl> <dl class="return"><dt><b>Returns:</b></dt><dd>MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if on ore more parameters are invalid, or another error code otherwise. </dd></dl> </div> </div> <a class="anchor" id="a44b66755d06202d4b592227106529ce4"></a><!-- doxytag: member="mobile_image_mounter.h::mobile_image_mounter_new" ref="a44b66755d06202d4b592227106529ce4" args="(idevice_t device, uint16_t port, mobile_image_mounter_client_t *client)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="include_2libimobiledevice_2mobile__image__mounter_8h.html#ae0b7c39de39769f44bba8dd94e9b03a8">mobile_image_mounter_error_t</a> mobile_image_mounter_new </td> <td>(</td> <td class="paramtype"><a class="el" href="structidevice__private.html">idevice_t</a> </td> <td class="paramname"> <em>device</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>port</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="structmobile__image__mounter__client__private.html">mobile_image_mounter_client_t</a> * </td> <td class="paramname"> <em>client</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Connects to the mobile_image_mounter service on the specified device. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>device</em> </td><td>The device to connect to. </td></tr> <tr><td valign="top"></td><td valign="top"><em>port</em> </td><td>Destination port (usually given by lockdownd_start_service). </td></tr> <tr><td valign="top"></td><td valign="top"><em>client</em> </td><td>Pointer that will be set to a newly allocated mobile_image_mounter_client_t upon successful return.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if device is NULL, or MOBILE_IMAGE_MOUNTER_E_CONN_FAILED if the connection to the device could not be established. </dd></dl> </div> </div> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Sat Nov 27 19:58:07 2010 for libimobiledevice by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>