aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testing_ng_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_testing_ng_lib.h')
-rw-r--r--src/include/gnunet_testing_ng_lib.h97
1 files changed, 92 insertions, 5 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h
index 31665f8f7..6138f567b 100644
--- a/src/include/gnunet_testing_ng_lib.h
+++ b/src/include/gnunet_testing_ng_lib.h
@@ -79,17 +79,17 @@ enum GNUNET_TESTING_NODE_TYPE
79 GNUNET_TESTING_GLOBAL_NODE 79 GNUNET_TESTING_GLOBAL_NODE
80}; 80};
81 81
82struct GNUNET_TESTING_ADDRESS_PREFIX 82struct GNUNET_TESTING_AddressPrefix
83{ 83{
84 /** 84 /**
85 * Pointer to the previous prefix in the DLL. 85 * Pointer to the previous prefix in the DLL.
86 */ 86 */
87 struct GNUNET_TESTING_ADDRESS_PREFIX *prev; 87 struct GNUNET_TESTING_AddressPrefix *prev;
88 88
89 /** 89 /**
90 * Pointer to the next prefix in the DLL. 90 * Pointer to the next prefix in the DLL.
91 */ 91 */
92 struct GNUNET_TESTING_ADDRESS_PREFIX *next; 92 struct GNUNET_TESTING_AddressPrefix *next;
93 93
94 /** 94 /**
95 * The address prefix. 95 * The address prefix.
@@ -138,12 +138,12 @@ struct GNUNET_TESTING_NodeConnection
138 /** 138 /**
139 * Head of the DLL with the address prefixes for the protocolls this node is reachable. 139 * Head of the DLL with the address prefixes for the protocolls this node is reachable.
140 */ 140 */
141 struct GNUNET_TESTING_ADDRESS_PREFIX *address_prefixes_head; 141 struct GNUNET_TESTING_AddressPrefix *address_prefixes_head;
142 142
143 /** 143 /**
144 * Tail of the DLL with the address prefixes for the protocolls this node is reachable. 144 * Tail of the DLL with the address prefixes for the protocolls this node is reachable.
145 */ 145 */
146 struct GNUNET_TESTING_ADDRESS_PREFIX *address_prefixes_tail; 146 struct GNUNET_TESTING_AddressPrefix *address_prefixes_tail;
147}; 147};
148 148
149/** 149/**
@@ -379,6 +379,11 @@ struct GNUNET_TESTING_Command
379 */ 379 */
380 bool asynchronous_finish; 380 bool asynchronous_finish;
381 381
382 /**
383 * Shall the scheduler shutdown, when end cmd is reach?
384 */
385 bool shutdown_on_end;
386
382}; 387};
383 388
384 389
@@ -450,6 +455,15 @@ GNUNET_TESTING_cmd_end (void);
450 455
451 456
452/** 457/**
458 * Create command array terminator without shutdown.
459 *
460 * @return a end-command.
461 */
462struct GNUNET_TESTING_Command
463GNUNET_TESTING_cmd_end_without_shutdown (void);
464
465
466/**
453 * Turn asynchronous command into non blocking command by setting asynchronous_finish to true. 467 * Turn asynchronous command into non blocking command by setting asynchronous_finish to true.
454 * 468 *
455 * @param cmd command to make synchronous. 469 * @param cmd command to make synchronous.
@@ -661,6 +675,55 @@ GNUNET_TESTING_get_topo_from_file (const char *filename);
661 675
662 676
663/** 677/**
678 * Get the connections to other nodes for a specific node.
679 *
680 * @param num The specific node we want the connections for.
681 * @param topology The topology we get the connections from.
682 * @return The connections of the node.
683 */
684struct GNUNET_TESTING_NodeConnection *
685GNUNET_TESTING_get_connections (unsigned int num, struct
686 GNUNET_TESTING_NetjailTopology *topology);
687
688
689/**
690 * Get the address for a specific communicator from a connection.
691 *
692 * @param connection The connection we like to have the address from.
693 * @param prefix The communicator protocol prefix.
694 * @return The address of the communicator.
695 */
696char *
697GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection,
698 char *prefix);
699
700
701/**
702 * Calculate the unique id identifying a node from a given connction.
703 *
704 * @param node_connection The connection we calculate the id from.
705 * @param topology The topology we get all needed information from.
706 * @return The unique id of the node from the connection.
707 */
708unsigned int
709GNUNET_TESTING_calculate_num (struct
710 GNUNET_TESTING_NodeConnection *node_connection,
711 struct GNUNET_TESTING_NetjailTopology *topology);
712
713
714/**
715 * Retrieve the public key from the test system with the unique node id.
716 *
717 * @param num The unique node id.
718 * @param tl_system The test system.
719 * @return The peer identity wrapping the public key.
720 */
721struct GNUNET_PeerIdentity *
722GNUNET_TESTING_get_pub_key (unsigned int num, struct
723 GNUNET_TESTING_System *tl_system);
724
725
726/**
664 * Obtain performance data from the interpreter. 727 * Obtain performance data from the interpreter.
665 * 728 *
666 * @param timers what commands (by label) to obtain runtimes for 729 * @param timers what commands (by label) to obtain runtimes for
@@ -1183,12 +1246,36 @@ GNUNET_TESTING_cmd_block_until_external_trigger (const char *label,
1183 unsigned int * 1246 unsigned int *
1184 stop_blocking); 1247 stop_blocking);
1185 1248
1249
1186struct GNUNET_TESTING_Command 1250struct GNUNET_TESTING_Command
1187GNUNET_TESTING_cmd_send_peer_ready (const char *label, 1251GNUNET_TESTING_cmd_send_peer_ready (const char *label,
1188 TESTING_CMD_HELPER_write_cb write_message); 1252 TESTING_CMD_HELPER_write_cb write_message);
1189 1253
1254
1255/**
1256 * Create command.
1257 *
1258 * @param label name for command.
1259 * @param write_message Callback to write messages to the master loop.
1260 * @return command.
1261 */
1190struct GNUNET_TESTING_Command 1262struct GNUNET_TESTING_Command
1191GNUNET_TESTING_cmd_local_test_finished (const char *label, 1263GNUNET_TESTING_cmd_local_test_finished (const char *label,
1192 TESTING_CMD_HELPER_write_cb 1264 TESTING_CMD_HELPER_write_cb
1193 write_message); 1265 write_message);
1266
1267/**
1268 * Create command.
1269 *
1270 * @param label name for command.
1271 * @param write_message Callback to write messages to the master loop.
1272 * @param all_local_tests_prepared Flag which will be set from outside.
1273 * @return command.
1274 */
1275struct GNUNET_TESTING_Command
1276GNUNET_TESTING_cmd_local_test_prepared (const char *label,
1277 TESTING_CMD_HELPER_write_cb
1278 write_message,
1279 unsigned int *
1280 all_local_tests_prepared);
1194#endif 1281#endif