summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/libiphone/libiphone.h127
-rw-r--r--include/plist/plist.h39
3 files changed, 40 insertions, 128 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index a5f8766..4ed2784 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1 +1 @@
nobase_include_HEADERS = libiphone/libiphone.h nobase_include_HEADERS = plist/plist.h
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
deleted file mode 100644
index b3e3f95..0000000
--- a/include/libiphone/libiphone.h
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * libiphone.h
3 * Main include of libiphone
4 *
5 * Copyright (c) 2008 Jonathan Beck All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef LIBIPHONE_H
23#define LIBIPHONE_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <stdint.h>
30#include <sys/types.h>
31#include <sys/stat.h>
32
33//general errors
34#define IPHONE_E_SUCCESS 0
35#define IPHONE_E_INVALID_ARG -1
36#define IPHONE_E_UNKNOWN_ERROR -2
37#define IPHONE_E_NO_DEVICE -3
38#define IPHONE_E_TIMEOUT -4
39#define IPHONE_E_NOT_ENOUGH_DATA -5
40#define IPHONE_E_BAD_HEADER -6
41
42//lockdownd specific error
43#define IPHONE_E_INVALID_CONF -7
44#define IPHONE_E_PAIRING_FAILED -8
45#define IPHONE_E_SSL_ERROR -9
46#define IPHONE_E_PLIST_ERROR -10
47#define IPHONE_E_DICT_ERROR -11
48
49//afc specific error
50#define IPHONE_E_NO_SUCH_FILE -12
51
52typedef int16_t iphone_error_t;
53
54typedef enum {
55 IPHONE_AFC_FILE_READ = 0x00000002, // seems to be able to read and write files
56 IPHONE_AFC_FILE_WRITE = 0x00000003, // writes and creates a file, blanks it out, etc.
57 IPHONE_AFC_FILE_RW = 0x00000005, // seems to do the same as 2. Might even create the file.
58 IPHONE_AFC_FILE_OP4 = 0x00000004, // no idea -- appears to be "write" -- clears file beforehand like 3
59 IPHONE_AFC_FILE_OP6 = 0x00000006, // no idea yet -- appears to be the same as 5.
60 IPHONE_AFC_FILE_OP1 = 0x00000001, // no idea juuust yet... probably read.
61 IPHONE_AFC_FILE_OP0 = 0x00000000,
62 IPHONE_AFC_FILE_OP10 = 0x0000000a
63} iphone_afc_file_mode_t;
64
65struct iphone_device_int;
66typedef struct iphone_device_int *iphone_device_t;
67
68struct iphone_lckd_client_int;
69typedef struct iphone_lckd_client_int *iphone_lckd_client_t;
70
71struct iphone_umux_client_int;
72typedef struct iphone_umux_client_int *iphone_umux_client_t;
73
74struct iphone_afc_client_int;
75typedef struct iphone_afc_client_int *iphone_afc_client_t;
76
77struct iphone_afc_file_int;
78typedef struct iphone_afc_file_int *iphone_afc_file_t;
79
80//device related functions
81void iphone_set_debug(int level);
82iphone_error_t iphone_get_device ( iphone_device_t *device );
83iphone_error_t iphone_free_device ( iphone_device_t device );
84
85
86//lockdownd related functions
87iphone_error_t iphone_lckd_new_client ( iphone_device_t device, iphone_lckd_client_t *client );
88iphone_error_t iphone_lckd_free_client( iphone_lckd_client_t client );
89
90iphone_error_t iphone_lckd_start_service ( iphone_lckd_client_t client, const char *service, int *port );
91iphone_error_t iphone_lckd_recv ( iphone_lckd_client_t client, char **dump_data, uint32_t *recv_bytes );
92iphone_error_t iphone_lckd_send ( iphone_lckd_client_t client, char *raw_data, uint32_t length, uint32_t *recv_bytes );
93
94
95//usbmux related functions
96iphone_error_t iphone_mux_new_client ( iphone_device_t device, uint16_t src_port, uint16_t dst_port, iphone_umux_client_t *client );
97iphone_error_t iphone_mux_free_client ( iphone_umux_client_t client );
98
99iphone_error_t iphone_mux_send ( iphone_umux_client_t client, const char *data, uint32_t datalen, uint32_t *sent_bytes );
100iphone_error_t iphone_mux_recv ( iphone_umux_client_t client, char *data, uint32_t datalen, uint32_t *recv_bytes );
101
102
103//afc related functions
104iphone_error_t iphone_afc_new_client ( iphone_device_t device, int src_port, int dst_port, iphone_afc_client_t *client );
105iphone_error_t iphone_afc_free_client ( iphone_afc_client_t client );
106
107iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***infos );
108iphone_error_t iphone_afc_get_dir_list ( iphone_afc_client_t client, const char *dir, char ***list);
109
110iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf );
111iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, iphone_afc_file_mode_t file_mode, iphone_afc_file_t *file );
112iphone_error_t iphone_afc_close_file ( iphone_afc_client_t client, iphone_afc_file_t file);
113iphone_error_t iphone_afc_read_file ( iphone_afc_client_t client, iphone_afc_file_t file, char *data, int length, uint32_t *bytes);
114iphone_error_t iphone_afc_write_file ( iphone_afc_client_t client, iphone_afc_file_t file, const char *data, int length, uint32_t *bytes);
115iphone_error_t iphone_afc_seek_file ( iphone_afc_client_t client, iphone_afc_file_t file, int seekpos);
116iphone_error_t iphone_afc_truncate_file ( iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize);
117iphone_error_t iphone_afc_delete_file ( iphone_afc_client_t client, const char *path);
118iphone_error_t iphone_afc_rename_file ( iphone_afc_client_t client, const char *from, const char *to);
119iphone_error_t iphone_afc_mkdir ( iphone_afc_client_t client, const char *dir);
120
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif
127
diff --git a/include/plist/plist.h b/include/plist/plist.h
new file mode 100644
index 0000000..a67075c
--- /dev/null
+++ b/include/plist/plist.h
@@ -0,0 +1,39 @@
1/*
2 * plist.h
3 * Main include of libplist
4 *
5 * Copyright (c) 2008 Jonathan Beck All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef LIBPLIST_H
23#define LIBPLIST_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <stdint.h>
30#include <sys/types.h>
31
32
33
34#ifdef __cplusplus
35}
36#endif
37
38#endif
39