GNUnet  0.10.x
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 
49 
55 };
56 
57 
66 struct OperationQueue *
68  unsigned int max_active);
69 
70 
77 void
79 
80 
88 int
90 
91 
100 void
102  unsigned int max_active);
103 
104 
116 void
119  unsigned int nres);
120 
121 
131 void
133  struct GNUNET_TESTBED_Operation *op);
134 
135 
145 void
147 
148 
156 typedef void (*OperationStart) (void *cls);
157 
158 
172 typedef void (*OperationRelease) (void *cls);
173 
174 
186 
187 
194 void
196 
197 
207 void
209 
210 
218 void
220 
221 
227 void
229 
230 
231 #endif
232 /* end of testbed_api_operations.h */
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.
static void queue(const char *hostname)
Add hostname to the list of requests to be made.
int GNUNET_TESTBED_operation_queue_destroy_empty_(struct OperationQueue *queue)
Destroys the operation queue if it is empty.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_operation_create_(void *cls, OperationStart start, OperationRelease release)
Create an &#39;operation&#39; to be performed.
void GNUNET_TESTBED_operation_queue_insert_(struct OperationQueue *queue, struct GNUNET_TESTBED_Operation *op)
Add an operation to a queue.
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
Operation queue which permits a fixed maximum number of operations to be active at any time...
OperationRelease release
Function to call to clean up after the operation (which may or may not have been started yet)...
void GNUNET_TESTBED_operation_queue_insert2_(struct OperationQueue *queue, struct GNUNET_TESTBED_Operation *op, unsigned int nres)
Add an operation to a queue.
void(* OperationRelease)(void *cls)
Function to call to cancel an operation (release all associated resources).
Opaque handle to an abstract operation to be executed by the testing framework.
void GNUNET_TESTBED_operation_queue_destroy_(struct OperationQueue *queue)
Destroy an operation queue.
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_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...
OperationQueueType
The type of operation queue.
void GNUNET_TESTBED_operation_mark_failed(struct GNUNET_TESTBED_Operation *op)
Marks an operation as failed.
Queue of operations where we can only support a certain number of concurrent operations of a particul...
struct OperationQueue * GNUNET_TESTBED_operation_queue_create_(enum OperationQueueType type, unsigned int max_active)
Create an operation queue.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
unsigned int max_active
Max number of operations which can be active at any time in this queue.
void GNUNET_TESTBED_operation_release_(struct GNUNET_TESTBED_Operation *op)
An operation is &#39;done&#39; (was cancelled or finished); remove it from the queues and release associated ...
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
void GNUNET_TESTBED_operation_activate_(struct GNUNET_TESTBED_Operation *op)
Marks and inactive operation as active.
Operation queue which adapts the number of operations to be active based on the operation completion ...
void GNUNET_TESTBED_operation_begin_wait_(struct GNUNET_TESTBED_Operation *op)
Marks the given operation as waiting on the queues.