#define GNUNET_SERVICE_FS_MESH_H
/**
- * Handle for a request that is going out via stream API.
+ * Handle for a request that is going out via mesh API.
*/
-struct GSF_StreamRequest;
+struct GSF_MeshRequest;
/**
- * Function called with a reply from the stream.
- *
+ * Function called with a reply from the mesh.
+ *
* @param cls closure
* @param type type of the block, ANY on error
* @param expiration expiration time for the block
* @param data_size number of bytes in 'data', 0 on error
* @param data reply block data, NULL on error
*/
-typedef void (*GSF_StreamReplyProcessor)(void *cls,
+typedef void (*GSF_MeshReplyProcessor)(void *cls,
enum GNUNET_BLOCK_Type type,
struct GNUNET_TIME_Absolute expiration,
size_t data_size,
* @param proc_cls closure for 'proc'
* @return handle to cancel the operation
*/
-struct GSF_StreamRequest *
-GSF_stream_query (const struct GNUNET_PeerIdentity *target,
+struct GSF_MeshRequest *
+GSF_mesh_query (const struct GNUNET_PeerIdentity *target,
const struct GNUNET_HashCode *query,
enum GNUNET_BLOCK_Type type,
- GSF_StreamReplyProcessor proc, void *proc_cls);
+ GSF_MeshReplyProcessor proc, void *proc_cls);
/**
* @param sr request to cancel
*/
void
-GSF_stream_query_cancel (struct GSF_StreamRequest *sr);
+GSF_mesh_query_cancel (struct GSF_MeshRequest *sr);
+
+
+/**
+ * Initialize subsystem for non-anonymous file-sharing.
+ */
+void
+GSF_mesh_start_server (void);
+
+/**
+ * Shutdown subsystem for non-anonymous file-sharing.
+ */
+void
+GSF_mesh_stop_server (void);
/**
* Initialize subsystem for non-anonymous file-sharing.
*/
void
-GSF_stream_start (void);
+GSF_mesh_start_client (void);
/**
* Shutdown subsystem for non-anonymous file-sharing.
*/
void
-GSF_stream_stop (void);
+GSF_mesh_stop_client (void);
+
+
+GNUNET_NETWORK_STRUCT_BEGIN
+
+/**
+ * Query from one peer, asking the other for CHK-data.
+ */
+struct MeshQueryMessage
+{
+
+ /**
+ * Type is GNUNET_MESSAGE_TYPE_FS_MESH_QUERY.
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Block type must be DBLOCK or IBLOCK.
+ */
+ uint32_t type GNUNET_PACKED;
+
+ /**
+ * Query hash from CHK (hash of encrypted block).
+ */
+ struct GNUNET_HashCode query;
+
+};
+
+
+/**
+ * Reply to a MeshQueryMessage.
+ */
+struct MeshReplyMessage
+{
+
+ /**
+ * Type is GNUNET_MESSAGE_TYPE_FS_MESH_REPLY.
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Block type must be DBLOCK or IBLOCK.
+ */
+ uint32_t type GNUNET_PACKED;
+
+ /**
+ * Expiration time for the block.
+ */
+ struct GNUNET_TIME_AbsoluteNBO expiration;
+
+ /* followed by the encrypted block */
+
+};
+
+GNUNET_NETWORK_STRUCT_END
+
#endif