GNUnet 0.22.2
gnunet_helper_lib.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2011, 2012 Christian Grothoff
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
41#if ! defined (__GNUNET_UTIL_LIB_H_INSIDE__)
42#error "Only <gnunet_util_lib.h> can be included directly."
43#endif
44
45#ifndef GNUNET_HELPER_LIB_H
46#define GNUNET_HELPER_LIB_H
47
48
49#include "gnunet_mst_lib.h"
50
51
56
57
64typedef void
66
67
88 const char *binary_name,
89 char *const binary_argv[],
92 void *cb_cls);
93
94
106 int soft_kill);
107
108
119
120
126void
128
129
138void
139GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill);
140
141
150typedef void
152 void *cls,
154
155
160
161
177 const struct GNUNET_MessageHeader *msg,
178 bool can_drop,
180 void *cont_cls);
181
182
189void
191
192
193#endif
194/* end of include guard: GNUNET_HELPER_LIB_H */
195 /* end of group */
197 /* end of group addition */
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:98
static struct GNUNET_IDENTITY_Handle * sh
Handle to IDENTITY service.
static int result
Global testing status.
Library for tokenizing a message stream.
void GNUNET_HELPER_send_cancel(struct GNUNET_HELPER_SendHandle *sh)
Cancel a GNUNET_HELPER_send operation.
Definition: helper.c:655
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.
Definition: helper.c:615
enum GNUNET_GenericReturnValue GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h)
Reap the helper process.
Definition: helper.c:206
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.
Definition: helper.c:460
void(* GNUNET_HELPER_ExceptionCallback)(void *cls)
Callback that will be called when the helper process dies.
enum GNUNET_GenericReturnValue GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
Definition: helper.c:166
void GNUNET_HELPER_stop(struct GNUNET_HELPER_Handle *h, int soft_kill)
Kills the helper, closes the pipe, frees the handle and calls wait() on the helper process.
Definition: helper.c:538
void(* GNUNET_HELPER_Continuation)(void *cls, enum GNUNET_GenericReturnValue result)
Continuation function.
void GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h)
Free's the resources occupied by the helper handle.
Definition: helper.c:501
GNUNET_GenericReturnValue
Named constants for return values.
int(* GNUNET_MessageTokenizerCallback)(void *cls, const struct GNUNET_MessageHeader *message)
Functions with this signature are called whenever a complete message is received by the tokenizer.
The handle to a helper process.
Definition: helper.c:77
int with_control_pipe
Does the helper support the use of a control pipe for signalling?
Definition: helper.c:156
void * cb_cls
The closure for callbacks.
Definition: helper.c:116
char ** binary_argv
NULL-terminated list of command-line arguments.
Definition: helper.c:136
char * binary_name
Binary to run.
Definition: helper.c:131
Entry in the queue of messages we need to transmit to the helper.
Definition: helper.c:35
GNUNET_HELPER_Continuation cont
Function to call upon completion.
Definition: helper.c:59
void * cont_cls
Closure to 'cont'.
Definition: helper.c:64
Header for all communications.
Project-specific data used to help the OS subsystem find installation paths.
static void exp_cb(void *cls)
Callback called if there was an exception during execution of the helper.