-more issues with multicast API
authorChristian Grothoff <christian@grothoff.org>
Sat, 21 Sep 2013 10:22:37 +0000 (10:22 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 21 Sep 2013 10:22:37 +0000 (10:22 +0000)
src/include/gnunet_multicast_service.h
src/multicast/multicast.h
src/multicast/multicast_api.c

index f3c5b5d93a4a924df2979b373119d20e9d0e1232..a1dbaf8412128273b7249eb255576e0b4a0f544b 100644 (file)
@@ -259,6 +259,13 @@ typedef void
  * Function called whenever a group member has transmitted a request
  * to the origin (other than joining or leaving).
  *
+ * FIXME: need to distinguish between origin cancelling a message (some fragments
+ * were sent, then the rest 'discarded') and the case where we got disconnected;
+ * right now, both would mean 'msg' is NULL, but they could be quite different...
+ * So the semantics from the receiver side of 
+ * GNUNET_MULTICAST_member_to_origin_cancel() are not clear here.   Maybe we
+ * should do something with the flags in this case?
+ *
  * @param cls Closure (set from GNUNET_MULTICAST_origin_start).
  * @param sender Identity of the sender.
  * @param req Request to the origin.
@@ -279,6 +286,12 @@ typedef void
  * response of the @e origin (as given to GNUNET_MULTICAST_join_decision()) and
  * then a second time with NULL to indicate that the connection failed for good.
  *
+ * FIXME: need to distinguish between origin cancelling a message (some fragments
+ * were sent, then the rest 'discarded') and the case where we got disconnected;
+ * right now, both would mean 'msg' is NULL, but they could be quite different...
+ * So the semantics from the receiver side of 
+ * GNUNET_MULTICAST_origin_to_all_cancel() are not clear here.
+ *
  * @param cls Closure (set from GNUNET_MULTICAST_member_join())
  * @param msg Message from the origin, NULL if the origin shut down
  *        (or we were kicked out, and we should thus call
@@ -705,6 +718,7 @@ struct GNUNET_MULTICAST_MemberRequestHandle;
  * @param member Membership handle.
  * @param message_id Application layer ID for the message.  Opaque to multicast.
  * @param size Number of bytes we want to send to origin.
+ *             FIXME: this should probably be a uint64_t?
  * @param notify Callback to call to get the message.
  * @param notify_cls Closure for @a notify.
  * @return Handle to cancel request, NULL on error (i.e. request already pending).
index 5a18af461f2ec3baa35307dcc03fb2daaf35cc0b..95c989707693642a0a849ebc6d66b43f3efca1b5 100644 (file)
@@ -243,7 +243,9 @@ struct MulticastReplayRequestMessage
 {
 
   /**
-   *
+   * The message type can be either 
+   * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST or
+   * #GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST_CANCEL.
    */
   struct GNUNET_MessageHeader header;
 
@@ -253,17 +255,17 @@ struct MulticastReplayRequestMessage
   uint32_t uid;
 
   /**
-   * 
+   * ID of the message that is being requested.
    */
   uint64_t message_id;
 
   /**
-   * 
+   * Offset of the fragment that is being requested.
    */
   uint64_t fragment_offset;
 
   /**
-   * 
+   * Additional flags for the request.
    */
   uint64_t flags;
 
@@ -271,6 +273,63 @@ struct MulticastReplayRequestMessage
 
 
 
+/**
+ * Message sent from the client to the service to unicast to the group origin.
+ */
+struct MulticastUnicastToOriginMessage
+{
+
+  /**
+   *
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Reserved (always 0).
+   */
+  uint32_t reserved;
+
+  /**
+   * Message ID.
+   */
+  uint64_t message_id;
+
+  /**
+   * Total message size.
+   */
+  uint64_t total_size;
+
+  /* followed by payload */
+
+};
+
+
+/**
+ * Message sent from the client to the service to
+ * cancel unicast to the group origin.
+ */
+struct MulticastUnicastToOriginCancelMessage
+{
+
+  /**
+   *
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Reserved (always 0).
+   */
+  uint32_t reserved;
+
+  /**
+   * Message ID.
+   */
+  uint64_t message_id;
+
+};
+
+
+
 
 
 GNUNET_NETWORK_STRUCT_END
index b8ee42cb36d85dd660a9f741d316943e3a418a31..cc2554c7d91152760cd137349496452224a91d6c 100644 (file)
@@ -515,7 +515,8 @@ struct GNUNET_MULTICAST_MemberRequestHandle
  * 
  * @param member Membership handle.
  * @param message_id Application layer ID for the message.  Opaque to multicast.
- * @param size Number of bytes we want to send to origin.
+ * @param size Number of bytes we want to send to origin. 
+ *             FIXME: this should probably be a uint64_t?
  * @param notify Callback to call to get the message.
  * @param notify_cls Closure for @a notify.
  * @return Handle to cancel request, NULL on error (i.e. request already pending).