aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_http_server.c5
-rw-r--r--src/transport/transport-testing.c14
-rw-r--r--src/transport/transport-testing.h37
3 files changed, 40 insertions, 16 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 2c180c5ff..24c27aced 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -47,10 +47,12 @@ struct ServerConnection
47 * starts the task waiting for them. 47 * starts the task waiting for them.
48 * @param plugin plugin 48 * @param plugin plugin
49 * @param daemon_handle the MHD daemon handle 49 * @param daemon_handle the MHD daemon handle
50 * @param now schedule now or with MHD delay
50 * @return gnunet task identifier 51 * @return gnunet task identifier
51 */ 52 */
52static GNUNET_SCHEDULER_TaskIdentifier 53static GNUNET_SCHEDULER_TaskIdentifier
53server_schedule (struct Plugin *plugin, struct MHD_Daemon *daemon_handle, 54server_schedule (struct Plugin *plugin,
55 struct MHD_Daemon *daemon_handle,
54 int now); 56 int now);
55 57
56static void 58static void
@@ -238,6 +240,7 @@ server_load_certificate (struct Plugin *plugin)
238/** 240/**
239 * Reschedule the execution of both IPv4 and IPv6 server 241 * Reschedule the execution of both IPv4 and IPv6 server
240 * @param plugin the plugin 242 * @param plugin the plugin
243 * @param server which server to schedule v4 or v6?
241 * @param now GNUNET_YES to schedule execution immediately, GNUNET_NO to wait 244 * @param now GNUNET_YES to schedule execution immediately, GNUNET_NO to wait
242 * until timeout 245 * until timeout
243 */ 246 */
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 9f7a99a7b..dcd95053b 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -253,9 +253,13 @@ try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
253 253
254/** 254/**
255 * Start a peer with the given configuration 255 * Start a peer with the given configuration
256 * @param tth the testing handle
257 * @param cfgname configuration file
258 * @param peer_id the peer_id
256 * @param rec receive callback 259 * @param rec receive callback
257 * @param nc connect callback 260 * @param nc connect callback
258 * @param nd disconnect callback 261 * @param nd disconnect callback
262 * @param start_cb start callback
259 * @param cb_cls closure for callback 263 * @param cb_cls closure for callback
260 * @return the peer context 264 * @return the peer context
261 */ 265 */
@@ -352,6 +356,8 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle
352* @param tth testing handle 356* @param tth testing handle
353* @param p the peer 357* @param p the peer
354* @param cfgname the cfg file used to restart 358* @param cfgname the cfg file used to restart
359* @param restart_cb callback to call when restarted
360* @param cb_cls callback closure
355* @return GNUNET_OK in success otherwise GNUNET_SYSERR 361* @return GNUNET_OK in success otherwise GNUNET_SYSERR
356*/ 362*/
357int 363int
@@ -460,6 +466,7 @@ fail:
460 466
461/** 467/**
462 * shutdown the given peer 468 * shutdown the given peer
469 * @param tth testing handle
463 * @param p the peer 470 * @param p the peer
464 */ 471 */
465void 472void
@@ -563,7 +570,9 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle
563/** 570/**
564 * Cancel the request to connect two peers 571 * Cancel the request to connect two peers
565 * Tou MUST cancel the request if you stop the peers before the peers connected succesfully 572 * Tou MUST cancel the request if you stop the peers before the peers connected succesfully
566 * @param cc a connect request handle 573 *
574 * @param tth transport testing handle
575 * @param ccr a connect request handle
567 */ 576 */
568void 577void
569GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct 578GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
@@ -829,8 +838,9 @@ suc:
829/** 838/**
830 * This function takes the filename (e.g. argv[0), removes a "lt-"-prefix and 839 * This function takes the filename (e.g. argv[0), removes a "lt-"-prefix and
831 * if existing ".exe"-prefix and adds the peer-number 840 * if existing ".exe"-prefix and adds the peer-number
841 *
832 * @param file filename of the test, e.g. argv[0] 842 * @param file filename of the test, e.g. argv[0]
833 * @param cfgname where to write the result 843 * @param dest where to write the filename
834 * @param count peer number 844 * @param count peer number
835 */ 845 */
836void 846void
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*/
144struct PeerContext * 146struct PeerContext *
145GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle 147GNUNET_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*/
171int 176int
@@ -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 */
200void 208void
201GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct 209GNUNET_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 */
238void 249void
239GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **cfgname, 250GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **dest,
240 int count); 251 int count);
241 252
242 253