diff options
author | Gabor X Toth <*@tg-x.net> | 2013-08-12 16:57:49 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2013-08-12 16:57:49 +0000 |
commit | 544201a6bb7ec4480619f576f388d84883895de0 (patch) | |
tree | 8bb90aa95bcf2551807fe154bf3bb6b3dc34ff20 | |
parent | 99206c12844f13722688589530244ac7c56aab63 (diff) | |
download | gnunet-544201a6bb7ec4480619f576f388d84883895de0.tar.gz gnunet-544201a6bb7ec4480619f576f388d84883895de0.zip |
psyc/store: added effective_since msg ID for specifying when a membership change went into effect; psyc/social: added state_reset/clear_objects flag for message sending functions
-rw-r--r-- | src/include/gnunet_multicast_service.h | 31 | ||||
-rw-r--r-- | src/include/gnunet_psyc_service.h | 24 | ||||
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 8 | ||||
-rw-r--r-- | src/include/gnunet_social_service.h | 8 |
4 files changed, 33 insertions, 38 deletions
diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index 16c8ae740..418afd34b 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h | |||
@@ -171,15 +171,6 @@ struct GNUNET_MULTICAST_MessageHeader | |||
171 | struct GNUNET_CRYPTO_EccSignature signature; | 171 | struct GNUNET_CRYPTO_EccSignature signature; |
172 | 172 | ||
173 | /** | 173 | /** |
174 | * Signature of the multicast message fragment. | ||
175 | * | ||
176 | * FIXME: not strictly necessary, the size is already in the MessageHeader | ||
177 | * (minus the unsigned fields), and we could implicitly associate | ||
178 | * a sig. purpose with the message type in the header. | ||
179 | */ | ||
180 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
181 | |||
182 | /** | ||
183 | * Number of the message fragment, monotonically increasing. | 174 | * Number of the message fragment, monotonically increasing. |
184 | */ | 175 | */ |
185 | uint64_t fragment_id GNUNET_PACKED; | 176 | uint64_t fragment_id GNUNET_PACKED; |
@@ -221,32 +212,17 @@ struct GNUNET_MULTICAST_MessageHeader | |||
221 | */ | 212 | */ |
222 | enum GNUNET_MULTICAST_MessageFlags flags GNUNET_PACKED; | 213 | enum GNUNET_MULTICAST_MessageFlags flags GNUNET_PACKED; |
223 | 214 | ||
224 | /** | ||
225 | * Header for the message body. | ||
226 | * | ||
227 | * Three message types are specifically understood by multicast, namely "peer | ||
228 | * join", "peer part", and "group terminated". Multicast will use those | ||
229 | * messages to update its list of candidates for content distribution. All | ||
230 | * other message types are application-specific. | ||
231 | * | ||
232 | * FIXME: Needed? The payload could have its own message header already, | ||
233 | * multicast does not actually need it. | ||
234 | * Also, we have no message type argument for origin_to_all(), | ||
235 | */ | ||
236 | struct GNUNET_MessageHeader body; | ||
237 | |||
238 | /* Followed by message body. */ | 215 | /* Followed by message body. */ |
239 | }; | 216 | }; |
240 | 217 | ||
241 | GNUNET_NETWORK_STRUCT_END | 218 | GNUNET_NETWORK_STRUCT_END |
242 | 219 | ||
243 | |||
244 | GNUNET_NETWORK_STRUCT_BEGIN | 220 | GNUNET_NETWORK_STRUCT_BEGIN |
245 | 221 | ||
246 | /** | 222 | /** |
247 | * Header of a request from a member to the origin. | 223 | * Header of a request from a member to the origin. |
248 | * | 224 | * |
249 | * FIXME: this is going to be internal. | 225 | * FIXME: this struct is going to be internal. |
250 | */ | 226 | */ |
251 | struct GNUNET_MULTICAST_RequestHeader | 227 | struct GNUNET_MULTICAST_RequestHeader |
252 | { | 228 | { |
@@ -297,6 +273,11 @@ GNUNET_NETWORK_STRUCT_END | |||
297 | 273 | ||
298 | GNUNET_NETWORK_STRUCT_BEGIN | 274 | GNUNET_NETWORK_STRUCT_BEGIN |
299 | 275 | ||
276 | /** | ||
277 | * Header of a join request sent to the origin or another member. | ||
278 | * | ||
279 | * FIXME: this struct is going to be internal. | ||
280 | */ | ||
300 | struct GNUNET_MULTICAST_JoinRequest { | 281 | struct GNUNET_MULTICAST_JoinRequest { |
301 | /** | 282 | /** |
302 | * Header for the join request. | 283 | * Header for the join request. |
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 569342107..3c01ab480 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h | |||
@@ -297,22 +297,26 @@ struct GNUNET_PSYC_MasterTransmitHandle; | |||
297 | * Send a message to call a method to all members in the PSYC channel. | 297 | * Send a message to call a method to all members in the PSYC channel. |
298 | * | 298 | * |
299 | * @param master Handle to the PSYC channel. | 299 | * @param master Handle to the PSYC channel. |
300 | * @param increment_group_generation #GNUNET_YES if we need to increment | ||
301 | * the group generation counter after transmitting this message. | ||
302 | * @param method_name Which method should be invoked. | 300 | * @param method_name Which method should be invoked. |
303 | * @param env Environment containing state operations and transient variables | 301 | * @param env Environment containing state operations and transient variables |
304 | * for the message, or NULL. | 302 | * for the message, or NULL. |
305 | * @param notify Function to call to obtain the arguments. | 303 | * @param notify Function to call to obtain the arguments. |
306 | * @param notify_cls Closure for @a notify. | 304 | * @param notify_cls Closure for @a notify. |
305 | * @param reset_state #GNUNET_YES if this message should reset the channel | ||
306 | * state, i.e. remove all previously stored state variables. | ||
307 | * #GNUNET_NO to keep the state as is. | ||
308 | * @param increment_group_generation #GNUNET_YES if we need to increment | ||
309 | * the group generation counter after transmitting this message. | ||
307 | * @return Transmission handle, NULL on error (i.e. more than one request queued). | 310 | * @return Transmission handle, NULL on error (i.e. more than one request queued). |
308 | */ | 311 | */ |
309 | struct GNUNET_PSYC_MasterTransmitHandle * | 312 | struct GNUNET_PSYC_MasterTransmitHandle * |
310 | GNUNET_PSYC_master_transmit (struct GNUNET_PSYC_Master *master, | 313 | GNUNET_PSYC_master_transmit (struct GNUNET_PSYC_Master *master, |
311 | int increment_group_generation, | ||
312 | const char *method_name, | 314 | const char *method_name, |
313 | const struct GNUNET_ENV_Environment *env, | 315 | const struct GNUNET_ENV_Environment *env, |
314 | GNUNET_PSYC_MasterReadyNotify notify, | 316 | GNUNET_PSYC_MasterReadyNotify notify, |
315 | void *notify_cls); | 317 | void *notify_cls, |
318 | int reset_state, | ||
319 | int increment_group_generation); | ||
316 | 320 | ||
317 | 321 | ||
318 | /** | 322 | /** |
@@ -495,12 +499,14 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave); | |||
495 | * | 499 | * |
496 | * @param channel Channel handle. | 500 | * @param channel Channel handle. |
497 | * @param slave_key Identity of channel slave to add. | 501 | * @param slave_key Identity of channel slave to add. |
498 | * @param message_id Message ID for the message that changed the membership. | 502 | * @param announced_at ID of the message that announced the membership change. |
503 | * @param effective_since Addition of slave is in effect since this message ID. | ||
499 | */ | 504 | */ |
500 | void | 505 | void |
501 | GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, | 506 | GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, |
502 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 507 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, |
503 | uint64_t message_id); | 508 | uint64_t announced_at, |
509 | uint64_t effective_since); | ||
504 | 510 | ||
505 | 511 | ||
506 | /** | 512 | /** |
@@ -522,12 +528,14 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, | |||
522 | * | 528 | * |
523 | * @param channel Channel handle. | 529 | * @param channel Channel handle. |
524 | * @param slave_key Identity of channel slave to remove. | 530 | * @param slave_key Identity of channel slave to remove. |
525 | * @param message_id Message ID for the message that changed the membership. | 531 | * @param announced_at ID of the message that announced the membership change. |
532 | * @param effective_since Removal of slave is in effect since this message ID. | ||
526 | */ | 533 | */ |
527 | void | 534 | void |
528 | GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, | 535 | GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, |
529 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 536 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, |
530 | uint64_t message_id); | 537 | uint64_t announced_at, |
538 | uint64_t effective_since); | ||
531 | 539 | ||
532 | 540 | ||
533 | /** | 541 | /** |
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index f243fdc70..5c79e2073 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -92,8 +92,9 @@ typedef void (*GNUNET_PSYCSTORE_ResultCallback)(void *cls, | |||
92 | * @param h Handle for the PSYCstore. | 92 | * @param h Handle for the PSYCstore. |
93 | * @param channel_key The channel where the event happened. | 93 | * @param channel_key The channel where the event happened. |
94 | * @param slave_key Public key of joining/leaving slave. | 94 | * @param slave_key Public key of joining/leaving slave. |
95 | * @param message_id ID of the message in which this event was announced. | 95 | * @param announced_at ID of the message that announced the membership change. |
96 | * @param did_join #GNUNET_YES on join, #GNUNET_NO on leave. | 96 | * @param effective_since Message ID this membership change is in effect since. |
97 | * @param did_join #GNUNET_YES on join, #GNUNET_NO on part. | ||
97 | * @param rcb Callback to call with the result of the storage operation. | 98 | * @param rcb Callback to call with the result of the storage operation. |
98 | * @param rcb_cls Closure for the callback. | 99 | * @param rcb_cls Closure for the callback. |
99 | * | 100 | * |
@@ -103,7 +104,8 @@ struct GNUNET_PSYCSTORE_OperationHandle * | |||
103 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | 104 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, |
104 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 105 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, |
105 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 106 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, |
106 | uint64_t message_id, | 107 | uint64_t announced_at, |
108 | uint64_t effective_since, | ||
107 | int did_join, | 109 | int did_join, |
108 | GNUNET_PSYCSTORE_ResultCallback rcb, | 110 | GNUNET_PSYCSTORE_ResultCallback rcb, |
109 | void *rcb_cls); | 111 | void *rcb_cls); |
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h index c248eb81f..079290a3a 100644 --- a/src/include/gnunet_social_service.h +++ b/src/include/gnunet_social_service.h | |||
@@ -345,9 +345,12 @@ struct GNUNET_SOCIAL_Announcement; | |||
345 | * | 345 | * |
346 | * @param home Home to address the announcement to. | 346 | * @param home Home to address the announcement to. |
347 | * @param method_name Method to use for the announcement. | 347 | * @param method_name Method to use for the announcement. |
348 | * @param env Environment containing variables for the message, or NULL. | 348 | * @param env Environment containing variables for the message and operations on |
349 | * objects of the home, or NULL. | ||
349 | * @param notify Function to call to get the payload of the announcement. | 350 | * @param notify Function to call to get the payload of the announcement. |
350 | * @param notify_cls Closure for @a notify. | 351 | * @param notify_cls Closure for @a notify. |
352 | * @param clear_objects #GNUNET_YES to remove all objects from the home, #GNUNET_NO otherwise. | ||
353 | * New objects can be added to the now empty home using the @a env parameter. | ||
351 | * @return NULL on error (announcement already in progress?). | 354 | * @return NULL on error (announcement already in progress?). |
352 | */ | 355 | */ |
353 | struct GNUNET_SOCIAL_Announcement * | 356 | struct GNUNET_SOCIAL_Announcement * |
@@ -355,7 +358,8 @@ GNUNET_SOCIAL_home_announce (struct GNUNET_SOCIAL_Home *home, | |||
355 | const char *method_name, | 358 | const char *method_name, |
356 | const struct GNUNET_ENV_Environment *env, | 359 | const struct GNUNET_ENV_Environment *env, |
357 | GNUNET_CONNECTION_TransmitReadyNotify notify, | 360 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
358 | void *notify_cls); | 361 | void *notify_cls, |
362 | int clear_objects); | ||
359 | 363 | ||
360 | 364 | ||
361 | /** | 365 | /** |