diff options
author | Gabor X Toth <*@tg-x.net> | 2013-07-17 13:43:51 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2013-07-17 13:43:51 +0000 |
commit | 58f3fcb5fbdaabd767443c5b1baeb28964175777 (patch) | |
tree | d4656e04a2eca9d1edf1faef7ff7ebbe58cf80b3 /src/include | |
parent | f112f0014de7dd8d780a3493437629a5895c5ea0 (diff) | |
download | gnunet-58f3fcb5fbdaabd767443c5b1baeb28964175777.tar.gz gnunet-58f3fcb5fbdaabd767443c5b1baeb28964175777.zip |
PSYC/multicast: message parameters for join/part requests
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_multicast_service.h | 18 | ||||
-rw-r--r-- | src/include/gnunet_psyc_service.h | 22 | ||||
-rw-r--r-- | src/include/gnunet_social_service.h | 32 |
3 files changed, 47 insertions, 25 deletions
diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index 42e723125..cbe0ac698 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h | |||
@@ -222,19 +222,21 @@ struct GNUNET_MULTICAST_MessageHeader | |||
222 | /** | 222 | /** |
223 | * Header of a request from a member to the origin. | 223 | * Header of a request from a member to the origin. |
224 | * | 224 | * |
225 | * This format is public as the replay mechanism must replay message fragments using the | 225 | * FIXME: this is going to be internal. |
226 | * same format. This is needed as we want to integrity-check message fragments within | ||
227 | * the multicast layer to avoid multicasting mal-formed messages. | ||
228 | */ | 226 | */ |
229 | struct GNUNET_MULTICAST_RequestHeader | 227 | struct GNUNET_MULTICAST_RequestHeader |
230 | { | 228 | { |
231 | |||
232 | /** | 229 | /** |
233 | * Header for all requests from a member to the origin. | 230 | * Header for all requests from a member to the origin. |
234 | */ | 231 | */ |
235 | struct GNUNET_MessageHeader header; | 232 | struct GNUNET_MessageHeader header; |
236 | 233 | ||
237 | /** | 234 | /** |
235 | * Public key of the group. | ||
236 | */ | ||
237 | struct GNUNET_CRYPTO_ECCPublicKey pub_key; | ||
238 | |||
239 | /** | ||
238 | * Flags for this request. | 240 | * Flags for this request. |
239 | */ | 241 | */ |
240 | enum GNUNET_MULTICAST_MessageFlags flags GNUNET_PACKED; | 242 | enum GNUNET_MULTICAST_MessageFlags flags GNUNET_PACKED; |
@@ -389,10 +391,12 @@ typedef void (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, | |||
389 | * @param cls Closure (set from GNUNET_MULTICAST_origin_start). | 391 | * @param cls Closure (set from GNUNET_MULTICAST_origin_start). |
390 | * @param sender Identity of the sender. | 392 | * @param sender Identity of the sender. |
391 | * @param req Request to the origin. | 393 | * @param req Request to the origin. |
394 | * @param flags Flags for the request. | ||
392 | */ | 395 | */ |
393 | typedef void (*GNUNET_MULTICAST_RequestCallback) (void *cls, | 396 | typedef void (*GNUNET_MULTICAST_RequestCallback) (void *cls, |
394 | const struct GNUNET_PeerIdentity *sender, | 397 | const struct GNUNET_PeerIdentity *sender, |
395 | const struct GNUNET_MULTICAST_RequestHeader *req); | 398 | const struct GNUNET_MessageHeader *req, |
399 | enum GNUNET_MULTICAST_MessageFlags flags); | ||
396 | 400 | ||
397 | 401 | ||
398 | /** | 402 | /** |
@@ -649,9 +653,11 @@ GNUNET_MULTICAST_member_request_replay_cancel (struct GNUNET_MULTICAST_MemberRep | |||
649 | * Part a multicast group. | 653 | * Part a multicast group. |
650 | * | 654 | * |
651 | * @param member Membership handle. | 655 | * @param member Membership handle. |
656 | * @param part_req Application-dependent part request to send to the origin. | ||
652 | */ | 657 | */ |
653 | void | 658 | void |
654 | GNUNET_MULTICAST_member_part (struct GNUNET_MULTICAST_Member *member); | 659 | GNUNET_MULTICAST_member_part (struct GNUNET_MULTICAST_Member *member, |
660 | const struct GNUNET_MessageHeader *part_req); | ||
655 | 661 | ||
656 | 662 | ||
657 | /** | 663 | /** |
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 6f8597498..5abd08eaa 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h | |||
@@ -118,7 +118,7 @@ enum GNUNET_PSYC_MessageFlags | |||
118 | /** | 118 | /** |
119 | * Historic message, retrieved from PSYCstore. | 119 | * Historic message, retrieved from PSYCstore. |
120 | */ | 120 | */ |
121 | GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 2 | 121 | GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 30 |
122 | }; | 122 | }; |
123 | 123 | ||
124 | 124 | ||
@@ -385,6 +385,10 @@ struct GNUNET_PSYC_Slave; | |||
385 | * @param method Function to invoke on messages received from the channel, | 385 | * @param method Function to invoke on messages received from the channel, |
386 | * typically at least contains functions for @e join and @e part. | 386 | * typically at least contains functions for @e join and @e part. |
387 | * @param method_cls Closure for @a method. | 387 | * @param method_cls Closure for @a method. |
388 | * @param method_name Method name for the join request. | ||
389 | * @param env Environment containing transient variables for the request, or NULL. | ||
390 | * @param data_size Number of bytes in @a data. | ||
391 | * @param data Payload for the join message. | ||
388 | * @return Handle for the slave, NULL on error. | 392 | * @return Handle for the slave, NULL on error. |
389 | */ | 393 | */ |
390 | struct GNUNET_PSYC_Slave * | 394 | struct GNUNET_PSYC_Slave * |
@@ -392,7 +396,11 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
392 | const struct GNUNET_CRYPTO_EccPublicKey *pub_key, | 396 | const struct GNUNET_CRYPTO_EccPublicKey *pub_key, |
393 | const struct GNUNET_PeerIdentity *origin, | 397 | const struct GNUNET_PeerIdentity *origin, |
394 | GNUNET_PSYC_Method method, | 398 | GNUNET_PSYC_Method method, |
395 | void *method_cls); | 399 | void *method_cls, |
400 | const char *method_name, | ||
401 | const struct GNUNET_ENV_Environment *env, | ||
402 | size_t data_size, | ||
403 | const void *data); | ||
396 | 404 | ||
397 | 405 | ||
398 | /** | 406 | /** |
@@ -402,9 +410,17 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
402 | * first explicitly send a @e part request (via GNUNET_PSYC_slave_to_master()). | 410 | * first explicitly send a @e part request (via GNUNET_PSYC_slave_to_master()). |
403 | * | 411 | * |
404 | * @param slave Slave handle. | 412 | * @param slave Slave handle. |
413 | * @param method_name Method name for the part request. | ||
414 | * @param env Environment containing transient variables for the request, or NULL. | ||
415 | * @param data_size Number of bytes in @a data. | ||
416 | * @param data Payload for the part message. | ||
405 | */ | 417 | */ |
406 | void | 418 | void |
407 | GNUNET_PSYC_slave_part (struct GNUNET_PSYC_Slave *slave); | 419 | GNUNET_PSYC_slave_part (struct GNUNET_PSYC_Slave *slave, |
420 | const char *method_name, | ||
421 | const struct GNUNET_ENV_Environment *env, | ||
422 | size_t data_size, | ||
423 | const void *data); | ||
408 | 424 | ||
409 | 425 | ||
410 | /** | 426 | /** |
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h index 501efe433..36a7e7ed2 100644 --- a/src/include/gnunet_social_service.h +++ b/src/include/gnunet_social_service.h | |||
@@ -189,15 +189,15 @@ GNUNET_SOCIAL_ego_destroy (struct GNUNET_SOCIAL_Ego *ego); | |||
189 | * @param nym Handle for the user who wants to enter. | 189 | * @param nym Handle for the user who wants to enter. |
190 | * @param header_length Number of modifiers in header. | 190 | * @param header_length Number of modifiers in header. |
191 | * @param header Modifiers present in the message. | 191 | * @param header Modifiers present in the message. |
192 | * @param msg_size Number of bytes in @a msg. | 192 | * @param data_size Number of bytes in @a data. |
193 | * @param msg Payload given on enter (e.g. a password). | 193 | * @param data Payload given on enter (e.g. a password). |
194 | */ | 194 | */ |
195 | typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, | 195 | typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, |
196 | struct GNUNET_SOCIAL_Nym *nym, | 196 | struct GNUNET_SOCIAL_Nym *nym, |
197 | size_t header_length, | 197 | size_t header_length, |
198 | GNUNET_PSYC_Modifier *header, | 198 | GNUNET_PSYC_Modifier *header, |
199 | size_t msg_size, | 199 | size_t data_size, |
200 | const void *msg); | 200 | const void *data); |
201 | 201 | ||
202 | 202 | ||
203 | /** | 203 | /** |
@@ -283,16 +283,16 @@ GNUNET_SOCIAL_home_eject (struct GNUNET_SOCIAL_Home *home, | |||
283 | * @param nym Handle for the entity that wanted to enter. | 283 | * @param nym Handle for the entity that wanted to enter. |
284 | * @param method_name Method name for the rejection message. | 284 | * @param method_name Method name for the rejection message. |
285 | * @param env Environment containing variables for the message, or NULL. | 285 | * @param env Environment containing variables for the message, or NULL. |
286 | * @param msg_size Number of bytes in @a message for method. | 286 | * @param data_size Number of bytes in @a data for method. |
287 | * @param msg Rejection message to send back. | 287 | * @param data Data for the rejection message to send back. |
288 | */ | 288 | */ |
289 | void | 289 | void |
290 | GNUNET_SOCIAL_home_reject_entry (struct GNUNET_SOCIAL_Home *home, | 290 | GNUNET_SOCIAL_home_reject_entry (struct GNUNET_SOCIAL_Home *home, |
291 | struct GNUNET_SOCIAL_Nym *nym, | 291 | struct GNUNET_SOCIAL_Nym *nym, |
292 | const char *method_name, | 292 | const char *method_name, |
293 | const struct GNUNET_ENV_Environment *env, | 293 | const struct GNUNET_ENV_Environment *env, |
294 | size_t msg_size, | 294 | size_t data_size, |
295 | const void *msg); | 295 | const void *data); |
296 | 296 | ||
297 | 297 | ||
298 | /** | 298 | /** |
@@ -411,8 +411,8 @@ GNUNET_SOCIAL_home_destroy (struct GNUNET_SOCIAL_Home *home); | |||
411 | * 'PLACE' record in the GADS zone with the public key 'HEX', and can be | 411 | * 'PLACE' record in the GADS zone with the public key 'HEX', and can be |
412 | * used to request entry to a pseudonym's place directly. | 412 | * used to request entry to a pseudonym's place directly. |
413 | * @param env Environment containing variables for the message, or NULL. | 413 | * @param env Environment containing variables for the message, or NULL. |
414 | * @param msg_size Number of bytes in @a msg. | 414 | * @param data_size Number of bytes in @a data. |
415 | * @param msg Message to give to the enter callback. | 415 | * @param data Payload for the message to give to the enter callback. |
416 | * @param slicer Slicer to use for processing incoming requests from guests. | 416 | * @param slicer Slicer to use for processing incoming requests from guests. |
417 | * @return NULL on errors, otherwise handle to the place. | 417 | * @return NULL on errors, otherwise handle to the place. |
418 | */ | 418 | */ |
@@ -421,8 +421,8 @@ GNUNET_SOCIAL_place_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
421 | struct GNUNET_SOCIAL_Ego *ego, | 421 | struct GNUNET_SOCIAL_Ego *ego, |
422 | char *address, | 422 | char *address, |
423 | const struct GNUNET_ENV_Environment *env, | 423 | const struct GNUNET_ENV_Environment *env, |
424 | size_t msg_size, | 424 | size_t data_size, |
425 | const void *msg, | 425 | const void *data, |
426 | struct GNUNET_SOCIAL_Slicer *slicer); | 426 | struct GNUNET_SOCIAL_Slicer *slicer); |
427 | 427 | ||
428 | /** | 428 | /** |
@@ -434,8 +434,8 @@ GNUNET_SOCIAL_place_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
434 | * @param peer Peer to send request to. | 434 | * @param peer Peer to send request to. |
435 | * @param slicer Slicer to use for processing incoming requests from guests. | 435 | * @param slicer Slicer to use for processing incoming requests from guests. |
436 | * @param env Environment containing variables for the message, or NULL. | 436 | * @param env Environment containing variables for the message, or NULL. |
437 | * @param msg_size Number of bytes in @a msg. | 437 | * @param data_size Number of bytes in @a data. |
438 | * @param msg Message to give to the enter callback. | 438 | * @param data Payload for the message to give to the enter callback. |
439 | * @return NULL on errors, otherwise handle to the place. | 439 | * @return NULL on errors, otherwise handle to the place. |
440 | */ | 440 | */ |
441 | struct GNUNET_SOCIAL_Place * | 441 | struct GNUNET_SOCIAL_Place * |
@@ -445,8 +445,8 @@ GNUNET_SOCIAL_place_enter2 (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
445 | struct GNUNET_PeerIdentity *peer, | 445 | struct GNUNET_PeerIdentity *peer, |
446 | struct GNUNET_SOCIAL_Slicer *slicer, | 446 | struct GNUNET_SOCIAL_Slicer *slicer, |
447 | const struct GNUNET_ENV_Environment *env, | 447 | const struct GNUNET_ENV_Environment *env, |
448 | size_t msg_size, | 448 | size_t data_size, |
449 | const void *msg); | 449 | const void *data); |
450 | 450 | ||
451 | 451 | ||
452 | struct GNUNET_SOCIAL_WatchHandle; | 452 | struct GNUNET_SOCIAL_WatchHandle; |