[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8896 - in gnunet/src: fs include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8896 - in gnunet/src: fs include |
Date: |
Sun, 30 Aug 2009 13:05:29 -0600 |
Author: grothoff
Date: 2009-08-30 13:05:29 -0600 (Sun, 30 Aug 2009)
New Revision: 8896
Modified:
gnunet/src/fs/fs_publish.c
gnunet/src/include/gnunet_fs_service.h
gnunet/src/include/gnunet_signatures.h
Log:
sblocks
Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c 2009-08-30 19:03:53 UTC (rev 8895)
+++ gnunet/src/fs/fs_publish.c 2009-08-30 19:05:29 UTC (rev 8896)
@@ -30,6 +30,7 @@
* - code-sharing with unindex (can wait)
* - persistence support (can wait)
* - datastore reservation support (optimization)
+ * - location URIs (publish with anonymity-level zero)
*/
#include "platform.h"
Modified: gnunet/src/include/gnunet_fs_service.h
===================================================================
--- gnunet/src/include/gnunet_fs_service.h 2009-08-30 19:03:53 UTC (rev
8895)
+++ gnunet/src/include/gnunet_fs_service.h 2009-08-30 19:05:29 UTC (rev
8896)
@@ -1770,6 +1770,24 @@
/**
+ * Options for publishing. Compatible options
+ * can be OR'ed together.
+ */
+enum GNUNET_FS_PublishOptions
+ {
+ /**
+ * No options (use defaults for everything).
+ */
+ GNUNET_FS_PUBLISH_OPTION_NONE = 0,
+
+ /**
+ * Simulate publishing. With this option, no data will be stored
+ * in the datastore. Useful for computing URIs from files.
+ */
+ GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY = 1
+ };
+
+/**
* Publish a file or directory.
*
* @param h handle to the file sharing subsystem
@@ -1781,6 +1799,7 @@
* (can be NULL, must be NULL if namespace is NULL)
* @param nuid update-identifier that will be used for future updates
* (can be NULL, must be NULL if namespace or nid is NULL)
+ * @param options options for the publication
* @return context that can be used to control the publish operation
*/
struct GNUNET_FS_PublishContext *
@@ -1789,7 +1808,8 @@
struct GNUNET_FS_FileInformation *fi,
struct GNUNET_FS_Namespace *namespace,
const char *nid,
- const char *nuid);
+ const char *nuid,
+ enum GNUNET_FS_PublishOptions options);
/**
@@ -1804,25 +1824,42 @@
/**
+ * Signature of a function called as the continuation of a KBlock or
+ * SBlock publication.
+ *
+ * @param cls closure
+ * @param uri URI under which the block is now available, NULL on error
+ * @param emsg error message, NULL on success
+ */
+typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
+ const struct GNUNET_FS_Uri *uri,
+ const char *emsg);
+
+
+/**
* Publish a KBlock on GNUnet.
*
* @param h handle to the file sharing subsystem
- * @param keyword keyword to use
+ * @param keywords keywords to use
* @param meta metadata to use
* @param uri URI to refer to in the KBlock
* @param expirationTime when the KBlock expires
* @param anonymity anonymity level for the KBlock
* @param priority priority for the KBlock
+ * @param cont continuation
+ * @param cont_cls closure for cont
*/
-// FIXME: CPS this one..
void
GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
- const char *keyword,
+ struct GNUNET_FS_Uri *keywords,
struct GNUNET_CONTAINER_MetaData *meta,
struct GNUNET_FS_Uri *uri,
struct GNUNET_TIME_Absolute expirationTime,
unsigned int anonymity,
- unsigned int priority);
+ unsigned int priority,
+ enum GNUNET_FS_PublishOptions options,
+ GNUNET_FS_PublishContinuation cont,
+ void *cont_cls);
/**
@@ -1837,8 +1874,9 @@
* @param expirationTime when the SBlock expires
* @param anonymity anonymity level for the SBlock
* @param priority priority for the SBlock
+ * @param cont continuation
+ * @param cont_cls closure for cont
*/
-// FIXME: CPS this one..
void
GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
struct GNUNET_FS_Namespace *namespace,
@@ -1848,7 +1886,10 @@
struct GNUNET_FS_Uri *uri,
struct GNUNET_TIME_Absolute expirationTime,
unsigned int anonymity,
- unsigned int priority);
+ unsigned int priority,
+ enum GNUNET_FS_PublishOptions options,
+ GNUNET_FS_PublishContinuation cont,
+ void *cont_cls);
/**
Modified: gnunet/src/include/gnunet_signatures.h
===================================================================
--- gnunet/src/include/gnunet_signatures.h 2009-08-30 19:03:53 UTC (rev
8895)
+++ gnunet/src/include/gnunet_signatures.h 2009-08-30 19:05:29 UTC (rev
8896)
@@ -59,16 +59,27 @@
*/
#define GNUNET_SIGNATURE_PURPOSE_NAMESPACE_ADVERTISEMENT 3
+/**
+ * Signature by which a peer affirms that it is
+ * providing a certain bit of content (used
+ * in LOCation URIs).
+ */
+#define GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT 4
/**
+ * Signature in a KBlock of the FS module.
+ */
+#define GNUNET_SIGNATURE_PURPOSE_FS_KBLOCK 5
+
+/**
* Signature of content URI placed into a namespace.
*/
-#define GNUNET_SIGNATURE_PURPOSE_NAMESPACE_PLACEMENT 4
+#define GNUNET_SIGNATURE_PURPOSE_FS_SBLOCK 6
/**
*
*/
-#define GNUNET_SIGNATURE_PURPOSE_RESOLVER_RESPONSE 5
+#define GNUNET_SIGNATURE_PURPOSE_RESOLVER_RESPONSE 7
#if 0 /* keep Emacsens' auto-indent happy */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8896 - in gnunet/src: fs include,
gnunet <=