diff options
| author | 2008-08-06 00:10:25 -0700 | |
|---|---|---|
| committer | 2008-08-06 00:10:25 -0700 | |
| commit | d81a3c5c412cca9b8327d6d27625bc52650e9651 (patch) | |
| tree | 23986c22a08126efcf29c0ad637424a8858c2e00 | |
| parent | 2dcc296d9209b02d3e794f953fcf995a4a19a498 (diff) | |
| download | libimobiledevice-d81a3c5c412cca9b8327d6d27625bc52650e9651.tar.gz libimobiledevice-d81a3c5c412cca9b8327d6d27625bc52650e9651.tar.bz2 | |
Finish converting over to doxygen.
(I thought there was more documentation there but apparently we need to add
some)
| -rw-r--r-- | src/usbmux.c | 59 | ||||
| -rw-r--r-- | src/userpref.h | 48 |
2 files changed, 50 insertions, 57 deletions
diff --git a/src/usbmux.c b/src/usbmux.c index c5b7535..235a1f2 100644 --- a/src/usbmux.c +++ b/src/usbmux.c | |||
| @@ -60,12 +60,11 @@ usbmux_version_header *version_header() { | |||
| 60 | 60 | ||
| 61 | // Maintenance functions. | 61 | // Maintenance functions. |
| 62 | 62 | ||
| 63 | /* delete_connection(connection) | 63 | /** Removes a connection from the list of connections made. |
| 64 | * connection: the connection to delete from the tracking list. | ||
| 65 | * Removes a connection from the list of connections made. | ||
| 66 | * The list of connections is necessary for buffering. | 64 | * The list of connections is necessary for buffering. |
| 65 | * | ||
| 66 | * @param connection The connection to delete from the tracking list. | ||
| 67 | */ | 67 | */ |
| 68 | |||
| 69 | void delete_connection(usbmux_connection *connection) { | 68 | void delete_connection(usbmux_connection *connection) { |
| 70 | usbmux_connection **newlist = (usbmux_connection**)malloc(sizeof(usbmux_connection*) * (connections - 1)); | 69 | usbmux_connection **newlist = (usbmux_connection**)malloc(sizeof(usbmux_connection*) * (connections - 1)); |
| 71 | int i = 0, j = 0; | 70 | int i = 0, j = 0; |
| @@ -85,10 +84,10 @@ void delete_connection(usbmux_connection *connection) { | |||
| 85 | free(connection); | 84 | free(connection); |
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | /* add_connection(connection) | 87 | /** Adds a connection to the list of connections made. |
| 89 | * connection: the connection to add to the global list of connections. | ||
| 90 | * Adds a connection to the list of connections made. | ||
| 91 | * The connection list is necessary for buffering. | 88 | * The connection list is necessary for buffering. |
| 89 | * | ||
| 90 | * @param connection The connection to add to the global list of connections. | ||
| 92 | */ | 91 | */ |
| 93 | 92 | ||
| 94 | void add_connection(usbmux_connection *connection) { | 93 | void add_connection(usbmux_connection *connection) { |
| @@ -98,14 +97,14 @@ void add_connection(usbmux_connection *connection) { | |||
| 98 | connections++; | 97 | connections++; |
| 99 | } | 98 | } |
| 100 | 99 | ||
| 101 | /* mux_connect(phone, s_port, d_port) | 100 | /** This is a higher-level USBMuxTCP-type function. |
| 102 | * This is a higher-level USBMuxTCP-type function. | ||
| 103 | * phone: the iPhone to initialize a connection on. | ||
| 104 | * s_port: the source port | ||
| 105 | * d_port: the destination port -- 0xf27e for lockdownd. | ||
| 106 | * Initializes a connection on phone, with source port s_port and destination port d_port | 101 | * Initializes a connection on phone, with source port s_port and destination port d_port |
| 102 | * | ||
| 103 | * @param phone The iPhone to initialize a connection on. | ||
| 104 | * @param s_port The source port | ||
| 105 | * @param d_port The destination port -- 0xf27e for lockdownd. | ||
| 106 | * @return A mux TCP header for the connection which is used for tracking and data transfer. | ||
| 107 | * | 107 | * |
| 108 | * Returns a mux TCP header for the connection which is used for tracking and data transfer. | ||
| 109 | */ | 108 | */ |
| 110 | 109 | ||
| 111 | usbmux_connection *mux_connect(iPhone *phone, uint16 s_port, uint16 d_port) { | 110 | usbmux_connection *mux_connect(iPhone *phone, uint16 s_port, uint16 d_port) { |
| @@ -146,12 +145,12 @@ usbmux_connection *mux_connect(iPhone *phone, uint16 s_port, uint16 d_port) { | |||
| 146 | return NULL; | 145 | return NULL; |
| 147 | } | 146 | } |
| 148 | 147 | ||
| 149 | /* mux_close_connection(phone, connection) | 148 | /** |
| 150 | * This is a higher-level USBmuxTCP-type function. | 149 | * This is a higher-level USBmuxTCP-type function. |
| 151 | * phone: the iPhone to close a connection with. | ||
| 152 | * connection: the connection to close. | ||
| 153 | * | 150 | * |
| 154 | * Doesn't return anything; WILL FREE THE CONNECTION'S MEMORY!!! | 151 | * @param phone The iPhone to close a connection with. |
| 152 | * @param connection The connection to close. | ||
| 153 | * @return Doesn't return anything; WILL FREE THE CONNECTION'S MEMORY!!! | ||
| 155 | */ | 154 | */ |
| 156 | 155 | ||
| 157 | void mux_close_connection(usbmux_connection *connection) { | 156 | void mux_close_connection(usbmux_connection *connection) { |
| @@ -173,14 +172,14 @@ void mux_close_connection(usbmux_connection *connection) { | |||
| 173 | delete_connection(connection); | 172 | delete_connection(connection); |
| 174 | } | 173 | } |
| 175 | 174 | ||
| 176 | /* mux_send(phone, connection, data, datalen) | 175 | /* |
| 177 | * This is a higher-level USBMuxTCP-like function. | 176 | * This is a higher-level USBMuxTCP-like function. |
| 178 | * phone: the iPhone to send to. | ||
| 179 | * connection: the connection we're sending data on. | ||
| 180 | * data: a pointer to the data to send. | ||
| 181 | * datalen: how much data we're sending. | ||
| 182 | * | 177 | * |
| 183 | * Returns number of bytes sent, minus the header (28), or -1 on error. | 178 | * @param phone The iPhone to send to. |
| 179 | * @param connection The connection we're sending data on. | ||
| 180 | * @param data A pointer to the data to send. | ||
| 181 | * @param datalen How much data we're sending. | ||
| 182 | * @return The number of bytes sent, minus the header (28), or -1 on error. | ||
| 184 | */ | 183 | */ |
| 185 | int mux_send(usbmux_connection *connection, const char *data, uint32 datalen) { | 184 | int mux_send(usbmux_connection *connection, const char *data, uint32 datalen) { |
| 186 | if (!connection->phone || !connection || !data || datalen == 0) return -1; | 185 | if (!connection->phone || !connection || !data || datalen == 0) return -1; |
| @@ -233,14 +232,14 @@ int mux_send(usbmux_connection *connection, const char *data, uint32 datalen) { | |||
| 233 | return bytes; // or something | 232 | return bytes; // or something |
| 234 | } | 233 | } |
| 235 | 234 | ||
| 236 | /* mux_recv(phone, connection, data, datalen) | 235 | /** |
| 237 | * This is a higher-level USBMuxTCP-like function | 236 | * This is a higher-level USBMuxTCP-like function |
| 238 | * phone: the phone to receive data from. | 237 | * |
| 239 | * connection: the connection to receive data on. | 238 | * @param phone The phone to receive data from. |
| 240 | * data: where to put the data we receive. | 239 | * @param connection The connection to receive data on. |
| 241 | * datalen: how much data to read. | 240 | * @param data Where to put the data we receive. |
| 242 | * | 241 | * @param datalen How much data to read. |
| 243 | * Returns: how many bytes were read, or -1 if something bad happens. | 242 | * @returns How many bytes were read, or -1 if something bad happens. |
| 244 | */ | 243 | */ |
| 245 | 244 | ||
| 246 | int mux_recv(usbmux_connection *connection, char *data, uint32 datalen) { | 245 | int mux_recv(usbmux_connection *connection, char *data, uint32 datalen) { |
diff --git a/src/userpref.h b/src/userpref.h index 441c7be..c437e52 100644 --- a/src/userpref.h +++ b/src/userpref.h | |||
| @@ -24,54 +24,48 @@ | |||
| 24 | 24 | ||
| 25 | #include <gnutls/gnutls.h> | 25 | #include <gnutls/gnutls.h> |
| 26 | /** | 26 | /** |
| 27 | * \fn char* get_host_id() | 27 | * Method to get user's HostID. Caller must free returned buffer. |
| 28 | * method to get user's HostID. Caller must free returned buffer. | 28 | * |
| 29 | * \return the HostID if exist in config file. Returns NULL otherwise. | 29 | * @return the HostID if exist in config file. Returns NULL otherwise. |
| 30 | */ | 30 | */ |
| 31 | char* get_host_id(); | 31 | char* get_host_id(); |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * \fn int is_device_known(char* public_key) | 34 | * Determine if we already paired this device. |
| 35 | * determine if we already paired this device. | 35 | * |
| 36 | * \return 1 if device is already paired. Returns 0 otherwise. | 36 | * @return 1 if device is already paired. Returns 0 otherwise. |
| 37 | */ | 37 | */ |
| 38 | int is_device_known(char* public_key); | 38 | int is_device_known(char* public_key); |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * \fn int store_device_public_key(char* public_key) | 41 | * @return 1 if everything went well. Returns 0 otherwise. |
| 42 | * \return 1 if everything went well. Returns 0 otherwise. | 42 | */ |
| 43 | */ | ||
| 44 | int store_device_public_key(char* public_key); | 43 | int store_device_public_key(char* public_key); |
| 45 | 44 | ||
| 46 | /** | 45 | /** |
| 47 | * \fn int get_root_private_key(gnutls_datum_t* root_privkey) | 46 | * @return 1 if everything went well. Returns 0 otherwise. |
| 48 | * \return 1 if everything went well. Returns 0 otherwise. | 47 | */ |
| 49 | */ | ||
| 50 | int get_root_private_key(gnutls_datum_t* root_privkey); | 48 | int get_root_private_key(gnutls_datum_t* root_privkey); |
| 51 | 49 | ||
| 52 | /** | 50 | /** |
| 53 | * \fn int get_host_private_key(gnutls_datum_t* host_privkey) | 51 | * @return 1 if everything went well. Returns 0 otherwise. |
| 54 | * \return 1 if everything went well. Returns 0 otherwise. | 52 | */ |
| 55 | */ | ||
| 56 | int get_host_private_key(gnutls_datum_t* host_privkey); | 53 | int get_host_private_key(gnutls_datum_t* host_privkey); |
| 57 | 54 | ||
| 58 | /** | 55 | /** |
| 59 | * \fn int get_root_certificate(gnutls_datum_t* root_cert) | 56 | * @return 1 if everything went well. Returns 0 otherwise. |
| 60 | * \return 1 if everything went well. Returns 0 otherwise. | 57 | */ |
| 61 | */ | ||
| 62 | int get_root_certificate(gnutls_datum_t* root_cert); | 58 | int get_root_certificate(gnutls_datum_t* root_cert); |
| 63 | 59 | ||
| 64 | /** | 60 | /** |
| 65 | * \fn int get_host_certificate(gnutls_datum_t* host_cert) | 61 | * @return 1 if everything went well. Returns 0 otherwise. |
| 66 | * \return 1 if everything went well. Returns 0 otherwise. | 62 | */ |
| 67 | */ | ||
| 68 | int get_host_certificate(gnutls_datum_t* host_cert); | 63 | int get_host_certificate(gnutls_datum_t* host_cert); |
| 69 | 64 | ||
| 70 | /** | 65 | /** |
| 71 | * \fn int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert) | 66 | * Setup a brand new config file. |
| 72 | * setup a brand new config file. | 67 | * @return 1 if everything went well. Returns 0 otherwise. |
| 73 | * \return 1 if everything went well. Returns 0 otherwise. | 68 | */ |
| 74 | */ | ||
| 75 | int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert); | 69 | int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert); |
| 76 | #endif | 70 | #endif |
| 77 | 71 | ||
