aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_operations.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-07-29 11:24:08 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-07-29 11:24:08 +0000
commitaf106ded69593d7f4676f32da6e0058cf1577ce2 (patch)
treee09e73d77cb1b137346defe393a86882b779712d /src/testbed/testbed_api_operations.h
parentcc7efcc843411a956524a00c91425b9d626b03c3 (diff)
downloadgnunet-af106ded69593d7f4676f32da6e0058cf1577ce2.tar.gz
gnunet-af106ded69593d7f4676f32da6e0058cf1577ce2.zip
testbed operations
Diffstat (limited to 'src/testbed/testbed_api_operations.h')
-rw-r--r--src/testbed/testbed_api_operations.h50
1 files changed, 47 insertions, 3 deletions
diff --git a/src/testbed/testbed_api_operations.h b/src/testbed/testbed_api_operations.h
index 245e9a60e..a02f397ac 100644
--- a/src/testbed/testbed_api_operations.h
+++ b/src/testbed/testbed_api_operations.h
@@ -38,6 +38,44 @@ struct OperationQueue;
38 38
39 39
40/** 40/**
41 * Enumeration of operation types
42 */
43enum OperationType
44 {
45 /**
46 * Peer create operation
47 */
48 OP_PEER_CREATE,
49
50 /**
51 * Peer start operation
52 */
53 OP_PEER_START,
54
55 /**
56 * Peer stop operation
57 */
58 OP_PEER_STOP,
59
60 /**
61 * Peer destroy operation
62 */
63 OP_PEER_DESTROY,
64
65 /**
66 * Get peer information operation
67 */
68 OP_PEER_INFO,
69
70 /**
71 * Overlay connection operation
72 */
73 OP_OVERLAY_CONNECT,
74
75 };
76
77
78/**
41 * Create an operation queue. 79 * Create an operation queue.
42 * 80 *
43 * @param max_active maximum number of operations in this 81 * @param max_active maximum number of operations in this
@@ -94,6 +132,8 @@ GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue,
94 * Function to call to start an operation once all 132 * Function to call to start an operation once all
95 * queues the operation is part of declare that the 133 * queues the operation is part of declare that the
96 * operation can be activated. 134 * operation can be activated.
135 *
136 * @param cls the closure from GNUNET_TESTBED_operation_create_()
97 */ 137 */
98typedef void (*OperationStart)(void *cls); 138typedef void (*OperationStart)(void *cls);
99 139
@@ -107,7 +147,9 @@ typedef void (*OperationStart)(void *cls);
107 * a callback to the 'OperationStart' preceeds the call to 147 * a callback to the 'OperationStart' preceeds the call to
108 * 'OperationRelease'. Implementations of this function are expected 148 * 'OperationRelease'. Implementations of this function are expected
109 * to clean up whatever state is in 'cls' and release all resources 149 * to clean up whatever state is in 'cls' and release all resources
110 * associated with the operation. 150 * associated with the operation.
151 *
152 * @param cls the closure from GNUNET_TESTBED_operation_create_()
111 */ 153 */
112typedef void (*OperationRelease)(void *cls); 154typedef void (*OperationRelease)(void *cls);
113 155
@@ -118,14 +160,16 @@ typedef void (*OperationRelease)(void *cls);
118 * @param cls closure for the callbacks 160 * @param cls closure for the callbacks
119 * @param start function to call to start the operation 161 * @param start function to call to start the operation
120 * @param release function to call to close down the operation 162 * @param release function to call to close down the operation
121 * @param ... FIXME 163 * @param type the type of the operation
164 * @param data operation's relavant data
122 * @return handle to the operation 165 * @return handle to the operation
123 */ 166 */
124struct GNUNET_TESTBED_Operation * 167struct GNUNET_TESTBED_Operation *
125GNUNET_TESTBED_operation_create_ (void *cls, 168GNUNET_TESTBED_operation_create_ (void *cls,
126 OperationStart start, 169 OperationStart start,
127 OperationRelease release, 170 OperationRelease release,
128 ...); 171 enum OperationType type,
172 void *data);
129 173
130 174
131/** 175/**