-skeletons for transport-ng
[oweals/gnunet.git] / src / include / gnunet_psyc_slicer.h
index d29c231e1ba8658ce7f2d7625c7d50f28a20809c..56a7fb6365476f23ff61f4d38ab549eea1b3b91c 100644 (file)
@@ -63,11 +63,15 @@ struct GNUNET_PSYC_Slicer;
  *        Message part, as it arrived from the network.
  * @param message_id
  *        Message counter, monotonically increasing from 1.
+ * @param flags
+ *        OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ *        Multicast message fragment offset.
+ * @param tmit_flags
+ *        OR'ed GNUNET_PSYC_MasterTransmitFlags
  * @param nym
  *        The sender of the message.
  *        Can be NULL if the message is not connected to a pseudonym.
- * @param flags
- *        OR'ed GNUNET_PSYC_MessageFlags
  * @param method_name
  *        Original method name from PSYC.
  *        May be more specific than the registered method name due to
@@ -75,10 +79,9 @@ struct GNUNET_PSYC_Slicer;
  */
 typedef void
 (*GNUNET_PSYC_MethodCallback) (void *cls,
-                               const struct GNUNET_PSYC_MessageMethod *msg,
+                               const struct GNUNET_PSYC_MessageHeader *msg,
+                               const struct GNUNET_PSYC_MessageMethod *meth,
                                uint64_t message_id,
-                               uint32_t flags,
-                               const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key,
                                const char *method_name);
 
 
@@ -89,6 +92,10 @@ typedef void
  *        Closure.
  * @param message_id
  *        Message ID this data fragment belongs to.
+ * @param flags
+ *        OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ *        Multicast message fragment offset.
  * @param msg
  *        Message part, as it arrived from the network.
  * @param oper
@@ -104,7 +111,8 @@ typedef void
  */
 typedef void
 (*GNUNET_PSYC_ModifierCallback) (void *cls,
-                                 const struct GNUNET_MessageHeader *msg,
+                                 const struct GNUNET_PSYC_MessageHeader *msg,
+                                 const struct GNUNET_MessageHeader *pmsg,
                                  uint64_t message_id,
                                  enum GNUNET_PSYC_Operator oper,
                                  const char *name,
@@ -118,16 +126,18 @@ typedef void
  *
  * @param cls
  *        Closure.
- * @param message_id
- *        Message ID this data fragment belongs to.
  * @param msg
  *        Message part, as it arrived from the network.
- * @param data_offset
- *        Byte offset of @a data in the overall data of the method.
- * @param data_size
- *        Number of bytes in @a data.
+ * @param message_id
+ *        Message ID this data fragment belongs to.
+ * @param flags
+ *        OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ *        Multicast message fragment offset.
  * @param data
  *        Data stream given to the method.
+ * @param data_size
+ *        Number of bytes in @a data.
  * @param end
  *        End of message?
  *        #GNUNET_NO     if there are further fragments,
@@ -136,9 +146,9 @@ typedef void
  */
 typedef void
 (*GNUNET_PSYC_DataCallback) (void *cls,
-                             const struct GNUNET_MessageHeader *msg,
+                             const struct GNUNET_PSYC_MessageHeader *msg,
+                             const struct GNUNET_MessageHeader *pmsg,
                              uint64_t message_id,
-                             uint64_t data_offset,
                              const void *data,
                              uint16_t data_size);
 
@@ -152,15 +162,20 @@ typedef void
  *        Message part, as it arrived from the network.
  * @param message_id
  *        Message ID this data fragment belongs to.
+ * @param flags
+ *        OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ *        Multicast message fragment offset.
  * @param cancelled
  *        #GNUNET_YES if the message was cancelled,
  *        #GNUNET_NO  if the message is complete.
  */
 typedef void
 (*GNUNET_PSYC_EndOfMessageCallback) (void *cls,
-                                     const struct GNUNET_MessageHeader *msg,
+                                     const struct GNUNET_PSYC_MessageHeader *msg,
+                                     const struct GNUNET_MessageHeader *pmsg,
                                      uint64_t message_id,
-                                     uint8_t cancelled);
+                                     uint8_t is_cancelled);
 
 
 /**
@@ -199,6 +214,7 @@ GNUNET_PSYC_slicer_create (void);
 void
 GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer,
                                const char *method_name,
+                               GNUNET_PSYC_MessageCallback msg_cb,
                                GNUNET_PSYC_MethodCallback method_cb,
                                GNUNET_PSYC_ModifierCallback modifier_cb,
                                GNUNET_PSYC_DataCallback data_cb,
@@ -216,13 +232,13 @@ GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer,
  * @param method_name
  *        Name of the method to remove.
  * @param method_cb
- *        Method handler.
+ *        Only remove matching method handler, or NULL.
  * @param modifier_cb
- *        Modifier handler.
+ *        Only remove matching modifier handler, or NULL.
  * @param data_cb
- *        Data handler.
+ *        Only remove matching data handler, or NULL.
  * @param eom_cb
- *        End of message handler.
+ *        Only remove matching End of Message handler, or NULL.
  *
  * @return #GNUNET_OK if a method handler was removed,
  *         #GNUNET_NO if no handler matched the given method name and callbacks.
@@ -230,6 +246,7 @@ GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer,
 int
 GNUNET_PSYC_slicer_method_remove (struct GNUNET_PSYC_Slicer *slicer,
                                   const char *method_name,
+                                  GNUNET_PSYC_MessageCallback msg_cb,
                                   GNUNET_PSYC_MethodCallback method_cb,
                                   GNUNET_PSYC_ModifierCallback modifier_cb,
                                   GNUNET_PSYC_DataCallback data_cb,
@@ -304,11 +321,8 @@ GNUNET_PSYC_slicer_message (struct GNUNET_PSYC_Slicer *slicer,
  */
 void
 GNUNET_PSYC_slicer_message_part (struct GNUNET_PSYC_Slicer *slicer,
-                                 const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key,
-                                 uint64_t message_id,
-                                 uint32_t flags,
-                                 uint64_t fragment_offset,
-                                 const struct GNUNET_MessageHeader *msg);
+                                 const struct GNUNET_PSYC_MessageHeader *msg,
+                                 const struct GNUNET_MessageHeader *pmsg);
 
 
 /**