aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testbed_ng_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_testbed_ng_service.h')
-rw-r--r--src/include/gnunet_testbed_ng_service.h203
1 files changed, 14 insertions, 189 deletions
diff --git a/src/include/gnunet_testbed_ng_service.h b/src/include/gnunet_testbed_ng_service.h
index 2ff5228cf..5979cd85a 100644
--- a/src/include/gnunet_testbed_ng_service.h
+++ b/src/include/gnunet_testbed_ng_service.h
@@ -38,176 +38,6 @@
38#include "gnunet_util_lib.h" 38#include "gnunet_util_lib.h"
39#include "gnunet_testing_ng_lib.h" 39#include "gnunet_testing_ng_lib.h"
40 40
41struct TngState;
42
43struct PeerCmdState
44{
45 /**
46 * The label of a controller command.
47 */
48 const char *controller_label;
49
50 /**
51 * Handle to operation
52 */
53 struct GNUNET_TESTBED_Operation *operation;
54
55 /**
56 * Name of the host, use "NULL" for localhost.
57 */
58 const char *hostname;
59
60 /**
61 * Username to use for the login; may be NULL.
62 */
63 const char *username;
64
65 /**
66 * Port number to use for ssh; use 0 to let ssh decide.
67 */
68 uint16_t port;
69
70 /**
71 * The configuration to use as a template while starting a controller
72 * on this host. Operation queue sizes specific to a host are also
73 * read from this configuration handle.
74 */
75 struct GNUNET_CONFIGURATION_Handle *cfg;
76
77 /**
78 * The host to run peers and controllers on
79 */
80 struct GNUNET_TESTBED_Host *host;
81
82 /**
83 * Abort task identifier
84 */
85 struct GNUNET_SCHEDULER_Task *abort_task;
86
87 /**
88 * Flag indicating if peer is ready.
89 */
90 int peer_ready;
91
92 /**
93 * Flag indicating controller is going down.
94 */
95 int peer_going_down;
96
97 /**
98 * Interpreter state.
99 */
100 struct GNUNET_TESTING_Interpreter *is;
101
102 /**
103 * Peer to start
104 */
105 struct GNUNET_TESTBED_Peer *peer;
106};
107
108struct ControllerState
109{
110 /**
111 * The ip address of the controller which will be set as TRUSTED
112 * HOST(all connections form this ip are permitted by the testbed) when
113 * starting testbed controller at host. This can either be a single ip
114 * address or a network address in CIDR notation.
115 */
116 const char *trusted_ip;
117
118 /**
119 * Name of the host, use "NULL" for localhost.
120 */
121 const char *hostname;
122
123 /**
124 * Username to use for the login; may be NULL.
125 */
126 const char *username;
127
128 /**
129 * Port number to use for ssh; use 0 to let ssh decide.
130 */
131 uint16_t port;
132
133 /**
134 * The configuration to use as a template while starting a controller
135 * on this host. Operation queue sizes specific to a host are also
136 * read from this configuration handle.
137 */
138 struct GNUNET_CONFIGURATION_Handle *cfg;
139
140 /**
141 * The host to run peers and controllers on
142 */
143 struct GNUNET_TESTBED_Host *host;
144
145 /**
146 * The controller process
147 */
148 struct GNUNET_TESTBED_ControllerProc *cp;
149
150 /**
151 * The controller handle
152 */
153 struct GNUNET_TESTBED_Controller *controller;
154
155 /**
156 * A bit mask with set of events to call the controller for.
157 */
158 uint64_t event_mask;
159
160 /**
161 * Abort task identifier
162 */
163 struct GNUNET_SCHEDULER_Task *abort_task;
164
165 /**
166 * Handle for host registration
167 */
168 struct GNUNET_TESTBED_HostRegistrationHandle *reg_handle;
169
170 /**
171 * Flag indicating if host create with controller is ready.
172 */
173 int host_ready;
174
175 /**
176 * Flag indicating controller is going down.
177 */
178 int controller_going_down;
179
180 /**
181 * Interpreter state.
182 */
183 struct GNUNET_TESTING_Interpreter *is;
184};
185
186/**
187 * Offer data from trait
188 *
189 * @param cmd command to extract the controller from.
190 * @param pt pointer to controller.
191 * @return #GNUNET_OK on success.
192 */
193int
194GNUNET_TESTBED_get_trait_controller (const struct GNUNET_TESTING_Command *cmd,
195 struct GNUNET_TESTBED_Controller **
196 controller);
197
198struct GNUNET_TESTING_Command
199GNUNET_TESTBED_cmd_controller (const char *label,
200 const char *host,
201 uint64_t event_mask);
202
203void
204GNUNET_TESTBED_shutdown_controller (struct ControllerState *cs);
205
206void
207GNUNET_TESTBED_shutdown_peer (struct PeerCmdState *ps);
208
209void
210GNUNET_TESTBED_shutdown_service (struct TngState *ss);
211 41
212/** 42/**
213 * Create command. 43 * Create command.
@@ -217,7 +47,7 @@ GNUNET_TESTBED_shutdown_service (struct TngState *ss);
217 * @return command. 47 * @return command.
218 */ 48 */
219struct GNUNET_TESTING_Command 49struct GNUNET_TESTING_Command
220GNUNET_TESTBED_cmd_netjail_start (const char *label, 50GNUNET_TESTING_cmd_netjail_start (const char *label,
221 char *local_m, 51 char *local_m,
222 char *global_n); 52 char *global_n);
223 53
@@ -230,11 +60,11 @@ GNUNET_TESTBED_cmd_netjail_start (const char *label,
230 * @return command. 60 * @return command.
231 */ 61 */
232struct GNUNET_TESTING_Command 62struct GNUNET_TESTING_Command
233GNUNET_TESTBED_cmd_netjail_start_testbed (const char *label, 63GNUNET_TESTING_cmd_netjail_start_testing_system (const char *label,
234 char *local_m, 64 char *local_m,
235 char *global_n, 65 char *global_n,
236 char *plugin_name, 66 char *plugin_name,
237 unsigned int *rv); 67 unsigned int *rv);
238 68
239 69
240/** 70/**
@@ -245,29 +75,24 @@ GNUNET_TESTBED_cmd_netjail_start_testbed (const char *label,
245 * @return command. 75 * @return command.
246 */ 76 */
247struct GNUNET_TESTING_Command 77struct GNUNET_TESTING_Command
248GNUNET_TESTBED_cmd_netjail_stop (const char *label, 78GNUNET_TESTING_cmd_netjail_stop (const char *label,
249 char *local_m, 79 char *local_m,
250 char *global_n); 80 char *global_n);
251 81
252 82
253struct GNUNET_TESTING_Command 83struct GNUNET_TESTING_Command
254GNUNET_TESTBED_cmd_stop_testbed (const char *label, 84GNUNET_TESTING_cmd_stop_testing_system (const char *label,
255 const char *helper_start_label, 85 const char *helper_start_label,
256 char *local_m, 86 char *local_m,
257 char *global_n); 87 char *global_n);
258 88
259 89
260int 90int
261GNUNET_TESTBED_get_trait_helper_handles (const struct 91GNUNET_TESTING_get_trait_helper_handles (const struct
262 GNUNET_TESTING_Command *cmd, 92 GNUNET_TESTING_Command *cmd,
263 struct GNUNET_HELPER_Handle ***helper); 93 struct GNUNET_HELPER_Handle ***helper);
264 94
265 95
266int
267GNUNET_TESTBED_get_trait_hosts (const struct
268 GNUNET_TESTING_Command *cmd,
269 struct GNUNET_TESTBED_Host ***hosts);
270
271struct GNUNET_TESTING_Command 96struct GNUNET_TESTING_Command
272GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, 97GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label,
273 unsigned int * 98 unsigned int *
@@ -275,11 +100,11 @@ GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label,
275 100
276struct GNUNET_TESTING_Command 101struct GNUNET_TESTING_Command
277GNUNET_TESTING_cmd_send_peer_ready (const char *label, 102GNUNET_TESTING_cmd_send_peer_ready (const char *label,
278 TESTBED_CMD_HELPER_write_cb write_message); 103 TESTING_CMD_HELPER_write_cb write_message);
279 104
280struct GNUNET_TESTING_Command 105struct GNUNET_TESTING_Command
281GNUNET_TESTING_cmd_local_test_finished (const char *label, 106GNUNET_TESTING_cmd_local_test_finished (const char *label,
282 TESTBED_CMD_HELPER_write_cb 107 TESTING_CMD_HELPER_write_cb
283 write_message); 108 write_message);
284 109
285#endif 110#endif