56 pi->
value.
publish.pctx = (NULL ==
p->dir) ? NULL :
p->dir->client_info;
60 p->data.file.file_size;
82 "Cleaning up publish context (done!)\n");
129 _ (
"Publishing failed: %s"),
176 p->data.file.file_size);
202 (NULL !=
p->filename) &&
231 "Releasing reserve done!\n");
324 "Error uploading KSK blocks: %s\n",
338 "KSK blocks published, moving on to next file\n");
383 dd =
p->data.dir.dir_data;
388 if (UINT64_MAX == offset)
393 p->data.file.reader (
p->data.file.reader_cls, offset, 0, NULL, NULL);
402 p->data.file.reader (
p->data.file.reader_cls, offset, pt_size, buf,
427 "Finished with tree encoder\n");
436 "Error during tree walk: %s\n",
439 _ (
"Publishing failed: %s"),
498 "Waiting for datastore connection\n");
511 "Indexing block `%s' for offset %llu with index size %u\n",
513 (
unsigned long long)
offset,
525 p->bo.content_priority,
526 p->bo.anonymity_level,
527 p->bo.replication_level,
528 p->bo.expiration_time,
534 "Publishing block `%s' for offset %llu with size %u\n",
536 (
unsigned long long)
offset,
537 (
unsigned int) block_size);
546 p->bo.content_priority,
547 p->bo.anonymity_level,
548 p->bo.replication_level,
549 p->bo.expiration_time,
568 const void *pt_block,
587 while (NULL != (par =
p->dir))
591 p->data.dir.contents_completed += pt_size;
593 pi.
value.
publish.specifics.progress_directory.completed =
594 p->data.dir.contents_completed;
596 p->data.dir.contents_size;
600 ->data.dir.contents_completed,
602 ->data.dir.contents_size);
633 dirpos =
p->data.dir.entries;
634 while (NULL != dirpos)
665 dirpos = dirpos->
next;
668 p->data.dir.dir_data = NULL;
669 p->data.dir.dir_size = 0;
671 &
p->data.dir.dir_data);
675 p->data.file.file_size;
677 "Creating tree encoder\n");
684 "Processing next block from tree\n");
700 size_t msize = ntohs (
msg->
size) -
sizeof(*msg);
701 const char *
emsg = (
const char *) &
msg[1];
703 if (
emsg[msize - 1] !=
'\0')
725 const char *
emsg = (
const char *) &
msg[1];
732 _ (
"Can not index file `%s': %s.\n"),
789 _ (
"Can not index file `%s': %s. Will try to insert instead.\n"),
791 _ (
"error on index-start request to `fs' service"));
835 "Can not index file `%s': %s. Will try to insert instead.\n"),
837 _ (
"failed to compute hash"));
843 if (
GNUNET_YES ==
p->data.file.index_start_confirmed)
850 slen = strlen (fn) + 1;
856 (
"Can not index file `%s': %s. Will try to insert instead.\n"),
857 fn,
_ (
"filename too long"));
865 "Hash of indexed file `%s' is `%s'\n",
870 p->data.file.file_id = *
res;
887 "Can not index file `%s': %s. Will try to insert instead.\n"),
889 _ (
"could not connect to `fs' service"));
897 p->data.file.file_id = *
res;
915 _ (
"Failed to get file identifiers for `%s'\n"),
940 if (NULL !=
p->keywords)
974 p->chk_uri->data.loc.peer = sig->
peer;
975 p->chk_uri->data.loc.expirationTime
977 p->chk_uri->data.loc.contentSignature = sig->
signature;
1004 _ (
"Can not create LOC URI. Will continue with CHK instead.\n"));
1041 "Can not create LOC URI. Will continue with CHK instead.\n"));
1050 req->
chk =
p->chk_uri->data.chk.chk;
1075 "Publishing complete, now publishing SKS and KSK blocks.\n");
1084 (NULL !=
p->data.dir.entries) &&
1085 (NULL ==
p->emsg) &&
1086 (NULL ==
p->data.dir.entries->chk_uri))
1088 p =
p->data.dir.entries;
1093 if (NULL !=
p->emsg)
1096 "Error uploading: %s\n",
1100 while (NULL !=
p->dir)
1108 _ (
"Recursive upload failed at `%s': %s"),
1116 _ (
"Recursive upload failed: %s"),
1129 if (NULL !=
p->chk_uri)
1132 "File upload complete, now publishing KSK blocks.\n");
1135 if ((0 ==
p->bo.anonymity_level) &&
1148 if ((
GNUNET_YES !=
p->is_directory) && (
p->data.file.do_index))
1150 if (NULL ==
p->filename)
1155 "Can not index file `%s': %s. Will try to insert instead.\n"),
1157 _ (
"needs to be an actual file"));
1162 if (
p->data.file.have_hash)
1214 "Starting publish operation\n");
1284 "Suspending publish operation\n");
1291 if (NULL !=
pc->
qre)
1296 if (NULL !=
pc->
dsh)
1343 *client_info = NULL;
1392 "Reservation complete (%d)!\n",
1394 if ((
msg != NULL) || (success <= 0))
1397 _ (
"Datastore failure: %s"),
1484 if (NULL !=
ret->dsh)
1489 "Reserving space for %u entries and %llu bytes for publication\n"),
1490 (
unsigned int)
ret->reserve_entries,
1491 (
unsigned long long)
ret->reserve_space);
1494 ret->reserve_entries,
1530 int *do_index,
void **client_info)
1554 off = (
fi->
chk_uri == NULL) ? 0 : length;
1557 *client_info = NULL;
1577 "Publish stop called\n");
1614 if (NULL !=
pc->
qre)
struct GNUNET_GETOPT_CommandLineOption options[]
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
#define HASHING_BLOCKSIZE
Blocksize to use when hashing files for indexing (blocksize for IO, not for the DBlocks).
#define DBLOCK_SIZE
Size of the individual blocks used for file-sharing.
void GNUNET_FS_remove_sync_file_(struct GNUNET_FS_Handle *h, const char *ext, const char *ent)
Remove serialization/deserialization file from disk.
struct TopLevelActivity * GNUNET_FS_make_top(struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, void *ssf_cls)
Create a top-level activity entry.
void GNUNET_FS_file_information_sync_(struct GNUNET_FS_FileInformation *fi)
Create a temporary file on disk to store the current state of fi in.
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.
void GNUNET_FS_end_top(struct GNUNET_FS_Handle *h, struct TopLevelActivity *top)
Destroy a top-level activity entry.
void GNUNET_FS_publish_sync_(struct GNUNET_FS_PublishContext *pc)
Synchronize this publishing struct with its mirror on disk.
shared definitions for the FS library
#define MAX_INLINE_SIZE
Maximum size for a file to be considered for inlining in a directory.
@ GNUNET_FS_URI_LOC
Location (chk with identity of hosting peer).
#define GNUNET_FS_SYNC_PATH_MASTER_PUBLISH
Name of the directory with publishing operations.
#define GNUNET_FS_SYNC_PATH_FILE_INFO
Name of the directory with files that are being published.
static int check_index_start_failed(void *cls, const struct GNUNET_MessageHeader *msg)
Check the response from the "fs" service to our 'start index' request.
static int fip_signal_suspend(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)
Signal the FS's progress function that we are suspending an upload.
static int fip_signal_stop(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)
Signal the FS's progress function that we are stopping an upload.
static void encode_cont(void *cls)
The tree encoder has finished processing a file.
static void progress_proc(void *cls, uint64_t offset, const void *pt_block, size_t pt_size, unsigned int depth)
Function called with information about our progress in computing the tree encoding.
static void handle_index_start_ok(void *cls, const struct GNUNET_MessageHeader *msg)
Process the response from the "fs" service to our 'start index' request.
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...
static void handle_index_start_failed(void *cls, const struct GNUNET_MessageHeader *msg)
Process the response from the "fs" service to our 'start index' request.
static void publish_cleanup(struct GNUNET_FS_PublishContext *pc)
Cleanup the publish context, we're done with it.
static size_t block_reader(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function called by the tree encoder to obtain a block of plaintext data (for the lowest level of the ...
static void publish_content(struct GNUNET_FS_PublishContext *pc)
We are uploading a file or directory; load (if necessary) the next block into memory,...
static void finish_release_reserve(void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
Datastore returns from reservation cancel request.
static void publish_kblocks_cont(void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
We've finished publishing a KBlock as part of a larger upload.
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.
static void index_mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static void signal_publish_error(struct GNUNET_FS_FileInformation *p, struct GNUNET_FS_PublishContext *pc, const char *emsg)
Generate the callback that signals clients that a file (or directory) has encountered a problem durin...
static void create_loc_uri(struct GNUNET_FS_PublishContext *pc)
We're publishing without anonymity.
static void publish_sblocks_cont(void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
We've finished publishing the SBlock as part of a larger upload.
static void publish_sblock(struct GNUNET_FS_PublishContext *pc)
We are almost done publishing the structure, add SBlocks (if needed).
static void publish_kblocks(struct GNUNET_FS_PublishContext *pc)
We've computed the CHK/LOC URI, now publish the KSKs (if applicable).
static void ds_put_cont(void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
Function called by the datastore API with the result from the PUT request.
static void handle_signature_response(void *cls, const struct ResponseLocSignatureMessage *sig)
Process the response from the "fs" service to our LOC sign request.
static void hash_for_index_cb(void *cls, const struct GNUNET_HashCode *res)
Function called once the hash computation over an indexed file has completed.
static void block_proc(void *cls, const struct ContentHashKey *chk, uint64_t offset, unsigned int depth, enum GNUNET_BLOCK_Type type, const void *block, uint16_t block_size)
Function called asking for the current (encoded) block to be processed.
static int fip_signal_start(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)
Signal the FS's progress function that we are starting an upload.
static uint64_t compute_contents_size(struct GNUNET_FS_FileInformation *fi)
Calculate the total size of all of the files in the directory structure.
static void loc_mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static void suspend_operation(struct GNUNET_FS_FileInformation *fi, struct GNUNET_FS_PublishContext *pc)
Actually signal the FS's progress function that we are suspending an upload.
static void finish_reserve(void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
We have gotten a reply for our space reservation request.
void GNUNET_FS_publish_main_(void *cls)
Main function that performs the upload.
static void signal_publish_completion(struct GNUNET_FS_FileInformation *p, struct GNUNET_FS_PublishContext *pc)
Generate the callback that signals clients that a file (or directory) has been completely published.
void GNUNET_FS_tree_encoder_next(struct GNUNET_FS_TreeEncoder *te)
Encrypt the next block of the file (and call proc and progress accordingly; or of course "cont" if we...
unsigned int GNUNET_FS_compute_depth(uint64_t flen)
Compute the depth of the CHK tree.
void GNUNET_FS_tree_encoder_finish(struct GNUNET_FS_TreeEncoder *te, char **emsg)
Clean up a tree encoder and return information about possible errors.
struct GNUNET_FS_TreeEncoder * GNUNET_FS_tree_encoder_create(struct GNUNET_FS_Handle *h, uint64_t size, void *cls, GNUNET_FS_DataReader reader, GNUNET_FS_TreeBlockProcessor proc, GNUNET_FS_TreeProgressCallback progress, GNUNET_SCHEDULER_TaskCallback cont)
Initialize a tree encoder.
struct GNUNET_FS_Uri * GNUNET_FS_tree_encoder_get_uri(struct GNUNET_FS_TreeEncoder *te)
Get the resulting URI from the encoding.
Merkle-tree-ish-CHK file encoding for GNUnet.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static int ret
Final status code.
static struct GNUNET_NAMECACHE_Handle * ns
Handle to the namecache.
static char * res
Currently read line or NULL on EOF.
static uint32_t type
Type string converted to DNS type value.
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
static struct GNUNET_FS_MetaData * meta
Meta-data provided via command-line option.
static struct GNUNET_FS_BlockOptions bo
Options we set for published blocks.
static struct GNUNET_FS_PublishContext * pc
Handle to FS-publishing operation.
static struct GNUNET_FS_DirectoryBuilder * db
static struct GNUNET_TIME_Absolute min_expiration
Minimum time that content should have to not be discarded instantly (time stamp of any content that w...
static struct GNUNET_DATASTORE_Handle * dsh
Datastore handle.
static struct GNUNET_OS_Process * p
Helper process we started.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
@ GNUNET_BLOCK_TYPE_FS_DBLOCK
Data block (leaf) in the CHK tree.
@ GNUNET_BLOCK_TYPE_FS_ONDEMAND
Type of a block representing a block to be encoded on demand from disk.
API for file sharing via GNUnet.
#define GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT
Signature by which a peer affirms that it is providing a certain bit of content for use in LOCation U...
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_reserve(struct GNUNET_DATASTORE_Handle *h, uint64_t amount, uint32_t entries, GNUNET_DATASTORE_ContinuationWithStatus cont, void *cont_cls)
Reserve space in the datastore.
void GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, int drop)
Disconnect from the datastore service (and free associated resources).
void GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe)
Cancel a datastore operation.
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_put(struct GNUNET_DATASTORE_Handle *h, uint32_t rid, const struct GNUNET_HashCode *key, size_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, unsigned int queue_priority, unsigned int max_queue_size, GNUNET_DATASTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the datastore.
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_release_reserve(struct GNUNET_DATASTORE_Handle *h, uint32_t rid, unsigned int queue_priority, unsigned int max_queue_size, GNUNET_DATASTORE_ContinuationWithStatus cont, void *cont_cls)
Signal that all of the data for which a reservation was made has been stored and that whatever excess...
struct GNUNET_DATASTORE_Handle * GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the datastore service.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_get_identifiers(const char *filename, uint64_t *dev, uint64_t *ino)
Obtain some unique identifiers for the given file that can be used to identify it in the local system...
struct GNUNET_FS_Uri * GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri)
Duplicate URI.
#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
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.
int GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld, size_t *rsize, void **rdata)
Finish building the directory.
void GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc)
Abort the KSK publishing operation.
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?
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.
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.
int GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri)
Is this a location URI?
GNUNET_FS_PublishOptions
Options for publishing.
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.
struct GNUNET_FS_DirectoryBuilder * GNUNET_FS_directory_builder_create(const struct GNUNET_FS_MetaData *mdir)
Create a directory builder.
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 direct...
unsigned int GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri)
How many keywords are ANDed in this keyword URI?
void GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc)
Stop an upload.
struct GNUNET_FS_UnindexContext * GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h, const char *filename, void *cctx)
Unindex a file.
void GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi, GNUNET_FS_FileInformationProcessor cleaner, void *cleaner_cls)
Destroy publish-structure.
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.
void GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc)
Abort the SKS publishing operation.
@ GNUNET_FS_STATUS_PUBLISH_STOPPED
Notification that we have stopped the process of uploading a file structure; no further events will b...
@ GNUNET_FS_STATUS_PUBLISH_ERROR
Notification that an error was encountered sharing a file structure.
@ GNUNET_FS_STATUS_PUBLISH_SUSPEND
Notification that we have suspended sharing a file structure.
@ GNUNET_FS_STATUS_PUBLISH_PROGRESS
Notification that we are making progress sharing a file structure.
@ GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY
Notification that we are making progress sharing a directory.
@ GNUNET_FS_STATUS_PUBLISH_START
Notification that we have started to publish a file structure.
@ GNUNET_FS_STATUS_PUBLISH_COMPLETED
Notification that we completed sharing a file structure.
@ GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY
Simulate publishing.
struct GNUNET_CRYPTO_FileHashContext * GNUNET_CRYPTO_hash_file(enum GNUNET_SCHEDULER_Priority priority, const char *filename, size_t blocksize, GNUNET_CRYPTO_HashCompletedCallback callback, void *callback_cls)
Compute the hash of an entire file.
#define GNUNET_log(kind,...)
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
void GNUNET_CRYPTO_hash_file_cancel(struct GNUNET_CRYPTO_FileHashContext *fhc)
Cancel a file hashing operation.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_SCHEDULER_PRIORITY_IDLE
Run when otherwise idle.
@ GNUNET_SCHEDULER_PRIORITY_BACKGROUND
Run as background job (higher than idle, lower than default).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_START
Message sent by fs client to start indexing.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED
Response to a request for start indexing that refuses.
#define GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGN
Message sent by fs client to request LOC signature.
#define GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE
Reply sent by fs service with LOC signature.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK
Affirmative response to a request for start indexing.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
char * GNUNET_STRINGS_filename_expand(const char *fil)
Complete filename (a la shell) from abbrevition.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
#define GNUNET_TIME_UNIT_ZERO_ABS
Absolute time zero.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start, uint64_t finished, uint64_t total)
Calculate the estimate time of arrival/completion for an operation.
static unsigned int size
Size of the "table".
struct GNUNET_HashCode query
Hash of the encrypted content, used for querying.
uint64_t file_length
Total size of the file in bytes.
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration that we are using.
Private ECC key encoded for transmission.
Handle to the datastore service.
Settings for publishing a block (which may of course also apply to an entire directory or file).
Internal state of a directory builder.
Master context for most FS operations.
void * upcb_cls
Closure for upcb.
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Argument given to the progress callback with information about what is going on.
struct GNUNET_FS_ProgressInfo::@21::GNUNET_FS_PublishStatusEvent publish
unsigned int depth
Depth of the given block in the tree; 0 would be the lowest level (DBLOCKs).
struct GNUNET_FS_Handle * fsh
File-sharing handle that generated the event.
enum GNUNET_FS_Status status
Specific status code (determines the event type).
uint64_t offset
At what offset in the file is "data"?
union GNUNET_FS_ProgressInfo::@21 value
Values that depend on the event type.
const struct GNUNET_FS_FileInformation * fi
Information about the file that is being published.
Handle for controlling a publication process.
int skip_next_fi_callback
Flag set to GNUNET_YES if the next callback from GNUNET_FS_file_information_inspect should be skipped...
struct GNUNET_FS_PublishKskContext * ksk_pc
Context for KSK publishing operation that is part of this publishing operation (NULL if not active).
uint32_t reserve_entries
Overall number of entries to reserve for the publish operation.
enum GNUNET_FS_PublishOptions options
Options for publishing.
struct GNUNET_DATASTORE_Handle * dsh
Connection to the datastore service.
struct GNUNET_CRYPTO_FileHashContext * fhc
Non-null if we are currently hashing a file.
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
struct GNUNET_FS_FileInformation * fi_pos
Current position in the file-tree for the upload.
char * nuid
ID for future updates, NULL if we have no namespace or no updates.
int any_done
Set to GNUNET_YES if we were able to publish any block.
int all_done
Set to GNUNET_YES if all processing has completed.
struct GNUNET_DATASTORE_QueueEntry * qre
Queue entry for reservation/unreservation.
struct GNUNET_FS_FileInformation * fi
File-structure that is being shared.
struct GNUNET_MQ_Handle * mq
Our own message queue for the FS service; only briefly used when we start to index a file,...
uint64_t reserve_space
Storage space to reserve for the operation.
char * nid
ID of the content in the namespace, NULL if we have no namespace.
struct GNUNET_FS_Handle * h
Handle to the global fs context.
struct GNUNET_CRYPTO_EcdsaPrivateKey * ns
Namespace that we are publishing in, NULL if we have no namespace.
struct GNUNET_SCHEDULER_Task * upload_task
ID of the task performing the upload.
int rid
Space reservation ID with datastore service for this upload.
struct GNUNET_FS_PublishSksContext * sks_pc
Context for SKS publishing operation that is part of this publishing operation (NULL if not active).
char * serialization
Filename used for serializing information about this operation (should be determined using 'mktemp').
A Universal Resource Identifier (URI), opaque.
union GNUNET_FS_Uri::@49 data
struct FileIdentifier chk
Information needed to retrieve a file (content-hash-key plus file size).
Message handler for a specific message type.
Time for absolute times used by GNUnet, in microseconds.
Message sent from a GNUnet (fs) publishing activity to the gnunet-fs-service to initiate indexing of ...
uint64_t inode
Inode of the file on the given device, as seen by the client ("st_ino" field from "struct stat").
struct GNUNET_HashCode file_id
Hash of the file that we would like to index.
uint64_t device
ID of device containing the file, as seen by the client.
index block (indexing a DBlock that can be obtained directly from reading the plaintext file)
uint64_t offset
At which offset should we be able to find this on-demand encoded block? (in NBO)
struct GNUNET_HashCode file_id
Hash code of the entire content of the file that was indexed (used to uniquely identify the plaintext...
Message sent from a GNUnet (fs) publishing activity to sign a LOC URI.
uint64_t file_length
Size of the shared file (to be signed).
uint32_t purpose
Requested signature purpose.
struct GNUNET_TIME_AbsoluteNBO expiration_time
Requested expiration time.
struct ContentHashKey chk
Information about the shared file (to be signed).
Message sent from the service with the signed LOC URI.
struct GNUNET_CRYPTO_EddsaSignature signature
The requested signature.
struct GNUNET_PeerIdentity peer
Identity of the peer sharing the file.
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time that was actually used (rounded!).