diff options
Diffstat (limited to 'libusbmuxd/usbmuxd-proto.h')
-rw-r--r-- | libusbmuxd/usbmuxd-proto.h | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/libusbmuxd/usbmuxd-proto.h b/libusbmuxd/usbmuxd-proto.h deleted file mode 100644 index be9e709..0000000 --- a/libusbmuxd/usbmuxd-proto.h +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | /* | ||
2 | libusbmuxd - client library to talk to usbmuxd | ||
3 | |||
4 | Copyright (C) 2009 Paul Sladen <libiphone@paul.sladen.org> | ||
5 | Copyright (C) 2009 Nikias Bassen <nikias@gmx.li> | ||
6 | Copyright (C) 2009 Hector Martin "marcan" <hector@marcansoft.com> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU Lesser General Public License as | ||
10 | published by the Free Software Foundation, either version 2.1 of the | ||
11 | License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | GNU General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this program; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | |||
22 | */ | ||
23 | |||
24 | /* Protocol defintion for usbmuxd proxy protocol */ | ||
25 | #ifndef __USBMUXD_PROTO_H | ||
26 | #define __USBMUXD_PROTO_H | ||
27 | |||
28 | #include <stdint.h> | ||
29 | #define USBMUXD_PROTOCOL_VERSION 0 | ||
30 | |||
31 | #if defined(WIN32) || defined(__CYGWIN__) | ||
32 | #define USBMUXD_SOCKET_PORT 27015 | ||
33 | #else | ||
34 | #define USBMUXD_SOCKET_FILE "/var/run/usbmuxd" | ||
35 | #endif | ||
36 | |||
37 | #ifdef __cplusplus | ||
38 | extern "C" { | ||
39 | #endif | ||
40 | |||
41 | enum usbmuxd_result { | ||
42 | RESULT_OK = 0, | ||
43 | RESULT_BADCOMMAND = 1, | ||
44 | RESULT_BADDEV = 2, | ||
45 | RESULT_CONNREFUSED = 3, | ||
46 | // ??? | ||
47 | // ??? | ||
48 | RESULT_BADVERSION = 6, | ||
49 | }; | ||
50 | |||
51 | enum usbmuxd_msgtype { | ||
52 | MESSAGE_RESULT = 1, | ||
53 | MESSAGE_CONNECT = 2, | ||
54 | MESSAGE_LISTEN = 3, | ||
55 | MESSAGE_DEVICE_ADD = 4, | ||
56 | MESSAGE_DEVICE_REMOVE = 5, | ||
57 | //??? | ||
58 | //??? | ||
59 | MESSAGE_PLIST = 8, | ||
60 | }; | ||
61 | |||
62 | struct usbmuxd_header { | ||
63 | uint32_t length; // length of message, including header | ||
64 | uint32_t version; // protocol version | ||
65 | uint32_t message; // message type | ||
66 | uint32_t tag; // responses to this query will echo back this tag | ||
67 | } __attribute__((__packed__)); | ||
68 | |||
69 | struct usbmuxd_result_msg { | ||
70 | struct usbmuxd_header header; | ||
71 | uint32_t result; | ||
72 | } __attribute__((__packed__)); | ||
73 | |||
74 | struct usbmuxd_connect_request { | ||
75 | struct usbmuxd_header header; | ||
76 | uint32_t device_id; | ||
77 | uint16_t port; // TCP port number | ||
78 | uint16_t reserved; // set to zero | ||
79 | } __attribute__((__packed__)); | ||
80 | |||
81 | struct usbmuxd_listen_request { | ||
82 | struct usbmuxd_header header; | ||
83 | } __attribute__((__packed__)); | ||
84 | |||
85 | struct usbmuxd_device_record { | ||
86 | uint32_t device_id; | ||
87 | uint16_t product_id; | ||
88 | char serial_number[256]; | ||
89 | uint16_t padding; | ||
90 | uint32_t location; | ||
91 | } __attribute__((__packed__)); | ||
92 | |||
93 | #ifdef __cplusplus | ||
94 | } | ||
95 | #endif | ||
96 | |||
97 | #endif /* __USBMUXD_PROTO_H */ | ||