aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_fs_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r--src/include/gnunet_fs_service.h102
1 files changed, 62 insertions, 40 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 1f1e60f..a806628 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -55,7 +55,7 @@ extern "C"
* 9.0.0: CPS-style integrated API
* 9.1.1: asynchronous directory scanning
*/
-#define GNUNET_FS_VERSION 0x00090102
+#define GNUNET_FS_VERSION 0x00090103
/* ******************** URI API *********************** */
@@ -68,6 +68,12 @@ extern "C"
/**
+ * How often do we signal applications that a probe for a particular
+ * search result is running? (used to visualize probes).
+ */
+#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250)
+
+/**
* A Universal Resource Identifier (URI), opaque.
*/
struct GNUNET_FS_Uri;
@@ -91,7 +97,7 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword,
* @param key wherer to store the unique key
*/
void
-GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key);
+GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode * key);
/**
* Convert a URI to a UTF-8 String.
@@ -341,7 +347,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id,
* @return an FS URI for the given namespace and identifier
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * nsid, const char *id);
+GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_HashCode * nsid, const char *id);
/**
@@ -354,7 +360,7 @@ GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * nsid, const char *id);
*/
int
GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
- GNUNET_HashCode * nsid);
+ struct GNUNET_HashCode * nsid);
/**
@@ -1018,21 +1024,32 @@ struct GNUNET_FS_ProgressInfo
uint64_t data_len;
/**
+ * How much time passed between us asking for this block and
+ * actually getting it? GNUNET_TIME_UNIT_FOREVER_REL if unknown.
+ */
+ struct GNUNET_TIME_Relative block_download_duration;
+
+ /**
* Depth of the given block in the tree;
* 0 would be the lowest level (DBLOCKS).
*/
unsigned int depth;
/**
- * How much trust did we offer for downloading this block?
+ * How much respect did we offer for downloading this block? (estimate,
+ * because we might have the same request pending for multiple clients,
+ * and of course because a transmission may have failed at a lower
+ * layer).
*/
- unsigned int trust_offered;
+ uint32_t respect_offered;
/**
- * How much time passed between us asking for this block and
- * actually getting it? GNUNET_TIME_UNIT_FOREVER_REL if unknown.
+ * How often did we transmit the request? (estimate,
+ * because we might have the same request pending for multiple clients,
+ * and of course because a transmission may have failed at a lower
+ * layer).
*/
- struct GNUNET_TIME_Relative block_download_duration;
+ uint32_t num_transmissions;
} progress;
@@ -1258,6 +1275,11 @@ struct GNUNET_FS_ProgressInfo
*/
uint32_t applicability_rank;
+ /**
+ * How long has the current probe been active?
+ */
+ struct GNUNET_TIME_Relative current_probe_time;
+
} update;
/**
@@ -1383,9 +1405,9 @@ struct GNUNET_FS_ProgressInfo
/**
* Hash-identifier for the namespace.
*/
- GNUNET_HashCode id;
+ struct GNUNET_HashCode id;
- } namespace;
+ } ns;
} specifics;
@@ -1531,8 +1553,7 @@ struct GNUNET_FS_ProgressInfo
* field in the GNUNET_FS_ProgressInfo struct.
*/
typedef void *(*GNUNET_FS_ProgressCallback) (void *cls,
- const struct GNUNET_FS_ProgressInfo
- * info);
+ const struct GNUNET_FS_ProgressInfo *info);
/**
@@ -1559,30 +1580,31 @@ enum GNUNET_FS_Flags
GNUNET_FS_FLAGS_DO_PROBES = 2
};
+
/**
* Options specified in the VARARGs portion of GNUNET_FS_start.
*/
enum GNUNET_FS_OPTIONS
{
- /**
- * Last option in the VARARG list.
- */
+ /**
+ * Last option in the VARARG list.
+ */
GNUNET_FS_OPTIONS_END = 0,
- /**
- * Select the desired amount of parallelism (this option should be
- * followed by an "unsigned int" giving the desired maximum number
- * of parallel downloads).
- */
+ /**
+ * Select the desired amount of parallelism (this option should be
+ * followed by an "unsigned int" giving the desired maximum number
+ * of parallel downloads).
+ */
GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM = 1,
- /**
- * Maximum number of requests that should be pending at a given
- * point in time (invidivual downloads may go above this, but
- * if we are above this threshold, we should not activate any
- * additional downloads.
- */
+ /**
+ * Maximum number of requests that should be pending at a given
+ * point in time (invidivual downloads may go above this, but
+ * if we are above this threshold, we should not activate any
+ * additional downloads.
+ */
GNUNET_FS_OPTIONS_REQUEST_PARALLELISM = 2
};
@@ -1983,7 +2005,7 @@ enum GNUNET_FS_PublishOptions
*
* @param h handle to the file sharing subsystem
* @param fi information about the file or directory structure to publish
- * @param namespace namespace to publish the file in, NULL for no namespace
+ * @param ns namespace to publish the file in, NULL for no namespace
* @param nid identifier to use for the publishd content in the namespace
* (can be NULL, must be NULL if namespace is NULL)
* @param nuid update-identifier that will be used for future updates
@@ -1994,7 +2016,7 @@ enum GNUNET_FS_PublishOptions
struct GNUNET_FS_PublishContext *
GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
struct GNUNET_FS_FileInformation *fi,
- struct GNUNET_FS_Namespace *namespace, const char *nid,
+ struct GNUNET_FS_Namespace *ns, const char *nid,
const char *nuid,
enum GNUNET_FS_PublishOptions options);
@@ -2072,7 +2094,7 @@ struct GNUNET_FS_PublishSksContext;
* Publish an SBlock on GNUnet.
*
* @param h handle to the file sharing subsystem
- * @param namespace namespace to publish in
+ * @param ns namespace to publish in
* @param identifier identifier to use
* @param update update identifier to use
* @param meta metadata to use
@@ -2085,7 +2107,7 @@ struct GNUNET_FS_PublishSksContext;
*/
struct GNUNET_FS_PublishSksContext *
GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
- struct GNUNET_FS_Namespace *namespace,
+ struct GNUNET_FS_Namespace *ns,
const char *identifier, const char *update,
const struct GNUNET_CONTAINER_MetaData *meta,
const struct GNUNET_FS_Uri *uri,
@@ -2112,7 +2134,7 @@ GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc);
* @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
*/
typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename,
- const GNUNET_HashCode * file_id);
+ const struct GNUNET_HashCode * file_id);
/**
@@ -2177,7 +2199,7 @@ struct GNUNET_FS_AdvertisementContext;
*
* @param h handle to the file sharing subsystem
* @param ksk_uri keywords to use for advertisment
- * @param namespace handle for the namespace that should be advertised
+ * @param ns handle for the namespace that should be advertised
* @param meta meta-data for the namespace advertisement
* @param bo block options
* @param rootEntry name of the root of the namespace
@@ -2188,7 +2210,7 @@ struct GNUNET_FS_AdvertisementContext;
struct GNUNET_FS_AdvertisementContext *
GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
struct GNUNET_FS_Uri *ksk_uri,
- struct GNUNET_FS_Namespace *namespace,
+ struct GNUNET_FS_Namespace *ns,
const struct GNUNET_CONTAINER_MetaData *meta,
const struct GNUNET_FS_BlockOptions *bo,
const char *rootEntry,
@@ -2211,7 +2233,7 @@ GNUNET_FS_namespace_advertise_cancel (struct GNUNET_FS_AdvertisementContext *ac)
*
* @param h handle to the file sharing subsystem
* @param name name to use for the namespace
- * @return handle to the namespace, NULL on error
+ * @return handle to the namespace, NULL on error (i.e. invalid filename)
*/
struct GNUNET_FS_Namespace *
GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name);
@@ -2232,14 +2254,14 @@ GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns);
* memory) or also to freeze the namespace to prevent further
* insertions by anyone.
*
- * @param namespace handle to the namespace that should be deleted / freed
+ * @param ns handle to the namespace that should be deleted / freed
* @param freeze prevents future insertions; creating a namespace
* with the same name again will create a fresh namespace instead
*
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
int
-GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze);
+GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *ns, int freeze);
/**
@@ -2252,7 +2274,7 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze);
* @param id hash identifier for the namespace
*/
typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name,
- const GNUNET_HashCode * id);
+ const struct GNUNET_HashCode * id);
/**
@@ -2301,13 +2323,13 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id,
* cause the library to call "ip" with all children of the node. Note
* that cycles within an SCC are possible (including self-loops).
*
- * @param namespace namespace to inspect for updateable content
+ * @param ns namespace to inspect for updateable content
* @param next_id ID to look for; use NULL to look for SCC roots
* @param ip function to call on each updateable identifier
* @param ip_cls closure for ip
*/
void
-GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
+GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *ns,
const char *next_id,
GNUNET_FS_IdentifierProcessor ip,
void *ip_cls);