GNUnet  0.10.x
gnunet_arm_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2009, 2016 GNUnet e.V.
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 
35 #ifndef GNUNET_ARM_SERVICE_H
36 #define GNUNET_ARM_SERVICE_H
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #if 0 /* keep Emacsens' auto-indent happy */
42 }
43 #endif
44 #endif
45 
46 #include "gnunet_util_lib.h"
47 
51 #define GNUNET_ARM_VERSION 0x00000003
52 
53 
58 {
63 
68 
69 };
70 
71 
76 {
81 
86 
91 
96 };
97 
98 
103 {
108 
113 
118 
123 
128 
133 
138 
143 
148 
153 };
154 
155 
159 struct GNUNET_ARM_Handle;
160 
164 struct GNUNET_ARM_Operation;
165 
166 
174 typedef void
176  int connected);
177 
178 
189 typedef void
191  enum GNUNET_ARM_RequestStatus rs,
193 
194 
206 typedef void
208  enum GNUNET_ARM_RequestStatus rs,
209  unsigned int count,
210  const char *const*list);
211 
212 
224 struct GNUNET_ARM_Handle *
227  void *conn_status_cls);
228 
229 
235 void
237 
238 
245 void
247 
248 
257 struct GNUNET_ARM_Operation *
260  void *cont_cls);
261 
262 
277 struct GNUNET_ARM_Operation *
279  const char *service_name,
281  void *cont_cls);
282 
283 
294 struct GNUNET_ARM_Operation *
296  const char *service_name,
297  enum GNUNET_OS_InheritStdioFlags std_inheritance,
299  void *cont_cls);
300 
301 
306 
307 
315 typedef void
317  const char *service,
319 
320 
335  void *cont_cls);
336 
337 
343 void
345 
346 #if 0 /* keep Emacsens' auto-indent happy */
347 {
348 #endif
349 #ifdef __cplusplus
350 }
351 #endif
352 
353 #endif
354  /* end of group */
GNUNET_OS_InheritStdioFlags
Flags that determine which of the standard streams should be inherited by the child process...
Definition: gnunet_os_lib.h:68
ARM stopping was initiated (there&#39;s no "stopped" for ARM itself).
void(* GNUNET_ARM_ServiceStatusCallback)(void *cls, const char *service, enum GNUNET_ARM_ServiceStatus status)
Function called in when a status update arrives.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
Asked to stop it, but it&#39;s already stopping.
Entry in a doubly-linked list of operations awaiting for replies (in-order) from the ARM service...
Definition: arm_api.c:40
We disconnected from ARM, and request was not sent.
Handle for interacting with ARM.
Definition: arm_api.c:97
void GNUNET_ARM_operation_cancel(struct GNUNET_ARM_Operation *op)
Abort an operation.
Definition: arm_api.c:665
GNUNET_ARM_Result
Replies to ARM requests.
Service starting was initiated.
Handle for interacting with ARM.
void * cont_cls
Closure for result_cont or list_cont.
Definition: arm_api.c:70
Asked to start it, but it&#39;s already started.
void GNUNET_ARM_disconnect(struct GNUNET_ARM_Handle *h)
Disconnect from the ARM service and destroy the handle.
Definition: arm_api.c:507
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
Tried to start a service, but that failed for some reason.
struct GNUNET_ARM_Operation * GNUNET_ARM_request_service_stop(struct GNUNET_ARM_Handle *h, const char *service_name, GNUNET_ARM_ResultCallback cont, void *cont_cls)
Request a service to be stopped.
Definition: arm_api.c:864
Service starting was initiated.
static void conn_status(void *cls, int connected)
Function called whenever we connect to or disconnect from ARM.
Definition: gnunet-arm.c:286
static char * service_name
Option -s: service name (hash to get service descriptor)
Definition: gnunet-vpn.c:51
uint16_t status
See PRISM_STATUS_*-constants.
struct GNUNET_ARM_Operation * GNUNET_ARM_request_service_list(struct GNUNET_ARM_Handle *h, GNUNET_ARM_ServiceListCallback cont, void *cont_cls)
Request a list of running services.
Definition: arm_api.c:896
Asked to start it, but it&#39;s already starting.
static int result
Global testing status.
Service was stopped.
void(* GNUNET_ARM_ConnectionStatusCallback)(void *cls, int connected)
Function called whenever we connect to or disconnect from ARM.
struct GNUNET_ARM_Handle * GNUNET_ARM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ARM_ConnectionStatusCallback conn_status, void *conn_status_cls)
Set up a context for communicating with ARM, then start connecting to the ARM service using that cont...
Definition: arm_api.c:482
Asked to start something, but ARM is shutting down and can&#39;t comply.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
void(* GNUNET_ARM_ResultCallback)(void *cls, enum GNUNET_ARM_RequestStatus rs, enum GNUNET_ARM_Result result)
Function called in response to a start/stop request.
struct GNUNET_ARM_Operation * GNUNET_ARM_request_service_start(struct GNUNET_ARM_Handle *h, const char *service_name, enum GNUNET_OS_InheritStdioFlags std_inheritance, GNUNET_ARM_ResultCallback cont, void *cont_cls)
Request for a service to be started.
Definition: arm_api.c:789
Asked to stop it, but it&#39;s already stopped.
void * conn_status_cls
Closure for conn_status.
Definition: arm_api.c:127
void GNUNET_ARM_monitor_stop(struct GNUNET_ARM_MonitorHandle *h)
Disconnect from the ARM service and destroy the handle.
Message was sent successfully.
GNUNET_ARM_ServiceStatus
Statuses of services.
GNUNET_ARM_RequestStatus
Statuses of the requests that client can send to ARM.
configuration data
Definition: configuration.c:85
Service stopping was initiated.
Asked to start or stop a service, but it&#39;s not known.
struct GNUNET_ARM_MonitorHandle * GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ARM_ServiceStatusCallback cont, void *cont_cls)
Setup a context for monitoring ARM, then start connecting to the ARM service for monitoring using tha...
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Service was stopped (never sent for ARM itself).
void(* GNUNET_ARM_ServiceListCallback)(void *cls, enum GNUNET_ARM_RequestStatus rs, unsigned int count, const char *const *list)
Callback function invoked when list operation is complete.
static int list
Set if we should print a list of currently running services.
Definition: gnunet-arm.c:64