diff options
| author | 2009-08-20 03:42:52 +0200 | |
|---|---|---|
| committer | 2009-08-20 06:51:10 +0200 | |
| commit | 1a0c58e4062da7db73b4c08963f741cf016f6aa5 (patch) | |
| tree | b250f094e978d48622ecf652e28e9f3b68873893 /libusbmuxd/usbmuxd-proto.h | |
| parent | f4854f3fd725b5ba49cd5157d941783cffa08c04 (diff) | |
| parent | 79ca4d9a3c3a82bb5a3f9be1ac7a2533c7a89b05 (diff) | |
| download | usbmuxd-1a0c58e4062da7db73b4c08963f741cf016f6aa5.tar.gz usbmuxd-1a0c58e4062da7db73b4c08963f741cf016f6aa5.tar.bz2 | |
Merge the two development histories
Diffstat (limited to 'libusbmuxd/usbmuxd-proto.h')
| -rw-r--r-- | libusbmuxd/usbmuxd-proto.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libusbmuxd/usbmuxd-proto.h b/libusbmuxd/usbmuxd-proto.h new file mode 100644 index 0000000..7f8c2d6 --- /dev/null +++ b/libusbmuxd/usbmuxd-proto.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* Protocol defintion for usbmuxd proxy protocol */ | ||
| 2 | |||
| 3 | #ifndef __USBMUXD_PROTO_H | ||
| 4 | #define __USBMUXD_PROTO_H | ||
| 5 | |||
| 6 | #include <stdint.h> | ||
| 7 | |||
| 8 | #define USBMUXD_SOCKET_FILE "/var/run/usbmuxd" | ||
| 9 | |||
| 10 | struct usbmuxd_header { | ||
| 11 | uint32_t length; // length of message, including header | ||
| 12 | uint32_t reserved; // always zero | ||
| 13 | uint32_t type; // message type | ||
| 14 | uint32_t tag; // responses to this query will echo back this tag | ||
| 15 | } __attribute__((__packed__)); | ||
| 16 | |||
| 17 | struct usbmuxd_result { | ||
| 18 | struct usbmuxd_header header; | ||
| 19 | uint32_t result; | ||
| 20 | } __attribute__((__packed__)); | ||
| 21 | |||
| 22 | struct usbmuxd_connect_request { | ||
| 23 | struct usbmuxd_header header; | ||
| 24 | uint32_t device_id; | ||
| 25 | uint16_t tcp_dport; // TCP port number | ||
| 26 | uint16_t reserved; // set to zero | ||
| 27 | } __attribute__((__packed__)); | ||
| 28 | |||
| 29 | struct usbmuxd_device { | ||
| 30 | uint32_t device_id; | ||
| 31 | uint16_t product_id; | ||
| 32 | char serial_number[40]; | ||
| 33 | } __attribute__((__packed__)); | ||
| 34 | |||
| 35 | struct usbmuxd_device_info_record { | ||
| 36 | struct usbmuxd_header header; | ||
| 37 | struct usbmuxd_device device; | ||
| 38 | char padding[222]; | ||
| 39 | } __attribute__((__packed__)); | ||
| 40 | |||
| 41 | struct usbmuxd_scan_request { | ||
| 42 | struct usbmuxd_header header; | ||
| 43 | } __attribute__((__packed__)); | ||
| 44 | |||
| 45 | enum { | ||
| 46 | USBMUXD_RESULT = 1, | ||
| 47 | USBMUXD_CONNECT = 2, | ||
| 48 | USBMUXD_SCAN = 3, | ||
| 49 | USBMUXD_DEVICE_INFO = 4, | ||
| 50 | }; | ||
| 51 | |||
| 52 | #endif /* __USBMUXD_PROTO_H */ | ||
