diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/Makefile.am | 3 | ||||
| -rw-r--r-- | include/libimobiledevice/syslog_relay.h | 72 |
2 files changed, 74 insertions, 1 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index a697453..39a8d60 100644 --- a/include/Makefile.am +++ b/include/Makefile.am | |||
| @@ -17,4 +17,5 @@ nobase_include_HEADERS = libimobiledevice/libimobiledevice.h \ | |||
| 17 | libimobiledevice/restore.h\ | 17 | libimobiledevice/restore.h\ |
| 18 | libimobiledevice/webinspector.h\ | 18 | libimobiledevice/webinspector.h\ |
| 19 | libimobiledevice/heartbeat.h\ | 19 | libimobiledevice/heartbeat.h\ |
| 20 | libimobiledevice/diagnostics_relay.h | 20 | libimobiledevice/diagnostics_relay.h\ |
| 21 | libimobiledevice/syslog_relay.h \ No newline at end of file | ||
diff --git a/include/libimobiledevice/syslog_relay.h b/include/libimobiledevice/syslog_relay.h new file mode 100644 index 0000000..9152d79 --- /dev/null +++ b/include/libimobiledevice/syslog_relay.h | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | /** | ||
| 2 | * @file libimobiledevice/syslog_relay.h | ||
| 3 | * @brief Capture the syslog output from a device. | ||
| 4 | * \internal | ||
| 5 | * | ||
| 6 | * Copyright (c) 2013 Martin Szulecki All Rights Reserved. | ||
| 7 | * | ||
| 8 | * This library is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU Lesser General Public | ||
| 10 | * License as published by the Free Software Foundation; either | ||
| 11 | * version 2.1 of the License, or (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This library is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * Lesser General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU Lesser General Public | ||
| 19 | * License along with this library; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef ISYSLOG_RELAY_H | ||
| 24 | #define ISYSLOG_RELAY_H | ||
| 25 | |||
| 26 | #ifdef __cplusplus | ||
| 27 | extern "C" { | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #include <libimobiledevice/libimobiledevice.h> | ||
| 31 | #include <libimobiledevice/lockdown.h> | ||
| 32 | |||
| 33 | #define SYSLOG_RELAY_SERVICE_NAME "com.apple.syslog_relay" | ||
| 34 | |||
| 35 | /** @name Error Codes */ | ||
| 36 | /*@{*/ | ||
| 37 | #define SYSLOG_RELAY_E_SUCCESS 0 | ||
| 38 | #define SYSLOG_RELAY_E_INVALID_ARG -1 | ||
| 39 | #define SYSLOG_RELAY_E_MUX_ERROR -2 | ||
| 40 | #define SYSLOG_RELAY_E_SSL_ERROR -3 | ||
| 41 | #define SYSLOG_RELAY_E_UNKNOWN_ERROR -256 | ||
| 42 | /*@}*/ | ||
| 43 | |||
| 44 | /** Represents an error code. */ | ||
| 45 | typedef int16_t syslog_relay_error_t; | ||
| 46 | |||
| 47 | typedef struct syslog_relay_client_private syslog_relay_client_private; | ||
| 48 | typedef syslog_relay_client_private *syslog_relay_client_t; /**< The client handle. */ | ||
| 49 | |||
| 50 | /** Receives each character received from the device. */ | ||
| 51 | typedef void (*syslog_relay_receive_cb_t)(char c, void *user_data); | ||
| 52 | |||
| 53 | /* Interface */ | ||
| 54 | syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t * client); | ||
| 55 | syslog_relay_error_t syslog_relay_client_start_service(idevice_t device, syslog_relay_client_t * client, const char* label); | ||
| 56 | syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client); | ||
| 57 | |||
| 58 | syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data); | ||
| 59 | syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client); | ||
| 60 | |||
| 61 | /* sending */ | ||
| 62 | syslog_relay_error_t syslog_relay_send(syslog_relay_client_t client, const char *data, uint32_t size, uint32_t *sent); | ||
| 63 | |||
| 64 | /* receiving */ | ||
| 65 | syslog_relay_error_t syslog_relay_receive_with_timeout(syslog_relay_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout); | ||
| 66 | syslog_relay_error_t syslog_relay_receive(syslog_relay_client_t client, char *data, uint32_t size, uint32_t *received); | ||
| 67 | |||
| 68 | #ifdef __cplusplus | ||
| 69 | } | ||
| 70 | #endif | ||
| 71 | |||
| 72 | #endif | ||
