diff options
Diffstat (limited to 'usbmuxd.h')
| -rw-r--r-- | usbmuxd.h | 46 |
1 files changed, 26 insertions, 20 deletions
| @@ -3,42 +3,48 @@ | |||
| 3 | 3 | ||
| 4 | #include <stdint.h> | 4 | #include <stdint.h> |
| 5 | 5 | ||
| 6 | struct usbmux_header { | 6 | #define USBMUXD_SOCKET_FILE "/var/run/usbmuxd" |
| 7 | |||
| 8 | struct usbmuxd_header { | ||
| 7 | uint32_t length; // length of message, including header | 9 | uint32_t length; // length of message, including header |
| 8 | uint32_t reserved; // always zero | 10 | uint32_t reserved; // always zero |
| 9 | uint32_t type; // message type | 11 | uint32_t type; // message type |
| 10 | uint32_t tag; // responses to this query will echo back this tag | 12 | uint32_t tag; // responses to this query will echo back this tag |
| 11 | }; | 13 | } __attribute__((__packed__)); |
| 12 | 14 | ||
| 13 | struct usbmux_result { | 15 | struct usbmuxd_result { |
| 14 | struct usbmux_header header; | 16 | struct usbmuxd_header header; |
| 15 | uint32_t result; | 17 | uint32_t result; |
| 16 | }; | 18 | } __attribute__((__packed__)); |
| 17 | 19 | ||
| 18 | struct usbmux_connect_request { | 20 | struct usbmuxd_connect_request { |
| 19 | struct usbmux_header header; | 21 | struct usbmuxd_header header; |
| 20 | uint32_t device_id; | 22 | uint32_t device_id; |
| 21 | uint16_t port; // TCP port number | 23 | uint16_t tcp_dport; // TCP port number |
| 22 | uint16_t reserved; // set to zero | 24 | uint16_t reserved; // set to zero |
| 23 | }; | 25 | } __attribute__((__packed__)); |
| 24 | 26 | ||
| 25 | struct usbmux_dev_info { | 27 | struct usbmuxd_device_info { |
| 26 | uint32_t device_id; | 28 | uint32_t device_id; |
| 27 | uint16_t product_id; | 29 | uint16_t product_id; |
| 28 | char serial_number[40]; | 30 | char serial_number[40]; |
| 29 | }; | 31 | } __attribute__((__packed__)); |
| 30 | 32 | ||
| 31 | struct usbmux_dev_info_request { | 33 | struct usbmuxd_device_info_request { |
| 32 | struct usbmux_header header; | 34 | struct usbmuxd_header header; |
| 33 | struct usbmux_dev_info dev_info; | 35 | struct usbmuxd_device_info device_info; |
| 34 | unsigned char padding[222]; | 36 | char padding[222]; |
| 35 | }; | 37 | } __attribute__((__packed__)); |
| 38 | |||
| 39 | struct usbmuxd_hello { | ||
| 40 | struct usbmuxd_header header; | ||
| 41 | } __attribute__((__packed__)); | ||
| 36 | 42 | ||
| 37 | enum { | 43 | enum { |
| 38 | usbmux_result = 1, | 44 | USBMUXD_RESULT = 1, |
| 39 | usbmux_connect = 2, | 45 | USBMUXD_CONNECT = 2, |
| 40 | usbmux_hello = 3, | 46 | USBMUXD_HELLO = 3, |
| 41 | usbmux_device_info = 4, | 47 | USBMUXD_DEVICE_INFO = 4, |
| 42 | }; | 48 | }; |
| 43 | 49 | ||
| 44 | #endif | 50 | #endif |
