summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Paul Sladen2009-03-29 19:49:46 +0200
committerGravatar Nikias Bassen2009-03-29 19:49:46 +0200
commit1a8b5bb89af79bb08ccede29a36aecb3c2ca839d (patch)
tree72bc4a5870d14bccb26f212f85c1a8720610104f
parentc6b43ebca43b2a44bccd15bf950e1cad921071b1 (diff)
downloadusbmuxd-1a8b5bb89af79bb08ccede29a36aecb3c2ca839d.tar.gz
usbmuxd-1a8b5bb89af79bb08ccede29a36aecb3c2ca839d.tar.bz2
Added missing usbmuxd-proto.h file
Signed-off-by: Nikias Bassen <nikias@gmx.li>
-rw-r--r--usbmuxd-proto.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/usbmuxd-proto.h b/usbmuxd-proto.h
new file mode 100644
index 0000000..868ee06
--- /dev/null
+++ b/usbmuxd-proto.h
@@ -0,0 +1,52 @@
+/* Protocol defintion for usbmuxd proxy protocol */
+
+#ifndef __USBMUXD_H
+#define __USBMUXD_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 */