From 58f3fcb5fbdaabd767443c5b1baeb28964175777 Mon Sep 17 00:00:00 2001 From: Gabor X Toth <*@tg-x.net> Date: Wed, 17 Jul 2013 13:43:51 +0000 Subject: PSYC/multicast: message parameters for join/part requests --- src/include/gnunet_multicast_service.h | 18 ++++++++++++------ src/include/gnunet_psyc_service.h | 22 +++++++++++++++++++--- src/include/gnunet_social_service.h | 32 ++++++++++++++++---------------- 3 files changed, 47 insertions(+), 25 deletions(-) (limited to 'src/include') 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,18 +222,20 @@ struct GNUNET_MULTICAST_MessageHeader /** * Header of a request from a member to the origin. * - * This format is public as the replay mechanism must replay message fragments using the - * same format. This is needed as we want to integrity-check message fragments within - * the multicast layer to avoid multicasting mal-formed messages. + * FIXME: this is going to be internal. */ struct GNUNET_MULTICAST_RequestHeader { - /** * Header for all requests from a member to the origin. */ struct GNUNET_MessageHeader header; + /** + * Public key of the group. + */ + struct GNUNET_CRYPTO_ECCPublicKey pub_key; + /** * Flags for this request. */ @@ -389,10 +391,12 @@ typedef void (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, * @param cls Closure (set from GNUNET_MULTICAST_origin_start). * @param sender Identity of the sender. * @param req Request to the origin. + * @param flags Flags for the request. */ typedef void (*GNUNET_MULTICAST_RequestCallback) (void *cls, const struct GNUNET_PeerIdentity *sender, - const struct GNUNET_MULTICAST_RequestHeader *req); + const struct GNUNET_MessageHeader *req, + enum GNUNET_MULTICAST_MessageFlags flags); /** @@ -649,9 +653,11 @@ GNUNET_MULTICAST_member_request_replay_cancel (struct GNUNET_MULTICAST_MemberRep * Part a multicast group. * * @param member Membership handle. + * @param part_req Application-dependent part request to send to the origin. */ void -GNUNET_MULTICAST_member_part (struct GNUNET_MULTICAST_Member *member); +GNUNET_MULTICAST_member_part (struct GNUNET_MULTICAST_Member *member, + const struct GNUNET_MessageHeader *part_req); /** 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 /** * Historic message, retrieved from PSYCstore. */ - GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 2 + GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 30 }; @@ -385,6 +385,10 @@ struct GNUNET_PSYC_Slave; * @param method Function to invoke on messages received from the channel, * typically at least contains functions for @e join and @e part. * @param method_cls Closure for @a method. + * @param method_name Method name for the join request. + * @param env Environment containing transient variables for the request, or NULL. + * @param data_size Number of bytes in @a data. + * @param data Payload for the join message. * @return Handle for the slave, NULL on error. */ struct GNUNET_PSYC_Slave * @@ -392,7 +396,11 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EccPublicKey *pub_key, const struct GNUNET_PeerIdentity *origin, GNUNET_PSYC_Method method, - void *method_cls); + void *method_cls, + const char *method_name, + const struct GNUNET_ENV_Environment *env, + size_t data_size, + const void *data); /** @@ -402,9 +410,17 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, * first explicitly send a @e part request (via GNUNET_PSYC_slave_to_master()). * * @param slave Slave handle. + * @param method_name Method name for the part request. + * @param env Environment containing transient variables for the request, or NULL. + * @param data_size Number of bytes in @a data. + * @param data Payload for the part message. */ void -GNUNET_PSYC_slave_part (struct GNUNET_PSYC_Slave *slave); +GNUNET_PSYC_slave_part (struct GNUNET_PSYC_Slave *slave, + const char *method_name, + const struct GNUNET_ENV_Environment *env, + size_t data_size, + const void *data); /** 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); * @param nym Handle for the user who wants to enter. * @param header_length Number of modifiers in header. * @param header Modifiers present in the message. - * @param msg_size Number of bytes in @a msg. - * @param msg Payload given on enter (e.g. a password). + * @param data_size Number of bytes in @a data. + * @param data Payload given on enter (e.g. a password). */ typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, struct GNUNET_SOCIAL_Nym *nym, size_t header_length, GNUNET_PSYC_Modifier *header, - size_t msg_size, - const void *msg); + size_t data_size, + const void *data); /** @@ -283,16 +283,16 @@ GNUNET_SOCIAL_home_eject (struct GNUNET_SOCIAL_Home *home, * @param nym Handle for the entity that wanted to enter. * @param method_name Method name for the rejection message. * @param env Environment containing variables for the message, or NULL. - * @param msg_size Number of bytes in @a message for method. - * @param msg Rejection message to send back. + * @param data_size Number of bytes in @a data for method. + * @param data Data for the rejection message to send back. */ void GNUNET_SOCIAL_home_reject_entry (struct GNUNET_SOCIAL_Home *home, struct GNUNET_SOCIAL_Nym *nym, const char *method_name, const struct GNUNET_ENV_Environment *env, - size_t msg_size, - const void *msg); + size_t data_size, + const void *data); /** @@ -411,8 +411,8 @@ GNUNET_SOCIAL_home_destroy (struct GNUNET_SOCIAL_Home *home); * 'PLACE' record in the GADS zone with the public key 'HEX', and can be * used to request entry to a pseudonym's place directly. * @param env Environment containing variables for the message, or NULL. - * @param msg_size Number of bytes in @a msg. - * @param msg Message to give to the enter callback. + * @param data_size Number of bytes in @a data. + * @param data Payload for the message to give to the enter callback. * @param slicer Slicer to use for processing incoming requests from guests. * @return NULL on errors, otherwise handle to the place. */ @@ -421,8 +421,8 @@ GNUNET_SOCIAL_place_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SOCIAL_Ego *ego, char *address, const struct GNUNET_ENV_Environment *env, - size_t msg_size, - const void *msg, + size_t data_size, + const void *data, struct GNUNET_SOCIAL_Slicer *slicer); /** @@ -434,8 +434,8 @@ GNUNET_SOCIAL_place_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param peer Peer to send request to. * @param slicer Slicer to use for processing incoming requests from guests. * @param env Environment containing variables for the message, or NULL. - * @param msg_size Number of bytes in @a msg. - * @param msg Message to give to the enter callback. + * @param data_size Number of bytes in @a data. + * @param data Payload for the message to give to the enter callback. * @return NULL on errors, otherwise handle to the place. */ struct GNUNET_SOCIAL_Place * @@ -445,8 +445,8 @@ GNUNET_SOCIAL_place_enter2 (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *peer, struct GNUNET_SOCIAL_Slicer *slicer, const struct GNUNET_ENV_Environment *env, - size_t msg_size, - const void *msg); + size_t data_size, + const void *data); struct GNUNET_SOCIAL_WatchHandle; -- cgit v1.2.3