/**
* 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.
*/
* @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);
/**
* 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);
/**
/**
* Historic message, retrieved from PSYCstore.
*/
- GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 2
+ GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 30
};
* @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 *
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);
/**
* 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);
/**
* @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);
/**
* @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);
/**
* '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.
*/
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);
/**
* @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 *
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;