libimobiledevice
1.3.0
|
Capture the syslog output from a device. More...
Macros | |
#define | SYSLOG_RELAY_SERVICE_NAME "com.apple.syslog_relay" |
Typedefs | |
typedef struct syslog_relay_client_private | syslog_relay_client_private |
typedef syslog_relay_client_private * | syslog_relay_client_t |
The client handle. | |
typedef void(* | syslog_relay_receive_cb_t) (char c, void *user_data) |
Receives each character received from the device. | |
Enumerations | |
enum | syslog_relay_error_t { SYSLOG_RELAY_E_SUCCESS = 0, SYSLOG_RELAY_E_INVALID_ARG = -1, SYSLOG_RELAY_E_MUX_ERROR = -2, SYSLOG_RELAY_E_SSL_ERROR = -3, SYSLOG_RELAY_E_NOT_ENOUGH_DATA = -4, SYSLOG_RELAY_E_TIMEOUT = -5, SYSLOG_RELAY_E_UNKNOWN_ERROR = -256 } |
Error Codes. | |
Functions | |
syslog_relay_error_t | syslog_relay_client_new (idevice_t device, lockdownd_service_descriptor_t service, syslog_relay_client_t *client) |
Connects to the syslog_relay service on the specified device. More... | |
syslog_relay_error_t | syslog_relay_client_start_service (idevice_t device, syslog_relay_client_t *client, const char *label) |
Starts a new syslog_relay service on the specified device and connects to it. More... | |
syslog_relay_error_t | syslog_relay_client_free (syslog_relay_client_t client) |
Disconnects a syslog_relay client from the device and frees up the syslog_relay client data. More... | |
syslog_relay_error_t | syslog_relay_start_capture (syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void *user_data) |
Starts capturing the syslog of the device using a callback. More... | |
syslog_relay_error_t | syslog_relay_start_capture_raw (syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void *user_data) |
Starts capturing the raw syslog of the device using a callback. More... | |
syslog_relay_error_t | syslog_relay_stop_capture (syslog_relay_client_t client) |
Stops capturing the syslog of the device. More... | |
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) |
Receives data using the given syslog_relay client with specified timeout. More... | |
syslog_relay_error_t | syslog_relay_receive (syslog_relay_client_t client, char *data, uint32_t size, uint32_t *received) |
Receives data from the service. More... | |
Capture the syslog output from a device.
syslog_relay_error_t syslog_relay_client_free | ( | syslog_relay_client_t | client | ) |
Disconnects a syslog_relay client from the device and frees up the syslog_relay client data.
client | The syslog_relay client to disconnect and free. |
syslog_relay_error_t syslog_relay_client_new | ( | idevice_t | device, |
lockdownd_service_descriptor_t | service, | ||
syslog_relay_client_t * | client | ||
) |
Connects to the syslog_relay service on the specified device.
device | The device to connect to. |
service | The service descriptor returned by lockdownd_start_service. |
client | Pointer that will point to a newly allocated syslog_relay_client_t upon successful return. Must be freed using syslog_relay_client_free() after use. |
syslog_relay_error_t syslog_relay_client_start_service | ( | idevice_t | device, |
syslog_relay_client_t * | client, | ||
const char * | label | ||
) |
Starts a new syslog_relay service on the specified device and connects to it.
device | The device to connect to. |
client | Pointer that will point to a newly allocated syslog_relay_client_t upon successful return. Must be freed using syslog_relay_client_free() after use. |
label | The label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd. |
syslog_relay_error_t syslog_relay_receive | ( | syslog_relay_client_t | client, |
char * | data, | ||
uint32_t | size, | ||
uint32_t * | received | ||
) |
Receives data from the service.
client | The syslog_relay client |
data | Buffer that will be filled with the data received |
size | Number of bytes to receive |
received | Number of bytes received (can be NULL to ignore) |
timeout | Maximum time in milliseconds to wait for data. |
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 | ||
) |
Receives data using the given syslog_relay client with specified timeout.
client | The syslog_relay client to use for receiving |
data | Buffer that will be filled with the data received |
size | Number of bytes to receive |
received | Number of bytes received (can be NULL to ignore) |
timeout | Maximum time in milliseconds to wait for data. |
syslog_relay_error_t syslog_relay_start_capture | ( | syslog_relay_client_t | client, |
syslog_relay_receive_cb_t | callback, | ||
void * | user_data | ||
) |
Starts capturing the syslog of the device using a callback.
Use syslog_relay_stop_capture() to stop receiving the syslog.
client | The syslog_relay client to use |
callback | Callback to receive each character from the syslog. |
user_data | Custom pointer passed to the callback function. |
syslog_relay_error_t syslog_relay_start_capture_raw | ( | syslog_relay_client_t | client, |
syslog_relay_receive_cb_t | callback, | ||
void * | user_data | ||
) |
Starts capturing the raw syslog of the device using a callback.
This function is like syslog_relay_start_capture with the difference that it will neither check nor process the received data before passing it to the callback function.
Use syslog_relay_stop_capture() to stop receiving the syslog.
client | The syslog_relay client to use |
callback | Callback to receive each character from the syslog. |
user_data | Custom pointer passed to the callback function. |
syslog_relay_error_t syslog_relay_stop_capture | ( | syslog_relay_client_t | client | ) |
Stops capturing the syslog of the device.
Use syslog_relay_start_capture() to start receiving the syslog.
client | The syslog_relay client to use |