diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-17 11:54:31 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-17 11:54:31 +0100 |
commit | 500842f42c4e51c4c5fc3c1cdfc1c1f7166b2d0d (patch) | |
tree | 9a80967af02b49319d0ab406b0ec9fa3d31e13fd /src/cadet/gnunet-service-cadet-new_peer.h | |
parent | d0bb14e2a958f4f816c6c006dd8b7a979e6de289 (diff) | |
download | gnunet-500842f42c4e51c4c5fc3c1cdfc1c1f7166b2d0d.tar.gz gnunet-500842f42c4e51c4c5fc3c1cdfc1c1f7166b2d0d.zip |
more work on new CADET
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_peer.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_peer.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_peer.h b/src/cadet/gnunet-service-cadet-new_peer.h index 780640674..74988981f 100644 --- a/src/cadet/gnunet-service-cadet-new_peer.h +++ b/src/cadet/gnunet-service-cadet-new_peer.h | |||
@@ -218,6 +218,28 @@ GCP_detach_path (struct CadetPeer *cp, | |||
218 | 218 | ||
219 | 219 | ||
220 | /** | 220 | /** |
221 | * Add a @a connection to this @a cp. | ||
222 | * | ||
223 | * @param cp peer via which the @a connection goes | ||
224 | * @param cc the connection to add | ||
225 | */ | ||
226 | void | ||
227 | GCP_add_connection (struct CadetPeer *cp, | ||
228 | struct CadetConnection *cc); | ||
229 | |||
230 | |||
231 | /** | ||
232 | * Remove a @a connection that went via this @a cp. | ||
233 | * | ||
234 | * @param cp peer via which the @a connection went | ||
235 | * @param cc the connection to remove | ||
236 | */ | ||
237 | void | ||
238 | GCP_remove_connection (struct CadetPeer *cp, | ||
239 | struct CadetConnection *cc); | ||
240 | |||
241 | |||
242 | /** | ||
221 | * We got a HELLO for a @a cp, remember it, and possibly | 243 | * We got a HELLO for a @a cp, remember it, and possibly |
222 | * trigger adequate actions (like trying to connect). | 244 | * trigger adequate actions (like trying to connect). |
223 | * | 245 | * |
@@ -238,4 +260,56 @@ void | |||
238 | GCP_destroy_all_peers (void); | 260 | GCP_destroy_all_peers (void); |
239 | 261 | ||
240 | 262 | ||
263 | /** | ||
264 | * Data structure used to track whom we have to notify about changes | ||
265 | * to our message queue. | ||
266 | */ | ||
267 | struct GCP_MessageQueueManager; | ||
268 | |||
269 | |||
270 | /** | ||
271 | * Function to call with updated message queue object. | ||
272 | * | ||
273 | * @param cls closure | ||
274 | * @param mq NULL if MQ is gone, otherwise an active message queue | ||
275 | */ | ||
276 | typedef void | ||
277 | (*GCP_MessageQueueNotificationCallback)(void *cls, | ||
278 | struct GNUNET_MQ_Handle *mq); | ||
279 | |||
280 | |||
281 | /** | ||
282 | * Start message queue change notifications. | ||
283 | * | ||
284 | * @param cp peer to notify for | ||
285 | * @param cb function to call if mq becomes available or unavailable | ||
286 | * @param cb_cls closure for @a cb | ||
287 | * @return handle to cancel request | ||
288 | */ | ||
289 | struct GCP_MessageQueueManager * | ||
290 | GCP_request_mq (struct CadetPeer *cp, | ||
291 | GCP_MessageQueueNotificationCallback cb, | ||
292 | void *cb_cls); | ||
293 | |||
294 | |||
295 | /** | ||
296 | * Stops message queue change notifications. | ||
297 | * | ||
298 | * @param mqm handle matching request to cancel | ||
299 | */ | ||
300 | void | ||
301 | GCP_request_mq_cancel (struct GCP_MessageQueueManager *mqm); | ||
302 | |||
303 | |||
304 | /** | ||
305 | * Set the message queue to @a mq for peer @a cp and notify watchers. | ||
306 | * | ||
307 | * @param cp peer to modify | ||
308 | * @param mq message queue to set (can be NULL) | ||
309 | */ | ||
310 | void | ||
311 | GCP_set_mq (struct CadetPeer *cp, | ||
312 | struct GNUNET_MQ_Handle *mq); | ||
313 | |||
314 | |||
241 | #endif | 315 | #endif |