summaryrefslogtreecommitdiffstats
path: root/libusbmuxd/usbmuxd-proto.h
diff options
context:
space:
mode:
authorGravatar Hector Martin2009-08-20 03:42:52 +0200
committerGravatar Hector Martin2009-08-20 06:51:10 +0200
commit1a0c58e4062da7db73b4c08963f741cf016f6aa5 (patch)
treeb250f094e978d48622ecf652e28e9f3b68873893 /libusbmuxd/usbmuxd-proto.h
parentf4854f3fd725b5ba49cd5157d941783cffa08c04 (diff)
parent79ca4d9a3c3a82bb5a3f9be1ac7a2533c7a89b05 (diff)
downloadusbmuxd-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.h52
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 @@
+/* Protocol defintion for usbmuxd proxy protocol */
+
+#ifndef __USBMUXD_PROTO_H
+#define __USBMUXD_PROTO_H
+
+#include <stdint.h>
+
+#define USBMUXD_SOCKET_FILE "/var/run/usbmuxd"
+
+struct usbmuxd_header {
+ uint32_t length; // length of message, including header
+ uint32_t reserved; // always zero
+ uint32_t type; // message type
+ uint32_t tag; // responses to this query will echo back this tag
+} __attribute__((__packed__));
+
+struct usbmuxd_result {
+ struct usbmuxd_header header;
+ uint32_t result;
+} __attribute__((__packed__));
+
+struct usbmuxd_connect_request {
+ struct usbmuxd_header header;
+ uint32_t device_id;
+ uint16_t tcp_dport; // TCP port number
+ uint16_t reserved; // set to zero
+} __attribute__((__packed__));
+
+struct usbmuxd_device {
+ uint32_t device_id;
+ uint16_t product_id;
+ char serial_number[40];
+} __attribute__((__packed__));
+
+struct usbmuxd_device_info_record {
+ struct usbmuxd_header header;
+ struct usbmuxd_device device;
+ char padding[222];
+} __attribute__((__packed__));
+
+struct usbmuxd_scan_request {
+ struct usbmuxd_header header;
+} __attribute__((__packed__));
+
+enum {
+ USBMUXD_RESULT = 1,
+ USBMUXD_CONNECT = 2,
+ USBMUXD_SCAN = 3,
+ USBMUXD_DEVICE_INFO = 4,
+};
+
+#endif /* __USBMUXD_PROTO_H */