GNUnet  0.17.6
testbed_api_operations.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2008--2013 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 
26 #ifndef NEW_TESTING_API_OPERATIONS_H
27 #define NEW_TESTING_API_OPERATIONS_H
28 
29 #include "gnunet_testbed_service.h"
30 #include "gnunet_helper_lib.h"
31 
32 
37 struct OperationQueue;
38 
39 
44 {
50 
56 };
57 
58 
67 struct OperationQueue *
69  unsigned int max_active);
70 
71 
78 void
80 
81 
89 int
91 
92 
101 void
103  unsigned int max_active);
104 
105 
117 void
120  unsigned int nres);
121 
122 
132 void
134  struct GNUNET_TESTBED_Operation *op);
135 
136 
146 void
148 
149 
157 typedef void (*OperationStart) (void *cls);
158 
159 
173 typedef void (*OperationRelease) (void *cls);
174 
175 
187 
188 
195 void
197 
198 
208 void
210 
211 
219 void
221 
222 
228 void
230 
231 
232 #endif
233 /* end of testbed_api_operations.h */
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
static void queue(const char *hostname)
Add hostname to the list of requests to be made.
API for dealing with SUID helper processes.
API for writing tests and creating large-scale emulation testbeds for GNUnet.
Opaque handle to an abstract operation to be executed by the testing framework.
OperationRelease release
Function to call to clean up after the operation (which may or may not have been started yet).
Queue of operations where we can only support a certain number of concurrent operations of a particul...
unsigned int max_active
Max number of operations which can be active at any time in this queue.
void GNUNET_TESTBED_operation_mark_failed(struct GNUNET_TESTBED_Operation *op)
Marks an operation as failed.
void(* OperationRelease)(void *cls)
Function to call to cancel an operation (release all associated resources).
void GNUNET_TESTBED_operation_activate_(struct GNUNET_TESTBED_Operation *op)
Marks and inactive operation as active.
void(* OperationStart)(void *cls)
Function to call to start an operation once all queues the operation is part of declare that the oper...
void GNUNET_TESTBED_operation_queue_insert2_(struct OperationQueue *queue, struct GNUNET_TESTBED_Operation *op, unsigned int nres)
Add an operation to a queue.
OperationQueueType
The type of operation queue.
@ OPERATION_QUEUE_TYPE_ADAPTIVE
Operation queue which adapts the number of operations to be active based on the operation completion ...
@ OPERATION_QUEUE_TYPE_FIXED
Operation queue which permits a fixed maximum number of operations to be active at any time.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_operation_create_(void *cls, OperationStart start, OperationRelease release)
Create an 'operation' to be performed.
void GNUNET_TESTBED_operation_release_(struct GNUNET_TESTBED_Operation *op)
An operation is 'done' (was cancelled or finished); remove it from the queues and release associated ...
struct OperationQueue * GNUNET_TESTBED_operation_queue_create_(enum OperationQueueType type, unsigned int max_active)
Create an operation queue.
void GNUNET_TESTBED_operation_queue_reset_max_active_(struct OperationQueue *queue, unsigned int max_active)
Function to reset the maximum number of operations in the given queue.
void GNUNET_TESTBED_operation_queue_insert_(struct OperationQueue *queue, struct GNUNET_TESTBED_Operation *op)
Add an operation to a queue.
void GNUNET_TESTBED_operation_inactivate_(struct GNUNET_TESTBED_Operation *op)
Marks an active operation as inactive - the operation will be kept in a ready-to-be-released state an...
void GNUNET_TESTBED_operation_queue_destroy_(struct OperationQueue *queue)
Destroy an operation queue.
void GNUNET_TESTBED_operation_begin_wait_(struct GNUNET_TESTBED_Operation *op)
Marks the given operation as waiting on the queues.
int GNUNET_TESTBED_operation_queue_destroy_empty_(struct OperationQueue *queue)
Destroys the operation queue if it is empty.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model