API for dealing with (SUID) helper processes that communicate via GNUNET_MessageHeaders on stdin/stdout. More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_HELPER_SendHandle |
Entry in the queue of messages we need to transmit to the helper. More... | |
struct | GNUNET_HELPER_Handle |
The handle to a helper process. More... | |
Functions | |
enum GNUNET_GenericReturnValue | GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill) |
Sends termination signal to the helper process. More... | |
enum GNUNET_GenericReturnValue | GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h) |
Reap the helper process. More... | |
static void | stop_helper (struct GNUNET_HELPER_Handle *h, int soft_kill) |
Stop the helper process, we're closing down or had an error. More... | |
static void | restart_task (void *cls) |
Restart the helper process. More... | |
static void | helper_read (void *cls) |
Read from the helper-process. More... | |
static void | start_helper (struct GNUNET_HELPER_Handle *h) |
Start the helper process. More... | |
struct GNUNET_HELPER_Handle * | GNUNET_HELPER_start (const struct GNUNET_OS_ProjectData *pd, int with_control_pipe, const char *binary_name, char *const binary_argv[], GNUNET_MessageTokenizerCallback cb, GNUNET_HELPER_ExceptionCallback exp_cb, void *cb_cls) |
Starts a helper and begins reading from it. More... | |
void | GNUNET_HELPER_destroy (struct GNUNET_HELPER_Handle *h) |
Free's the resources occupied by the helper handle. More... | |
void | GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill) |
Kills the helper, closes the pipe and frees the handle. More... | |
static void | helper_write (void *cls) |
Write to the helper-process. More... | |
struct GNUNET_HELPER_SendHandle * | GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, const struct GNUNET_MessageHeader *msg, bool can_drop, GNUNET_HELPER_Continuation cont, void *cont_cls) |
Send an message to the helper. More... | |
void | GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh) |
Cancel a GNUNET_HELPER_send operation. More... | |
API for dealing with (SUID) helper processes that communicate via GNUNET_MessageHeaders on stdin/stdout.
Definition in file helper.c.
|
static |
Stop the helper process, we're closing down or had an error.
h | handle to the helper process |
soft_kill | if GNUNET_YES, signals termination by closing the helper's stdin; GNUNET_NO to signal termination by sending SIGTERM to helper |
Definition at line 262 of file helper.c.
References GNUNET_break, GNUNET_HELPER_kill(), GNUNET_HELPER_wait(), GNUNET_OK, GNUNET_SCHEDULER_cancel(), and h.
Referenced by GNUNET_HELPER_stop(), helper_read(), helper_write(), and start_helper().
|
static |
Restart the helper process.
cls | handle to the helper process |
Definition at line 446 of file helper.c.
References GNUNET_ERROR_TYPE_INFO, GNUNET_log, h, and start_helper().
Referenced by helper_read(), helper_write(), and start_helper().
|
static |
Read from the helper-process.
cls | handle to the helper process |
Definition at line 292 of file helper.c.
References _, GNUNET_ALIGN, GNUNET_DISK_file_read(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_HELPER_stop(), GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_MST_from_buffer(), GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_read_file(), GNUNET_SYSERR, GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_SECONDS, h, helper_read(), restart_task(), stop_helper(), and t.
Referenced by helper_read(), and start_helper().
|
static |
Start the helper process.
h | handle to the helper process |
Definition at line 382 of file helper.c.
References GNUNET_DISK_PF_BLOCKING_RW, GNUNET_DISK_pipe(), GNUNET_DISK_pipe_close_end(), GNUNET_DISK_PIPE_END_READ, GNUNET_DISK_PIPE_END_WRITE, GNUNET_DISK_pipe_handle(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, GNUNET_OS_start_process_vap(), GNUNET_OS_USE_PIPE_CONTROL, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_read_file(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_SECONDS, h, helper_read(), restart_task(), and stop_helper().
Referenced by GNUNET_HELPER_start(), and restart_task().
|
static |
Write to the helper-process.
cls | handle to the helper process |
Definition at line 552 of file helper.c.
References _, GNUNET_CONTAINER_DLL_remove, GNUNET_DISK_file_write(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_HELPER_stop(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_write_file(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_TIME_UNIT_SECONDS, GNUNET_YES, h, helper_write(), restart_task(), sh, stop_helper(), and t.
Referenced by GNUNET_HELPER_send(), and helper_write().