aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_multicast_service.h
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2013-07-29 03:50:22 +0000
committerGabor X Toth <*@tg-x.net>2013-07-29 03:50:22 +0000
commita8318fab8d0bd30cd98d2a42a0b429893e34b284 (patch)
tree6f31c202f01ff7c3602dab1b3cebd9da8c184b0c /src/include/gnunet_multicast_service.h
parent67370e1b06a281cf45d9bf7d9019a2b86491d473 (diff)
downloadgnunet-a8318fab8d0bd30cd98d2a42a0b429893e34b284.tar.gz
gnunet-a8318fab8d0bd30cd98d2a42a0b429893e34b284.zip
multicast: no state_delta
Diffstat (limited to 'src/include/gnunet_multicast_service.h')
-rw-r--r--src/include/gnunet_multicast_service.h77
1 files changed, 32 insertions, 45 deletions
diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h
index cc951495d..253c0ffff 100644
--- a/src/include/gnunet_multicast_service.h
+++ b/src/include/gnunet_multicast_service.h
@@ -157,8 +157,9 @@ struct GNUNET_MULTICAST_MessageHeader
157 /** 157 /**
158 * Number of hops this message fragment has taken since the origin. 158 * Number of hops this message fragment has taken since the origin.
159 * 159 *
160 * Helpful to determine shortest paths to the origin for responses among 160 * Helpful to determine shortest paths to the origin among honest peers for
161 * honest peers; updated at each hop and thus not signed and not secure. 161 * unicast requests from members. Updated at each hop and thus not signed and
162 * not secure.
162 */ 163 */
163 uint32_t hop_counter GNUNET_PACKED; 164 uint32_t hop_counter GNUNET_PACKED;
164 165
@@ -180,11 +181,6 @@ struct GNUNET_MULTICAST_MessageHeader
180 uint64_t fragment_id GNUNET_PACKED; 181 uint64_t fragment_id GNUNET_PACKED;
181 182
182 /** 183 /**
183 * Number of the message this fragment belongs to.
184 */
185 uint64_t message_id GNUNET_PACKED;
186
187 /**
188 * Number of fragments before the current one that has the same @a message_id. 184 * Number of fragments before the current one that has the same @a message_id.
189 * 185 *
190 * 0 for the first fragment of a message. 186 * 0 for the first fragment of a message.
@@ -198,8 +194,17 @@ struct GNUNET_MULTICAST_MessageHeader
198 uint64_t fragment_offset GNUNET_PACKED; 194 uint64_t fragment_offset GNUNET_PACKED;
199 195
200 /** 196 /**
197 * Number of the message this fragment belongs to.
198 *
199 * Set in GNUNET_MULTICAST_origin_to_all().
200 */
201 uint64_t message_id GNUNET_PACKED;
202
203 /**
201 * Counter that monotonically increases whenever a member parts the group. 204 * Counter that monotonically increases whenever a member parts the group.
202 * 205 *
206 * Set in GNUNET_MULTICAST_origin_to_all().
207 *
203 * It has significance in case of replay requests: when a member has missed 208 * It has significance in case of replay requests: when a member has missed
204 * messages and gets a replay request: in this case if the @a group_generation 209 * messages and gets a replay request: in this case if the @a group_generation
205 * is still the same before and after the missed messages, it means that no 210 * is still the same before and after the missed messages, it means that no
@@ -207,29 +212,6 @@ struct GNUNET_MULTICAST_MessageHeader
207 */ 212 */
208 uint64_t group_generation GNUNET_PACKED; 213 uint64_t group_generation GNUNET_PACKED;
209 214
210 /**
211 * Difference between the current @a fragment_id and the @a fragment_id of the
212 * preceeding non-transient message.
213 *
214 * Zero for transient messages, @c UINT64_MAX for the first message, or any
215 * other message creating a full state reset by the origin. By subtracting
216 * @a state_delta from @a fragment_id, it is possible to calculate the message
217 * ID of the preceeding non-transient message and thus quickly traverse all
218 * state changes up to the last full state reset by the origin. This is
219 * useful as it allows joining clients to quickly reassemble the state while
220 * skipping over transient messages (and doing so without having to trust
221 * intermediaries to do it right, as the indices in the chain are signed). If
222 * the state chain is getting too long, the origin can choose to originate a
223 * state message with a state_delta of UINT64_MAX, thereby starting a new
224 * chain. The origin will then have to re-create the full state with state
225 * update messages following the state reset message.
226 *
227 * Open question: needed in multicast, or just have this in PSYC; still might
228 * be useful for selective fetching of messages. Still, that again should
229 * that not be done by PSYC?
230 */
231 uint64_t state_delta GNUNET_PACKED;
232
233 /** 215 /**
234 * Flags for this message fragment. 216 * Flags for this message fragment.
235 */ 217 */
@@ -242,6 +224,9 @@ struct GNUNET_MULTICAST_MessageHeader
242 * join", "peer part", and "group terminated". Multicast will use those 224 * join", "peer part", and "group terminated". Multicast will use those
243 * messages to update its list of candidates for content distribution. All 225 * messages to update its list of candidates for content distribution. All
244 * other message types are application-specific. 226 * other message types are application-specific.
227 *
228 * FIXME: Needed? There's no message type argument of origin_to_all(),
229 * PSYC does not need it, but could be added.
245 */ 230 */
246 struct GNUNET_MessageHeader body; 231 struct GNUNET_MessageHeader body;
247 232
@@ -536,22 +521,22 @@ struct GNUNET_MULTICAST_OriginMessageHandle;
536 * Send a message to the multicast group. 521 * Send a message to the multicast group.
537 * 522 *
538 * @param origin Handle to the multicast group. 523 * @param origin Handle to the multicast group.
539 * @param message_id Application layer ID for the message. 524 * @param message_id Application layer ID for the message. Opaque to multicast.
540 * @param group_generation Group generation of the message. See GNUNET_MULTICAST_MessageHeader. 525 * @param group_generation Group generation of the message. Documented in
541 * @param state_delta State delta of the message. See GNUNET_MULTICAST_MessageHeader. 526 * GNUNET_MULTICAST_MessageHeader.
542 * @param size Number of bytes to transmit. 527 * @param size Number of bytes to transmit.
543 * @param cb Function to call to get the message. 528 * FIXME: Needed? The end of the message can be flagged with a last fragment flag.
544 * @param cb_cls Closure for @a cb. 529 * @param notify Function to call to get the message.
530 * @param notify_cls Closure for @a notify.
545 * @return NULL on error (i.e. request already pending). 531 * @return NULL on error (i.e. request already pending).
546 */ 532 */
547struct GNUNET_MULTICAST_OriginMessageHandle * 533struct GNUNET_MULTICAST_OriginMessageHandle *
548GNUNET_MULTICAST_origin_to_all (struct GNUNET_MULTICAST_Origin *origin, 534GNUNET_MULTICAST_origin_to_all (struct GNUNET_MULTICAST_Origin *origin,
549 uint64_t message_id, 535 uint64_t message_id,
550 uint64_t group_generation, 536 uint64_t group_generation,
551 uint64_t state_delta,
552 size_t size, 537 size_t size,
553 GNUNET_CONNECTION_TransmitReadyNotify cb, 538 GNUNET_CONNECTION_TransmitReadyNotify notify,
554 void *cb_cls); 539 void *notify_cls);
555 540
556 541
557/** 542/**
@@ -586,7 +571,9 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin);
586 * 571 *
587 * @param cfg Configuration to use. 572 * @param cfg Configuration to use.
588 * @param pub_key ECC key that identifies the group. 573 * @param pub_key ECC key that identifies the group.
589 * @param origin Peer identity of the origin, to send unicast requests to. 574 * @param origin Peer ID of the origin to send unicast requsets to. If NULL,
575 * unicast requests are sent back via multiple hops on the reverse path
576 * of multicast messages.
590 * @param relay_count Number of peers in the @a relays array. 577 * @param relay_count Number of peers in the @a relays array.
591 * @param relays Peer identities of members of the group, which serve as relays 578 * @param relays Peer identities of members of the group, which serve as relays
592 * and can be used to join the group at. and send the @a join_request to. 579 * and can be used to join the group at. and send the @a join_request to.
@@ -615,8 +602,8 @@ struct GNUNET_MULTICAST_Member *
615GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, 602GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg,
616 const struct GNUNET_CRYPTO_EccPublicKey *pub_key, 603 const struct GNUNET_CRYPTO_EccPublicKey *pub_key,
617 const struct GNUNET_PeerIdentity *origin, 604 const struct GNUNET_PeerIdentity *origin,
618 size_t member_count, 605 size_t relay_count,
619 const struct GNUNET_PeerIdentity *members, 606 const struct GNUNET_PeerIdentity *relays,
620 const struct GNUNET_MessageHeader *join_request, 607 const struct GNUNET_MessageHeader *join_request,
621 uint64_t max_known_fragment_id, 608 uint64_t max_known_fragment_id,
622 GNUNET_MULTICAST_JoinCallback join_cb, 609 GNUNET_MULTICAST_JoinCallback join_cb,
@@ -685,15 +672,15 @@ struct GNUNET_MULTICAST_MemberRequestHandle;
685 * 672 *
686 * @param member Membership handle. 673 * @param member Membership handle.
687 * @param size Number of bytes we want to send to origin. 674 * @param size Number of bytes we want to send to origin.
688 * @param cb Callback to call to get the message. 675 * @param notify Callback to call to get the message.
689 * @param cb_cls Closure for @a cb. 676 * @param notify_cls Closure for @a notify.
690 * @return Handle to cancel request, NULL on error (i.e. request already pending). 677 * @return Handle to cancel request, NULL on error (i.e. request already pending).
691 */ 678 */
692struct GNUNET_MULTICAST_MemberRequestHandle * 679struct GNUNET_MULTICAST_MemberRequestHandle *
693GNUNET_MULTICAST_member_to_origin (struct GNUNET_MULTICAST_Member *member, 680GNUNET_MULTICAST_member_to_origin (struct GNUNET_MULTICAST_Member *member,
694 size_t size, 681 size_t size,
695 GNUNET_CONNECTION_TransmitReadyNotify cb, 682 GNUNET_CONNECTION_TransmitReadyNotify notify,
696 void *cb_cls); 683 void *notify_cls);
697 684
698 685
699/** 686/**