multicast/psyc: no part cb needed
authorGabor X Toth <*@tg-x.net>
Tue, 23 Jul 2013 05:38:35 +0000 (05:38 +0000)
committerGabor X Toth <*@tg-x.net>
Tue, 23 Jul 2013 05:38:35 +0000 (05:38 +0000)
src/include/gnunet_multicast_service.h
src/include/gnunet_psyc_service.h

index 58f5c4fbe512b5f2cb4cf49251cf972c4d40a209..68d4944dee753e8a738b9f4f21dfe564e779f936 100644 (file)
@@ -164,6 +164,8 @@ struct GNUNET_MULTICAST_MessageHeader
 
   /** 
    * Byte offset of this @e fragment of the @e message.
+   *
+   * FIXME: needed?
    */
   uint64_t fragment_offset GNUNET_PACKED;
 
@@ -201,7 +203,7 @@ struct GNUNET_MULTICAST_MessageHeader
   uint64_t state_delta GNUNET_PACKED;
 
   /**
-   * Flags for this message.
+   * Flags for this message fragment.
    */
   enum GNUNET_MULTICAST_MessageFlags flags GNUNET_PACKED;
 
@@ -265,14 +267,6 @@ GNUNET_NETWORK_STRUCT_END
  */
 struct GNUNET_MULTICAST_JoinHandle;
 
-/** 
- * Handle that identifies a part request.
- *
- * Used to match calls to #GNUNET_MULTICAST_PartCallback to the
- * corresponding calls to GNUNET_MULTICAST_part_ack().
- */
-struct GNUNET_MULTICAST_PartHandle;
-
 
 /** 
  * Function to call with the decision made for a join request.
@@ -304,15 +298,6 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh,
                                 const struct GNUNET_PeerIdentity *relays);
 
 
-/** 
- * Part acknowledgment.
- *
- * @param ph Part handle.
- */
-void
-GNUNET_MULTICAST_part_ack (struct GNUNET_MULTICAST_PartHandle *ph);
-
-
 /** 
  * Method called whenever another peer wants to join the multicast group.
  *
@@ -333,22 +318,6 @@ typedef void (*GNUNET_MULTICAST_JoinCallback)(void *cls,
                                               struct GNUNET_MULTICAST_JoinHandle *jh);
 
 
-/** 
- * Method called whenever another peer wants to part the multicast group.
- *
- * A part request must always be honoured, and answered with GNUNET_MULTICAST_part_ack();
- *
- * @param cls Closure.
- * @param peer Identity of the peer that wants to part.
- * @param msg Application-dependent part message from the leaving user.
- * @param ph Part handle.
- */
-typedef void (*GNUNET_MULTICAST_PartCallback)(void *cls,
-                                              const struct GNUNET_PeerIdentity *peer,
-                                              const struct GNUNET_MessageHeader *msg,
-                                              struct GNUNET_MULTICAST_PartHandle *ph);
-
-
 /** 
  * Handle to pass back for the answer of a membership test.
  */
@@ -507,7 +476,6 @@ GNUNET_MULTICAST_replay (struct GNUNET_MULTICAST_ReplayHandle *rh,
  * @param replay_cb Function that can be called to replay a message.
  * @param test_cb Function multicast can use to test group membership.
  * @param join_cb Function called to approve / disapprove joining of a peer.
- * @param part_cb Function called when a member wants to part the group.
  * @param request_cb Function called with messages from group members.
  * @return Handle for the origin, NULL on error.
  */
@@ -519,7 +487,6 @@ GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                GNUNET_MULITCAST_ReplayCallback replay_cb,
                                GNUNET_MULITCAST_MembershipTestCallback test_cb,
                                GNUNET_MULTICAST_JoinCallback join_cb,
-                               GNUNET_MULTICAST_PartCallback part_cb,
                                GNUNET_MULTICAST_RequestCallback request_cb);
 
 
@@ -580,11 +547,11 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin);
  * @param pub_key ECC key that identifies the group.
  * @param origin Peer identity of the origin.
  * @param max_known_fragment_id Largest known message fragment ID to the replay
         service; all messages with IDs larger than this ID will be replayed if
