diff options
Diffstat (limited to 'src/transport/transport-testing.h')
-rw-r--r-- | src/transport/transport-testing.h | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h index c77d79381..cc4974ff8 100644 --- a/src/transport/transport-testing.h +++ b/src/transport/transport-testing.h | |||
@@ -131,16 +131,18 @@ struct GNUNET_TRANSPORT_TESTING_handle | |||
131 | }; | 131 | }; |
132 | 132 | ||
133 | 133 | ||
134 | |||
135 | /** | 134 | /** |
136 | * Start a peer with the given configuration | 135 | * Start a peer with the given configuration |
137 | * @param rec receive callback | 136 | * @param tth the testing handle |
138 | * @param nc connect callback | 137 | * @param cfgname configuration file |
139 | * @param nd disconnect callback | 138 | * @param peer_id the peer_id |
140 | * @param cb_cls closure for callback | 139 | * @param rec receive callback |
141 | * if NULL passed the PeerContext * will be used! | 140 | * @param nc connect callback |
142 | * @return the peer context | 141 | * @param nd disconnect callback |
143 | */ | 142 | * @param start_cb start callback |
143 | * @param cb_cls closure for callback | ||
144 | * @return the peer context | ||
145 | */ | ||
144 | struct PeerContext * | 146 | struct PeerContext * |
145 | GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle | 147 | GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle |
146 | *tth, const char *cfgname, int peer_id, | 148 | *tth, const char *cfgname, int peer_id, |
@@ -153,6 +155,7 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle | |||
153 | 155 | ||
154 | /** | 156 | /** |
155 | * shutdown the given peer | 157 | * shutdown the given peer |
158 | * @param tth the testing handle | ||
156 | * @param p the peer | 159 | * @param p the peer |
157 | */ | 160 | */ |
158 | 161 | ||
@@ -166,6 +169,8 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth, | |||
166 | * @param tth testing handle | 169 | * @param tth testing handle |
167 | * @param p the peer | 170 | * @param p the peer |
168 | * @param cfgname the cfg file used to restart | 171 | * @param cfgname the cfg file used to restart |
172 | * @param restart_cb restart callback | ||
173 | * @param cb_cls callback closure | ||
169 | * @return GNUNET_OK in success otherwise GNUNET_SYSERR | 174 | * @return GNUNET_OK in success otherwise GNUNET_SYSERR |
170 | */ | 175 | */ |
171 | int | 176 | int |
@@ -173,12 +178,14 @@ GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_handle | |||
173 | *tth, struct PeerContext *p, | 178 | *tth, struct PeerContext *p, |
174 | const char *cfgname, | 179 | const char *cfgname, |
175 | GNUNET_TRANSPORT_TESTING_start_cb | 180 | GNUNET_TRANSPORT_TESTING_start_cb |
176 | start_cb, void *cb_cls); | 181 | restart_cb, void *cb_cls); |
177 | 182 | ||
178 | /** | 183 | /** |
179 | * Connect the given peers and call the callback when both peers report the | 184 | * Connect the given peers and call the callback when both peers report the |
180 | * inbound connection. Remarks: start_peer's notify_connect callback can be called | 185 | * inbound connection. Remarks: start_peer's notify_connect callback can be called |
181 | * before. | 186 | * before. |
187 | * | ||
188 | * @param tth transport testing handle | ||
182 | * @param p1 peer 1 | 189 | * @param p1 peer 1 |
183 | * @param p2 peer 2 | 190 | * @param p2 peer 2 |
184 | * @param cb the callback to call when both peers notified that they are connected | 191 | * @param cb the callback to call when both peers notified that they are connected |
@@ -195,12 +202,15 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle | |||
195 | /** | 202 | /** |
196 | * Cancel the request to connect two peers | 203 | * Cancel the request to connect two peers |
197 | * Tou MUST cancel the request if you stop the peers before the peers connected succesfully | 204 | * Tou MUST cancel the request if you stop the peers before the peers connected succesfully |
205 | * @param tth testing | ||
198 | * @param cc a connect request handle | 206 | * @param cc a connect request handle |
199 | */ | 207 | */ |
200 | void | 208 | void |
201 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct | 209 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct |
202 | GNUNET_TRANSPORT_TESTING_handle | 210 | GNUNET_TRANSPORT_TESTING_handle |
203 | *, void *cc); | 211 | *tth, |
212 | GNUNET_TRANSPORT_TESTING_ConnectRequest | ||
213 | ccr); | ||
204 | 214 | ||
205 | /** | 215 | /** |
206 | * Clean up the transport testing | 216 | * Clean up the transport testing |
@@ -231,12 +241,13 @@ GNUNET_TRANSPORT_TESTING_get_test_name (const char *file, char **dest); | |||
231 | /** | 241 | /** |
232 | * This function takes the filename (e.g. argv[0), removes a "lt-"-prefix and | 242 | * This function takes the filename (e.g. argv[0), removes a "lt-"-prefix and |
233 | * if existing ".exe"-prefix and adds the peer-number | 243 | * if existing ".exe"-prefix and adds the peer-number |
244 | * | ||
234 | * @param file filename of the test, e.g. argv[0] | 245 | * @param file filename of the test, e.g. argv[0] |
235 | * @param cfgname where to write the result | 246 | * @param dest where to write the filename |
236 | * @param count peer number | 247 | * @param count peer number |
237 | */ | 248 | */ |
238 | void | 249 | void |
239 | GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **cfgname, | 250 | GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **dest, |
240 | int count); | 251 | int count); |
241 | 252 | ||
242 | 253 | ||