+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
+ uint64_t message_limit,
+ const char *method_prefix,
+ GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
+ GNUNET_PSYCSTORE_ResultCallback result_cb,
+ void *cls);
+
+
+/**
+ * Retrieve a fragment of message specified by its message ID and fragment
+ * offset.
+ *
+ * @param h
+ * Handle for the PSYCstore.
+ * @param channel_key
+ * The channel we are interested in.
+ * @param slave_key
+ * The slave requesting the message fragment. If not NULL, a membership
+ * test is performed first and the message fragment is only returned
+ * if the slave has access to it.
+ * @param message_id
+ * Message ID to retrieve. Use 0 to get the latest message.
+ * @param fragment_offset
+ * Offset of the fragment to retrieve.
+ * @param fragment_cb
+ * Callback to call with the retrieved fragments.
+ * @param result_cb
+ * Callback to call with the result of the operation.
+ * @param cls
+ * Closure for the callbacks.
+ *
+ * @return Handle that can be used to cancel the operation.
+ */
+struct GNUNET_PSYCSTORE_OperationHandle *
+GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
+ uint64_t message_id,
+ uint64_t fragment_offset,
+ GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
+ GNUNET_PSYCSTORE_ResultCallback result_cb,
+ void *cls);
+
+
+/**
+ * Callback used to return the latest value of counters for the channel master.
+ *
+ * @see GNUNET_PSYCSTORE_counters_get()
+ *
+ * @param cls Closure.
+ * @param result_code
+ * Status code for the operation:
+ * #GNUNET_OK: success, counter values are returned.
+ * #GNUNET_NO: no message has been sent to the channel yet.
+ * #GNUNET_SYSERR: an error occurred.
+ * @param max_fragment_id
+ * Latest message fragment ID, used by multicast.
+ * @param max_message_id
+ * Latest message ID, used by PSYC.
+ * @param max_group_generation
+ * Latest group generation, used by PSYC.
+ * @param max_state_message_id
+ * Latest message ID containing state modifiers that
+ * was applied to the state store. Used for the state sync process.
+ */
+typedef void
+(*GNUNET_PSYCSTORE_CountersCallback) (void *cls,
+ int result_code,
+ uint64_t max_fragment_id,
+ uint64_t max_message_id,
+ uint64_t max_group_generation,
+ uint64_t max_state_message_id);
+
+
+/**
+ * Retrieve latest values of counters for a channel.
+ *
+ * The current value of counters are needed
+ * - when a channel master is restarted, so that it can continue incrementing
+ * the counters from their last value.
+ * - when a channel slave rejoins and starts the state synchronization process.
+ *
+ * @param h
+ * Handle for the PSYCstore.
+ * @param channel_key
+ * Public key that identifies the channel.
+ * @param counters_cb
+ * Callback to call with the result.
+ * @param cls
+ * Closure for the @a ccb callback.
+ *
+ * @return Handle that can be used to cancel the operation.
+ */
+struct GNUNET_PSYCSTORE_OperationHandle *
+GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
+ struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ GNUNET_PSYCSTORE_CountersCallback counters_cb,
+ void *cls);
+
+
+/**
+ * Apply modifiers of a message to the current channel state.
+ *
+ * An error is returned if there are missing messages containing state
+ * operations before the current one.
+ *
+ * @param h
+ * Handle for the PSYCstore.
+ * @param channel_key
+ * The channel we are interested in.
+ * @param message_id
+ * ID of the message that contains the @a modifiers.
+ * @param state_delta
+ * Value of the @e state_delta PSYC header variable of the message.
+ * @param result_cb
+ * Callback to call with the result of the operation.
+ * @param cls
+ * Closure for the @a result_cb callback.
+ *
+ * @return Handle that can be used to cancel the operation.
+ */
+struct GNUNET_PSYCSTORE_OperationHandle *
+GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ uint64_t message_id,
+ uint64_t state_delta,
+ GNUNET_PSYCSTORE_ResultCallback result_cb,
+ void *cls);
+
+
+/**
+ * Store synchronized state.
+ *
+ * @param h
+ * Handle for the PSYCstore.
+ * @param channel_key
+ * The channel we are interested in.
+ * @param max_state_message_id
+ * ID of the last stateful message before @a state_hash_message_id.
+ * @param state_hash_message_id
+ * ID of the message that contains the state_hash PSYC header variable.
+ * @param modifier_count
+ * Number of elements in the @a modifiers array.
+ * @param modifiers
+ * Full state to store.
+ * @param result_cb
+ * Callback to call with the result of the operation.
+ * @param cls
+ * Closure for the callback.
+ *
+ * @return Handle that can be used to cancel the operation.
+ */
+struct GNUNET_PSYCSTORE_OperationHandle *
+GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+ uint64_t max_state_message_id,
+ uint64_t state_hash_message_id,
+ size_t modifier_count,
+ const struct GNUNET_PSYC_Modifier *modifiers,
+ GNUNET_PSYCSTORE_ResultCallback result_cb,
+ void *cls);