summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/syslog_relay.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libimobiledevice/syslog_relay.h')
-rw-r--r--include/libimobiledevice/syslog_relay.h72
1 files changed, 72 insertions, 0 deletions
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
27extern "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. */
45typedef int16_t syslog_relay_error_t;
46
47typedef struct syslog_relay_client_private syslog_relay_client_private;
48typedef syslog_relay_client_private *syslog_relay_client_t; /**< The client handle. */
49
50/** Receives each character received from the device. */
51typedef void (*syslog_relay_receive_cb_t)(char c, void *user_data);
52
53/* Interface */
54syslog_relay_error_t syslog_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t * client);
55syslog_relay_error_t syslog_relay_client_start_service(idevice_t device, syslog_relay_client_t * client, const char* label);
56syslog_relay_error_t syslog_relay_client_free(syslog_relay_client_t client);
57
58syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data);
59syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client);
60
61/* sending */
62syslog_relay_error_t syslog_relay_send(syslog_relay_client_t client, const char *data, uint32_t size, uint32_t *sent);
63
64/* receiving */
65syslog_relay_error_t syslog_relay_receive_with_timeout(syslog_relay_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout);
66syslog_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