API for file sharing via GNUnet. More...
Go to the source code of this file.
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 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180 |
#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_FS_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_FS_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_FS_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... | |
const struct GNUNET_HashCode * | GNUNET_FS_uri_chk_get_file_hash (const struct GNUNET_FS_Uri *uri) |
What is the hash of the original file's content 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_FS_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_FS_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 (const 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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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_FS_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... | |
struct GNUNET_FS_MetaData * | GNUNET_FS_meta_data_create (void) |
Create a fresh meta data container. More... | |
struct GNUNET_FS_MetaData * | GNUNET_FS_meta_data_duplicate (const struct GNUNET_FS_MetaData *md) |
Duplicate a MetaData token. More... | |
void | GNUNET_FS_meta_data_destroy (struct GNUNET_FS_MetaData *md) |
Free meta data. More... | |
int | GNUNET_FS_meta_data_test_equal (const struct GNUNET_FS_MetaData *md1, const struct GNUNET_FS_MetaData *md2) |
Test if two MDs are equal. More... | |
int | GNUNET_FS_meta_data_insert (struct GNUNET_FS_MetaData *md, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_size) |
Extend metadata. More... | |
void | GNUNET_FS_meta_data_merge (struct GNUNET_FS_MetaData *md, const struct GNUNET_FS_MetaData *in) |
Extend metadata. More... | |
int | GNUNET_FS_meta_data_delete (struct GNUNET_FS_MetaData *md, enum EXTRACTOR_MetaType type, const char *data, size_t data_size) |
Remove an item. More... | |
void | GNUNET_FS_meta_data_clear (struct GNUNET_FS_MetaData *md) |
Remove all items in the container. More... | |
void | GNUNET_FS_meta_data_add_publication_date (struct GNUNET_FS_MetaData *md) |
Add the current time as the publication date to the meta-data. More... | |
int | GNUNET_FS_meta_data_iterate (const struct GNUNET_FS_MetaData *md, EXTRACTOR_MetaDataProcessor iter, void *iter_cls) |
Iterate over MD entries. More... | |
char * | GNUNET_FS_meta_data_get_by_type (const struct GNUNET_FS_MetaData *md, enum EXTRACTOR_MetaType type) |
Get the first MD entry of the given type. More... | |
char * | GNUNET_FS_meta_data_get_first_by_types (const struct GNUNET_FS_MetaData *md,...) |
Get the first matching MD entry of the given types. More... | |
size_t | GNUNET_FS_meta_data_get_thumbnail (const struct GNUNET_FS_MetaData *md, unsigned char **thumb) |
Get a thumbnail from the meta-data (if present). More... | |
ssize_t | GNUNET_FS_meta_data_serialize (const struct GNUNET_FS_MetaData *md, char **target, size_t max, enum GNUNET_FS_MetaDataSerializationOptions opt) |
Serialize meta-data to target. More... | |
ssize_t | GNUNET_FS_meta_data_get_serialized_size (const struct GNUNET_FS_MetaData *md) |
Get the size of the full meta-data in serialized form. More... | |
struct GNUNET_FS_MetaData * | GNUNET_FS_meta_data_deserialize (const char *input, size_t size) |
Deserialize meta-data. More... | |
enum GNUNET_GenericReturnValue | GNUNET_FS_write_meta_data (struct GNUNET_BIO_WriteHandle *h, const char *what, const struct GNUNET_FS_MetaData *m) |
Write a metadata container. More... | |
struct GNUNET_BIO_ReadSpec | GNUNET_FS_read_spec_meta_data (const char *what, struct GNUNET_FS_MetaData **result) |
Create the specification to read a metadata container. More... | |
struct GNUNET_BIO_WriteSpec | GNUNET_FS_write_spec_meta_data (const char *what, const struct GNUNET_FS_MetaData *m) |
Create the specification to write a metadata container. More... | |
enum GNUNET_GenericReturnValue | GNUNET_FS_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, struct GNUNET_FS_MetaData **result) |
Read a metadata container. More... | |
API for file sharing via GNUnet.
Definition in file gnunet_fs_service.h.