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 
62 
67 };
68 
69 
78 
83 
88 
93 };
94 
95 
104 
109 
114 
119 
124 
129 
134 
139 
144 
149 };
150 
151 
155 struct GNUNET_ARM_Handle;
156 
160 struct GNUNET_ARM_Operation;
161 
162 
170 typedef void
172  int connected);
173 
174 
185 typedef void
187  enum GNUNET_ARM_RequestStatus rs,
189 
190 
202 typedef void
204  enum GNUNET_ARM_RequestStatus rs,
205  unsigned int count,
206  const char *const*list);
207 
208 
220 struct GNUNET_ARM_Handle *
223  void *conn_status_cls);
224 
225 
231 void
233 
234 
241 void
243 
244 
253 struct GNUNET_ARM_Operation *
256  void *cont_cls);
257 
258 
273 struct GNUNET_ARM_Operation *
275  const char *service_name,
277  void *cont_cls);
278 
279 
290 struct GNUNET_ARM_Operation *
292  const char *service_name,
293  enum GNUNET_OS_InheritStdioFlags std_inheritance,
295  void *cont_cls);
296 
297 
302 
303 
311 typedef void
313  const char *service,
315 
316 
331  void *cont_cls);
332 
333 
339 void
341 
342 #if 0 /* keep Emacsens' auto-indent happy */
343 {
344 #endif
345 #ifdef __cplusplus
346 }
347 #endif
348 
349 #endif
350  /* 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:96
void GNUNET_ARM_operation_cancel(struct GNUNET_ARM_Operation *op)
Abort an operation.
Definition: arm_api.c:663
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:69
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:505
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:862
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:296
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:894
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:480
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:787
Asked to stop it, but it&#39;s already stopped.
void * conn_status_cls
Closure for conn_status.
Definition: arm_api.c:125
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:83
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