aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-04-17 13:01:13 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-04-17 13:01:13 +0000
commitc5989d817871492bde9ee6df59db98901d4cf317 (patch)
tree8701d33982e686483ee29d0a8b5155c2806c38bd /src/testbed/testbed_api.h
parent2b7a52a080e089e852b0a15da690b058e97bedc0 (diff)
downloadgnunet-c5989d817871492bde9ee6df59db98901d4cf317.tar.gz
gnunet-c5989d817871492bde9ee6df59db98901d4cf317.zip
- use hashmap for remembering active operation contexts
Diffstat (limited to 'src/testbed/testbed_api.h')
-rw-r--r--src/testbed/testbed_api.h53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h
index 7c7edff5f..320289bb0 100644
--- a/src/testbed/testbed_api.h
+++ b/src/testbed/testbed_api.h
@@ -136,16 +136,6 @@ enum OperationContextState
136struct OperationContext 136struct OperationContext
137{ 137{
138 /** 138 /**
139 * next ptr for DLL
140 */
141 struct OperationContext *next;
142
143 /**
144 * prev ptr for DLL
145 */
146 struct OperationContext *prev;
147
148 /**
149 * The controller to which this operation context belongs to 139 * The controller to which this operation context belongs to
150 */ 140 */
151 struct GNUNET_TESTBED_Controller *c; 141 struct GNUNET_TESTBED_Controller *c;
@@ -240,14 +230,9 @@ struct GNUNET_TESTBED_Controller
240 struct GNUNET_TESTBED_HostRegistrationHandle *rh; 230 struct GNUNET_TESTBED_HostRegistrationHandle *rh;
241 231
242 /** 232 /**
243 * The head of the opeartion context queue 233 * The map of active operation contexts
244 */
245 struct OperationContext *ocq_head;
246
247 /**
248 * The tail of the operation context queue
249 */ 234 */
250 struct OperationContext *ocq_tail; 235 struct GNUNET_CONTAINER_MultiHashMap32 *opc_map;
251 236
252 /** 237 /**
253 * Operation queue for simultaneous operations 238 * Operation queue for simultaneous operations
@@ -294,6 +279,31 @@ GNUNET_TESTBED_queue_message_ (struct GNUNET_TESTBED_Controller *controller,
294 279
295 280
296/** 281/**
282 * Inserts the given operation context into the operation context map of the
283 * given controller. Creates the operation context map if one does not exist
284 * for the controller
285 *
286 * @param c the controller
287 * @param opc the operation context to be inserted
288 */
289void
290GNUNET_TESTBED_insert_opc_ (struct GNUNET_TESTBED_Controller *c,
291 struct OperationContext *opc);
292
293
294/**
295 * Removes the given operation context from the operation context map of the
296 * given controller
297 *
298 * @param c the controller
299 * @param opc the operation context to remove
300 */
301void
302GNUNET_TESTBED_remove_opc_ (const struct GNUNET_TESTBED_Controller *c,
303 struct OperationContext *opc);
304
305
306/**
297 * Compresses given configuration using zlib compress 307 * Compresses given configuration using zlib compress
298 * 308 *
299 * @param config the serialized configuration 309 * @param config the serialized configuration
@@ -322,15 +332,6 @@ GNUNET_TESTBED_compress_cfg_ (const struct GNUNET_CONFIGURATION_Handle *cfg,
322 332
323 333
324/** 334/**
325 * Adds an operation to the queue of operations
326 *
327 * @param op the operation to add
328 */
329void
330GNUNET_TESTBED_operation_add_ (struct GNUNET_TESTBED_Operation *op);
331
332
333/**
334 * Creates a helper initialization message. This function is here because we 335 * Creates a helper initialization message. This function is here because we
335 * want to use this in testing 336 * want to use this in testing
336 * 337 *