diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-11 13:14:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-11 13:14:16 +0000 |
commit | 8599c7df4dff7eddba77260634dd7b94f9ebe016 (patch) | |
tree | 218305950249a590f5b35cfaa597bfec17521df0 /src/include/gnunet_multicast_service.h | |
parent | 0c0a922873c6647d07e038496d62568547c23e0b (diff) | |
download | gnunet-8599c7df4dff7eddba77260634dd7b94f9ebe016.tar.gz gnunet-8599c7df4dff7eddba77260634dd7b94f9ebe016.zip |
-further refinements to the APIs for PSYC/multicast
Diffstat (limited to 'src/include/gnunet_multicast_service.h')
-rw-r--r-- | src/include/gnunet_multicast_service.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index f8d37fc54..a110799c4 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h | |||
@@ -205,6 +205,10 @@ struct GNUNET_MULTICAST_MessageHeader | |||
205 | * thereby starting a new chain. The origin will then have to | 205 | * thereby starting a new chain. The origin will then have to |
206 | * re-create the full state with state update messages following the | 206 | * re-create the full state with state update messages following the |
207 | * state reset message. | 207 | * state reset message. |
208 | * | ||
209 | * Open question: needed in multicast, or just have this in PSYC; | ||
210 | * still might be useful for selective fetching of messages. | ||
211 | * Still, that again should that not be done by PSYC? | ||
208 | */ | 212 | */ |
209 | uint64_t state_delta GNUNET_PACKED; | 213 | uint64_t state_delta GNUNET_PACKED; |
210 | 214 | ||
@@ -287,27 +291,27 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh, | |||
287 | * @param is_joining GNUNET_YES if the peer wants to join, GNUNET_NO if the peer left | 291 | * @param is_joining GNUNET_YES if the peer wants to join, GNUNET_NO if the peer left |
288 | * @param jh join handle to pass to 'GNUNET_MULTICAST_join_decison' | 292 | * @param jh join handle to pass to 'GNUNET_MULTICAST_join_decison' |
289 | */ | 293 | */ |
290 | typedef int (*GNUNET_MULTICAST_MembershipChangeCallback)(void *cls, | 294 | typedef void (*GNUNET_MULTICAST_MembershipChangeCallback)(void *cls, |
291 | const struct GNUNET_PeerIdentity *peer, | 295 | const struct GNUNET_PeerIdentity *peer, |
292 | const struct GNUNET_MessageHeader *join_req, | 296 | const struct GNUNET_MessageHeader *join_req, |
293 | int is_joining, | 297 | int is_joining, |
294 | struct GNUNET_MULTICAST_JoinHandle *jh); | 298 | struct GNUNET_MULTICAST_JoinHandle *jh); |
295 | 299 | ||
296 | 300 | ||
297 | /** | 301 | /** |
298 | * Method called to test if a member was in the group at a particular time. | 302 | * Method called to test if a member was in the group at a particular time. |
299 | * | 303 | * |
304 | * FIXME: maybe allow reply to be asynchronous | ||
305 | * | ||
300 | * @param cls closure | 306 | * @param cls closure |
301 | * @param peer identity of the peer that we want to test | 307 | * @param peer identity of the peer that we want to test |
302 | * @param message_id message ID for which we want to do the test | 308 | * @param message_id message ID for which we want to do the test |
303 | * @param group_generation the generation of the group for which we want to do the test | ||
304 | * @return GNUNET_YES if peer was a member, GNUNET_NO if peer was not a member, | 309 | * @return GNUNET_YES if peer was a member, GNUNET_NO if peer was not a member, |
305 | * GNUNET_SYSERR if we cannot answer the membership test | 310 | * GNUNET_SYSERR if we cannot answer the membership test |
306 | */ | 311 | */ |
307 | typedef int (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, | 312 | typedef int (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, |
308 | const struct GNUNET_PeerIdentity *peer, | 313 | const struct GNUNET_PeerIdentity *peer, |
309 | uint64_t message_id, | 314 | uint64_t message_id); |
310 | uint64_t group_generation); | ||
311 | 315 | ||
312 | 316 | ||
313 | /** | 317 | /** |
@@ -333,13 +337,14 @@ typedef void (*GNUNET_MULTICAST_ResponseCallback) (void *cls, | |||
333 | * to indicate that the connection failed for good. | 337 | * to indicate that the connection failed for good. |
334 | * | 338 | * |
335 | * @param cls closure (set from GNUNET_MULTICAST_member_join) | 339 | * @param cls closure (set from GNUNET_MULTICAST_member_join) |
336 | * @param message_id unique number of the message | 340 | * @param message_id unique number of the message, 0 for response to join request, |
341 | * normal message IDs in either direction start at 1. | ||
337 | * @param msg message from the origin, NULL if the origin shut down | 342 | * @param msg message from the origin, NULL if the origin shut down |
338 | * (or we were kicked out, and we should thus call GNUNET_MULTICAST_member_leave next) | 343 | * (or we were kicked out, and we should thus call GNUNET_MULTICAST_member_leave next) |
339 | */ | 344 | */ |
340 | typedef void (*GNUNET_MULTICAST_MessageCallback) (void *cls, | 345 | typedef void (*GNUNET_MULTICAST_MulticastMessageCallback) (void *cls, |
341 | uint64_t message_id, | 346 | uint64_t message_id, |
342 | const struct GNUNET_MULTICAST_MessageHeader *msg); | 347 | const struct GNUNET_MULTICAST_MessageHeader *msg); |
343 | 348 | ||
344 | 349 | ||
345 | /** | 350 | /** |
@@ -463,7 +468,7 @@ GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
463 | uint64_t max_known_state_message_id, | 468 | uint64_t max_known_state_message_id, |
464 | GNUNET_MULTICAST_ReplayCallback replay_cb, | 469 | GNUNET_MULTICAST_ReplayCallback replay_cb, |
465 | GNUNET_MULITCAST_MembershipTestCallback test_cb, | 470 | GNUNET_MULITCAST_MembershipTestCallback test_cb, |
466 | GNUNET_MULTICAST_MessageCallback message_cb, | 471 | GNUNET_MULTICAST_MulticastMessageCallback message_cb, |
467 | const struct GNUNET_MessageHeader *join_req); | 472 | const struct GNUNET_MessageHeader *join_req); |
468 | 473 | ||
469 | 474 | ||
@@ -487,7 +492,7 @@ struct GNUNET_MULTICAST_ReplayRequest; | |||
487 | struct GNUNET_MULTICAST_ReplayRequest * | 492 | struct GNUNET_MULTICAST_ReplayRequest * |
488 | GNUNET_MULTICAST_member_request_replay (struct GNUNET_MULTICAST_Member *member, | 493 | GNUNET_MULTICAST_member_request_replay (struct GNUNET_MULTICAST_Member *member, |
489 | uint64_t message_id, | 494 | uint64_t message_id, |
490 | GNUNET_MULTICAST_MessageCallback message_cb, | 495 | GNUNET_MULTICAST_MulticastMessageCallback message_cb, |
491 | void *message_cb_cls); | 496 | void *message_cb_cls); |
492 | 497 | ||
493 | 498 | ||