![]() |
GNUnet
0.11.x
|
File sharing. More...
Data Structures | |
struct | GNUNET_FS_ProgressInfo |
Argument given to the progress callback with information about what is going on. More... | |
struct | GNUNET_FS_BlockOptions |
Settings for publishing a block (which may of course also apply to an entire directory or file). More... | |
struct | GNUNET_FS_ShareTreeItem |
A node of a directory tree (produced by dirscanner) More... | |
Macros | |
#define | GNUNET_FS_VERSION 0x00090300 |
Version number of the implementation. More... | |
#define | GNUNET_FS_URI_PREFIX "gnunet://fs/" |
#define | GNUNET_FS_URI_KSK_INFIX "ksk/" |
#define | GNUNET_FS_URI_SKS_INFIX "sks/" |
#define | GNUNET_FS_URI_CHK_INFIX "chk/" |
#define | GNUNET_FS_URI_LOC_INFIX "loc/" |
#define | GNUNET_FS_PROBE_UPDATE_FREQUENCY |
How often do we signal applications that a probe for a particular search result is running? (used to visualize probes). More... | |
#define | GNUNET_FS_DIRECTORY_MIME "application/gnunet-directory" |
#define | GNUNET_FS_DIRECTORY_MAGIC "\211GND\r\n\032\n" |
#define | GNUNET_FS_DIRECTORY_EXT ".gnd" |
Typedefs | |
typedef int(* | GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, int is_mandatory) |
Iterator over keywords. More... | |
typedef void *(* | GNUNET_FS_ProgressCallback) (void *cls, const struct GNUNET_FS_ProgressInfo *info) |
Notification of FS to a client about the progress of an operation. More... | |
typedef int(* | GNUNET_FS_FileInformationProcessor) (void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info) |
Function called on entries in a struct GNUNET_FS_FileInformation iteration. More... | |
typedef size_t(* | GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, void *buf, char **emsg) |
Function that provides data. More... | |
typedef void(* | GNUNET_FS_PublishContinuation) (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) |
Signature of a function called as the continuation of a KBlock or SBlock publication. More... | |
typedef int(* | GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, const struct GNUNET_HashCode *file_id) |
Type of a function called by GNUNET_FS_get_indexed_files. More... | |
typedef void(* | GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, const struct GNUNET_FS_Uri *last_uri, const struct GNUNET_CONTAINER_MetaData *last_meta, const char *next_id) |
Function called on updateable identifiers. More... | |
typedef void(* | GNUNET_FS_DirectoryEntryProcessor) (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, size_t length, const void *data) |
Function used to process entries in a directory. More... | |
typedef void(* | GNUNET_FS_DirScannerProgressCallback) (void *cls, const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason) |
Function called over time as the directory scanner makes progress on the job at hand. More... | |
Functions | |
int | GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode *key) |
Get a unique key from a URI. More... | |
char * | GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri) |
Convert a URI to a UTF-8 String. More... | |
char * | GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri) |
Convert keyword URI to a human readable format (i.e. More... | |
void | GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, const char *keyword, int is_mandatory) |
Add the given keyword to the set of keywords represented by the URI. More... | |
void | GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, const char *keyword) |
Remove the given keyword from the set of keywords represented by the URI. More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_parse (const char *uri, char **emsg) |
Convert a UTF-8 String to a URI. More... | |
void | GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri) |
Free URI. More... | |
unsigned int | GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri) |
How many keywords are ANDed in this keyword URI? More... | |
int | GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, GNUNET_FS_KeywordIterator iterator, void *iterator_cls) |
Iterate over all keywords in this keyword URI. More... | |
int | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, struct GNUNET_PeerIdentity *peer) |
Obtain the identity of the peer offering the data. More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri) |
Obtain the URI of the content itself. More... | |
struct GNUNET_TIME_Absolute | GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri) |
Obtain the expiration of the LOC URI. More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri, const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, struct GNUNET_TIME_Absolute expiration_time) |
Construct a location URI (this peer will be used for the location). More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, const struct GNUNET_FS_Uri *u2) |
Merge the sets of keywords from two KSK URIs. More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri) |
Duplicate URI. More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_ksk_create (const char *keywords, char **emsg) |
Create an FS URI from a single user-supplied string of keywords. More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv) |
Create an FS URI from a user-supplied command line of keywords. More... | |
int | GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, const struct GNUNET_FS_Uri *u2) |
Test if two URIs are equal. More... | |
int | GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri) |
Is this a namespace URI? More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, const char *id) |
Create an SKS URI from a namespace ID and an identifier. More... | |
int | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym) |
Get the public key of a namespace from the given namespace URI. More... | |
char * | GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri) |
Get the content identifier of an SKS URI. More... | |
int | GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri) |
Is this a keyword URI? More... | |
int | GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri) |
Is this a file (or directory) URI? More... | |
uint64_t | GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri) |
What is the size of the file that this URI refers to? More... | |
int | GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri) |
Is this a location URI? More... | |
struct GNUNET_FS_Uri * | GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData *md) |
Construct a keyword-URI from meta-data (take all entries in the meta-data and construct one large keyword URI that lists all keywords that can be found in the meta-data). More... | |
struct GNUNET_GETOPT_CommandLineOption | GNUNET_FS_GETOPT_KEYWORDS (char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_FS_Uri **topKeywords) |
Allow user to specify keywords. More... | |
struct GNUNET_GETOPT_CommandLineOption | GNUNET_FS_GETOPT_METADATA (char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_CONTAINER_MetaData **meta) |
Allow user to specify metadata. More... | |
int | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value) |
Command-line option parser function that allows the user to specify one or more '-m' options with metadata. More... | |
struct GNUNET_FS_Handle * | GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *client_name, GNUNET_FS_ProgressCallback upcb, void *upcb_cls, enum GNUNET_FS_Flags flags,...) |
Setup a connection to the file-sharing service. More... | |
void | GNUNET_FS_stop (struct GNUNET_FS_Handle *h) |
Close our connection with the file-sharing service. More... | |
const char * | GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s) |
Obtain the name under which this file information structure is stored on disk. More... | |
const char * | GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s) |
Obtain the filename from the file information structure. More... | |
void | GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s, const char *filename) |
Set the filename in the file information structure. More... | |
struct GNUNET_FS_FileInformation * | GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, void *client_info, const char *filename, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo) |
Create an entry for a file in a publish-structure. More... | |
struct GNUNET_FS_FileInformation * | GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, void *client_info, uint64_t length, void *data, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo) |
Create an entry for a file in a publish-structure. More... | |
struct GNUNET_FS_FileInformation * | GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, void *client_info, uint64_t length, GNUNET_FS_DataReader reader, void *reader_cls, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo) |
Create an entry for a file in a publish-structure. More... | |
struct GNUNET_FS_FileInformation * | GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, void *client_info, const struct GNUNET_FS_Uri *keywords, const struct GNUNET_CONTAINER_MetaData *meta, const struct GNUNET_FS_BlockOptions *bo, const char *filename) |
Create an entry for an empty directory in a publish-structure. More... | |
int | GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation *ent) |
Test if a given entry represents a directory. More... | |
int | GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, struct GNUNET_FS_FileInformation *ent) |
Add an entry to a directory in a publish-structure. More... | |
void | GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, GNUNET_FS_FileInformationProcessor proc, void *proc_cls) |
Inspect a file or directory in a publish-structure. More... | |
void | GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, GNUNET_FS_FileInformationProcessor cleaner, void *cleaner_cls) |
Destroy publish-structure. More... | |
struct GNUNET_FS_PublishContext * | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, struct GNUNET_FS_FileInformation *fi, const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, const char *nid, const char *nuid, enum GNUNET_FS_PublishOptions options) |
Publish a file or directory. More... | |
void | GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc) |
Stop a publication. More... | |
struct GNUNET_FS_PublishKskContext * | GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *ksk_uri, const struct GNUNET_CONTAINER_MetaData *meta, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_BlockOptions *bo, enum GNUNET_FS_PublishOptions options, GNUNET_FS_PublishContinuation cont, void *cont_cls) |
Publish a KBlock on GNUnet. More... | |
void | GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc) |
Abort the KSK publishing operation. More... | |
struct GNUNET_FS_PublishSksContext * | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, const char *identifier, const char *update, const struct GNUNET_CONTAINER_MetaData *meta, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_BlockOptions *bo, enum GNUNET_FS_PublishOptions options, GNUNET_FS_PublishContinuation cont, void *cont_cls) |
Publish an SBlock on GNUnet. More... | |
void | GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc) |
Abort the SKS publishing operation. More... | |
struct GNUNET_FS_GetIndexedContext * | GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, GNUNET_FS_IndexedFileProcessor iterator, void *iterator_cls) |
Iterate over all indexed files. More... | |
void | GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic) |
Cancel iteration over all indexed files. More... | |
struct GNUNET_FS_UnindexContext * | GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, void *cctx) |
Unindex a file. More... | |
void | GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc) |
Clean up after completion of an unindex operation. More... | |
void | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, const char *next_id, GNUNET_FS_IdentifierProcessor ip, void *ip_cls) |
List all of the identifiers in the namespace for which we could produce an update. More... | |
struct GNUNET_FS_SearchContext * | GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, uint32_t anonymity, enum GNUNET_FS_SearchOptions options, void *cctx) |
Start search for content. More... | |
void | GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc) |
Pause search. More... | |
void | GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc) |
Continue paused search. More... | |
void | GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc) |
Stop search for content. More... | |
struct GNUNET_FS_SearchResult * | GNUNET_FS_probe (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, void *client_info, uint32_t anonymity) |
Start download probes for the given search result. More... | |
void * | GNUNET_FS_probe_stop (struct GNUNET_FS_SearchResult *sr) |
Stop probe activity. More... | |
struct GNUNET_FS_DownloadContext * | GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, const char *filename, const char *tempname, uint64_t offset, uint64_t length, uint32_t anonymity, enum GNUNET_FS_DownloadOptions options, void *cctx, struct GNUNET_FS_DownloadContext *parent) |
Download parts of a file. More... | |
struct GNUNET_FS_DownloadContext * | GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, struct GNUNET_FS_SearchResult *sr, const char *filename, const char *tempname, uint64_t offset, uint64_t length, uint32_t anonymity, enum GNUNET_FS_DownloadOptions options, void *cctx) |
Download parts of a file based on a search result. More... | |
void | GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete) |
Stop a download (aborts if download is incomplete). More... | |
void | GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc) |
Suspend a download. More... | |
void | GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc) |
Resume a suspended download. More... | |
int | GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData *md) |
Does the meta-data claim that this is a directory? Checks if the mime-type is that of a GNUnet directory. More... | |
void | GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md) |
Set the MIMETYPE information for the given metadata to "application/gnunet-directory". More... | |
char * | GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData *md) |
Suggest a filename based on given metadata. More... | |
int | GNUNET_FS_directory_list_contents (size_t size, const void *data, uint64_t offset, GNUNET_FS_DirectoryEntryProcessor dep, void *dep_cls) |
Iterate over all entries in a directory. More... | |
struct GNUNET_FS_DirectoryBuilder * | GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData *mdir) |
Create a directory builder. More... | |
void | GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *md, const void *data) |
Add an entry to a directory. More... | |
int | GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, size_t *rsize, void **rdata) |
Finish building the directory. More... | |
struct GNUNET_FS_DirScanner * | GNUNET_FS_directory_scan_start (const char *filename, int disable_extractor, const char *ex, GNUNET_FS_DirScannerProgressCallback cb, void *cb_cls) |
Start a directory scanner. More... | |
void | GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds) |
Abort the scan. More... | |
struct GNUNET_FS_ShareTreeItem * | GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds) |
Obtain the result of the scan after the scan has signalled completion. More... | |
void | GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel) |
Process a share item tree, moving frequent keywords up and copying frequent metadata up. More... | |
void | GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel) |
Release memory of a share item tree. More... | |
File sharing.
#define GNUNET_FS_VERSION 0x00090300 |
Version number of the implementation.
History:
1.x.x: initial version with triple GNUNET_hash and merkle tree 2.x.x: root node with mime-type, filename and version number 2.1.x: combined GNUNET_EC_ContentHashKey/3HASH encoding with 25:1 super-nodes 2.2.x: with directories 3.0.x: with namespaces 3.1.x: with namespace meta-data 3.2.x: with collections 4.0.x: with expiration, variable meta-data, kblocks 4.1.x: with new error and configuration handling 5.0.x: with location URIs 6.0.0: with support for OR in KSKs 6.1.x: with simplified namespace support 9.0.0: CPS-style integrated API 9.1.1: asynchronous directory scanning 9.2.0: unified K-Block and S-block format (#2564) 9.3.0: base32crockford encoded URLs
Definition at line 67 of file gnunet_fs_service.h.
Referenced by process_kblock().
#define GNUNET_FS_URI_PREFIX "gnunet://fs/" |
Definition at line 72 of file gnunet_fs_service.h.
Referenced by GNUNET_FS_uri_ksk_create_from_args(), uri_chk_to_string(), uri_ksk_to_string(), uri_loc_to_string(), and uri_sks_to_string().
#define GNUNET_FS_URI_KSK_INFIX "ksk/" |
Definition at line 73 of file gnunet_fs_service.h.
Referenced by uri_ksk_to_string().
#define GNUNET_FS_URI_SKS_INFIX "sks/" |
Definition at line 74 of file gnunet_fs_service.h.
Referenced by uri_sks_to_string().
#define GNUNET_FS_URI_CHK_INFIX "chk/" |
Definition at line 75 of file gnunet_fs_service.h.
Referenced by uri_chk_to_string().
#define GNUNET_FS_URI_LOC_INFIX "loc/" |
Definition at line 76 of file gnunet_fs_service.h.
Referenced by uri_loc_to_string().
#define GNUNET_FS_PROBE_UPDATE_FREQUENCY |
How often do we signal applications that a probe for a particular search result is running? (used to visualize probes).
Definition at line 83 of file gnunet_fs_service.h.
Referenced by probe_ping_task_cb().
#define GNUNET_FS_DIRECTORY_MIME "application/gnunet-directory" |
Definition at line 2459 of file gnunet_fs_service.h.
Referenced by get_file_information(), GNUNET_FS_meta_data_make_directory(), and GNUNET_FS_meta_data_test_for_directory().
#define GNUNET_FS_DIRECTORY_MAGIC "\211GND\r\n\032\n" |
Definition at line 2460 of file gnunet_fs_service.h.
Referenced by GNUNET_FS_directory_list_contents().
#define GNUNET_FS_DIRECTORY_EXT ".gnd" |
Definition at line 2461 of file gnunet_fs_service.h.
Referenced by is_recursive_download(), progress_cb(), and trigger_recursive_download().
typedef int(* GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, int is_mandatory) |
Iterator over keywords.
cls | closure |
keyword | the keyword |
is_mandatory | is the keyword mandatory (in a search) |
Definition at line 101 of file gnunet_fs_service.h.
typedef void*(* GNUNET_FS_ProgressCallback) (void *cls, const struct GNUNET_FS_ProgressInfo *info) |
Notification of FS to a client about the progress of an operation.
Callbacks of this type will be used for uploads, downloads and searches. Some of the arguments depend a bit in their meaning on the context in which the callback is used.
cls | closure |
info | details about the event, specifying the event type and various bits about the event |
struct GNUNET_FS_ProgressInfo
. Definition at line 1548 of file gnunet_fs_service.h.
typedef int(* GNUNET_FS_FileInformationProcessor) (void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info) |
Function called on entries in a struct GNUNET_FS_FileInformation
iteration.
cls | closure |
fi | the entry in the publish-structure |
length | length of the file or directory |
meta | metadata for the file or directory (can be modified) |
uri | pointer to the keywords that will be used for this entry (can be modified) |
bo | block options (can be modified) |
do_index | should we index (can be modified) |
client_info | pointer to client context set upon creation (can be modified) |
Definition at line 1702 of file gnunet_fs_service.h.
typedef size_t(* GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, void *buf, char **emsg) |
Function that provides data.
cls | closure |
offset | offset to read from; it is possible that the caller might need to go backwards a bit at times; set to UINT64_MAX to tell the reader that we won't be reading for a while (used to close the file descriptor but NOT fully clean up the reader's state); in this case, a value of '0' for max should be ignored |
max | maximum number of bytes that should be copied to buf; readers are not allowed to provide less data unless there is an error; a value of "0" will be used at the end to allow the reader to clean up its internal state |
buf | where the reader should write the data |
emsg | location for the reader to store an error message |
Definition at line 1826 of file gnunet_fs_service.h.
typedef void(* GNUNET_FS_PublishContinuation) (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) |
Signature of a function called as the continuation of a KBlock or SBlock publication.
cls | closure |
uri | URI under which the block is now available, NULL on error |
emsg | error message, NULL on success |
Definition at line 2014 of file gnunet_fs_service.h.
typedef int(* GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, const struct GNUNET_HashCode *file_id) |
Type of a function called by GNUNET_FS_get_indexed_files.
cls | closure |
filename | the name of the file, NULL for end of list |
file_id | hash of the contents of the indexed file |
Definition at line 2108 of file gnunet_fs_service.h.
typedef void(* GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, const struct GNUNET_FS_Uri *last_uri, const struct GNUNET_CONTAINER_MetaData *last_meta, const char *next_id) |
Function called on updateable identifiers.
cls | closure |
last_id | last identifier |
last_uri | uri used for the content published under the last_id |
last_meta | metadata associated with last_uri |
next_id | identifier that should be used for updates |
Definition at line 2174 of file gnunet_fs_service.h.
typedef void(* GNUNET_FS_DirectoryEntryProcessor) (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, size_t length, const void *data) |
Function used to process entries in a directory.
cls | closure |
filename | name of the file in the directory |
uri | URI of the file |
metadata | metadata for the file; metadata for the directory if everything else is NULL/zero |
length | length of the available data for the file (of type size_t since data must certainly fit into memory; if files are larger than size_t permits, then they will certainly not be embedded with the directory itself). |
data | data available for the file (length bytes) |
Definition at line 2511 of file gnunet_fs_service.h.
typedef void(* GNUNET_FS_DirScannerProgressCallback) (void *cls, const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason) |
Function called over time as the directory scanner makes progress on the job at hand.
cls | closure |
filename | which file we are making progress on |
is_directory | GNUNET_YES if this is a directory, GNUNET_NO if this is a file GNUNET_SYSERR if it is neither (or unknown) |
reason | kind of progress we are making |
Definition at line 2647 of file gnunet_fs_service.h.
enum GNUNET_FS_Status |
Possible status codes used in the callback for the various file-sharing operations.
On each file (or search), the callback is guaranteed to be called once with "START" and once with STOPPED; calls with PROGRESS, ERROR or COMPLETED are optional and depend on the circumstances; parent operations will be STARTED before child-operations and STOPPED after their respective child-operations. START and STOP signals are typically generated either due to explicit client requests or because of suspend/resume operations.
Definition at line 507 of file gnunet_fs_service.h.
enum GNUNET_FS_Flags |
General (global) option flags for file-sharing.
Enumerator | |
---|---|
GNUNET_FS_FLAGS_NONE | No special flags set. |
GNUNET_FS_FLAGS_PERSISTENCE | Is persistence of operations desired? (will create SUSPEND/RESUME events). |
GNUNET_FS_FLAGS_DO_PROBES | Should we automatically trigger probes for search results to determine availability? (will create GNUNET_FS_STATUS_SEARCH_UPDATE events). |
Definition at line 1555 of file gnunet_fs_service.h.
enum GNUNET_FS_OPTIONS |
Options specified in the VARARGs portion of GNUNET_FS_start.
Definition at line 1580 of file gnunet_fs_service.h.
Options for publishing.
Compatible options can be OR'ed together.
Definition at line 1956 of file gnunet_fs_service.h.
Options for searching.
Compatible options can be OR'ed together.
Enumerator | |
---|---|
GNUNET_FS_SEARCH_OPTION_NONE | No options (use defaults for everything). |
GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY | Only search the local host, do not search remote systems (no P2P) |
Definition at line 2218 of file gnunet_fs_service.h.
Options for downloading.
Compatible options can be OR'ed together.
Definition at line 2309 of file gnunet_fs_service.h.
Progress reasons of the directory scanner.
Definition at line 2600 of file gnunet_fs_service.h.
int GNUNET_FS_uri_to_key | ( | const struct GNUNET_FS_Uri * | uri, |
struct GNUNET_HashCode * | key | ||
) |
Get a unique key from a URI.
This is for putting URIs into HashMaps. The key may change between FS implementations.
uri | uri to convert to a unique key |
key | wherer to store the unique key |
This is for putting URIs into HashMaps. The key may change between FS implementations.
uri | uri to convert to a unique key |
key | where to store the unique key |
Definition at line 103 of file fs_uri.c.
References GNUNET_FS_Uri::chk, FileIdentifier::chk, GNUNET_FS_Uri::data, Location::fi, GNUNET_CRYPTO_hash(), GNUNET_FS_URI_CHK, GNUNET_FS_URI_KSK, GNUNET_FS_URI_LOC, GNUNET_FS_URI_SKS, GNUNET_OK, GNUNET_SYSERR, GNUNET_FS_Uri::ksk, GNUNET_FS_Uri::loc, ContentHashKey::query, GNUNET_FS_Uri::sks, and GNUNET_FS_Uri::type.
Referenced by process_ksk_result(), and process_sks_result().
char* GNUNET_FS_uri_to_string | ( | const struct GNUNET_FS_Uri * | uri | ) |
Convert a URI to a UTF-8 String.
uri | uri to convert to a string |
Definition at line 2027 of file fs_uri.c.
References GNUNET_break, GNUNET_FS_URI_CHK, GNUNET_FS_URI_KSK, GNUNET_FS_URI_LOC, GNUNET_FS_URI_SKS, GNUNET_FS_Uri::type, uri_chk_to_string(), uri_ksk_to_string(), uri_loc_to_string(), and uri_sks_to_string().
Referenced by GNUNET_FS_directory_builder_add(), GNUNET_FS_download_sync_(), GNUNET_FS_file_information_sync_(), GNUNET_FS_publish_ublock_(), GNUNET_FS_search_result_sync_(), GNUNET_FS_search_sync_(), GNUNET_FS_unindex_sync_(), print_entry(), progress_cb(), trigger_recursive_download(), and write_update_information_graph().
char* GNUNET_FS_uri_ksk_to_string_fancy | ( | const struct GNUNET_FS_Uri * | uri | ) |
Convert keyword URI to a human readable format (i.e.
the search query that was used in the first place)
uri | ksk uri to convert to a string |
Definition at line 155 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_break, GNUNET_FS_URI_KSK, GNUNET_malloc, GNUNET_FS_Uri::ksk, ret, and GNUNET_FS_Uri::type.
void GNUNET_FS_uri_ksk_add_keyword | ( | struct GNUNET_FS_Uri * | uri, |
const char * | keyword, | ||
int | is_mandatory | ||
) |
Add the given keyword to the set of keywords represented by the URI.
Does nothing if the keyword is already present.
uri | ksk uri to modify |
keyword | keyword to add |
is_mandatory | is this keyword mandatory? |
Definition at line 762 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_array_append, GNUNET_asprintf(), GNUNET_assert, GNUNET_FS_URI_KSK, GNUNET_FS_Uri::ksk, and GNUNET_FS_Uri::type.
Referenced by get_file_information(), and migrate_and_drop_keywords().
void GNUNET_FS_uri_ksk_remove_keyword | ( | struct GNUNET_FS_Uri * | uri, |
const char * | keyword | ||
) |
Remove the given keyword from the set of keywords represented by the URI.
Does nothing if the keyword is not present.
uri | ksk uri to modify |
keyword | keyword to add |
Definition at line 790 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_array_grow, GNUNET_assert, GNUNET_free, GNUNET_FS_URI_KSK, GNUNET_FS_Uri::ksk, and GNUNET_FS_Uri::type.
Referenced by remove_high_frequency_keywords().
struct GNUNET_FS_Uri* GNUNET_FS_uri_parse | ( | const char * | uri, |
char ** | emsg | ||
) |
Convert a UTF-8 String to a URI.
uri | string to parse |
emsg | where to store the parser error message (if any) |
Definition at line 644 of file fs_uri.c.
References _, GNUNET_break, GNUNET_free, GNUNET_strdup, msg, ret, uri_chk_parse(), uri_ksk_parse(), uri_loc_parse(), and uri_sks_parse().
Referenced by deserialize_download(), deserialize_fi_node(), deserialize_search(), deserialize_search_result(), deserialize_unindex_file(), GNUNET_FS_directory_list_contents(), GNUNET_FS_uri_ksk_create_from_args(), identity_continuation(), process_kblock(), process_kblock_for_unindex(), process_sblock(), read_update_information_graph(), and run().
void GNUNET_FS_uri_destroy | ( | struct GNUNET_FS_Uri * | uri | ) |
Free URI.
uri | uri to free |
Definition at line 678 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_array_grow, GNUNET_free, GNUNET_FS_URI_KSK, GNUNET_FS_URI_LOC, GNUNET_FS_URI_SKS, GNUNET_FS_Uri::ksk, GNUNET_FS_Uri::sks, and GNUNET_FS_Uri::type.
Referenced by deserialize_search_result(), do_stop_task(), download_timeout(), free_download_context(), free_result(), free_search_context(), free_update_information_graph(), GNUNET_FS_directory_builder_add(), GNUNET_FS_directory_list_contents(), GNUNET_FS_download_signal_suspend_(), GNUNET_FS_download_stop(), GNUNET_FS_file_information_destroy(), GNUNET_FS_probe_stop(), GNUNET_FS_publish_ksk_cancel(), GNUNET_FS_publish_sks_cancel(), GNUNET_FS_search_signal_suspend_(), GNUNET_FS_search_stop(), GNUNET_FS_share_tree_free(), GNUNET_FS_tree_encoder_finish(), GNUNET_FS_unindex_signal_suspend_(), GNUNET_FS_unindex_stop(), handle_client_loc_sign(), make_file(), process_kblock(), process_kblock_for_unindex(), process_sblock(), publish_inspector(), report_success(), report_uri(), run(), search_result_free(), search_result_suspend(), search_start(), and share_tree_trim().
unsigned int GNUNET_FS_uri_ksk_get_keyword_count | ( | const struct GNUNET_FS_Uri * | uri | ) |
How many keywords are ANDed in this keyword URI?
uri | ksk uri to get the number of keywords from |
Definition at line 712 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_FS_URI_KSK, GNUNET_FS_Uri::ksk, and GNUNET_FS_Uri::type.
Referenced by fip_signal_start().
int GNUNET_FS_uri_ksk_get_keywords | ( | const struct GNUNET_FS_Uri * | uri, |
GNUNET_FS_KeywordIterator | iterator, | ||
void * | iterator_cls | ||
) |
Iterate over all keywords in this keyword URI.
uri | ksk uri to get the keywords from |
iterator | function to call on each keyword |
iterator_cls | closure for iterator |
uri | ksk uri to get the keywords from |
iterator | function to call on each keyword |
iterator_cls | closure for iterator |
Definition at line 730 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_FS_URI_KSK, GNUNET_OK, GNUNET_FS_Uri::ksk, and GNUNET_FS_Uri::type.
Referenced by publish_inspector(), and share_tree_trim().
int GNUNET_FS_uri_loc_get_peer_identity | ( | const struct GNUNET_FS_Uri * | uri, |
struct GNUNET_PeerIdentity * | peer | ||
) |
Obtain the identity of the peer offering the data.
uri | the location URI to inspect |
peer | where to store the identify of the peer (presumably) offering the content |
Definition at line 822 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_FS_URI_LOC, GNUNET_OK, GNUNET_SYSERR, GNUNET_FS_Uri::loc, Location::peer, and GNUNET_FS_Uri::type.
Referenced by create_download_context(), and deserialize_download().
struct GNUNET_FS_Uri* GNUNET_FS_uri_loc_get_uri | ( | const struct GNUNET_FS_Uri * | uri | ) |
Obtain the URI of the content itself.
uri | location URI to get the content URI from |
Definition at line 853 of file fs_uri.c.
References GNUNET_FS_Uri::chk, GNUNET_FS_Uri::data, Location::fi, GNUNET_FS_URI_CHK, GNUNET_FS_URI_LOC, GNUNET_new, GNUNET_FS_Uri::loc, ret, and GNUNET_FS_Uri::type.
Referenced by GNUNET_FS_directory_builder_add().
struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration | ( | const struct GNUNET_FS_Uri * | uri | ) |
Obtain the expiration of the LOC URI.
uri | location URI to get the expiration from |
Definition at line 839 of file fs_uri.c.
References GNUNET_FS_Uri::data, Location::expirationTime, GNUNET_assert, GNUNET_FS_URI_LOC, GNUNET_FS_Uri::loc, GNUNET_FS_Uri::type, and uri.
struct GNUNET_FS_Uri* GNUNET_FS_uri_loc_create | ( | const struct GNUNET_FS_Uri * | base_uri, |
const struct GNUNET_CRYPTO_EddsaPrivateKey * | sign_key, | ||
struct GNUNET_TIME_Absolute | expiration_time | ||
) |
Construct a location URI (this peer will be used for the location).
This function should only be called from within gnunet-service-fs, as it requires the peer's private key which is generally unavailable to processes directly under the user's control. However, for testing and as it logically fits under URIs, it is in this API.
base_uri | content offered by the sender |
sign_key | private key of the peer |
expiration_time | how long will the content be offered? |
Definition at line 879 of file fs_uri.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_FS_Uri::chk, Location::contentSignature, GNUNET_FS_Uri::data, Location::expirationTime, LocUriAssembly::exptime, Location::fi, LocUriAssembly::fi, GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_CRYPTO_eddsa_sign, GNUNET_FS_URI_CHK, GNUNET_FS_URI_LOC, GNUNET_new, GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, GNUNET_TIME_absolute_hton(), GNUNET_FS_Uri::loc, Location::peer, LocUriAssembly::peer, GNUNET_PeerIdentity::public_key, GNUNET_CRYPTO_EccSignaturePurpose::purpose, LocUriAssembly::purpose, GNUNET_CRYPTO_EccSignaturePurpose::size, GNUNET_FS_Uri::type, and uri.
Referenced by handle_client_loc_sign().
struct GNUNET_FS_Uri* GNUNET_FS_uri_ksk_merge | ( | const struct GNUNET_FS_Uri * | u1, |
const struct GNUNET_FS_Uri * | u2 | ||
) |
Merge the sets of keywords from two KSK URIs.
u1 | first uri |
u2 | second uri |
(useful for merging the canonicalized keywords with the original keywords for sharing).
u1 | first uri |
u2 | second uri |
Definition at line 941 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_break, GNUNET_FS_uri_dup(), GNUNET_FS_URI_KSK, GNUNET_new, GNUNET_new_array, GNUNET_strdup, GNUNET_FS_Uri::ksk, ret, and GNUNET_FS_Uri::type.
Referenced by publish_inspector().
struct GNUNET_FS_Uri* GNUNET_FS_uri_dup | ( | const struct GNUNET_FS_Uri * | uri | ) |
Duplicate URI.
uri | the URI to duplicate |
Definition at line 997 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_break, GNUNET_free, GNUNET_FS_URI_KSK, GNUNET_FS_URI_LOC, GNUNET_FS_URI_SKS, GNUNET_MAX_MALLOC_CHECKED, GNUNET_memcpy, GNUNET_new, GNUNET_new_array, GNUNET_strdup, GNUNET_FS_Uri::ksk, ret, GNUNET_FS_Uri::sks, and GNUNET_FS_Uri::type.
Referenced by create_download_context(), GNUNET_FS_file_information_create_empty_directory(), GNUNET_FS_file_information_create_from_reader(), GNUNET_FS_probe(), GNUNET_FS_publish_ksk(), GNUNET_FS_publish_sks(), GNUNET_FS_TEST_download(), GNUNET_FS_tree_encoder_get_uri(), GNUNET_FS_uri_ksk_merge(), process_ksk_result(), process_sks_result(), publish_progress_cb(), publish_sblocks_cont(), search_start(), share_tree_trim(), and unindex_directory_scan_cb().
struct GNUNET_FS_Uri* GNUNET_FS_uri_ksk_create | ( | const char * | keywords, |
char ** | emsg | ||
) |
Create an FS URI from a single user-supplied string of keywords.
The string is broken up at spaces into individual keywords. Keywords that start with "+" are mandatory. Double-quotes can be used to prevent breaking up strings at spaces (and also to specify non-mandatory keywords starting with "+").
Keywords must contain a balanced number of double quotes and double quotes can not be used in the actual keywords (for example, the string '""foo bar""' will be turned into two "OR"ed keywords 'foo' and 'bar', not into '"foo bar"'.
keywords | the keyword string |
emsg | where to store an error message |
Definition at line 1059 of file fs_uri.c.
References _, GNUNET_break, GNUNET_free, GNUNET_FS_uri_ksk_create_from_args(), GNUNET_new_array, GNUNET_strdup, and uri.
Referenced by make_keywords().
struct GNUNET_FS_Uri* GNUNET_FS_uri_ksk_create_from_args | ( | unsigned int | argc, |
const char ** | argv | ||
) |
Create an FS URI from a user-supplied command line of keywords.
Arguments should start with "+" to indicate mandatory keywords.
argc | number of keywords |
argv | keywords (double quotes are not required for keywords containing spaces; however, double quotes are required for keywords starting with "+"); there is no mechanism for having double quotes in the actual keywords (if the user did specifically specify double quotes, the caller should convert each double quote into two single quotes). |
Definition at line 1154 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_asprintf(), GNUNET_free, GNUNET_FS_URI_KSK, GNUNET_FS_uri_parse(), GNUNET_FS_URI_PREFIX, GNUNET_new, GNUNET_new_array, GNUNET_strdup, GNUNET_FS_Uri::ksk, GNUNET_FS_Uri::type, and uri.
Referenced by get_file_information(), GNUNET_FS_uri_ksk_create(), migrate_and_drop_keywords(), and run().
int GNUNET_FS_uri_test_equal | ( | const struct GNUNET_FS_Uri * | u1, |
const struct GNUNET_FS_Uri * | u2 | ||
) |
Test if two URIs are equal.
u1 | one of the URIs |
u2 | the other URI |
Definition at line 1211 of file fs_uri.c.
References GNUNET_FS_Uri::chk, GNUNET_FS_Uri::data, GNUNET_assert, GNUNET_FS_URI_CHK, GNUNET_FS_URI_KSK, GNUNET_FS_URI_LOC, GNUNET_FS_URI_SKS, GNUNET_NO, GNUNET_YES, GNUNET_FS_Uri::ksk, GNUNET_FS_Uri::loc, ret, GNUNET_FS_Uri::sks, and GNUNET_FS_Uri::type.
Referenced by get_result_present(), test_result_present(), and trigger_recursive_download().
int GNUNET_FS_uri_test_sks | ( | const struct GNUNET_FS_Uri * | uri | ) |
Is this a namespace URI?
uri | the uri to check |
Definition at line 1281 of file fs_uri.c.
References GNUNET_FS_URI_SKS, and GNUNET_FS_Uri::type.
Referenced by deserialize_fi_node(), deserialize_search(), GNUNET_FS_directory_builder_add(), GNUNET_FS_search_sync_(), GNUNET_FS_uri_sks_get_content_id(), GNUNET_FS_uri_sks_get_namespace(), and schedule_transmit_search_request().
struct GNUNET_FS_Uri* GNUNET_FS_uri_sks_create | ( | const struct GNUNET_CRYPTO_EcdsaPublicKey * | ns, |
const char * | id | ||
) |
Create an SKS URI from a namespace ID and an identifier.
ns | pseudonym to use |
id | identifier |
ns | namespace ID |
id | identifier |
Definition at line 918 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_FS_URI_SKS, GNUNET_new, GNUNET_strdup, ns, GNUNET_FS_Uri::sks, and GNUNET_FS_Uri::type.
int GNUNET_FS_uri_sks_get_namespace | ( | const struct GNUNET_FS_Uri * | uri, |
struct GNUNET_CRYPTO_EcdsaPublicKey * | pseudonym | ||
) |
Get the public key of a namespace from the given namespace URI.
uri | the uri to get the namespace ID from |
pseudonym | where to store the public key of the namespace |
Get the public key of a namespace from the given namespace URI.
uri | the uri to get the namespace ID from |
pseudonym | where to store the ID of the namespace |
Definition at line 1296 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_break, GNUNET_FS_uri_test_sks(), GNUNET_OK, GNUNET_SYSERR, and GNUNET_FS_Uri::sks.
char* GNUNET_FS_uri_sks_get_content_id | ( | const struct GNUNET_FS_Uri * | uri | ) |
Get the content identifier of an SKS URI.
uri | the sks uri |
Definition at line 1316 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_break, GNUNET_FS_uri_test_sks(), GNUNET_strdup, and GNUNET_FS_Uri::sks.
int GNUNET_FS_uri_test_ksk | ( | const struct GNUNET_FS_Uri * | uri | ) |
Is this a keyword URI?
uri | the uri |
Definition at line 1334 of file fs_uri.c.
References GNUNET_FS_Uri::data, GNUNET_assert, GNUNET_FS_URI_KSK, GNUNET_FS_Uri::ksk, and GNUNET_FS_Uri::type.
Referenced by deserialize_fi_node(), deserialize_search(), GNUNET_FS_directory_builder_add(), GNUNET_FS_directory_list_contents(), GNUNET_FS_search_signal_suspend_(), GNUNET_FS_search_start_searching_(), GNUNET_FS_search_stop(), GNUNET_FS_search_sync_(), and schedule_transmit_search_request().
int GNUNET_FS_uri_test_chk | ( | const struct GNUNET_FS_Uri * | uri | ) |
Is this a file (or directory) URI?
uri | the uri to check |
Definition at line 1356 of file fs_uri.c.
References GNUNET_FS_URI_CHK, and GNUNET_FS_Uri::type.
Referenced by create_download_context(), deserialize_download(), deserialize_fi_node(), GNUNET_FS_directory_builder_add(), GNUNET_FS_download_sync_(), progress_cb(), and run().
uint64_t GNUNET_FS_uri_chk_get_file_size | ( | const struct GNUNET_FS_Uri * | uri | ) |
What is the size of the file that this URI refers to?
uri | the CHK (or LOC) URI to inspect |
uri | the CHK URI to inspect |
Definition at line 1370 of file fs_uri.c.
References GNUNET_FS_Uri::chk, GNUNET_FS_Uri::data, Location::fi, FileIdentifier::file_length, GNUNET_assert, GNUNET_FS_URI_CHK, GNUNET_FS_URI_LOC, GNUNET_ntohll(), GNUNET_FS_Uri::loc, and GNUNET_FS_Uri::type.
Referenced by create_download_context(), deserialize_download(), encode_cont(), full_recursive_download(), GNUNET_FS_directory_builder_add(), GNUNET_FS_download_start_task_(), GNUNET_FS_search_start_probe_(), GNUNET_FS_TEST_download(), match_full_data(), progress_cb(), run(), trigger_recursive_download(), and try_top_down_reconstruction().
int GNUNET_FS_uri_test_loc | ( | const struct GNUNET_FS_Uri * | uri | ) |
Is this a location URI?
uri | the uri to check |
Definition at line 1394 of file fs_uri.c.
References GNUNET_FS_URI_LOC, and GNUNET_FS_Uri::type.
Referenced by create_download_context(), deserialize_download(), GNUNET_FS_download_sync_(), GNUNET_FS_publish_main_(), and run().
struct GNUNET_FS_Uri* GNUNET_FS_uri_ksk_create_from_meta_data | ( | const struct GNUNET_CONTAINER_MetaData * | md | ) |
Construct a keyword-URI from meta-data (take all entries in the meta-data and construct one large keyword URI that lists all keywords that can be found in the meta-data).
md | metadata to use |
Definition at line 1781 of file fs_uri.c.
References GNUNET_FS_Uri::data, DIR_SEPARATOR_STR, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, filename, gather_uri_data(), get_keywords_from_parens(), get_keywords_from_tokens(), GNUNET_CONTAINER_meta_data_get_first_by_types(), GNUNET_CONTAINER_meta_data_iterate(), GNUNET_free, GNUNET_FS_URI_KSK, GNUNET_new, GNUNET_new_array, GNUNET_FS_Uri::ksk, ret, and GNUNET_FS_Uri::type.
Referenced by process_helper_msgs().
struct GNUNET_GETOPT_CommandLineOption GNUNET_FS_GETOPT_KEYWORDS | ( | char | shortName, |
const char * | name, | ||
const char * | argumentHelp, | ||
const char * | description, | ||
struct GNUNET_FS_Uri ** | topKeywords | ||
) |
Allow user to specify keywords.
shortName | short name of the option | |
name | long name of the option | |
argumentHelp | help text for the option argument | |
description | long help text for the option | |
[out] | topKeywords | set to the desired value |
Definition at line 129 of file fs_getopt.c.
References GNUNET_GETOPT_CommandLineOption::argumentHelp, GNUNET_GETOPT_CommandLineOption::description, getopt_set_keywords(), name, GNUNET_GETOPT_CommandLineOption::shortName, and topKeywords.
Referenced by main().
struct GNUNET_GETOPT_CommandLineOption GNUNET_FS_GETOPT_METADATA | ( | char | shortName, |
const char * | name, | ||
const char * | argumentHelp, | ||
const char * | description, | ||
struct GNUNET_CONTAINER_MetaData ** | meta | ||
) |
Allow user to specify metadata.
shortName | short name of the option | |
name | long name of the option | |
argumentHelp | help text for the option argument | |
description | long help text for the option | |
[out] | metadata | set to the desired value |
Definition at line 254 of file fs_getopt.c.
References GNUNET_GETOPT_CommandLineOption::argumentHelp, GNUNET_GETOPT_CommandLineOption::description, getopt_set_metadata(), meta, name, and GNUNET_GETOPT_CommandLineOption::shortName.
Referenced by main().
int GNUNET_FS_getopt_set_metadata | ( | struct GNUNET_GETOPT_CommandLineProcessorContext * | ctx, |
void * | scls, | ||
const char * | option, | ||
const char * | value | ||
) |
Command-line option parser function that allows the user to specify one or more '-m' options with metadata.
Each specified entry of the form "type=value" will be added to the metadata. A pointer to the metadata must be passed as the "scls" argument.
ctx | command line processor context |
scls | must be of type struct GNUNET_CONTAINER_MetaData ** |
option | name of the option (typically 'k') |
value | command line argument given |
struct GNUNET_FS_Handle* GNUNET_FS_start | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | client_name, | ||
GNUNET_FS_ProgressCallback | upcb, | ||
void * | upcb_cls, | ||
enum GNUNET_FS_Flags | flags, | ||
... | |||
) |
Setup a connection to the file-sharing service.
cfg | configuration to use |
client_name | unique identifier for this client |
upcb | function to call to notify about FS actions |
upcb_cls | closure for upcb |
flags | specific attributes for fs-operations |
... | list of optional options, terminated with GNUNET_FS_OPTIONS_END |
Definition at line 3263 of file fs_api.c.
References GNUNET_FS_Handle::avg_block_latency, cfg, GNUNET_FS_Handle::cfg, GNUNET_FS_Handle::client_name, DEFAULT_MAX_PARALLEL_DOWNLOADS, DEFAULT_MAX_PARALLEL_REQUESTS, deserialization_master(), deserialize_download_file(), deserialize_publish_file(), deserialize_search_file(), deserialize_unindex_file(), GNUNET_FS_Handle::flags, GNUNET_break, GNUNET_free, GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM, GNUNET_FS_OPTIONS_END, GNUNET_FS_OPTIONS_REQUEST_PARALLELISM, GNUNET_FS_SYNC_PATH_MASTER_DOWNLOAD, GNUNET_FS_SYNC_PATH_MASTER_PUBLISH, GNUNET_FS_SYNC_PATH_MASTER_SEARCH, GNUNET_FS_SYNC_PATH_MASTER_UNINDEX, GNUNET_new, GNUNET_strdup, GNUNET_TIME_UNIT_MINUTES, GNUNET_VA_ARG_ENUM, GNUNET_FS_Handle::max_parallel_downloads, GNUNET_FS_Handle::max_parallel_requests, ret, GNUNET_FS_Handle::upcb, and GNUNET_FS_Handle::upcb_cls.
Referenced by download_connect_adapter(), publish_connect_adapter(), and run().
void GNUNET_FS_stop | ( | struct GNUNET_FS_Handle * | h | ) |
Close our connection with the file-sharing service.
The callback given to GNUNET_FS_start() will no longer be called after this function returns. This function MUST NOT be called from within the callback itself.
h | handle that was returned from GNUNET_FS_start() |
Definition at line 3338 of file fs_api.c.
References GNUNET_FS_Handle::client_name, GNUNET_free, GNUNET_SCHEDULER_cancel(), GNUNET_FS_Handle::queue_job, TopLevelActivity::ssf, TopLevelActivity::ssf_cls, and GNUNET_FS_Handle::top_head.
Referenced by clean_task(), cleanup_task(), do_stop_task(), fs_disconnect_adapter(), print_indexed(), run(), and shutdown_task().
const char* GNUNET_FS_file_information_get_id | ( | struct GNUNET_FS_FileInformation * | s | ) |
Obtain the name under which this file information structure is stored on disk.
Only works for top-level file information structures.
s | structure to get the filename for |
Definition at line 45 of file fs_file_information.c.
References GNUNET_FS_FileInformation::dir, and GNUNET_FS_FileInformation::serialization.
const char* GNUNET_FS_file_information_get_filename | ( | struct GNUNET_FS_FileInformation * | s | ) |
Obtain the filename from the file information structure.
s | structure to get the filename for |
Definition at line 60 of file fs_file_information.c.
References GNUNET_FS_FileInformation::filename.
void GNUNET_FS_file_information_set_filename | ( | struct GNUNET_FS_FileInformation * | s, |
const char * | filename | ||
) |
Set the filename in the file information structure.
If filename was already set, frees it before setting the new one. Makes a copy of the argument.
s | structure to get the filename for |
filename | filename to set |
Definition at line 75 of file fs_file_information.c.
References GNUNET_FS_FileInformation::filename, GNUNET_free, and GNUNET_strdup.
struct GNUNET_FS_FileInformation* GNUNET_FS_file_information_create_from_file | ( | struct GNUNET_FS_Handle * | h, |
void * | client_info, | ||
const char * | filename, | ||
const struct GNUNET_FS_Uri * | keywords, | ||
const struct GNUNET_CONTAINER_MetaData * | meta, | ||
int | do_index, | ||
const struct GNUNET_FS_BlockOptions * | bo | ||
) |
Create an entry for a file in a publish-structure.
h | handle to the file sharing subsystem |
client_info | initial client-info value for this entry |
filename | name of the file or directory to publish |
keywords | under which keywords should this file be available directly; can be NULL |
meta | metadata for the file |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
bo | block options |
h | handle to the file sharing subsystem |
client_info | initial value for the client-info value for this entry |
filename | name of the file or directory to publish |
keywords | under which keywords should this file be available directly; can be NULL |
meta | metadata for the file |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
bo | block options |
Definition at line 101 of file fs_file_information.c.
References DIR_SEPARATOR_STR, EXTRACTOR_METAFORMAT_C_STRING, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, filename, GNUNET_FS_FileInformation::filename, fn, GNUNET_break, GNUNET_CONTAINER_meta_data_insert(), GNUNET_DISK_file_size(), GNUNET_ERROR_TYPE_WARNING, GNUNET_FS_data_reader_file_(), GNUNET_FS_file_information_create_from_reader(), GNUNET_FS_make_file_reader_context_(), GNUNET_log_strerror_file, GNUNET_NO, GNUNET_OK, GNUNET_strdup, GNUNET_YES, h, GNUNET_FS_FileInformation::h, GNUNET_FS_FileInformation::meta, and ret.
Referenced by get_file_information(), and publish_fs_connect_complete_cb().
struct GNUNET_FS_FileInformation* GNUNET_FS_file_information_create_from_data | ( | struct GNUNET_FS_Handle * | h, |
void * | client_info, | ||
uint64_t | length, | ||
void * | data, | ||
const struct GNUNET_FS_Uri * | keywords, | ||
const struct GNUNET_CONTAINER_MetaData * | meta, | ||
int | do_index, | ||
const struct GNUNET_FS_BlockOptions * | bo | ||
) |
Create an entry for a file in a publish-structure.
h | handle to the file sharing subsystem |
client_info | initial client-info value for this entry |
length | length of the file |
data | data for the file (should not be used afterwards by the caller; callee will "free") |
keywords | under which keywords should this file be available directly; can be NULL |
meta | metadata for the file |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
bo | block options |
h | handle to the file sharing subsystem |
client_info | initial value for the client-info value for this entry |
length | length of the file |
data | data for the file (should not be used afterwards by the caller; callee will "free") |
keywords | under which keywords should this file be available directly; can be NULL |
meta | metadata for the file |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
bo | block options |
Definition at line 177 of file fs_file_information.c.
References GNUNET_break, GNUNET_FS_data_reader_copy_(), GNUNET_FS_file_information_create_from_reader(), and GNUNET_YES.
Referenced by make_file().
struct GNUNET_FS_FileInformation* GNUNET_FS_file_information_create_from_reader | ( | struct GNUNET_FS_Handle * | h, |
void * | client_info, | ||
uint64_t | length, | ||
GNUNET_FS_DataReader | reader, | ||
void * | reader_cls, | ||
const struct GNUNET_FS_Uri * | keywords, | ||
const struct GNUNET_CONTAINER_MetaData * | meta, | ||
int | do_index, | ||
const struct GNUNET_FS_BlockOptions * | bo | ||
) |
Create an entry for a file in a publish-structure.
h | handle to the file sharing subsystem |
client_info | initial client-info value for this entry |
length | length of the file |
reader | function that can be used to obtain the data for the file |
reader_cls | closure for reader |
keywords | under which keywords should this file be available directly; can be NULL |
meta | metadata for the file |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
bo | block options |
h | handle to the file sharing subsystem |
client_info | initial value for the client-info value for this entry |
length | length of the file |
reader | function that can be used to obtain the data for the file |
reader_cls | closure for "reader" |
keywords | under which keywords should this file be available directly; can be NULL |
meta | metadata for the file |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
bo | block options |
Definition at line 222 of file fs_file_information.c.
References bo, GNUNET_FS_FileInformation::bo, GNUNET_FS_FileInformation::client_info, GNUNET_FS_FileInformation::data, GNUNET_FS_FileInformation::do_index, GNUNET_FS_FileInformation::file, GNUNET_break, GNUNET_CONTAINER_meta_data_create(), GNUNET_CONTAINER_meta_data_duplicate(), GNUNET_FS_data_reader_file_(), GNUNET_FS_uri_dup(), GNUNET_new, GNUNET_YES, h, GNUNET_FS_FileInformation::h, GNUNET_FS_FileInformation::keywords, GNUNET_FS_FileInformation::meta, GNUNET_FS_FileInformation::reader, GNUNET_FS_FileInformation::reader_cls, and ret.
Referenced by GNUNET_FS_file_information_create_from_data(), GNUNET_FS_file_information_create_from_file(), and publish_fs_connect_complete_cb().
struct GNUNET_FS_FileInformation* GNUNET_FS_file_information_create_empty_directory | ( | struct GNUNET_FS_Handle * | h, |
void * | client_info, | ||
const struct GNUNET_FS_Uri * | keywords, | ||
const struct GNUNET_CONTAINER_MetaData * | meta, | ||
const struct GNUNET_FS_BlockOptions * | bo, | ||
const char * | filename | ||
) |
Create an entry for an empty directory in a publish-structure.
h | handle to the file sharing subsystem |
client_info | initial client-info value for this entry |
keywords | under which keywords should this directory be available directly; can be NULL |
meta | metadata for the directory |
bo | block options |
filename | name of the directory; can be NULL |
h | handle to the file sharing subsystem |
client_info | initial value for the client-info value for this entry |
meta | metadata for the directory |
keywords | under which keywords should this directory be available directly; can be NULL |
bo | block options |
filename | name of the directory; can be NULL |
Definition at line 283 of file fs_file_information.c.
References bo, GNUNET_FS_FileInformation::bo, GNUNET_FS_FileInformation::client_info, GNUNET_FS_FileInformation::filename, GNUNET_CONTAINER_meta_data_duplicate(), GNUNET_FS_uri_dup(), GNUNET_new, GNUNET_strdup, GNUNET_YES, h, GNUNET_FS_FileInformation::h, GNUNET_FS_FileInformation::is_directory, GNUNET_FS_FileInformation::keywords, GNUNET_FS_FileInformation::meta, and ret.
Referenced by get_file_information().
int GNUNET_FS_file_information_is_directory | ( | const struct GNUNET_FS_FileInformation * | ent | ) |
Test if a given entry represents a directory.
ent | check if this FI represents a directory |
Definition at line 263 of file fs_file_information.c.
References GNUNET_FS_FileInformation::is_directory.
int GNUNET_FS_file_information_add | ( | struct GNUNET_FS_FileInformation * | dir, |
struct GNUNET_FS_FileInformation * | ent | ||
) |
Add an entry to a directory in a publish-structure.
Clients should never modify publish structures that were passed to GNUNET_FS_publish_start() already.
dir | the directory |
ent | the entry to add; the entry must not have been added to any other directory at this point and must not include dir in its structure |
Clients should never modify publish structures that were passed to GNUNET_FS_publish_start already.
dir | the directory |
ent | the entry to add; the entry must not have been added to any other directory at this point and must not include dir in its structure |
Definition at line 318 of file fs_file_information.c.
References GNUNET_FS_FileInformation::data, dir, GNUNET_FS_FileInformation::dir, GNUNET_FS_FileInformation::dir_size, GNUNET_FS_FileInformation::entries, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_FS_FileInformation::is_directory, and GNUNET_FS_FileInformation::next.
Referenced by get_file_information().
void GNUNET_FS_file_information_inspect | ( | struct GNUNET_FS_FileInformation * | dir, |
GNUNET_FS_FileInformationProcessor | proc, | ||
void * | proc_cls | ||
) |
Inspect a file or directory in a publish-structure.
Clients should never modify publish structures that were passed to GNUNET_FS_publish_start already. When called on a directory, this function will FIRST call proc with information about the directory itself and then for each of the files in the directory (but not for files in subdirectories). When called on a file, proc will be called exactly once (with information about the specific file).
dir | the directory |
proc | function to call on each entry |
proc_cls | closure for proc |
Definition at line 350 of file fs_file_information.c.
References GNUNET_FS_FileInformation::bo, GNUNET_FS_FileInformation::client_info, GNUNET_FS_FileInformation::data, GNUNET_FS_FileInformation::dir, GNUNET_FS_FileInformation::dir_size, GNUNET_FS_FileInformation::entries, GNUNET_FS_FileInformation::file, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_FS_FileInformation::is_directory, GNUNET_FS_FileInformation::keywords, GNUNET_FS_FileInformation::meta, and GNUNET_FS_FileInformation::next.
Referenced by deserialize_publish_file(), directory_trim_complete(), fip_signal_resume(), fip_signal_start(), fip_signal_stop(), fip_signal_suspend(), GNUNET_FS_publish_signal_suspend_(), GNUNET_FS_publish_start(), GNUNET_FS_publish_stop(), and publish_inspector().
void GNUNET_FS_file_information_destroy | ( | struct GNUNET_FS_FileInformation * | fi, |
GNUNET_FS_FileInformationProcessor | cleaner, | ||
void * | cleaner_cls | ||
) |
Destroy publish-structure.
Clients should never destroy publish structures that were passed to GNUNET_FS_publish_start already.
fi | structure to destroy |
cleaner | function to call on each entry in the structure (useful to clean up client_info); can be NULL; return values are ignored |
cleaner_cls | closure for cleaner |
Definition at line 403 of file fs_file_information.c.
References GNUNET_FS_FileInformation::bo, GNUNET_FS_FileInformation::chk_uri, GNUNET_FS_FileInformation::client_info, GNUNET_FS_FileInformation::data, GNUNET_FS_FileInformation::dir, GNUNET_FS_FileInformation::dir_data, GNUNET_FS_FileInformation::dir_size, GNUNET_FS_FileInformation::emsg, GNUNET_FS_FileInformation::entries, GNUNET_FS_FileInformation::file, GNUNET_FS_FileInformation::filename, GNUNET_CONTAINER_meta_data_destroy(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_FS_file_information_destroy(), GNUNET_FS_tree_encoder_finish(), GNUNET_FS_uri_destroy(), GNUNET_log_strerror_file, GNUNET_NO, GNUNET_YES, GNUNET_FS_FileInformation::is_directory, GNUNET_FS_FileInformation::keywords, GNUNET_FS_FileInformation::meta, GNUNET_FS_FileInformation::next, GNUNET_FS_FileInformation::serialization, GNUNET_FS_FileInformation::sks_uri, and GNUNET_FS_FileInformation::te.
Referenced by deserialize_fi_node(), deserialize_publish_file(), directory_trim_complete(), GNUNET_FS_file_information_destroy(), and publish_cleanup().
struct GNUNET_FS_PublishContext* GNUNET_FS_publish_start | ( | struct GNUNET_FS_Handle * | h, |
struct GNUNET_FS_FileInformation * | fi, | ||
const struct GNUNET_CRYPTO_EcdsaPrivateKey * | ns, | ||
const char * | nid, | ||
const char * | nuid, | ||
enum GNUNET_FS_PublishOptions | options | ||
) |
Publish a file or directory.
h | handle to the file sharing subsystem |
fi | information about the file or directory structure to publish |
ns | namespace to publish the file in, NULL for no namespace |
nid | identifier to use for the published content in the namespace (can be NULL, must be NULL if namespace is NULL) |
nuid | update-identifier that will be used for future updates (can be NULL, must be NULL if namespace or nid is NULL) |
options | options for the publication |
h | handle to the file sharing subsystem |
fi | information about the file or directory structure to publish |
ns | namespace to publish the file in, NULL for no namespace |
nid | identifier to use for the publishd content in the namespace (can be NULL, must be NULL if namespace is NULL) |
nuid | update-identifier that will be used for future updates (can be NULL, must be NULL if namespace or nid is NULL) |
options | options for the publication |
Definition at line 1442 of file fs_publish.c.
References _, GNUNET_FS_Handle::cfg, compute_contents_size(), dsh, GNUNET_FS_PublishContext::dsh, GNUNET_FS_PublishContext::fi, GNUNET_FS_PublishContext::fi_pos, finish_reserve(), fip_signal_start(), GNUNET_assert, GNUNET_DATASTORE_connect(), GNUNET_DATASTORE_reserve(), GNUNET_ERROR_TYPE_INFO, GNUNET_FS_file_information_inspect(), GNUNET_FS_make_top(), GNUNET_FS_publish_main_(), GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY, GNUNET_FS_publish_signal_suspend_(), GNUNET_FS_publish_sync_(), GNUNET_log, GNUNET_new, GNUNET_SCHEDULER_add_with_priority(), GNUNET_SCHEDULER_PRIORITY_BACKGROUND, GNUNET_strdup, h, GNUNET_FS_PublishContext::h, GNUNET_FS_PublishContext::nid, ns, GNUNET_FS_PublishContext::ns, GNUNET_FS_PublishContext::nuid, options, GNUNET_FS_PublishContext::options, GNUNET_FS_PublishContext::qre, GNUNET_FS_PublishContext::reserve_entries, GNUNET_FS_PublishContext::reserve_space, ret, GNUNET_FS_PublishContext::top, and GNUNET_FS_PublishContext::upload_task.
Referenced by directory_trim_complete(), publish_fs_connect_complete_cb(), and start_publish().
void GNUNET_FS_publish_stop | ( | struct GNUNET_FS_PublishContext * | pc | ) |
Stop a publication.
Will abort incomplete publications (but not remove blocks that have already been published) or simply clean up the state for completed publications. Must NOT be called from within the event callback!
pc | context for the publication to stop |
Stop a publication.
Will abort incomplete uploads (but not remove blocks that have already been publishd) or simply clean up the state for completed uploads. Must NOT be called from within the event callback!
pc | context for the upload to stop |
Definition at line 1570 of file fs_publish.c.
References GNUNET_FS_Uri::chk, GNUNET_FS_FileInformation::chk_uri, GNUNET_FS_Uri::data, GNUNET_FS_PublishContext::fi, FileIdentifier::file_length, fip_signal_stop(), GNUNET_break, GNUNET_DATASTORE_cancel(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_FS_end_top(), GNUNET_FS_file_information_inspect(), GNUNET_FS_publish_ksk_cancel(), GNUNET_FS_publish_make_status_(), GNUNET_FS_publish_sks_cancel(), GNUNET_FS_remove_sync_file_(), GNUNET_FS_STATUS_PUBLISH_STOPPED, GNUNET_FS_SYNC_PATH_FILE_INFO, GNUNET_FS_SYNC_PATH_MASTER_PUBLISH, GNUNET_log, GNUNET_ntohll(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, GNUNET_FS_PublishContext::h, GNUNET_FS_PublishContext::ksk_pc, publish_cleanup(), GNUNET_FS_PublishContext::qre, GNUNET_FS_FileInformation::serialization, GNUNET_FS_PublishContext::serialization, GNUNET_FS_PublishContext::skip_next_fi_callback, GNUNET_FS_PublishContext::sks_pc, GNUNET_FS_ProgressInfo::status, GNUNET_FS_PublishContext::top, and GNUNET_FS_PublishContext::upload_task.
Referenced by do_stop_task(), publish_stop_task(), publish_timeout(), report_uri(), and shutdown_task().
struct GNUNET_FS_PublishKskContext* GNUNET_FS_publish_ksk | ( | struct GNUNET_FS_Handle * | h, |
const struct GNUNET_FS_Uri * | ksk_uri, | ||
const struct GNUNET_CONTAINER_MetaData * | meta, | ||
const struct GNUNET_FS_Uri * | uri, | ||
const struct GNUNET_FS_BlockOptions * | bo, | ||
enum GNUNET_FS_PublishOptions | options, | ||
GNUNET_FS_PublishContinuation | cont, | ||
void * | cont_cls | ||
) |
Publish a KBlock on GNUnet.
h | handle to the file sharing subsystem |
ksk_uri | keywords to use |
meta | metadata to use |
uri | URI to refer to in the KBlock |
bo | block options |
options | publication options |
cont | continuation |
cont_cls | closure for cont |
Publish a KBlock on GNUnet.
h | handle to the file sharing subsystem |
ksk_uri | keywords to use |
meta | metadata to use |
uri | URI to refer to in the KBlock |
bo | per-block options |
options | publication options |
cont | continuation |
cont_cls | closure for cont |
Definition at line 193 of file fs_publish_ksk.c.
References _, GNUNET_FS_PublishKskContext::bo, GNUNET_FS_Handle::cfg, GNUNET_FS_PublishKskContext::cont, GNUNET_FS_PublishKskContext::cont_cls, GNUNET_FS_PublishKskContext::dsh, GNUNET_assert, GNUNET_CONTAINER_meta_data_duplicate(), GNUNET_DATASTORE_connect(), GNUNET_free, GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY, GNUNET_FS_uri_dup(), GNUNET_new, GNUNET_SCHEDULER_add_now(), GNUNET_FS_PublishKskContext::h, GNUNET_FS_PublishKskContext::ksk_task, GNUNET_FS_PublishKskContext::ksk_uri, GNUNET_FS_PublishKskContext::meta, GNUNET_FS_PublishKskContext::options, publish_ksk_cont(), and GNUNET_FS_PublishKskContext::uri.
Referenced by identity_continuation(), and publish_kblocks().
void GNUNET_FS_publish_ksk_cancel | ( | struct GNUNET_FS_PublishKskContext * | pkc | ) |
Abort the KSK publishing operation.
pkc | context of the operation to abort. |
Definition at line 236 of file fs_publish_ksk.c.
References GNUNET_FS_PublishKskContext::dsh, GNUNET_CONTAINER_meta_data_destroy(), GNUNET_DATASTORE_disconnect(), GNUNET_free, GNUNET_FS_publish_ublock_cancel_(), GNUNET_FS_uri_destroy(), GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_FS_PublishKskContext::ksk_task, GNUNET_FS_PublishKskContext::ksk_uri, GNUNET_FS_PublishKskContext::meta, GNUNET_FS_PublishKskContext::uc, and GNUNET_FS_PublishKskContext::uri.
Referenced by GNUNET_FS_publish_stop(), kb_put_cont(), publish_ksk_cont(), and suspend_operation().
struct GNUNET_FS_PublishSksContext* GNUNET_FS_publish_sks | ( | struct GNUNET_FS_Handle * | h, |
const struct GNUNET_CRYPTO_EcdsaPrivateKey * | ns, | ||
const char * | identifier, | ||
const char * | update, | ||
const struct GNUNET_CONTAINER_MetaData * | meta, | ||
const struct GNUNET_FS_Uri * | uri, | ||
const struct GNUNET_FS_BlockOptions * | bo, | ||
enum GNUNET_FS_PublishOptions | options, | ||
GNUNET_FS_PublishContinuation | cont, | ||
void * | cont_cls | ||
) |
Publish an SBlock on GNUnet.
h | handle to the file sharing subsystem |
ns | namespace to publish in |
identifier | identifier to use |
update | update identifier to use |
meta | metadata to use |
uri | URI to refer to in the SBlock |
bo | block options |
options | publication options |
cont | continuation |
cont_cls | closure for cont |
h | handle to the file sharing subsystem |
ns | namespace to publish in |
identifier | identifier to use |
update | update identifier to use |
meta | metadata to use |
uri | URI to refer to in the SBlock |
bo | block options |
options | publication options |
cont | continuation |
cont_cls | closure for cont |
Definition at line 442 of file fs_namespace.c.
References _, GNUNET_FS_Handle::cfg, GNUNET_FS_PublishSksContext::cont, GNUNET_FS_PublishSksContext::cont_cls, GNUNET_FS_Uri::data, GNUNET_FS_PublishSksContext::dsh, GNUNET_CONTAINER_meta_data_duplicate(), GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_DATASTORE_connect(), GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY, GNUNET_FS_publish_ublock_(), GNUNET_FS_uri_dup(), GNUNET_FS_URI_SKS, GNUNET_new, GNUNET_strdup, h, GNUNET_FS_PublishSksContext::h, NamespaceUpdateNode::id, NamespaceUpdateNode::md, ns, GNUNET_FS_PublishSksContext::ns, GNUNET_FS_PublishSksContext::nsn, GNUNET_FS_Uri::sks, sks_publish_cont(), GNUNET_FS_Uri::type, GNUNET_FS_PublishSksContext::uc, NamespaceUpdateNode::update, NamespaceUpdateNode::uri, and GNUNET_FS_PublishSksContext::uri.
Referenced by publish_sblock(), and uri_ksk_continuation().
void GNUNET_FS_publish_sks_cancel | ( | struct GNUNET_FS_PublishSksContext * | psc | ) |
Abort the SKS publishing operation.
psc | context of the operation to abort. |
Definition at line 505 of file fs_namespace.c.
References GNUNET_FS_PublishSksContext::dsh, GNUNET_CONTAINER_meta_data_destroy(), GNUNET_DATASTORE_disconnect(), GNUNET_free, GNUNET_FS_publish_ublock_cancel_(), GNUNET_FS_uri_destroy(), GNUNET_NO, NamespaceUpdateNode::id, NamespaceUpdateNode::md, GNUNET_FS_PublishSksContext::nsn, GNUNET_FS_PublishSksContext::uc, NamespaceUpdateNode::update, NamespaceUpdateNode::uri, and GNUNET_FS_PublishSksContext::uri.
Referenced by GNUNET_FS_publish_stop(), sks_publish_cont(), and suspend_operation().
struct GNUNET_FS_GetIndexedContext* GNUNET_FS_get_indexed_files | ( | struct GNUNET_FS_Handle * | h, |
GNUNET_FS_IndexedFileProcessor | iterator, | ||
void * | iterator_cls | ||
) |
Iterate over all indexed files.
h | handle to the file sharing subsystem |
iterator | function to call on each indexed file |
iterator_cls | closure for iterator |
h | handle to the file sharing subsystem |
iterator | function to call on each indexed file |
iterator_cls | closure for iterator |
Definition at line 167 of file fs_list_indexed.c.
References _, GNUNET_FS_Handle::cfg, env, GNUNET_CLIENT_connect(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END, GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY, GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_FS_GetIndexedContext::iterator, GNUNET_FS_GetIndexedContext::iterator_cls, GNUNET_FS_GetIndexedContext::mq, mq_error_handler(), and msg.
Referenced by run().
void GNUNET_FS_get_indexed_files_cancel | ( | struct GNUNET_FS_GetIndexedContext * | gic | ) |
Cancel iteration over all indexed files.
gic | operation to cancel |
Definition at line 216 of file fs_list_indexed.c.
References GNUNET_free, GNUNET_MQ_destroy(), and GNUNET_FS_GetIndexedContext::mq.
Referenced by handle_index_info(), handle_index_info_end(), and mq_error_handler().
struct GNUNET_FS_UnindexContext* GNUNET_FS_unindex_start | ( | struct GNUNET_FS_Handle * | h, |
const char * | filename, | ||
void * | cctx | ||
) |
Unindex a file.
h | handle to the file sharing subsystem |
filename | file to unindex |
cctx | initial value for the client context |
Definition at line 795 of file fs_unindex.c.
References GNUNET_FS_ProgressInfo::cctx, GNUNET_FS_UnindexContext::client_info, GNUNET_FS_UnindexContext::fhc, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_CRYPTO_hash_file(), GNUNET_DISK_file_size(), GNUNET_FS_make_top(), GNUNET_FS_STATUS_UNINDEX_START, GNUNET_FS_unindex_make_status_(), GNUNET_FS_unindex_process_hash_(), GNUNET_FS_unindex_signal_suspend_(), GNUNET_FS_unindex_sync_(), GNUNET_new, GNUNET_OK, GNUNET_SCHEDULER_PRIORITY_IDLE, GNUNET_strdup, GNUNET_TIME_absolute_get(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, h, GNUNET_FS_UnindexContext::h, HASHING_BLOCKSIZE, size, GNUNET_FS_UnindexContext::start_time, GNUNET_FS_ProgressInfo::status, GNUNET_FS_UnindexContext::top, uc, GNUNET_FS_ProgressInfo::unindex, and GNUNET_FS_ProgressInfo::value.
Referenced by ds_put_cont(), run(), and signal_publish_error().
void GNUNET_FS_unindex_stop | ( | struct GNUNET_FS_UnindexContext * | uc | ) |
Clean up after completion of an unindex operation.
uc | handle |
Definition at line 837 of file fs_unindex.c.
References GNUNET_FS_UnindexContext::client_info, GNUNET_FS_UnindexContext::dqe, GNUNET_FS_UnindexContext::dscan, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::fh, GNUNET_FS_UnindexContext::fhc, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_break, GNUNET_CRYPTO_hash_file_cancel(), GNUNET_DATASTORE_cancel(), GNUNET_DATASTORE_disconnect(), GNUNET_DISK_file_close(), GNUNET_free, GNUNET_FS_directory_scan_abort(), GNUNET_FS_end_top(), GNUNET_FS_remove_sync_file_(), GNUNET_FS_STATUS_UNINDEX_STOPPED, GNUNET_FS_SYNC_PATH_MASTER_UNINDEX, GNUNET_FS_tree_encoder_finish(), GNUNET_FS_unindex_make_status_(), GNUNET_FS_uri_destroy(), GNUNET_MQ_destroy(), GNUNET_NO, GNUNET_TIME_UNIT_ZERO, GNUNET_FS_UnindexContext::h, GNUNET_FS_UnindexContext::ksk_uri, GNUNET_FS_UnindexContext::mq, GNUNET_FS_UnindexContext::serialization, GNUNET_FS_UnindexContext::state, GNUNET_FS_ProgressInfo::status, GNUNET_FS_UnindexContext::tc, GNUNET_FS_UnindexContext::top, GNUNET_FS_ProgressInfo::unindex, UNINDEX_STATE_COMPLETE, and GNUNET_FS_ProgressInfo::value.
Referenced by GNUNET_FS_unindex_process_hash_(), progress_cb(), and shutdown_task().
void GNUNET_FS_namespace_list_update |