diff options
author | Nikias Bassen | 2013-09-17 12:14:51 +0200 |
---|---|---|
committer | Nikias Bassen | 2013-09-17 12:14:51 +0200 |
commit | fa03b9bb319b199de3399068f57d3c9453769bed (patch) | |
tree | 96c351486dd0fcde1cec9f2e6d8105027b58c4a3 /src | |
parent | 9b525ba69fff75f3a1cbc755b8da285d1f7286cf (diff) | |
download | usbmuxd-fa03b9bb319b199de3399068f57d3c9453769bed.tar.gz usbmuxd-fa03b9bb319b199de3399068f57d3c9453769bed.tar.bz2 |
added missing usbmuxd-proto.h
Diffstat (limited to 'src')
-rw-r--r-- | src/usbmuxd-proto.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/src/usbmuxd-proto.h b/src/usbmuxd-proto.h new file mode 100644 index 0000000..7842975 --- /dev/null +++ b/src/usbmuxd-proto.h @@ -0,0 +1,96 @@ +/* + usbmuxd - iPhone/iPod Touch USB multiplex server daemon + +Copyright (C) 2009 Paul Sladen <libiphone@paul.sladen.org> +Copyright (C) 2009 Nikias Bassen <nikias@gmx.li> +Copyright (C) 2009 Hector Martin "marcan" <hector@marcansoft.com> + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 or version 3. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +/* Protocol defintion for usbmuxd proxy protocol */ +#ifndef __USBMUXD_PROTO_H +#define __USBMUXD_PROTO_H + +#include <stdint.h> +#define USBMUXD_PROTOCOL_VERSION 0 + +#if defined(WIN32) || defined(__CYGWIN__) +#define USBMUXD_SOCKET_PORT 27015 +#else +#define USBMUXD_SOCKET_FILE "/var/run/usbmuxd" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +enum usbmuxd_result { + RESULT_OK = 0, + RESULT_BADCOMMAND = 1, + RESULT_BADDEV = 2, + RESULT_CONNREFUSED = 3, + // ??? + // ??? + RESULT_BADVERSION = 6, +}; + +enum usbmuxd_msgtype { + MESSAGE_RESULT = 1, + MESSAGE_CONNECT = 2, + MESSAGE_LISTEN = 3, + MESSAGE_DEVICE_ADD = 4, + MESSAGE_DEVICE_REMOVE = 5, + //??? + //??? + MESSAGE_PLIST = 8, +}; + +struct usbmuxd_header { + uint32_t length; // length of message, including header + uint32_t version; // protocol version + uint32_t message; // message type + uint32_t tag; // responses to this query will echo back this tag +} __attribute__((__packed__)); + +struct usbmuxd_result_msg { + struct usbmuxd_header header; + uint32_t result; +} __attribute__((__packed__)); + +struct usbmuxd_connect_request { + struct usbmuxd_header header; + uint32_t device_id; + uint16_t port; // TCP port number + uint16_t reserved; // set to zero +} __attribute__((__packed__)); + +struct usbmuxd_listen_request { + struct usbmuxd_header header; +} __attribute__((__packed__)); + +struct usbmuxd_device_record { + uint32_t device_id; + uint16_t product_id; + char serial_number[256]; + uint16_t padding; + uint32_t location; +} __attribute__((__packed__)); + +#ifdef __cplusplus +} +#endif + +#endif /* __USBMUXD_PROTO_H */ |