*        service; all messages with IDs larger than this ID will be replayed if
  *        possible (lower IDs will be considered known and thus only
  *        be replayed upon explicit request).
  * @param max_known_state_fragment_id Largest known message fragment ID with a
         non-zero value for the @e state_delta; state messages with
*        non-zero value for the @e state_delta; state messages with
  *        larger IDs than this value will be replayed with high priority
  *        (lower IDs will be considered known and thus only
  *        be replayed upon explicit request).
@@ -652,12 +619,15 @@ GNUNET_MULTICAST_member_request_replay_cancel (struct GNUNET_MULTICAST_MemberRep
 /** 
  * Part a multicast group.
  *
+ * Disconnects from all group members and invalidates the @a member handle.
+ *
+ * An application-dependent part message can be transmitted beforehand using
+ * GNUNET_MULTICAST_member_to_origin())
+ *
  * @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,
-                              const struct GNUNET_MessageHeader *part_req);
+GNUNET_MULTICAST_member_part (struct GNUNET_MULTICAST_Member *member);
 
 
 /** 
index b2b370cf9b80cc5328eb8ce06a17ee81702691f2..83c92598ffc86411961539c64e782966533ae28f 100644 (file)
@@ -130,14 +130,6 @@ enum GNUNET_PSYC_MessageFlags
  */
 struct GNUNET_PSYC_JoinHandle;
 
-/** 
- * Handle that identifies a part request.
- *
- * Used to match calls to #GNUNET_PSYC_PartCallback to the
- * corresponding calls to GNUNET_PSYC_part_ack().
- */
-struct GNUNET_PSYC_PartHandle;
-
 
 /** 
  * Method called from PSYC upon receiving a message indicating a call
@@ -194,28 +186,6 @@ typedef int (*GNUNET_PSYC_JoinCallback)(void *cls,
                                         struct GNUNET_PSYC_JoinHandle *jh);
 
 
-/** 
- * Method called from PSYC upon receiving a part request.
- *
- * @param cls Closure.
- * @param peer Peer requesting to leave.
- * @param method_name Method name in the part request.
- * @param header_length Number of modifiers in header.
- * @param header Modifiers present in the message.
- * @param data_size Number of bytes in @a data.
- * @param data Data stream given to the method (might not be zero-terminated
- *             if data is binary).
- */
-typedef int (*GNUNET_PSYC_PartCallback)(void *cls,
-                                        const struct GNUNET_PeerIdentity *peer,
-                                        const char *method_name,
-                                        size_t header_length,
-                                        GNUNET_PSYC_Modifier *header,
-                                        size_t data_size,
-                                        const void *data,
-                                        struct GNUNET_PSYC_PartHandle *ph);
-
-
 /** 
  * Function to call with the decision made for a join request.
  *
@@ -239,15 +209,6 @@ GNUNET_PSYC_join_decision (struct GNUNET_PSYC_JoinHandle *jh,
                            const void *data);
 
 
-/** 
- * Send a part acknowledgment.
- *
- * @param ph Part handle.
- */
-void
-GNUNET_PSYC_part_ack (struct GNUNET_PSYC_PartHandle *ph);
-
-
 /** 
  * Handle for the master of a PSYC channel.
  */
@@ -279,7 +240,6 @@ struct GNUNET_PSYC_Master;
  *                 Used to automate group management decisions.
  * @param method_cb Function to invoke on messages received from members.
  * @param join_cb Function to invoke when a peer wants to join.
- * @param part_cb Function to invoke when a peer wants to part.
  * @param cls Closure for the callbacks.
  * @return Handle for the channel master, NULL on error.
  */
@@ -289,7 +249,6 @@ GNUNET_PSYC_master_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
                           enum GNUNET_MULTICAST_JoinPolicy join_policy,
                           GNUNET_PSYC_Method method_cb,
                           GNUNET_PSYC_JoinCallback join_cb,
-                          GNUNET_PSYC_PartCallback part_cb,
                           void *cls);
 
 
@@ -410,17 +369,9 @@ 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,
-                        const char *method_name,
-                        const struct GNUNET_ENV_Environment *env,
-                        size_t data_size,
-                        const void *data);
+GNUNET_PSYC_slave_part (struct GNUNET_PSYC_Slave *slave);
 
 
 /**