aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_services.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-25 15:28:08 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-25 15:28:08 +0000
commit30c5c323f28ade8a1e7c6c593778793e44accb3a (patch)
tree845955ec895d221338b44f0cadce7932932e78cc /src/testbed/testbed_api_services.c
parent43d558efd13a3245e65efd0acdc9c4ba59cd2bee (diff)
downloadgnunet-30c5c323f28ade8a1e7c6c593778793e44accb3a.tar.gz
gnunet-30c5c323f28ade8a1e7c6c593778793e44accb3a.zip
- indent
Diffstat (limited to 'src/testbed/testbed_api_services.c')
-rw-r--r--src/testbed/testbed_api_services.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/testbed/testbed_api_services.c b/src/testbed/testbed_api_services.c
index c755a13a5..0c3d63de7 100644
--- a/src/testbed/testbed_api_services.c
+++ b/src/testbed/testbed_api_services.c
@@ -43,12 +43,11 @@ enum State
43 * The configuration request has been sent 43 * The configuration request has been sent
44 */ 44 */
45 CFG_REQUEST_QUEUED, 45 CFG_REQUEST_QUEUED,
46 46
47 /** 47 /**
48 * connected to service 48 * connected to service
49 */ 49 */
50 SERVICE_CONNECTED 50 SERVICE_CONNECTED
51
52}; 51};
53 52
54 53
@@ -149,23 +148,24 @@ configuration_receiver (void *cls, const struct GNUNET_MessageHeader *msg)
149 info.details.operation_finished.op_cls = data->op_cls; 148 info.details.operation_finished.op_cls = data->op_cls;
150 if (GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT == mtype) 149 if (GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT == mtype)
151 { 150 {
152 emsg = GNUNET_TESTBED_parse_error_string_ ((const struct 151 emsg =
153 GNUNET_TESTBED_OperationFailureEventMessage 152 GNUNET_TESTBED_parse_error_string_ ((const struct
154 *) msg); 153 GNUNET_TESTBED_OperationFailureEventMessage
154 *) msg);
155 if (NULL == emsg) 155 if (NULL == emsg)
156 emsg = "Unknown error"; 156 emsg = "Unknown error";
157 info.details.operation_finished.emsg = emsg; 157 info.details.operation_finished.emsg = emsg;
158 info.details.operation_finished.generic = NULL; 158 info.details.operation_finished.generic = NULL;
159 goto call_cb; 159 goto call_cb;
160 } 160 }
161 data->cfg = GNUNET_TESTBED_extract_config_ (msg); 161 data->cfg = GNUNET_TESTBED_extract_config_ (msg);
162 GNUNET_assert (NULL == data->op_result); 162 GNUNET_assert (NULL == data->op_result);
163 data->op_result = data->ca (data->cada_cls, data->cfg); 163 data->op_result = data->ca (data->cada_cls, data->cfg);
164 info.details.operation_finished.emsg = NULL; 164 info.details.operation_finished.emsg = NULL;
165 info.details.operation_finished.generic = data->op_result; 165 info.details.operation_finished.generic = data->op_result;
166 data->state = SERVICE_CONNECTED; 166 data->state = SERVICE_CONNECTED;
167 167
168 call_cb: 168call_cb:
169 if ((0 != (GNUNET_TESTBED_ET_OPERATION_FINISHED & c->event_mask)) && 169 if ((0 != (GNUNET_TESTBED_ET_OPERATION_FINISHED & c->event_mask)) &&
170 (NULL != c->cc)) 170 (NULL != c->cc))
171 c->cc (c->cc_cls, &info); 171 c->cc (c->cc_cls, &info);
@@ -237,7 +237,7 @@ oprelease_service_connect (void *cls)
237 * maintain connections with other systems. The actual service 237 * maintain connections with other systems. The actual service
238 * handle is then returned via the 'op_result' member in the event 238 * handle is then returned via the 'op_result' member in the event
239 * callback. The 'ca' callback is used to create the connection 239 * callback. The 'ca' callback is used to create the connection
240 * when the time is right; the 'da' callback will be used to 240 * when the time is right; the 'da' callback will be used to
241 * destroy the connection (upon 'GNUNET_TESTBED_operation_done'). 241 * destroy the connection (upon 'GNUNET_TESTBED_operation_done').
242 * 'GNUNET_TESTBED_operation_cancel' can be used to abort this 242 * 'GNUNET_TESTBED_operation_cancel' can be used to abort this
243 * operation until the event callback has been called. 243 * operation until the event callback has been called.
@@ -253,14 +253,13 @@ oprelease_service_connect (void *cls)
253 * @return handle for the operation 253 * @return handle for the operation
254 */ 254 */
255struct GNUNET_TESTBED_Operation * 255struct GNUNET_TESTBED_Operation *
256GNUNET_TESTBED_service_connect (void *op_cls, 256GNUNET_TESTBED_service_connect (void *op_cls, struct GNUNET_TESTBED_Peer *peer,
257 struct GNUNET_TESTBED_Peer *peer, 257 const char *service_name,
258 const char *service_name, 258 GNUNET_TESTBED_ServiceConnectCompletionCallback
259 GNUNET_TESTBED_ServiceConnectCompletionCallback cb, 259 cb, void *cb_cls,
260 void *cb_cls, 260 GNUNET_TESTBED_ConnectAdapter ca,
261 GNUNET_TESTBED_ConnectAdapter ca, 261 GNUNET_TESTBED_DisconnectAdapter da,
262 GNUNET_TESTBED_DisconnectAdapter da, 262 void *cada_cls)
263 void *cada_cls)
264{ 263{
265 struct ServiceConnectData *data; 264 struct ServiceConnectData *data;
266 265