aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-07-20 12:02:27 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-07-20 12:02:27 +0000
commit15f4d07a0a03d4c2358c92976cca4708fcca7ff4 (patch)
tree16b30b28c0e2564447d72725c758c47b14698129 /src/testbed/test_testbed_api.c
parenta5d6aecaeb8fac43d885d5e8cfad3d33b8f271b4 (diff)
downloadgnunet-15f4d07a0a03d4c2358c92976cca4708fcca7ff4.tar.gz
gnunet-15f4d07a0a03d4c2358c92976cca4708fcca7ff4.zip
peer create callback
Diffstat (limited to 'src/testbed/test_testbed_api.c')
-rw-r--r--src/testbed/test_testbed_api.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c
index 6378fd9cc..3ae6dbd67 100644
--- a/src/testbed/test_testbed_api.c
+++ b/src/testbed/test_testbed_api.c
@@ -153,6 +153,30 @@ controller_cb(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
153 153
154 154
155/** 155/**
156 * Functions of this signature are called when a peer has been successfully
157 * created
158 *
159 * @param cls the closure from GNUNET_TESTBED_peer_create()
160 * @param peer the handle for the created peer; NULL on any error during
161 * creation
162 * @param emsg NULL if peer is not NULL; else MAY contain the error description
163 */
164static void
165peer_create_cb (void *cls,
166 struct GNUNET_TESTBED_Peer *peer, const char *emsg)
167{
168 struct GNUNET_TESTBED_Peer **peer_ptr;
169
170 peer_ptr = cls;
171 GNUNET_assert (NULL != peer);
172 GNUNET_assert (NULL != peer_ptr);
173 *peer_ptr = peer;
174 operation = GNUNET_TESTBED_peer_destroy (peer);
175 GNUNET_assert (NULL != operation);
176}
177
178
179/**
156 * Callback which will be called to after a host registration succeeded or failed 180 * Callback which will be called to after a host registration succeeded or failed
157 * 181 *
158 * @param cls the host which has been registered 182 * @param cls the host which has been registered
@@ -163,9 +187,7 @@ registration_comp (void *cls, const char *emsg)
163{ 187{
164 GNUNET_assert (cls == neighbour); 188 GNUNET_assert (cls == neighbour);
165 reg_handle = NULL; 189 reg_handle = NULL;
166 peer = GNUNET_TESTBED_peer_create (controller, host, cfg); 190 operation = GNUNET_TESTBED_peer_create (controller, host, cfg, &peer_create_cb, &peer);
167 GNUNET_assert (NULL != peer);
168 operation = GNUNET_TESTBED_peer_destroy (peer);
169 GNUNET_assert (NULL != operation); 191 GNUNET_assert (NULL != operation);
170} 192}
171 193