37#define AVAILABILITY_TRIALS_MAX 8
68 ret =
h->upcb (
h->upcb_cls, pi);
136 pi.
value.
search.specifics.update.availability_rank =
138 pi.
value.
search.specifics.update.availability_certainty =
141 pi.
value.
search.specifics.update.current_probe_time
206 pi.
value.
search.specifics.update.availability_certainty
209 pi.
value.
search.specifics.update.current_probe_time
233 "Probe #%u for search result %p failed\n",
258 "Probe #%u for search result %p succeeded\n",
287 switch (
info->status)
375 if (NULL != sr->probe_ctx->mq)
397 if (NULL ==
h->probe_ping_task)
417 if (NULL ==
h->probes_head)
420 h->probe_ping_task = NULL;
461 "Starting probe #%u (at offset %llu) for search result %p\n",
463 (
unsigned long long) off,
687 const char *id_update,
729 if (0 == strlen (id_update))
766 if (0 == memcmp (dpub,
816 eos = memchr (&pt[1],
'\0',
sizeof(pt) - 1);
830 _ (
"Failed to parse URI `%s': %s\n"),
901 _ (
"Failed to parse URI `%s': %s\n"),
953 uint16_t msize = ntohs (cm->
header.
size) -
sizeof(*cm);
960 "Result received has already expired.\n");
968 (
const struct UBlock *) &cm[1],
972 (
const struct UBlock *) &cm[1],
994 _ (
"Got result with unknown block type `%d', ignoring"),
1120 unsigned int total_seen_results;
1125 unsigned int search_request_map_offset;
1126 unsigned int keyword_offset;
1129 memset (&mbc, 0,
sizeof(mbc));
1139 total_seen_results = mbc.
put_cnt;
1146 search_request_map_offset = 0;
1149 while ((0 != (left =
1150 (total_seen_results - search_request_map_offset))) ||
1165 mbc.
skip_cnt = search_request_map_offset;
1183 search_request_map_offset += todo;
1185 GNUNET_assert (total_seen_results >= search_request_map_offset);
1186 if (total_seen_results != search_request_map_offset)
1199 search_request_map_offset = 0;
1205 total_seen_results = mbc.
put_cnt;
1225 GNUNET_assert (total_seen_results >= search_request_map_offset);
1226 if (total_seen_results != search_request_map_offset)
1350 if (NULL != psearch)
1405 const char *keyword;
1771 if (NULL !=
sc->
top)
struct GNUNET_GETOPT_CommandLineOption options[]
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MQ_Envelope * env
#define SEARCH_MESSAGE_OPTION_NONE
No options.
#define SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY
Only search the local datastore (no network)
#define DBLOCK_SIZE
Size of the individual blocks used for file-sharing.
#define SEARCH_MESSAGE_OPTION_CONTINUED
Request is too large to fit in 64k format.
void GNUNET_FS_search_result_sync_(struct GNUNET_FS_SearchResult *sr)
Synchronize this search result with its mirror on disk.
void GNUNET_FS_search_sync_(struct GNUNET_FS_SearchContext *sc)
Synchronize this search struct with its mirror on disk.
void GNUNET_FS_download_sync_(struct GNUNET_FS_DownloadContext *dc)
Synchronize this download struct with its mirror on disk.
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_remove_sync_dir_(struct GNUNET_FS_Handle *h, const char *ext, const char *uni)
Remove serialization/deserialization directory from disk.
void GNUNET_FS_end_top(struct GNUNET_FS_Handle *h, struct TopLevelActivity *top)
Destroy a top-level activity entry.
shared definitions for the FS library
void GNUNET_FS_download_signal_suspend_(void *cls)
Create SUSPEND event for the given download operation and then clean up our state (without stop signa...
@ GNUNET_FS_URI_LOC
Location (chk with identity of hosting peer).
@ GNUNET_FS_URI_CHK
Content-hash-key (simple file).
@ GNUNET_FS_URI_SKS
Signed key space (file in namespace).
#define GNUNET_FS_SYNC_PATH_MASTER_SEARCH
Name of the directory with top-level searches.
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.
#define GNUNET_FS_SYNC_PATH_CHILD_SEARCH
Name of the directory with sub-searches (namespace-updates).
#define GNUNET_FS_SYNC_PATH_CHILD_DOWNLOAD
Name of the directory with downloads that are part of another download or a search.
void GNUNET_FS_ublock_decrypt_(const void *input, size_t input_len, const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, const char *label, void *output)
Decrypt the given UBlock, storing the result in output.
publish a UBLOCK in GNUnet
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.
static void notify_client_chk_update(struct GNUNET_FS_SearchContext *sc, struct GNUNET_FS_SearchResult *sr)
We've found new information about an existing CHK result.
static int search_result_stop(void *cls, const struct GNUNET_HashCode *key, void *value)
Signal stop for the given search result.
static void schedule_transmit_search_request(struct GNUNET_FS_SearchContext *sc)
Schedule the transmission of the (next) search request to the service.
static int update_sre_result_maps(void *cls, const struct GNUNET_HashCode *key, void *value)
Update the 'results' map for the individual keywords with the results from the 'global' result set.
#define AVAILABILITY_TRIALS_MAX
Number of availability trials we perform per search result.
void GNUNET_FS_stop_probe_ping_task_(struct GNUNET_FS_SearchResult *sr)
Stop the ping task for this search result.
static void probe_success_handler(void *cls)
Handle the case where we have gotten a response for our probe.
void * GNUNET_FS_search_probe_progress_(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Notification of FS that a search probe has made progress.
static void start_probe_ping_task(struct GNUNET_FS_SearchResult *sr)
Start the ping task for this search result.
static void probe_ping_task_cb(void *cls)
Task run periodically to remind clients that a probe is active.
static struct GNUNET_FS_SearchContext * search_start(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, uint32_t anonymity, enum GNUNET_FS_SearchOptions options, void *cctx, struct GNUNET_FS_SearchResult *psearch)
Start search for content, internal API.
static void process_kblock(struct GNUNET_FS_SearchContext *sc, const struct UBlock *ub, size_t size)
Process a keyword search result.
static int get_result_present(void *cls, const struct GNUNET_HashCode *key, void *value)
Check if the given result is identical to the given URI and if so return it.
void GNUNET_FS_search_start_probe_(struct GNUNET_FS_SearchResult *sr)
Start download probes for the given search result.
static int check_result(void *cls, const struct ClientPutMessage *cm)
We check a result message from the service.
static void signal_probe_result(struct GNUNET_FS_SearchResult *sr)
Signal result of last probe to client and then schedule next probe.
static void process_sks_result(struct GNUNET_FS_SearchContext *sc, const char *id_update, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_MetaData *meta)
We have received an SKS result.
static int search_result_resume_probes(void *cls, const struct GNUNET_HashCode *key, void *value)
Resume probes for the given search result.
static void do_reconnect(void *cls)
Reconnect to the FS service and transmit our queries NOW.
static int search_result_suspend(void *cls, const struct GNUNET_HashCode *key, void *value)
Signal suspend and free the given search result.
static int build_result_set(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterating over the known results, pick those matching the given result range and store their keys at ...
static int search_result_free(void *cls, const struct GNUNET_HashCode *key, void *value)
Free the given search result.
int GNUNET_FS_search_start_searching_(struct GNUNET_FS_SearchContext *sc)
Build the request and actually initiate the search using the GNUnet FS service.
static int decrypt_block_with_keyword(const struct GNUNET_FS_SearchContext *sc, const struct GNUNET_CRYPTO_EcdsaPublicKey *dpub, const void *edata, size_t edata_size, char *data)
Decrypt a ublock using a 'keyword' as the passphrase.
static void handle_result(void *cls, const struct ClientPutMessage *cm)
We process a search result from the service.
static void probe_failure_handler(void *cls)
Handle the case where we have failed to receive a response for our probe.
static void GNUNET_FS_search_stop_probe_(struct GNUNET_FS_SearchResult *sr)
Stop probing activity associated with a search result.
static int test_result_present(void *cls, const struct GNUNET_HashCode *key, void *value)
Check if the given result is identical to the given URI.
static void notify_client_chk_result(struct GNUNET_FS_SearchContext *sc, struct GNUNET_FS_SearchResult *sr)
We've found a new CHK result.
static void try_reconnect(struct GNUNET_FS_SearchContext *sc)
Shutdown any existing connection to the FS service and try to establish a fresh one (and then re-tran...
static void process_ksk_result(struct GNUNET_FS_SearchContext *sc, struct SearchRequestEntry *ent, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_MetaData *meta)
We have received a KSK result.
static int find_result_set(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterating over the known results, count those matching the given result range and increment put count...
static void search_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 process_sblock(struct GNUNET_FS_SearchContext *sc, const struct UBlock *ub, size_t size)
Process a namespace-search result.
static int search_result_freeze_probes(void *cls, const struct GNUNET_HashCode *key, void *value)
Freeze probes for the given search result.
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)...
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static int ret
Final status code.
static char * data
The data to insert into the dht.
struct GNUNET_HashCode key
The key used in the DHT.
static unsigned int anonymity
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
static char * value
Value of the record to add/remove.
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 int result
Global testing status.
static struct GNUNET_FS_SearchContext * sc
API for file sharing via GNUnet.
Constants for network protocols.
#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.
void GNUNET_CRYPTO_ecdsa_public_key_derive(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EcdsaPublicKey *result)
Derive a public key from a given public key and a label.
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_CRYPTO_ecdsa_key_get_anonymous(void)
Get the shared private key we use for anonymous users.
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Extract the public key for the given private key.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
struct GNUNET_FS_Uri * GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri)
Duplicate URI.
GNUNET_FS_SearchOptions
Options for searching.
#define GNUNET_FS_PROBE_UPDATE_FREQUENCY
How often do we signal applications that a probe for a particular search result is running?...
#define GNUNET_FS_VERSION
Version number of the implementation.
void GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc)
Continue paused search.
void * GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr)
Stop probe activity.
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?
int GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri)
Is this a keyword URI?
int GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1, const struct GNUNET_FS_Uri *u2)
Test if two URIs are equal.
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.
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.
void GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc)
Stop search for content.
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
int GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri)
Is this a namespace URI?
void GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete)
Stop a download (aborts if download is incomplete).
struct GNUNET_FS_Uri * GNUNET_FS_uri_parse(const char *uri, char **emsg)
Convert a UTF-8 String to a URI.
void GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc)
Pause search.
int GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode *key)
Get a unique key from a URI.
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.
@ GNUNET_FS_FLAGS_DO_PROBES
Should we automatically trigger probes for search results to determine availability?...
@ GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY
Only search the local host, do not search remote systems (no P2P)
@ GNUNET_FS_DOWNLOAD_IS_PROBE
Internal option used to flag this download as a 'probe' for a search result.
@ GNUNET_FS_DOWNLOAD_NO_TEMPORARIES
Do not append temporary data to the target file (for the IBlocks).
@ GNUNET_FS_STATUS_SEARCH_UPDATE
We have additional data about the quality or availability of a search result.
@ GNUNET_FS_STATUS_DOWNLOAD_INACTIVE
Notification that this download is no longer actively being pursued (back in the queue).
@ GNUNET_FS_STATUS_DOWNLOAD_ERROR
Notification that this download encountered an error.
@ GNUNET_FS_STATUS_DOWNLOAD_COMPLETED
Notification that this download completed.
@ GNUNET_FS_STATUS_DOWNLOAD_RESUME
Notification that this download is being resumed.
@ GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED
Event generated for each search result when the respective search is stopped.
@ GNUNET_FS_STATUS_SEARCH_SUSPEND
Last event when a search is being suspended; note that "GNUNET_FS_SEARCH_STOPPED" will not be generat...
@ GNUNET_FS_STATUS_DOWNLOAD_SUSPEND
Notification that this download was suspended.
@ GNUNET_FS_STATUS_SEARCH_RESULT
This search has yielded a result.
@ GNUNET_FS_STATUS_SEARCH_CONTINUED
Signals that this search was continued (unpaused).
@ GNUNET_FS_STATUS_DOWNLOAD_START
Notification that we have started this download.
@ GNUNET_FS_STATUS_SEARCH_PAUSED
Signals that this search was paused.
@ GNUNET_FS_STATUS_DOWNLOAD_PROGRESS
Notification about progress with this download.
@ GNUNET_FS_STATUS_DOWNLOAD_LOST_PARENT
Notification that this download is no longer part of a recursive download or search but now a 'stand-...
@ GNUNET_FS_STATUS_SEARCH_START
First event generated when a client requests a search to begin or when a namespace result automatical...
@ GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND
Event generated for each search result when the respective search is suspended.
@ GNUNET_FS_STATUS_DOWNLOAD_ACTIVE
Notification that this download is now actively being pursued (as opposed to waiting in the queue).
@ GNUNET_FS_STATUS_DOWNLOAD_STOPPED
Notification that this download was stopped (final event with respect to this action).
@ GNUNET_FS_STATUS_SEARCH_STOPPED
Last message from a search; this signals that there will be no further events associated with this se...
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
void GNUNET_CRYPTO_hash_xor(const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b, struct GNUNET_HashCode *result)
compute result = a ^ b
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
#define GNUNET_log(kind,...)
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#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.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#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_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
#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_hd_var_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_FS_START_SEARCH
Client asks FS service to start a (keyword) search.
#define GNUNET_MESSAGE_TYPE_FS_PUT
P2P response with content or active migration of content.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
unsigned int GNUNET_STRINGS_buffer_tokenize(const char *buffer, size_t size, unsigned int count,...)
Given a buffer of a given size, find "count" 0-terminated strings in the buffer and assign the count ...
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_Relative GNUNET_TIME_relative_saturating_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Saturating multiply relative time by a given factor.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Subtract relative timestamp from the other.
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_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
static unsigned int size
Size of the "table".
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.
@ GNUNET_BLOCK_TYPE_FS_IBLOCK
Inner block in the CHK tree.
@ GNUNET_BLOCK_TYPE_ANY
Identifier for any block.
@ GNUNET_BLOCK_TYPE_FS_UBLOCK
Type of a block representing any type of search result (universal).
Response from FS service with a result for a previous FS search.
uint32_t type
Type of the block (in big endian).
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
struct GNUNET_HashCode key
Hash of the original content, used for encryption.
struct GNUNET_HashCode query
Hash of the encrypted content, used for querying.
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
struct GNUNET_FS_SearchResult * search
Associated search (used when downloading files based on search results), or NULL for none.
char * serialization
Random portion of filename we use for syncing state of this download.
struct GNUNET_FS_Handle * h
Global FS context.
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
Master context for most FS operations.
enum GNUNET_FS_Flags flags
General flags.
struct GNUNET_TIME_Relative avg_block_latency
Average time we take for a single request to be satisfied.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
Argument given to the progress callback with information about what is going on.
void * cctx
Client context pointer (set the last time by the client for this operation; initially NULL on START/R...
struct GNUNET_FS_Handle * fsh
File-sharing handle that generated the event.
enum GNUNET_FS_Status status
Specific status code (determines the event type).
union GNUNET_FS_ProgressInfo::@21 value
Values that depend on the event type.
struct GNUNET_FS_ProgressInfo::@21::GNUNET_FS_SearchStatusEvent search
Handle for controlling a search.
struct GNUNET_CONTAINER_MultiHashMap * master_result_map
Map that contains a struct GNUNET_FS_SearchResult for each result that was found in the search.
char * emsg
Error message (non-NULL if this operation failed).
struct SearchRequestEntry * requests
Per-keyword information for a keyword search.
char * serialization
Name of the file on disk we use for persistence.
void * client_info
Pointer we keep for the client.
struct GNUNET_FS_SearchResult * psearch_result
For update-searches, link to the search result that triggered the update search; otherwise NULL.
struct GNUNET_SCHEDULER_Task * task
ID of a task that is using this struct and that must be cancelled when the search is being stopped (i...
struct GNUNET_TIME_Relative reconnect_backoff
How long to wait before we try to reconnect to FS service?
enum GNUNET_FS_SearchOptions options
Options for the search.
uint32_t anonymity
Anonymity level for the search.
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
struct GNUNET_FS_Uri * uri
List of keywords that we're looking for.
uint32_t mandatory_count
Number of mandatory keywords in this query.
struct GNUNET_FS_Handle * h
Handle to the global FS context.
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
struct GNUNET_TIME_Absolute start_time
When did we start?
Information we store for each search result.
uint32_t optional_support
Number of optional keywords under which this result was also found.
struct GNUNET_FS_DownloadContext * download
ID of an associated download based on this search result (or NULL for none).
struct GNUNET_FS_SearchContext * update_search
If this search result triggered an update search, this field links to the update search.
void * client_info
Client info for this search result.
struct GNUNET_FS_DownloadContext * probe_ctx
ID of a job that is currently probing this results' availability (NULL if we are not currently probin...
uint32_t availability_trials
Number of availability trials that we have performed for this search result.
struct GNUNET_FS_Uri * uri
URI to which this search result refers to.
uint8_t * keyword_bitmap
Bitmap that specifies precisely which keywords have been matched already.
struct GNUNET_FS_Handle * h
File-sharing context this result belongs to.
struct GNUNET_HashCode key
Key for the search result based on the URI.
char * serialization
Name under which this search result is stored on disk.
uint32_t anonymity
Anonymity level to use for probes using this search result.
uint32_t availability_success
Number of availability tests that have succeeded for this result.
struct GNUNET_FS_MetaData * meta
Metadata for the search result.
struct GNUNET_FS_SearchContext * sc
Search context this result belongs to; can be NULL for probes that come from a directory result.
struct GNUNET_TIME_Absolute probe_active_time
When did the current probe become active?
struct GNUNET_TIME_Relative remaining_probe_time
How much longer should we run the current probe before giving up?
uint32_t mandatory_missing
Number of mandatory keywords for which we have NOT yet found the search result; when this value hits ...
struct GNUNET_SCHEDULER_Task * probe_cancel_task
ID of the task that will clean up the probe_ctx should it not complete on time (and that will need to...
A Universal Resource Identifier (URI), opaque.
char ** keywords
Keywords start with a '+' if they are mandatory (in which case the '+' is NOT part of the keyword) an...
union GNUNET_FS_Uri::@49 data
struct GNUNET_FS_Uri::@49::@51 sks
enum GNUNET_FS_UriType type
Type of the URI.
struct GNUNET_FS_Uri::@49::@50 ksk
struct GNUNET_CRYPTO_EcdsaPublicKey ns
Identifier of the namespace.
unsigned int keywordCount
Size of the keywords array.
char * identifier
Human-readable identifier chosen for this entry in the namespace.
struct FileIdentifier chk
Information needed to retrieve a file (content-hash-key plus file size).
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
Context for "get_result_present".
const struct GNUNET_FS_Uri * uri
The URI we're looking for.
struct GNUNET_FS_SearchResult * sr
Where to store a pointer to the search result struct if we found a match.
Closure for build_result_set().
unsigned int put_cnt
How many entries can we store to xoff.
struct GNUNET_HashCode * xoff
Where to store the keys.
unsigned int keyword_offset
Keyword offset the search result must match (0 for SKS)
struct GNUNET_FS_SearchContext * sc
Search context we are iterating for.
unsigned int skip_cnt
How many entries should we skip.
Message sent from a GNUnet (fs) search activity to the gnunet-service-fs to start a search.
struct GNUNET_PeerIdentity target
If the request is for a DBLOCK or IBLOCK, this is the identity of the peer that is known to have a re...
uint32_t type
Type of the content that we're looking for.
struct GNUNET_HashCode query
Hash of the public key for UBLOCKs; Hash of the CHK-encoded block for DBLOCKS and IBLOCKS.
uint32_t anonymity_level
Desired anonymity level, big-endian.
uint32_t options
Bitmask with options.
Information we keep for each keyword in a keyword search.
int mandatory
Is this keyword a mandatory keyword (started with '+')?
struct GNUNET_CONTAINER_MultiHashMap * results
Map that contains a "struct GNUNET_FS_SearchResult" for each result that was found under this keyword...
struct GNUNET_CRYPTO_EcdsaPublicKey dpub
Derived public key, hashes to 'uquery'.
char * keyword
The original keyword, used to derive the key (for decrypting the UBlock).
struct GNUNET_HashCode uquery
Hash of the public key, also known as the query.
universal block for keyword and namespace search results
struct GNUNET_CRYPTO_EcdsaPublicKey verification_key
Public key used to sign this block.