shared definitions for the FS library More...
#include "gnunet_constants.h"
#include "gnunet_datastore_service.h"
#include "gnunet_dht_service.h"
#include "gnunet_fs_service.h"
#include "gnunet_block_lib.h"
#include "block_fs.h"
#include "fs.h"
Go to the source code of this file.
Data Structures | |
struct | FileIdentifier |
complete information needed to download a file. More... | |
struct | Location |
Information about a file and its location (peer claiming to share the file). More... | |
struct | GNUNET_FS_Uri |
A Universal Resource Identifier (URI), opaque. More... | |
struct | GNUNET_FS_FileInformation |
Information for a file or directory that is about to be published. More... | |
struct | GNUNET_FS_QueueEntry |
Entry in the job queue. More... | |
struct | GNUNET_FS_SearchResult |
Information we store for each search result. More... | |
struct | TopLevelActivity |
We track all of the top-level activities of FS so that we can signal 'suspend' on shutdown. More... | |
struct | GNUNET_FS_Handle |
Master context for most FS operations. More... | |
struct | GNUNET_FS_PublishContext |
Handle for controlling a publication process. More... | |
struct | GNUNET_FS_UnindexContext |
Handle for controlling an unindexing operation. More... | |
struct | SearchRequestEntry |
Information we keep for each keyword in a keyword search. More... | |
struct | GNUNET_FS_SearchContext |
Handle for controlling a search. More... | |
struct | DownloadRequest |
Information about an active download request. More... | |
struct | GNUNET_FS_DownloadContext |
Context for controlling a download. More... | |
Macros | |
#define | CHK_PER_INODE 256 |
Pick a multiple of 2 here to achieve 8-byte alignment! We also probably want DBlocks to have (roughly) the same size as IBlocks. More... | |
#define | MAX_INLINE_SIZE 65536 |
Maximum size for a file to be considered for inlining in a directory. More... | |
#define | GNUNET_FS_SYNC_PATH_MASTER_SEARCH "search" |
Name of the directory with top-level searches. More... | |
#define | GNUNET_FS_SYNC_PATH_CHILD_SEARCH "search-child" |
Name of the directory with sub-searches (namespace-updates). More... | |
#define | GNUNET_FS_SYNC_PATH_MASTER_DOWNLOAD "download" |
Name of the directory with master downloads (not associated with search or part of another download). More... | |
#define | GNUNET_FS_SYNC_PATH_CHILD_DOWNLOAD "download-child" |
Name of the directory with downloads that are part of another download or a search. More... | |
#define | GNUNET_FS_SYNC_PATH_MASTER_PUBLISH "publish" |
Name of the directory with publishing operations. More... | |
#define | GNUNET_FS_SYNC_PATH_FILE_INFO "publish-file" |
Name of the directory with files that are being published. More... | |
#define | GNUNET_FS_SYNC_PATH_MASTER_UNINDEX "unindex" |
Name of the directory with unindex operations. More... | |
Typedefs | |
typedef void(* | SuspendSignalFunction) (void *cls) |
Function signature of the functions that can be called to trigger suspend signals and clean-up for top-level activities. More... | |
Enumerations | |
enum | GNUNET_FS_UriType { GNUNET_FS_URI_CHK , GNUNET_FS_URI_SKS , GNUNET_FS_URI_KSK , GNUNET_FS_URI_LOC } |
Types of URIs. More... | |
enum | GNUNET_FS_QueuePriority { GNUNET_FS_QUEUE_PRIORITY_PROBE , GNUNET_FS_QUEUE_PRIORITY_NORMAL } |
Priorities for the queue. More... | |
enum | UnindexState { UNINDEX_STATE_HASHING = 0 , UNINDEX_STATE_DS_REMOVE = 1 , UNINDEX_STATE_EXTRACT_KEYWORDS = 2 , UNINDEX_STATE_DS_REMOVE_KBLOCKS = 3 , UNINDEX_STATE_FS_NOTIFY = 4 , UNINDEX_STATE_COMPLETE = 5 , UNINDEX_STATE_ERROR = 6 } |
Phases of unindex processing (state machine). More... | |
enum | BlockRequestState { BRS_INIT = 0 , BRS_RECONSTRUCT_DOWN = 1 , BRS_RECONSTRUCT_META_UP = 2 , BRS_RECONSTRUCT_UP = 3 , BRS_CHK_SET = 4 , BRS_DOWNLOAD_DOWN = 5 , BRS_DOWNLOAD_UP = 6 , BRS_ERROR = 7 } |
FSM for possible states a block can go through. More... | |
Functions | |
struct GNUNET_FS_QueueEntry * | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_SCHEDULER_TaskCallback start, GNUNET_SCHEDULER_TaskCallback stop, void *cls, unsigned int blocks, enum GNUNET_FS_QueuePriority priority) |
Add a job to the queue. More... | |
void | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe) |
Dequeue a job from the queue. More... | |
size_t | GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf, char **emsg) |
Function that provides data by reading from a file. More... | |
void * | GNUNET_FS_make_file_reader_context_ (const char *filename) |
Create the closure for the GNUNET_FS_data_reader_file_() callback. More... | |
size_t | GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, void *buf, char **emsg) |
Function that provides data by copying from a buffer. More... | |
void * | GNUNET_FS_search_probe_progress_ (void *cls, const struct GNUNET_FS_ProgressInfo *info) |
Notification of FS that a search probe has made progress. More... | |
void | GNUNET_FS_publish_main_ (void *cls) |
Main function that performs the upload. More... | |
void | GNUNET_FS_unindex_process_hash_ (void *cls, const struct GNUNET_HashCode *file_id) |
Function called once the hash of the file that is being unindexed has been computed. More... | |
void | GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc) |
Extract the keywords for KBlock removal. More... | |
void | GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) |
If necessary, connect to the datastore and remove the KBlocks. More... | |
void * | GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_PublishContext *pc, const struct GNUNET_FS_FileInformation *p, uint64_t offset) |
Fill in all of the generic fields for a publish event and call the callback. More... | |
void | GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_DownloadContext *dc) |
Fill in all of the generic fields for a download event and call the callback. More... | |
void | GNUNET_FS_download_start_task_ (void *cls) |
Task that creates the initial (top-level) download request for the file. More... | |
void | GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_UnindexContext *uc, uint64_t offset) |
Fill in all of the generic fields for an unindex event and call the callback. More... | |
void * | GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, struct GNUNET_FS_Handle *h, struct GNUNET_FS_SearchContext *sc) |
Fill in all of the generic fields for a search event and call the callback. More... | |
void | GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc) |
Connect to the datastore and remove the blocks. More... | |
int | GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) |
Build the request and actually initiate the search using the GNUnet FS service. More... | |
void | GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc) |
Start the downloading process (by entering the queue). More... | |
void | GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr) |
Start download probes for the given search result. More... | |
void | GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, const char *ent) |
Remove serialization/deserialization file from disk. More... | |
void | GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, const char *uni) |
Remove serialization/deserialization directory from disk. More... | |
void | GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f) |
Synchronize this file-information struct with its mirror on disk. More... | |
void | GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc) |
Synchronize this publishing struct with its mirror on disk. More... | |
void | GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc) |
Synchronize this unindex struct with its mirror on disk. More... | |
void | GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc) |
Synchronize this search struct with its mirror on disk. More... | |
void | GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr) |
Synchronize this search result with its mirror on disk. More... | |
void | GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc) |
Synchronize this download struct with its mirror on disk. More... | |
void | GNUNET_FS_publish_signal_suspend_ (void *cls) |
Create SUSPEND event for the given publish operation and then clean up our state (without stop signal). More... | |
void | GNUNET_FS_search_signal_suspend_ (void *cls) |
Create SUSPEND event for the given search operation and then clean up our state (without stop signal). More... | |
void | GNUNET_FS_download_signal_suspend_ (void *cls) |
Create SUSPEND event for the given download operation and then clean up our state (without stop signal). More... | |
void | GNUNET_FS_unindex_signal_suspend_ (void *cls) |
Create SUSPEND event for the given unindex operation and then clean up our state (without stop signal). More... | |
struct TopLevelActivity * | GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, void *ssf_cls) |
Create a top-level activity entry. More... | |
void | GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, struct TopLevelActivity *top) |
Destroy a top-level activity entry. More... | |
void | GNUNET_FS_free_download_request_ (struct DownloadRequest *dr) |
(recursively) free download request structure More... | |
void | GNUNET_FS_stop_probe_ping_task_ (struct GNUNET_FS_SearchResult *sr) |
Stop the ping task for this search result. More... | |
shared definitions for the FS library
Definition in file fs_api.h.
#define CHK_PER_INODE 256 |
#define MAX_INLINE_SIZE 65536 |
#define GNUNET_FS_SYNC_PATH_MASTER_SEARCH "search" |
#define GNUNET_FS_SYNC_PATH_CHILD_SEARCH "search-child" |
#define GNUNET_FS_SYNC_PATH_MASTER_DOWNLOAD "download" |
#define GNUNET_FS_SYNC_PATH_CHILD_DOWNLOAD "download-child" |
#define GNUNET_FS_SYNC_PATH_MASTER_PUBLISH "publish" |
#define GNUNET_FS_SYNC_PATH_FILE_INFO "publish-file" |
#define GNUNET_FS_SYNC_PATH_MASTER_UNINDEX "unindex" |
typedef void(* SuspendSignalFunction) (void *cls) |
enum GNUNET_FS_UriType |
Types of URIs.
Enumerator | |
---|---|
GNUNET_FS_URI_CHK | Content-hash-key (simple file). |
GNUNET_FS_URI_SKS | Signed key space (file in namespace). |
GNUNET_FS_URI_KSK | Keyword search key (query with keywords). |
GNUNET_FS_URI_LOC | Location (chk with identity of hosting peer). |
Definition at line 139 of file fs_api.h.
Priorities for the queue.
Enumerator | |
---|---|
GNUNET_FS_QUEUE_PRIORITY_PROBE | This is a probe (low priority). |
GNUNET_FS_QUEUE_PRIORITY_NORMAL | Default priority. |
Definition at line 403 of file fs_api.h.
enum UnindexState |
Phases of unindex processing (state machine).
Definition at line 1306 of file fs_api.h.
enum BlockRequestState |
FSM for possible states a block can go through.
The typical order of progression is linear through the states, alternatives are documented in the comments.
Definition at line 1607 of file fs_api.h.
struct GNUNET_FS_QueueEntry * GNUNET_FS_queue_ | ( | struct GNUNET_FS_Handle * | h, |
GNUNET_SCHEDULER_TaskCallback | start, | ||
GNUNET_SCHEDULER_TaskCallback | stop, | ||
void * | cls, | ||
unsigned int | blocks, | ||
enum GNUNET_FS_QueuePriority | priority | ||
) |
Add a job to the queue.
h | handle to the overall FS state |
start | function to call to begin the job |
stop | function to call to pause the job, or on dequeue (if the job was running) |
cls | closure for start and stop |
blocks | number of blocks this download has |
priority | how important is this download |
Definition at line 321 of file fs_api.c.
References GNUNET_FS_QueueEntry::blocks, GNUNET_FS_QueueEntry::cls, GNUNET_CONTAINER_DLL_insert_after, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_absolute_get(), h, GNUNET_DATASTORE_QueueEntry::h, GNUNET_DATASTORE_QueueEntry::priority, GNUNET_FS_QueueEntry::priority, process_job_queue(), qe, start, and GNUNET_FS_QueueEntry::stop.
Referenced by GNUNET_FS_download_resume(), and GNUNET_FS_download_start_downloading_().
void GNUNET_FS_dequeue_ | ( | struct GNUNET_FS_QueueEntry * | qe | ) |
Dequeue a job from the queue.
qe | handle for the job |
Definition at line 356 of file fs_api.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, h, GNUNET_DATASTORE_QueueEntry::h, process_job_queue(), qe, and stop_job().
Referenced by check_completed(), GNUNET_FS_download_signal_suspend_(), GNUNET_FS_download_stop(), and process_result_with_request().
size_t GNUNET_FS_data_reader_file_ | ( | void * | cls, |
uint64_t | offset, | ||
size_t | max, | ||
void * | buf, | ||
char ** | emsg | ||
) |
Function that provides data by reading from a file.
cls | closure (points to the file information) |
offset | offset to read from; it is possible that the caller might need to go backwards a bit at times |
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 |
cls | closure with the struct FileInfo * |
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 447 of file fs_api.c.
References _, FileInfo::fd, FileInfo::filename, GNUNET_asprintf(), GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_DISK_SEEK_SET, GNUNET_free, GNUNET_SYSERR, max, and ret.
Referenced by block_reader(), deserialize_fi_node(), GNUNET_FS_file_information_create_from_file(), and GNUNET_FS_file_information_create_from_reader().
void * GNUNET_FS_make_file_reader_context_ | ( | const char * | filename | ) |
Create the closure for the GNUNET_FS_data_reader_file_() callback.
filename | file to read |
Definition at line 509 of file fs_api.c.
References filename, FileInfo::filename, GNUNET_free, GNUNET_new, and GNUNET_STRINGS_filename_expand().
Referenced by deserialize_fi_node(), and GNUNET_FS_file_information_create_from_file().
size_t GNUNET_FS_data_reader_copy_ | ( | void * | cls, |
uint64_t | offset, | ||
size_t | max, | ||
void * | buf, | ||
char ** | emsg | ||
) |
Function that provides data by copying from a buffer.
cls | closure (points to the buffer) |
offset | offset to read from; it is possible that the caller might need to go backwards a bit at times |
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 |
cls | closure (points to the buffer) |
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 545 of file fs_api.c.
References data, GNUNET_free, GNUNET_memcpy, and max.
Referenced by deserialize_fi_node(), and GNUNET_FS_file_information_create_from_data().
void * GNUNET_FS_search_probe_progress_ | ( | void * | cls, |
const struct GNUNET_FS_ProgressInfo * | info | ||
) |
Notification of FS that a search probe has made progress.
This function is used INSTEAD of the client's event handler for downloads where the GNUNET_FS_DOWNLOAD_IS_PROBE flag is set.
cls | closure, always NULL (!), actual closure is in the client-context of the info struct |
info | details about the event, specifying the event type and various bits about the event |
struct GNUNET_FS_ProgressInfo
. Definition at line 281 of file fs_search.c.
References GNUNET_assert, GNUNET_break, GNUNET_FS_search_result_sync_(), GNUNET_FS_STATUS_DOWNLOAD_ACTIVE, GNUNET_FS_STATUS_DOWNLOAD_COMPLETED, GNUNET_FS_STATUS_DOWNLOAD_ERROR, GNUNET_FS_STATUS_DOWNLOAD_INACTIVE, GNUNET_FS_STATUS_DOWNLOAD_PROGRESS, GNUNET_FS_STATUS_DOWNLOAD_RESUME, GNUNET_FS_STATUS_DOWNLOAD_START, GNUNET_FS_STATUS_DOWNLOAD_STOPPED, GNUNET_FS_STATUS_DOWNLOAD_SUSPEND, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_subtract(), info, GNUNET_FS_SearchResult::probe_active_time, GNUNET_FS_SearchResult::probe_cancel_task, probe_failure_handler(), probe_success_handler(), GNUNET_TIME_Relative::rel_value_us, and GNUNET_FS_SearchResult::remaining_probe_time.
Referenced by GNUNET_FS_download_make_status_().
void GNUNET_FS_publish_main_ | ( | void * | cls | ) |
Main function that performs the upload.
cls | struct GNUNET_FS_PublishContext identifies the upload |
cls | struct GNUNET_FS_PublishContext * identifies the upload |
Definition at line 1063 of file fs_publish.c.
References _, GNUNET_FS_PublishContext::all_done, create_loc_uri(), EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, GNUNET_FS_PublishContext::fhc, GNUNET_FS_PublishContext::fi_pos, GNUNET_asprintf(), GNUNET_CRYPTO_hash_file(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_FS_file_information_sync_(), GNUNET_FS_meta_data_get_by_type(), GNUNET_FS_publish_make_status_(), GNUNET_FS_publish_sync_(), GNUNET_FS_STATUS_PUBLISH_ERROR, GNUNET_FS_uri_test_loc(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_PRIORITY_IDLE, GNUNET_TIME_absolute_get(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, hash_for_index_cb(), HASHING_BLOCKSIZE, p, pc, GNUNET_FS_ProgressInfo::publish, publish_content(), publish_kblocks(), publish_sblock(), GNUNET_FS_ProgressInfo::status, GNUNET_FS_PublishContext::upload_task, and GNUNET_FS_ProgressInfo::value.
Referenced by block_proc(), deserialize_publish_file(), ds_put_cont(), encode_cont(), finish_reserve(), GNUNET_FS_publish_start(), and publish_kblocks_cont().
void GNUNET_FS_unindex_process_hash_ | ( | void * | cls, |
const struct GNUNET_HashCode * | file_id | ||
) |
Function called once the hash of the file that is being unindexed has been computed.
cls | closure, unindex context |
file_id | computed hash, NULL on error |
Definition at line 695 of file fs_unindex.c.
References _, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::fhc, GNUNET_FS_UnindexContext::file_id, GNUNET_FS_unindex_do_remove_(), GNUNET_FS_unindex_stop(), GNUNET_FS_unindex_sync_(), GNUNET_strdup, signal_unindex_error(), GNUNET_FS_UnindexContext::state, uc, UNINDEX_STATE_DS_REMOVE, UNINDEX_STATE_ERROR, and UNINDEX_STATE_HASHING.
Referenced by deserialize_unindex_file(), and GNUNET_FS_unindex_start().
void GNUNET_FS_unindex_do_extract_keywords_ | ( | struct GNUNET_FS_UnindexContext * | uc | ) |
Extract the keywords for KBlock removal.
uc | context for the unindex operation. |
Extract the keywords for KBlock removal.
uc | context for the unindex operation. |
Definition at line 407 of file fs_unindex.c.
References GNUNET_FS_Handle::cfg, GNUNET_FS_UnindexContext::dscan, GNUNET_FS_UnindexContext::filename, GNUNET_CONFIGURATION_get_value_string(), GNUNET_free, GNUNET_FS_directory_scan_start(), GNUNET_NO, GNUNET_OK, GNUNET_FS_UnindexContext::h, uc, and unindex_directory_scan_cb().
Referenced by deserialize_unindex_file(), and unindex_extract_keywords().
void GNUNET_FS_unindex_do_remove_kblocks_ | ( | struct GNUNET_FS_UnindexContext * | uc | ) |
If necessary, connect to the datastore and remove the KBlocks.
uc | context for the unindex operation. |
Definition at line 581 of file fs_unindex.c.
References _, GNUNET_FS_Handle::cfg, GNUNET_FS_Uri::data, GNUNET_FS_UnindexContext::dqe, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, GNUNET_BLOCK_TYPE_FS_UBLOCK, GNUNET_CRYPTO_ecdsa_key_get_anonymous(), GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_CRYPTO_ecdsa_public_key_derive(), GNUNET_CRYPTO_hash(), GNUNET_DATASTORE_connect(), GNUNET_DATASTORE_get_key(), GNUNET_FS_unindex_sync_(), GNUNET_strdup, GNUNET_FS_UnindexContext::h, GNUNET_FS_Uri::keywordCount, GNUNET_FS_Uri::keywords, GNUNET_FS_Uri::ksk, GNUNET_FS_UnindexContext::ksk_offset, GNUNET_FS_UnindexContext::ksk_uri, process_kblock_for_unindex(), signal_unindex_error(), GNUNET_FS_UnindexContext::state, uc, unindex_finish(), UNINDEX_STATE_ERROR, and GNUNET_FS_UnindexContext::uquery.
Referenced by continue_after_remove(), deserialize_unindex_file(), process_kblock_for_unindex(), and unindex_directory_scan_cb().
void * GNUNET_FS_publish_make_status_ | ( | struct GNUNET_FS_ProgressInfo * | pi, |
struct GNUNET_FS_PublishContext * | pc, | ||
const struct GNUNET_FS_FileInformation * | p, | ||
uint64_t | offset | ||
) |
Fill in all of the generic fields for a publish event and call the callback.
pi | structure to fill in |
pc | overall publishing context |
p | file information for the file being published |
offset | where in the file are we so far |
Definition at line 48 of file fs_publish.c.
References GNUNET_FS_ProgressInfo::fsh, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_calculate_eta(), GNUNET_YES, GNUNET_FS_PublishContext::h, p, pc, GNUNET_FS_ProgressInfo::publish, GNUNET_FS_Handle::upcb, GNUNET_FS_Handle::upcb_cls, and GNUNET_FS_ProgressInfo::value.
Referenced by ds_put_cont(), encode_cont(), fip_signal_resume(), fip_signal_start(), fip_signal_stop(), GNUNET_FS_publish_main_(), GNUNET_FS_publish_stop(), progress_proc(), signal_publish_completion(), signal_publish_error(), and suspend_operation().
void GNUNET_FS_download_make_status_ | ( | struct GNUNET_FS_ProgressInfo * | pi, |
struct GNUNET_FS_DownloadContext * | dc | ||
) |
Fill in all of the generic fields for a download event and call the callback.
pi | structure to fill in |
dc | overall download context |
Definition at line 104 of file fs_download.c.
References GNUNET_FS_DownloadContext::anonymity, GNUNET_FS_SearchResult::client_info, GNUNET_FS_DownloadContext::client_info, GNUNET_FS_DownloadContext::completed, dc, GNUNET_FS_ProgressInfo::download, GNUNET_FS_DownloadContext::filename, GNUNET_FS_ProgressInfo::fsh, GNUNET_FS_DOWNLOAD_IS_PROBE, GNUNET_FS_search_probe_progress_(), GNUNET_NO, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_calculate_eta(), GNUNET_YES, GNUNET_FS_DownloadContext::h, GNUNET_FS_DownloadContext::length, GNUNET_FS_DownloadContext::mq, GNUNET_FS_DownloadContext::options, GNUNET_FS_DownloadContext::parent, GNUNET_FS_DownloadContext::search, GNUNET_FS_DownloadContext::start_time, GNUNET_FS_Handle::upcb, GNUNET_FS_Handle::upcb_cls, GNUNET_FS_DownloadContext::uri, and GNUNET_FS_ProgressInfo::value.
Referenced by activate_fs_download(), check_completed(), deactivate_fs_download(), GNUNET_FS_download_resume(), GNUNET_FS_download_signal_suspend_(), GNUNET_FS_download_start_task_(), GNUNET_FS_download_stop(), process_result_with_request(), reconstruct_cb(), search_result_stop(), signal_download_resume(), and try_match_block().
void GNUNET_FS_download_start_task_ | ( | void * | cls | ) |
Task that creates the initial (top-level) download request for the file.
cls | the 'struct GNUNET_FS_DownloadContext' |
Definition at line 1799 of file fs_download.c.
References _, BRS_CHK_SET, BRS_DOWNLOAD_DOWN, BRS_DOWNLOAD_UP, BRS_ERROR, check_completed(), FileIdentifier::chk, GNUNET_FS_Uri::chk, DownloadRequest::chk, create_download_request(), GNUNET_FS_Uri::data, dc, GNUNET_FS_ProgressInfo::download, GNUNET_FS_DownloadContext::emsg, fh_reader(), Location::fi, GNUNET_FS_DownloadContext::filename, get_next_block(), GNUNET_asprintf(), GNUNET_assert, GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_test(), GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_OPEN_READ, GNUNET_DISK_OPEN_READWRITE, GNUNET_DISK_OPEN_TRUNCATE, GNUNET_DISK_PERM_GROUP_READ, GNUNET_DISK_PERM_NONE, GNUNET_DISK_PERM_OTHER_READ, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_FS_download_make_status_(), GNUNET_FS_download_start_downloading_(), GNUNET_FS_download_sync_(), GNUNET_FS_meta_data_get_serialized_size(), GNUNET_FS_meta_data_iterate(), GNUNET_FS_search_result_sync_(), GNUNET_FS_STATUS_DOWNLOAD_ERROR, GNUNET_FS_STATUS_DOWNLOAD_START, GNUNET_FS_tree_encoder_create(), GNUNET_FS_URI_CHK, GNUNET_FS_uri_chk_get_file_size(), GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_YES, GNUNET_FS_DownloadContext::h, GNUNET_FS_DownloadContext::issue_requests, GNUNET_FS_DownloadContext::length, GNUNET_FS_Uri::loc, match_full_data(), MAX_INLINE_SIZE, GNUNET_FS_DownloadContext::meta, GNUNET_FS_DownloadContext::offset, reconstruct_cb(), reconstruct_cont(), GNUNET_FS_DownloadContext::rfh, schedule_block_download(), GNUNET_FS_DownloadContext::search, DownloadRequest::state, GNUNET_FS_ProgressInfo::status, GNUNET_FS_DownloadContext::task, GNUNET_FS_DownloadContext::te, GNUNET_FS_DownloadContext::top_request, GNUNET_FS_DownloadContext::treedepth, try_top_down_reconstruction(), GNUNET_FS_Uri::type, GNUNET_FS_DownloadContext::uri, and GNUNET_FS_ProgressInfo::value.
Referenced by create_download_context(), and deserialize_download().
void GNUNET_FS_unindex_make_status_ | ( | struct GNUNET_FS_ProgressInfo * | pi, |
struct GNUNET_FS_UnindexContext * | uc, | ||
uint64_t | offset | ||
) |
Fill in all of the generic fields for an unindex event and call the callback.
pi | structure to fill in |
uc | overall unindex context |
offset | where we are in the file (for progress) |
Definition at line 85 of file fs_unindex.c.
References GNUNET_FS_UnindexContext::client_info, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_FS_ProgressInfo::fsh, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_calculate_eta(), GNUNET_FS_UnindexContext::h, GNUNET_FS_UnindexContext::start_time, uc, GNUNET_FS_ProgressInfo::unindex, GNUNET_FS_Handle::upcb, GNUNET_FS_Handle::upcb_cls, and GNUNET_FS_ProgressInfo::value.
Referenced by deserialize_unindex_file(), GNUNET_FS_unindex_signal_suspend_(), GNUNET_FS_unindex_start(), GNUNET_FS_unindex_stop(), handle_unindex_response(), signal_unindex_error(), and unindex_progress().
void * GNUNET_FS_search_make_status_ | ( | struct GNUNET_FS_ProgressInfo * | pi, |
struct GNUNET_FS_Handle * | h, | ||
struct GNUNET_FS_SearchContext * | sc | ||
) |
Fill in all of the generic fields for a search event and call the callback.
pi | structure to fill in |
h | file-sharing handle |
sc | overall search context |
Definition at line 49 of file fs_search.c.
References GNUNET_FS_SearchContext::anonymity, GNUNET_FS_SearchResult::client_info, GNUNET_FS_SearchContext::client_info, GNUNET_FS_ProgressInfo::fsh, GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_UNIT_ZERO, h, GNUNET_FS_SearchContext::psearch_result, ret, sc, GNUNET_FS_ProgressInfo::search, GNUNET_FS_SearchContext::start_time, GNUNET_FS_SearchContext::uri, and GNUNET_FS_ProgressInfo::value.
Referenced by GNUNET_FS_search_continue(), GNUNET_FS_search_pause(), GNUNET_FS_search_signal_suspend_(), GNUNET_FS_search_stop(), notify_client_chk_result(), notify_client_chk_update(), search_result_stop(), search_result_suspend(), search_start(), signal_probe_result(), signal_result_resume(), and signal_search_resume().
void GNUNET_FS_unindex_do_remove_ | ( | struct GNUNET_FS_UnindexContext * | uc | ) |
Connect to the datastore and remove the blocks.
uc | context for the unindex operation. |
Definition at line 650 of file fs_unindex.c.
References _, GNUNET_FS_Handle::cfg, GNUNET_FS_UnindexContext::dsh, GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::fh, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, GNUNET_DATASTORE_connect(), GNUNET_DATASTORE_disconnect(), GNUNET_DISK_file_open(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_FS_tree_encoder_create(), GNUNET_FS_tree_encoder_next(), GNUNET_FS_unindex_sync_(), GNUNET_NO, GNUNET_strdup, GNUNET_FS_UnindexContext::h, signal_unindex_error(), GNUNET_FS_UnindexContext::state, GNUNET_FS_UnindexContext::tc, uc, unindex_extract_keywords(), unindex_process(), unindex_progress(), unindex_reader(), and UNINDEX_STATE_ERROR.
Referenced by deserialize_unindex_file(), and GNUNET_FS_unindex_process_hash_().
int GNUNET_FS_search_start_searching_ | ( | struct GNUNET_FS_SearchContext * | sc | ) |
Build the request and actually initiate the search using the GNUnet FS service.
sc | search context |
Definition at line 1402 of file fs_search.c.
References GNUNET_FS_Uri::data, do_reconnect(), SearchRequestEntry::dpub, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CRYPTO_ecdsa_key_get_anonymous(), GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_CRYPTO_ecdsa_public_key_derive(), GNUNET_CRYPTO_hash(), GNUNET_FS_uri_test_ksk(), GNUNET_new_array, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_cancel(), GNUNET_strdup, GNUNET_SYSERR, SearchRequestEntry::keyword, GNUNET_FS_Uri::keywordCount, GNUNET_FS_Uri::keywords, GNUNET_FS_Uri::ksk, SearchRequestEntry::mandatory, GNUNET_FS_SearchContext::mandatory_count, GNUNET_FS_SearchContext::master_result_map, GNUNET_FS_SearchContext::mq, GNUNET_FS_SearchContext::requests, SearchRequestEntry::results, sc, GNUNET_FS_SearchContext::task, update_sre_result_maps(), SearchRequestEntry::uquery, and GNUNET_FS_SearchContext::uri.
Referenced by deserialize_search(), and search_start().
void GNUNET_FS_download_start_downloading_ | ( | struct GNUNET_FS_DownloadContext * | dc | ) |
Start the downloading process (by entering the queue).
dc | our download context |
Definition at line 2183 of file fs_download.c.
References activate_fs_download(), GNUNET_FS_DownloadContext::active, GNUNET_FS_DownloadContext::completed, DBLOCK_SIZE, dc, deactivate_fs_download(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_FS_DOWNLOAD_IS_PROBE, GNUNET_FS_queue_(), GNUNET_FS_QUEUE_PRIORITY_NORMAL, GNUNET_FS_QUEUE_PRIORITY_PROBE, GNUNET_log, GNUNET_FS_DownloadContext::h, GNUNET_FS_DownloadContext::job_queue, GNUNET_FS_DownloadContext::length, GNUNET_FS_DownloadContext::mq, GNUNET_FS_DownloadContext::options, and GNUNET_FS_DownloadContext::task.
Referenced by GNUNET_FS_download_start_task_().
void GNUNET_FS_search_start_probe_ | ( | struct GNUNET_FS_SearchResult * | sr | ) |
Start download probes for the given search result.
sr | the search result |
Definition at line 431 of file fs_search.c.
References GNUNET_FS_SearchResult::anonymity, GNUNET_FS_SearchResult::availability_success, GNUNET_FS_SearchResult::availability_trials, AVAILABILITY_TRIALS_MAX, GNUNET_FS_Handle::avg_block_latency, DBLOCK_SIZE, GNUNET_FS_SearchResult::download, GNUNET_FS_Handle::flags, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_FS_DOWNLOAD_IS_PROBE, GNUNET_FS_DOWNLOAD_NO_TEMPORARIES, GNUNET_FS_download_start(), GNUNET_FS_FLAGS_DO_PROBES, GNUNET_FS_URI_CHK, GNUNET_FS_uri_chk_get_file_size(), GNUNET_FS_URI_LOC, GNUNET_log, GNUNET_TIME_relative_saturating_multiply(), GNUNET_FS_SearchResult::h, GNUNET_FS_SearchResult::meta, GNUNET_FS_SearchResult::probe_ctx, GNUNET_FS_SearchResult::remaining_probe_time, start_probe_ping_task(), GNUNET_FS_Uri::type, and GNUNET_FS_SearchResult::uri.
Referenced by GNUNET_FS_probe(), process_ksk_result(), process_sks_result(), search_result_resume_probes(), signal_probe_result(), and signal_result_resume().
void GNUNET_FS_remove_sync_file_ | ( | struct GNUNET_FS_Handle * | h, |
const char * | ext, | ||
const char * | ent | ||
) |
Remove serialization/deserialization file from disk.
h | master context |
ext | component of the path |
ent | entity identifier |
Definition at line 728 of file fs_api.c.
References filename, get_serialization_file_name(), GNUNET_break, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log_strerror_file, and h.
Referenced by deserialize_search_file(), deserialize_unindex_file(), fip_signal_stop(), free_search_context(), GNUNET_FS_download_stop(), GNUNET_FS_publish_stop(), GNUNET_FS_publish_sync_(), GNUNET_FS_search_stop(), GNUNET_FS_search_sync_(), GNUNET_FS_unindex_stop(), GNUNET_FS_unindex_sync_(), and search_result_stop().
void GNUNET_FS_remove_sync_dir_ | ( | struct GNUNET_FS_Handle * | h, |
const char * | ext, | ||
const char * | uni | ||
) |
Remove serialization/deserialization directory from disk.
h | master context |
ext | component of the path |
uni | unique name of parent |
Definition at line 787 of file fs_api.c.
References get_serialization_file_name_in_dir(), GNUNET_DISK_directory_remove(), GNUNET_DISK_directory_test(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log_strerror_file, GNUNET_OK, GNUNET_YES, and h.
Referenced by free_search_context(), GNUNET_FS_download_stop(), and GNUNET_FS_search_stop().
void GNUNET_FS_file_information_sync_ | ( | struct GNUNET_FS_FileInformation * | fi | ) |
Synchronize this file-information struct with its mirror on disk.
Note that all internal FS-operations that change file information data should already call "sync" internally, so this function is likely not useful for clients.
fi | the struct to sync |
Synchronize this file-information struct with its mirror on disk.
fi | file information to sync with disk |
Definition at line 1328 of file fs_api.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_FS_BlockOptions::anonymity_level, GNUNET_FS_FileInformation::bo, GNUNET_FS_FileInformation::chk_uri, cleanup(), GNUNET_FS_BlockOptions::content_priority, GNUNET_FS_FileInformation::contents_completed, GNUNET_FS_FileInformation::contents_size, copy_from_reader(), GNUNET_FS_FileInformation::data, GNUNET_FS_FileInformation::dir, GNUNET_FS_FileInformation::dir_data, GNUNET_FS_FileInformation::dir_size, GNUNET_FS_FileInformation::do_index, GNUNET_FS_FileInformation::emsg, GNUNET_FS_FileInformation::entries, GNUNET_FS_BlockOptions::expiration_time, GNUNET_FS_FileInformation::file, GNUNET_FS_FileInformation::file_id, GNUNET_FS_FileInformation::file_size, GNUNET_FS_FileInformation::filename, get_serialization_file_name(), get_write_handle(), GNUNET_assert, GNUNET_BIO_write(), GNUNET_BIO_write_close(), GNUNET_BIO_write_int64(), GNUNET_BIO_write_spec_commit(), GNUNET_BIO_write_spec_end, GNUNET_BIO_write_spec_int32(), GNUNET_BIO_write_spec_int64(), GNUNET_BIO_write_spec_object(), GNUNET_BIO_write_spec_string(), GNUNET_BIO_write_string(), GNUNET_break, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_FS_file_information_sync_(), GNUNET_FS_SYNC_PATH_FILE_INFO, GNUNET_FS_uri_to_string(), GNUNET_FS_write_spec_meta_data(), GNUNET_log_strerror_file, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_FS_FileInformation::h, GNUNET_FS_FileInformation::have_hash, GNUNET_FS_FileInformation::index_start_confirmed, GNUNET_FS_FileInformation::is_directory, GNUNET_FS_FileInformation::is_published, GNUNET_FS_FileInformation::keywords, make_serialization_file_name(), GNUNET_FS_FileInformation::meta, GNUNET_FS_FileInformation::next, GNUNET_FS_BlockOptions::replication_level, GNUNET_FS_FileInformation::serialization, GNUNET_FS_FileInformation::sks_uri, GNUNET_FS_FileInformation::start_time, GNUNET_BIO_WriteSpec::wh, and write_start_time().
Referenced by encode_cont(), fip_signal_start(), GNUNET_FS_file_information_sync_(), GNUNET_FS_publish_main_(), handle_index_start_failed(), handle_index_start_ok(), handle_signature_response(), hash_for_index_cb(), index_mq_error_handler(), publish_content(), and publish_kblocks_cont().
void GNUNET_FS_publish_sync_ | ( | struct GNUNET_FS_PublishContext * | pc | ) |
Synchronize this publishing struct with its mirror on disk.
Note that all internal FS-operations that change publishing structs should already call "sync" internally, so this function is likely not useful for clients.
pc | the struct to sync |
Definition at line 1753 of file fs_api.c.
References GNUNET_FS_PublishContext::all_done, cleanup(), GNUNET_FS_PublishContext::fi, GNUNET_FS_PublishContext::fi_pos, get_write_handle(), GNUNET_BIO_read_spec_end, GNUNET_BIO_write(), GNUNET_BIO_write_close(), GNUNET_BIO_write_spec_commit(), GNUNET_BIO_write_spec_int32(), GNUNET_BIO_write_spec_string(), GNUNET_break, GNUNET_free, GNUNET_FS_remove_sync_file_(), GNUNET_FS_SYNC_PATH_MASTER_PUBLISH, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_FS_PublishContext::h, make_serialization_file_name(), GNUNET_FS_PublishContext::nid, GNUNET_FS_PublishContext::ns, GNUNET_FS_PublishContext::nuid, GNUNET_FS_PublishContext::options, pc, GNUNET_FS_FileInformation::serialization, GNUNET_FS_PublishContext::serialization, and GNUNET_BIO_WriteSpec::wh.
Referenced by finish_release_reserve(), GNUNET_FS_publish_main_(), GNUNET_FS_publish_start(), handle_index_start_failed(), handle_signature_response(), publish_kblocks_cont(), and publish_sblocks_cont().
void GNUNET_FS_unindex_sync_ | ( | struct GNUNET_FS_UnindexContext * | uc | ) |
Synchronize this unindex struct with its mirror on disk.
Note that all internal FS-operations that change publishing structs should already call "sync" internally, so this function is likely not useful for clients.
uc | the struct to sync |
Definition at line 1831 of file fs_api.c.
References GNUNET_FS_UnindexContext::chk, cleanup(), GNUNET_FS_UnindexContext::emsg, GNUNET_FS_UnindexContext::file_id, GNUNET_FS_UnindexContext::file_size, GNUNET_FS_UnindexContext::filename, get_write_handle(), GNUNET_BIO_write(), GNUNET_BIO_write_close(), GNUNET_BIO_write_spec_commit(), GNUNET_BIO_write_spec_end, GNUNET_BIO_write_spec_int32(), GNUNET_BIO_write_spec_int64(), GNUNET_BIO_write_spec_object(), GNUNET_BIO_write_spec_string(), GNUNET_BIO_write_string(), GNUNET_break, GNUNET_free, GNUNET_FS_remove_sync_file_(), GNUNET_FS_SYNC_PATH_MASTER_UNINDEX, GNUNET_FS_uri_to_string(), GNUNET_OK, GNUNET_FS_UnindexContext::h, GNUNET_FS_UnindexContext::ksk_offset, GNUNET_FS_UnindexContext::ksk_uri, make_serialization_file_name(), GNUNET_FS_UnindexContext::serialization, GNUNET_FS_UnindexContext::start_time, GNUNET_FS_UnindexContext::state, uc, UNINDEX_STATE_ERROR, UNINDEX_STATE_FS_NOTIFY, GNUNET_BIO_WriteSpec::wh, and write_start_time().
Referenced by GNUNET_FS_unindex_do_remove_(), GNUNET_FS_unindex_do_remove_kblocks_(), GNUNET_FS_unindex_process_hash_(), GNUNET_FS_unindex_start(), handle_unindex_response(), unindex_directory_scan_cb(), unindex_extract_keywords(), unindex_finish(), and unindex_mq_error_handler().
void GNUNET_FS_search_sync_ | ( | struct GNUNET_FS_SearchContext * | sc | ) |
Synchronize this search struct with its mirror on disk.
Note that all internal FS-operations that change publishing structs should already call "sync" internally, so this function is likely not useful for clients.
sc | the struct to sync |
Definition at line 2266 of file fs_api.c.
References GNUNET_FS_SearchContext::anonymity, cleanup(), GNUNET_FS_SearchContext::emsg, get_write_handle(), GNUNET_assert, GNUNET_BIO_write(), GNUNET_BIO_write_close(), GNUNET_BIO_write_int32(), GNUNET_BIO_write_string(), GNUNET_break, GNUNET_free, GNUNET_FS_remove_sync_file_(), GNUNET_FS_SYNC_PATH_CHILD_SEARCH, GNUNET_FS_SYNC_PATH_MASTER_SEARCH, GNUNET_FS_uri_test_ksk(), GNUNET_FS_uri_test_sks(), GNUNET_FS_uri_to_string(), GNUNET_OK, GNUNET_YES, GNUNET_FS_SearchContext::h, make_serialization_file_name(), GNUNET_FS_SearchContext::options, GNUNET_FS_SearchContext::psearch_result, sc, GNUNET_FS_SearchContext::serialization, GNUNET_FS_SearchContext::start_time, GNUNET_FS_SearchContext::task, GNUNET_FS_SearchContext::uri, and write_start_time().
Referenced by GNUNET_FS_search_continue(), GNUNET_FS_search_pause(), and search_start().
void GNUNET_FS_search_result_sync_ | ( | struct GNUNET_FS_SearchResult * | sr | ) |
Synchronize this search result with its mirror on disk.
Note that all internal FS-operations that change publishing structs should already call "sync" internally, so this function is likely not useful for clients.
sr | the struct to sync |
Definition at line 2165 of file fs_api.c.
References GNUNET_FS_SearchResult::availability_success, GNUNET_FS_SearchResult::availability_trials, cleanup(), GNUNET_FS_Uri::data, GNUNET_FS_SearchResult::download, get_write_handle_in_dir(), GNUNET_BIO_write(), GNUNET_BIO_write_close(), GNUNET_BIO_write_spec_commit(), GNUNET_BIO_write_spec_end, GNUNET_BIO_write_spec_int32(), GNUNET_BIO_write_spec_object(), GNUNET_BIO_write_spec_string(), GNUNET_break, GNUNET_free, GNUNET_FS_SYNC_PATH_CHILD_SEARCH, GNUNET_FS_SYNC_PATH_MASTER_SEARCH, GNUNET_FS_URI_KSK, GNUNET_FS_uri_to_string(), GNUNET_FS_write_spec_meta_data(), GNUNET_OK, GNUNET_FS_SearchResult::h, GNUNET_FS_SearchResult::key, GNUNET_FS_SearchResult::keyword_bitmap, GNUNET_FS_Uri::keywordCount, GNUNET_FS_Uri::ksk, make_serialization_file_name_in_dir(), GNUNET_FS_SearchResult::mandatory_missing, GNUNET_FS_SearchResult::meta, GNUNET_FS_SearchResult::optional_support, GNUNET_FS_SearchContext::psearch_result, remove_sync_file_in_dir(), GNUNET_FS_SearchResult::sc, GNUNET_FS_SearchResult::serialization, GNUNET_FS_SearchContext::serialization, GNUNET_FS_DownloadContext::serialization, GNUNET_FS_Uri::type, GNUNET_FS_SearchResult::update_search, GNUNET_FS_SearchResult::uri, GNUNET_FS_SearchContext::uri, and GNUNET_BIO_WriteSpec::wh.
Referenced by GNUNET_FS_download_start_task_(), GNUNET_FS_download_stop(), GNUNET_FS_search_probe_progress_(), probe_failure_handler(), probe_success_handler(), process_ksk_result(), and process_sks_result().
void GNUNET_FS_download_sync_ | ( | struct GNUNET_FS_DownloadContext * | dc | ) |
Synchronize this download struct with its mirror on disk.
Note that all internal FS-operations that change publishing structs should already call "sync" internally, so this function is likely not useful for clients.
dc | the struct to sync |
Definition at line 2049 of file fs_api.c.
References GNUNET_FS_DownloadContext::anonymity, cleanup(), GNUNET_FS_DownloadContext::completed, dc, dir, GNUNET_FS_DownloadContext::emsg, GNUNET_FS_DownloadContext::filename, get_download_sync_filename(), get_serialization_short_name(), GNUNET_assert, GNUNET_BIO_write_close(), GNUNET_BIO_write_open_file(), GNUNET_BIO_write_spec_commit(), GNUNET_BIO_write_spec_end, GNUNET_BIO_write_spec_int32(), GNUNET_BIO_write_spec_int64(), GNUNET_BIO_write_spec_string(), GNUNET_break, GNUNET_DISK_directory_create_for_file(), GNUNET_DISK_mktemp(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_FS_DOWNLOAD_IS_PROBE, GNUNET_FS_uri_test_chk(), GNUNET_FS_uri_test_loc(), GNUNET_FS_uri_to_string(), GNUNET_FS_write_spec_meta_data(), GNUNET_log_strerror_file, GNUNET_OK, GNUNET_YES, GNUNET_FS_DownloadContext::has_finished, GNUNET_FS_DownloadContext::length, GNUNET_FS_DownloadContext::meta, GNUNET_FS_DownloadContext::offset, GNUNET_FS_DownloadContext::old_file_size, GNUNET_FS_DownloadContext::options, GNUNET_FS_DownloadContext::serialization, GNUNET_FS_DownloadContext::start_time, GNUNET_FS_DownloadContext::temp_filename, GNUNET_FS_DownloadContext::top_request, GNUNET_FS_DownloadContext::uri, GNUNET_BIO_WriteSpec::wh, write_download_request(), and write_start_time().
Referenced by check_completed(), GNUNET_FS_download_start_task_(), process_result_with_request(), search_result_stop(), and try_match_block().
void GNUNET_FS_publish_signal_suspend_ | ( | void * | cls | ) |
Create SUSPEND event for the given publish operation and then clean up our state (without stop signal).
cls | the struct GNUNET_FS_PublishContext to signal for |
Definition at line 1355 of file fs_publish.c.
References GNUNET_FS_PublishContext::fi, fip_signal_suspend(), GNUNET_FS_end_top(), GNUNET_FS_file_information_inspect(), GNUNET_SCHEDULER_cancel(), GNUNET_YES, GNUNET_FS_PublishContext::h, pc, publish_cleanup(), GNUNET_FS_PublishContext::skip_next_fi_callback, suspend_operation(), GNUNET_FS_PublishContext::top, and GNUNET_FS_PublishContext::upload_task.
Referenced by deserialize_publish_file(), and GNUNET_FS_publish_start().
void GNUNET_FS_search_signal_suspend_ | ( | void * | cls | ) |
Create SUSPEND event for the given search operation and then clean up our state (without stop signal).
cls | the 'struct GNUNET_FS_SearchContext' to signal for |
Definition at line 1555 of file fs_search.c.
References GNUNET_FS_SearchContext::client_info, GNUNET_FS_Uri::data, GNUNET_FS_SearchContext::emsg, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_free, GNUNET_FS_end_top(), GNUNET_FS_search_make_status_(), GNUNET_FS_STATUS_SEARCH_SUSPEND, GNUNET_FS_uri_destroy(), GNUNET_FS_uri_test_ksk(), GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), GNUNET_FS_SearchContext::h, SearchRequestEntry::keyword, GNUNET_FS_Uri::keywordCount, GNUNET_FS_Uri::ksk, GNUNET_FS_SearchContext::master_result_map, GNUNET_FS_SearchContext::mq, GNUNET_FS_SearchContext::requests, SearchRequestEntry::results, sc, search_result_suspend(), GNUNET_FS_SearchContext::serialization, GNUNET_FS_ProgressInfo::status, GNUNET_FS_SearchContext::task, GNUNET_FS_SearchContext::top, and GNUNET_FS_SearchContext::uri.
Referenced by deserialize_search_file(), GNUNET_FS_search_start(), and search_result_suspend().
void GNUNET_FS_download_signal_suspend_ | ( | void * | cls | ) |
Create SUSPEND event for the given download operation and then clean up our state (without stop signal).
cls | the struct GNUNET_FS_DownloadContext to signal for |
Definition at line 1952 of file fs_download.c.
References GNUNET_FS_DownloadContext::active, GNUNET_FS_DownloadContext::child_head, GNUNET_FS_DownloadContext::child_tail, dc, GNUNET_FS_SearchResult::download, GNUNET_FS_DownloadContext::filename, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_DISK_file_close(), GNUNET_free, GNUNET_FS_dequeue_(), GNUNET_FS_download_make_status_(), GNUNET_FS_download_signal_suspend_(), GNUNET_FS_end_top(), GNUNET_FS_free_download_request_(), GNUNET_FS_meta_data_destroy(), GNUNET_FS_STATUS_DOWNLOAD_SUSPEND, GNUNET_FS_tree_encoder_finish(), GNUNET_FS_uri_destroy(), GNUNET_SCHEDULER_cancel(), GNUNET_FS_DownloadContext::h, GNUNET_FS_DownloadContext::job_queue, GNUNET_FS_DownloadContext::meta, GNUNET_FS_DownloadContext::parent, GNUNET_FS_DownloadContext::rfh, GNUNET_FS_DownloadContext::search, GNUNET_FS_DownloadContext::serialization, GNUNET_FS_ProgressInfo::status, GNUNET_FS_DownloadContext::task, GNUNET_FS_DownloadContext::te, GNUNET_FS_DownloadContext::temp_filename, GNUNET_FS_DownloadContext::top, GNUNET_FS_DownloadContext::top_request, and GNUNET_FS_DownloadContext::uri.
Referenced by deserialize_download(), GNUNET_FS_download_signal_suspend_(), GNUNET_FS_download_start(), search_result_stop(), and search_result_suspend().
void GNUNET_FS_unindex_signal_suspend_ | ( | void * | cls | ) |
Create SUSPEND event for the given unindex operation and then clean up our state (without stop signal).
cls | the struct GNUNET_FS_UnindexContext to signal for |
Definition at line 728 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_STATUS_UNINDEX_SUSPEND, GNUNET_FS_tree_encoder_finish(), GNUNET_FS_unindex_make_status_(), GNUNET_FS_uri_destroy(), GNUNET_MQ_destroy(), GNUNET_NO, 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, uc, and UNINDEX_STATE_COMPLETE.
Referenced by deserialize_unindex_file(), and GNUNET_FS_unindex_start().
struct TopLevelActivity * GNUNET_FS_make_top | ( | struct GNUNET_FS_Handle * | h, |
SuspendSignalFunction | ssf, | ||
void * | ssf_cls | ||
) |
Create a top-level activity entry.
h | global fs handle |
ssf | suspend signal function to use |
ssf_cls | closure for ssf |
Definition at line 381 of file fs_api.c.
References GNUNET_CONTAINER_DLL_insert, GNUNET_new, h, ret, TopLevelActivity::ssf, and TopLevelActivity::ssf_cls.
Referenced by deserialize_download(), deserialize_publish_file(), deserialize_search_file(), deserialize_unindex_file(), GNUNET_FS_download_start(), GNUNET_FS_publish_start(), GNUNET_FS_search_start(), GNUNET_FS_unindex_start(), and search_result_stop().
void GNUNET_FS_end_top | ( | struct GNUNET_FS_Handle * | h, |
struct TopLevelActivity * | top | ||
) |
Destroy a top-level activity entry.
h | global fs handle |
top | top level activity entry |
Definition at line 402 of file fs_api.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, and h.
Referenced by GNUNET_FS_download_signal_suspend_(), GNUNET_FS_download_stop(), GNUNET_FS_publish_signal_suspend_(), GNUNET_FS_publish_stop(), GNUNET_FS_search_signal_suspend_(), GNUNET_FS_search_stop(), GNUNET_FS_unindex_signal_suspend_(), and GNUNET_FS_unindex_stop().
void GNUNET_FS_free_download_request_ | ( | struct DownloadRequest * | dr | ) |
(recursively) free download request structure
dr | request to free |
Definition at line 997 of file fs_download.c.
References DownloadRequest::children, GNUNET_free, GNUNET_FS_free_download_request_(), and DownloadRequest::num_children.
Referenced by free_download_context(), GNUNET_FS_download_signal_suspend_(), GNUNET_FS_download_stop(), GNUNET_FS_free_download_request_(), process_result_with_request(), and read_download_request().
void GNUNET_FS_stop_probe_ping_task_ | ( | struct GNUNET_FS_SearchResult * | sr | ) |
Stop the ping task for this search result.
sr | result to start pinging for. |
Definition at line 410 of file fs_search.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_SCHEDULER_cancel(), h, and GNUNET_FS_SearchResult::h.
Referenced by GNUNET_FS_download_start_from_search(), GNUNET_FS_search_stop_probe_(), probe_failure_handler(), probe_success_handler(), and search_result_freeze_probes().