aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_netjail_start_testsystem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_netjail_start_testsystem.c')
-rw-r--r--src/testing/testing_api_cmd_netjail_start_testsystem.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/testing/testing_api_cmd_netjail_start_testsystem.c b/src/testing/testing_api_cmd_netjail_start_testsystem.c
index 1709a58d2..d24ad3d28 100644
--- a/src/testing/testing_api_cmd_netjail_start_testsystem.c
+++ b/src/testing/testing_api_cmd_netjail_start_testsystem.c
@@ -86,7 +86,7 @@ struct NetJailState
86 /** 86 /**
87 * Array with handles of helper processes. 87 * Array with handles of helper processes.
88 */ 88 */
89 struct GNUNET_HELPER_Handle **helper; 89 const struct GNUNET_HELPER_Handle **helper;
90 90
91 /** 91 /**
92 * Size of the array NetJailState#helper. 92 * Size of the array NetJailState#helper.
@@ -211,22 +211,18 @@ netjail_exec_cleanup (void *cls)
211 * This function prepares an array with traits. 211 * This function prepares an array with traits.
212 * 212 *
213 */ 213 */
214static int 214static enum GNUNET_GenericReturnValue
215netjail_exec_traits (void *cls, 215netjail_exec_traits (void *cls,
216 const void **ret, 216 const void **ret,
217 const char *trait, 217 const char *trait,
218 unsigned int index) 218 unsigned int index)
219{ 219{
220 struct NetJailState *ns = cls; 220 struct NetJailState *ns = cls;
221 struct GNUNET_HELPER_Handle **helper = ns->helper; 221 const struct GNUNET_HELPER_Handle **helper = ns->helper;
222 222
223 223
224 struct GNUNET_TESTING_Trait traits[] = { 224 struct GNUNET_TESTING_Trait traits[] = {
225 { 225 GNUNET_TESTING_make_trait_helper_handles ((const void **) helper),
226 .index = 0,
227 .trait_name = "helper_handles",
228 .ptr = (const void *) helper,
229 },
230 GNUNET_TESTING_trait_end () 226 GNUNET_TESTING_trait_end ()
231 }; 227 };
232 228
@@ -238,26 +234,6 @@ netjail_exec_traits (void *cls,
238 234
239 235
240/** 236/**
241 * Offer handles to testing cmd helper from trait
242 *
243 * @param cmd command to extract the message from.
244 * @param pt pointer to message.
245 * @return #GNUNET_OK on success.
246 */
247int
248GNUNET_TESTING_get_trait_helper_handles (const struct
249 GNUNET_TESTING_Command *cmd,
250 struct GNUNET_HELPER_Handle ***
251 helper)
252{
253 return cmd->traits (cmd->cls,
254 (const void **) helper,
255 "helper_handles",
256 (unsigned int) 0);
257}
258
259
260/**
261 * Continuation function from GNUNET_HELPER_send() 237 * Continuation function from GNUNET_HELPER_send()
262 * 238 *
263 * @param cls closure 239 * @param cls closure
@@ -287,7 +263,7 @@ send_message_to_locals (
287 ) 263 )
288{ 264{
289 // unsigned int total_number = ns->local_m * ns->global_n + ns->known; 265 // unsigned int total_number = ns->local_m * ns->global_n + ns->known;
290 struct GNUNET_HELPER_Handle *helper; 266 const struct GNUNET_HELPER_Handle *helper;
291 struct TestingSystemCount *tbc; 267 struct TestingSystemCount *tbc;
292 268
293 LOG (GNUNET_ERROR_TYPE_DEBUG, 269 LOG (GNUNET_ERROR_TYPE_DEBUG,