diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-22 17:27:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-22 17:27:16 +0000 |
commit | 07632b2d9509b0e425967cbc80d2abd6ffc81c9d (patch) | |
tree | 905060f30d74d05304a448fe3e3cd06dad583328 /src/include | |
parent | 068bd6929580eb6521c7ac40c8ae05eb632f6c58 (diff) | |
download | gnunet-07632b2d9509b0e425967cbc80d2abd6ffc81c9d.tar.gz gnunet-07632b2d9509b0e425967cbc80d2abd6ffc81c9d.zip |
use new APIs for connect/disconnect
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_core_service.h | 36 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 5 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 7 |
3 files changed, 10 insertions, 38 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 3ba4ef137..6f49dc71a 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -232,43 +232,13 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_SCHEDULER_Handle *sched, | |||
232 | 232 | ||
233 | 233 | ||
234 | /** | 234 | /** |
235 | * Request that the core should try to disconnect from a particular | 235 | * Cancel a pending request to connect to a particular peer. Must not |
236 | * peer. Once the request has been transmitted to the core, the | 236 | * be called after the 'cont' function was invoked. |
237 | * continuation function will be called. Note that this does NOT mean | ||
238 | * that a connection was successfully cut -- it only means that the | ||
239 | * core will now try. Typically this will work pretty much | ||
240 | * immediately, but it is at least in theory also possible that a | ||
241 | * reconnect is also triggered rather quickly. Successful creation | ||
242 | * and destruction of connections will be signalled to the 'connects' | ||
243 | * and 'disconnects' callback arguments of 'GNUNET_CORE_connect' only. | ||
244 | * If the core service does not respond to our connection attempt | ||
245 | * within the given time frame, 'cont' will be called with the TIMEOUT | ||
246 | * reason code. | ||
247 | * | ||
248 | * @param sched scheduler to use | ||
249 | * @param cfg configuration to use | ||
250 | * @param timeout how long to try to talk to core | ||
251 | * @param cont function to call once the request has been completed (or timed out) | ||
252 | * @param cont_cls closure for cont | ||
253 | * @return NULL on error (cont will not be called), otherwise handle for cancellation | ||
254 | */ | ||
255 | struct GNUNET_CORE_PeerRequestHandle * | ||
256 | GNUNET_CORE_peer_request_disconnect (struct GNUNET_SCHEDULER_Handle *sched, | ||
257 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
258 | struct GNUNET_TIME_Relative timeout, | ||
259 | const struct GNUNET_PeerIdentity * peer, | ||
260 | GNUNET_SCHEDULER_Task cont, | ||
261 | void *cont_cls); | ||
262 | |||
263 | |||
264 | /** | ||
265 | * Cancel a pending request to connect or disconnect from/to a particular | ||
266 | * peer. Must not be called after the 'cont' function was invoked. | ||
267 | * | 237 | * |
268 | * @param req request handle that was returned for the original request | 238 | * @param req request handle that was returned for the original request |
269 | */ | 239 | */ |
270 | void | 240 | void |
271 | GNUNET_CORE_peer_request_cancel (struct GNUNET_CORE_PeerRequestHandle *req); | 241 | GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle *req); |
272 | 242 | ||
273 | 243 | ||
274 | /** | 244 | /** |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 85553bff0..779c16f73 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -307,11 +307,6 @@ extern "C" | |||
307 | */ | 307 | */ |
308 | #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT 74 | 308 | #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT 74 |
309 | 309 | ||
310 | /** | ||
311 | * Request from client asking to disconnect from a peer. | ||
312 | */ | ||
313 | #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_DISCONNECT 75 | ||
314 | |||
315 | 310 | ||
316 | /** | 311 | /** |
317 | * Session key exchange between peers. | 312 | * Session key exchange between peers. |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index b86bb1663..650dd2e68 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -223,6 +223,13 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | |||
223 | 223 | ||
224 | 224 | ||
225 | 225 | ||
226 | /** | ||
227 | * Function called whenever there is an update to the | ||
228 | * HELLO of this peer. | ||
229 | * | ||
230 | * @param cls closure | ||
231 | * @param hello our updated HELLO | ||
232 | */ | ||
226 | typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback)(void *cls, | 233 | typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback)(void *cls, |
227 | const struct GNUNET_MessageHeader *hello); | 234 | const struct GNUNET_MessageHeader *hello); |
228 | 235 | ||