36 #define AVAILABILITY_TRIALS_MAX 8 135 pi.
value.
search.specifics.update.availability_rank =
137 pi.
value.
search.specifics.update.availability_certainty =
140 pi.
value.
search.specifics.update.current_probe_time
205 pi.
value.
search.specifics.update.availability_certainty
208 pi.
value.
search.specifics.update.current_probe_time
232 "Probe #%u for search result %p failed\n",
257 "Probe #%u for search result %p succeeded\n",
460 "Starting probe #%u (at offset %llu) for search result %p\n",
462 (
unsigned long long) off,
625 (koff < sc->uri->data.ksk.keywordCount));
686 const char *id_update,
728 if (0 == strlen (id_update))
764 for (i = 0; i < sc->
uri->
data.
ksk.keywordCount; i++)
765 if (0 == memcmp (dpub,
801 char pt[size -
sizeof(
struct UBlock)];
811 size -
sizeof(
struct UBlock),
815 eos = memchr (&pt[1],
'\0',
sizeof(pt) - 1);
829 _ (
"Failed to parse URI `%s': %s\n"),
872 size_t len = size -
sizeof(
struct UBlock);
900 _ (
"Failed to parse URI `%s': %s\n"),
952 uint16_t msize = ntohs (cm->
header.
size) -
sizeof(*cm);
959 "Result received has already expired.\n");
967 (
const struct UBlock *) &cm[1],
971 (
const struct UBlock *) &cm[1],
993 _ (
"Got result with unknown block type `%d', ignoring"),
1119 unsigned int total_seen_results;
1124 unsigned int search_request_map_offset;
1125 unsigned int keyword_offset;
1128 memset (&mbc, 0,
sizeof(mbc));
1138 total_seen_results = mbc.
put_cnt;
1145 search_request_map_offset = 0;
1148 while ((0 != (left =
1149 (total_seen_results - search_request_map_offset))) ||
1164 mbc.
skip_cnt = search_request_map_offset;
1182 search_request_map_offset += todo;
1184 GNUNET_assert (total_seen_results >= search_request_map_offset);
1185 if (total_seen_results != search_request_map_offset)
1192 sm->
options = htonl (options);
1194 if (sc->
uri->
data.
ksk.keywordCount != keyword_offset)
1198 search_request_map_offset = 0;
1204 total_seen_results = mbc.
put_cnt;
1224 GNUNET_assert (total_seen_results >= search_request_map_offset);
1225 if (total_seen_results != search_request_map_offset)
1232 sm->
options = htonl (options);
1349 if (NULL != psearch)
1351 sc->psearch_result = psearch;
1355 sc->client_info =
cctx;
1387 for (
unsigned int i = 0; i < sc->
uri->
data.
ksk.keywordCount; i++)
1411 const char *keyword;
1426 for (i = 0; i < sc->
uri->
data.
ksk.keywordCount; i++)
1579 if (sc->
task != NULL)
1593 for (i = 0; i < sc->
uri->
data.
ksk.keywordCount; i++)
1625 ret =
search_start (h, uri, anonymity, options, cctx, NULL);
1643 if (NULL != sc->
task)
1783 if (NULL != sc->
top)
1800 : GNUNET_FS_SYNC_PATH_MASTER_SEARCH,
1809 if (NULL != sc->
task)
1825 for (i = 0; i < sc->
uri->
data.
ksk.keywordCount; i++)
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void * client_info
Client info for this search result.
uint32_t optional_support
Number of optional keywords under which this result was also found.
int GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri)
Is this a keyword URI?
#define GNUNET_FS_VERSION
Version number of the implementation.
Notification that we have started this download.
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_CRYPTO_ecdsa_key_get_anonymous(void)
Get the shared private key we use for anonymous users.
Closure for build_result_set().
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
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.
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...
static void start_probe_ping_task(struct GNUNET_FS_SearchResult *sr)
Start the ping task for this search result.
uint32_t mandatory_count
Number of mandatory keywords in this query.
static void signal_probe_result(struct GNUNET_FS_SearchResult *sr)
Signal result of last probe to client and then schedule next probe.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_FS_DownloadContext * download
ID of an associated download based on this search result (or NULL for none).
struct FileIdentifier chk
Information needed to retrieve a file (content-hash-key plus file size).
uint64_t rel_value_us
The actual value.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
This search has yielded a result.
struct GNUNET_TIME_Relative avg_block_latency
Average time we take for a single request to be satisfied.
Last message from a search; this signals that there will be no further events associated with this se...
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
struct GNUNET_FS_SearchResult * psearch_result
For update-searches, link to the search result that triggered the update search; otherwise NULL...
struct GNUNET_FS_ProgressInfo::@25::@27 download
Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events.
Any type of block, used as a wildcard when searching.
struct GNUNET_HashCode uquery
Hash of the public key, also known as the query.
struct GNUNET_FS_Handle * h
Global FS context.
struct GNUNET_GETOPT_CommandLineOption options[]
static void notify_client_chk_result(struct GNUNET_FS_SearchContext *sc, struct GNUNET_FS_SearchResult *sr)
We've found a new CHK result.
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_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_PUT.
struct GNUNET_FS_Uri::@13::@15 sks
Notification that this download was suspended.
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
static void schedule_transmit_search_request(struct GNUNET_FS_SearchContext *sc)
Schedule the transmission of the (next) search request to the service.
#define GNUNET_FS_SYNC_PATH_CHILD_DOWNLOAD
Name of the directory with downloads that are part of another download or a search.
Event generated for each search result when the respective search is stopped.
struct GNUNET_FS_SearchContext * sc
Search context we are iterating for.
struct GNUNET_FS_Uri * GNUNET_FS_uri_parse(const char *uri, char **emsg)
Convert a UTF-8 String to a URI.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc)
Continue paused search.
void GNUNET_FS_download_sync_(struct GNUNET_FS_DownloadContext *dc)
Synchronize this download struct with its mirror on disk.
Master context for most FS operations.
enum GNUNET_FS_SearchOptions options
Options for the search.
void GNUNET_FS_search_sync_(struct GNUNET_FS_SearchContext *sc)
Synchronize this search struct with its mirror on disk.
void * GNUNET_FS_search_probe_progress_(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Notification of FS that a search probe has made progress.
struct GNUNET_CRYPTO_EcdsaPublicKey dpub
Derived public key, hashes to 'uquery'.
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
char * emsg
Error message (non-NULL if this operation failed).
struct GNUNET_TIME_Absolute start_time
When did we start?
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_FS_SearchContext * sc
Search context this result belongs to; can be NULL for probes that come from a directory result...
uint8_t * keyword_bitmap
Bitmap that specifies precisely which keywords have been matched already.
int mandatory
Is this keyword a mandatory keyword (started with '+')?
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.
uint32_t options
Bitmask with options.
struct GNUNET_FS_SearchResult * GNUNET_FS_probe(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, void *client_info, uint32_t anonymity)
Start download probes for the given search result.
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.
GNUNET_FS_SearchOptions
Options for searching.
static void process_sblock(struct GNUNET_FS_SearchContext *sc, const struct UBlock *ub, size_t size)
Process a namespace-search result.
static int ret
Return value of the commandline.
struct GNUNET_FS_Uri * uri
URI to which this search result refers to.
First event generated when a client requests a search to begin or when a namespace result automatical...
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.
Context for "get_result_present".
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
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.
int GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1, const struct GNUNET_FS_Uri *u2)
Test if two URIs are equal.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Private ECC key encoded for transmission.
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.
struct GNUNET_FS_DownloadContext * probe_ctx
ID of a job that is currently probing this results' availability (NULL if we are not currently probin...
int GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri)
Is this a namespace URI?
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 struct GNUNET_PEERINFO_Handle * pi
Handle to peerinfo service.
static void probe_failure_handler(void *cls)
Handle the case where we have failed to receive a response for our probe.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
static int search_result_freeze_probes(void *cls, const struct GNUNET_HashCode *key, void *value)
Freeze probes for the given search result.
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...
struct GNUNET_FS_DownloadContext * GNUNET_FS_download_start(struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta, const char *filename, const char *tempname, uint64_t offset, uint64_t length, uint32_t anonymity, enum GNUNET_FS_DownloadOptions options, void *cctx, struct GNUNET_FS_DownloadContext *parent)
Download parts of a file.
struct GNUNET_FS_Uri * GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri)
Duplicate URI.
static void process_kblock(struct GNUNET_FS_SearchContext *sc, const struct UBlock *ub, size_t size)
Process a keyword search result.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
Type of a block representing a block to be encoded on demand from disk.
struct SearchRequestEntry * requests
Per-keyword information for a keyword search.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
struct GNUNET_FS_Uri * uri
List of keywords that we're looking for.
static void do_reconnect(void *cls)
Reconnect to the FS service and transmit our queries NOW.
struct GNUNET_FS_SearchContext * update_search
If this search result triggered an update search, this field links to the update search.
int GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri, struct GNUNET_HashCode *key)
Get a unique key from a URI.
uint32_t anonymity
Anonymity level for the search.
struct GNUNET_HashCode query
Hash of the public key for UBLOCKs; Hash of the CHK-encoded block for DBLOCKS and IBLOCKS...
Do not append temporary data to the target file (for the IBlocks).
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
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 ...
static void process_ksk_result(struct GNUNET_FS_SearchContext *sc, struct SearchRequestEntry *ent, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta)
We have received a KSK result.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Notification that this download completed.
union GNUNET_FS_ProgressInfo::@25 value
Values that depend on the event type.
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.
char * serialization
Name of the file on disk we use for persistence.
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...
struct GNUNET_TIME_Relative remaining_probe_time
How much longer should we run the current probe before giving up?
void * GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr)
Stop probe activity.
char * serialization
Random portion of filename we use for syncing state of this download.
uint32_t availability_trials
Number of availability trials that we have performed for this search result.
struct GNUNET_FS_SearchResult * sr
Where to store a pointer to the search result struct if we found a match.
static char * value
Value of the record to add/remove.
struct GNUNET_TIME_Relative reconnect_backoff
How long to wait before we try to reconnect to FS service?
struct GNUNET_FS_ProgressInfo::@25::@28 search
Values for all "GNUNET_FS_STATUS_SEARCH_*" events.
struct GNUNET_CONTAINER_MultiHashMap * master_result_map
Map that contains a struct GNUNET_FS_SearchResult for each result that was found in the search...
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Information we store for each search result.
struct GNUNET_FS_Handle * h
File-sharing context this result belongs to.
static void probe_success_handler(void *cls)
Handle the case where we have gotten a response for our probe.
Should we automatically trigger probes for search results to determine availability? (will create GNUNET_FS_STATUS_SEARCH_UPDATE events).
void GNUNET_FS_end_top(struct GNUNET_FS_Handle *h, struct TopLevelActivity *top)
Destroy a top-level activity entry.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
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.
enum GNUNET_FS_Status status
Specific status code (determines the event type).
uint32_t availability_success
Number of availability tests that have succeeded for this result.
Internal option used to flag this download as a 'probe' for a search result.
struct GNUNET_HashCode query
Hash of the encrypted content, used for querying.
void GNUNET_FS_stop_probe_ping_task_(struct GNUNET_FS_SearchResult *sr)
Stop the ping task for this search result.
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.
Inner block in the CHK tree.
void GNUNET_FS_search_result_sync_(struct GNUNET_FS_SearchResult *sr)
Synchronize this search result with its mirror on disk.
#define GNUNET_FS_PROBE_UPDATE_FREQUENCY
How often do we signal applications that a probe for a particular search result is running...
void GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete)
Stop a download (aborts if download is incomplete).
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
uint32_t type
Type of the content that we're looking for.
static void GNUNET_FS_search_stop_probe_(struct GNUNET_FS_SearchResult *sr)
Stop probing activity associated with a search result.
struct GNUNET_CONTAINER_MultiHashMap * results
Map that contains a "struct GNUNET_FS_SearchResult" for each result that was found under this keyword...
static int search_result_free(void *cls, const struct GNUNET_HashCode *key, void *value)
Free the given search result.
static int result
Global testing status.
struct TopLevelActivity * top
Our top-level activity entry (if we are top-level, otherwise NULL).
struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Subtract relative timestamp from the other.
uint32_t anonymity
Anonymity level to use for probes using this search result.
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
unsigned int keyword_offset
Keyword offset the search result must match (0 for SKS)
Signals that this search was continued (unpaused).
Type of a block representing any type of search result (universal).
#define AVAILABILITY_TRIALS_MAX
Number of availability trials we perform per search result.
Message handler for a specific message type.
#define GNUNET_FS_SYNC_PATH_CHILD_SEARCH
Name of the directory with sub-searches (namespace-updates).
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
#define DBLOCK_SIZE
Size of the individual blocks used for file-sharing.
static void process_sks_result(struct GNUNET_FS_SearchContext *sc, const char *id_update, const struct GNUNET_FS_Uri *uri, const struct GNUNET_CONTAINER_MetaData *meta)
We have received an SKS result.
Notification that this download is no longer actively being pursued (back in the queue).
Content-hash-key (simple file).
There must only be one value per key; storing a value should fail if a value under the same key alrea...
static int check_result(void *cls, const struct ClientPutMessage *cm)
We check a result message from the service.
struct GNUNET_FS_SearchResult * search
Associated search (used when downloading files based on search results), or NULL for none...
Last event when a search is being suspended; note that "GNUNET_FS_SEARCH_STOPPED" will not be generat...
struct GNUNET_HashCode key
The key used in the DHT.
static unsigned int size
Size of the "table".
int GNUNET_FS_search_start_searching_(struct GNUNET_FS_SearchContext *sc)
Build the request and actually initiate the search using the GNUnet FS service.
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.
Notification about progress with this download.
unsigned int put_cnt
How many entries can we store to xoff.
Notification that this download is now actively being pursued (as opposed to waiting in the queue)...
struct GNUNET_MQ_Envelope * env
static struct GNUNET_FS_SearchContext * sc
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
struct GNUNET_CONTAINER_MetaData * meta
Metadata for the search result.
Notification that this download is being resumed.
enum GNUNET_FS_UriType type
Type of the URI.
int 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.
struct GNUNET_HashCode key
Key for the search result based on the URI.
static int search_result_resume_probes(void *cls, const struct GNUNET_HashCode *key, void *value)
Resume probes for the given search result.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message...
union GNUNET_FS_Uri::@13 data
#define GNUNET_MESSAGE_TYPE_FS_START_SEARCH
Client asks FS service to start a (keyword) search.
struct GNUNET_FS_Handle * fsh
File-sharing handle that generated the event.
const struct GNUNET_FS_Uri * uri
The URI we're looking for.
struct TopLevelActivity * GNUNET_FS_make_top(struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, void *ssf_cls)
Create a top-level activity entry.
Response from FS service with a result for a previous FS search.
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...
Notification that this download is no longer part of a recursive download or search but now a 'stand-...
Allow multiple values with the same key.
uint32_t type
Type of the block (in big endian).
Signed key space (file in namespace).
struct GNUNET_HashCode key
Hash of the original content, used for encryption.
struct GNUNET_HashCode * xoff
Where to store the keys.
#define GNUNET_FS_SYNC_PATH_MASTER_SEARCH
Name of the directory with top-level searches.
The identity of the host (wraps the signing key of the peer).
uint32_t mandatory_missing
Number of mandatory keywords for which we have NOT yet found the search result; when this value hits ...
Event generated for each search result when the respective search is suspended.
GNUNET_FS_ProgressCallback upcb
Function to call with updates on our progress.
int GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
struct GNUNET_FS_SearchResult * next
Kept in a DLL while probing.
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?
shared definitions for the FS library
A Universal Resource Identifier (URI), opaque.
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...
Handle for controlling a search.
struct GNUNET_SCHEDULER_Task * probe_ping_task
Task we use to report periodically to the application that certain search probes (from probes_head) a...
static struct GNUNET_CONTAINER_MetaData * meta
Meta-data provided via command-line option.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
void * upcb_cls
Closure for upcb.
struct GNUNET_FS_Uri::@13::@14 ksk
static int search_result_suspend(void *cls, const struct GNUNET_HashCode *key, void *value)
Signal suspend and free the given search result.
static int search_result_stop(void *cls, const struct GNUNET_HashCode *key, void *value)
Signal stop for the given search result.
#define GNUNET_log(kind,...)
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
struct GNUNET_FS_Handle * h
Handle to the global FS context.
Only search the local host, do not search remote systems (no P2P)
Data block (leaf) in the CHK tree.
struct GNUNET_FS_SearchResult * probes_head
Head of active probes.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
#define SEARCH_MESSAGE_OPTION_CONTINUED
Request is too large to fit in 64k format.
struct GNUNET_MQ_Handle * mq
Connection to the FS service.
Location (chk with identity of hosting peer).
struct GNUNET_TIME_Absolute probe_active_time
When did the current probe become active?
We have additional data about the quality or availability of a search result.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
void GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc)
Pause search.
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
static unsigned int anonymity
void GNUNET_CRYPTO_hash_xor(const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b, struct GNUNET_HashCode *result)
compute result = a ^ b
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
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.
char * serialization
Name under which this search result is stored on disk.
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 SEARCH_MESSAGE_OPTION_NONE
No options.
#define SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY
Only search the local datastore (no network)
Information we keep for each keyword in a keyword search.
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 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.
struct GNUNET_FS_SearchResult * probes_tail
Tail of active probes.
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 ...
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
Notification that this download was stopped (final event with respect to this action).
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.
Message sent from a GNUnet (fs) search activity to the gnunet-service-fs to start a search...
uint32_t data
The data value.
Signals that this search was paused.
unsigned int skip_cnt
How many entries should we skip.
void * client_info
Pointer we keep for the client.
#define GNUNET_MESSAGE_TYPE_FS_PUT
P2P response with content or active migration of content.
uint32_t anonymity_level
Desired anonymity level, big-endian.
char * keyword
The original keyword, used to derive the key (for decrypting the UBlock).
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.
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)...
struct GNUNET_CRYPTO_EcdsaPublicKey verification_key
Public key used to sign this block.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
universal block for keyword and namespace search results
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_malloc(size)
Wrapper around malloc.
void GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc)
Stop search for content.
void GNUNET_FS_search_start_probe_(struct GNUNET_FS_SearchResult *sr)
Start download probes for the given search result.
void GNUNET_FS_remove_sync_file_(struct GNUNET_FS_Handle *h, const char *ext, const char *ent)
Remove serialization/deserialization file from disk.
Notification that this download encountered an error.
static void probe_ping_task_cb(void *cls)
Task run periodically to remind clients that a probe is active.
#define GNUNET_free(ptr)
Wrapper around free.
Argument given to the progress callback with information about what is going on.
Time for relative time used by GNUnet, in microseconds.
void * cctx
Client context pointer (set the last time by the client for this operation; initially NULL on START/R...
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
static void handle_result(void *cls, const struct ClientPutMessage *cm)
We process a search result from the service.
enum GNUNET_FS_Flags flags
General flags.
void GNUNET_FS_remove_sync_dir_(struct GNUNET_FS_Handle *h, const char *ext, const char *uni)
Remove serialization/deserialization directory from disk.
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...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
publish a UBLOCK in GNUnet
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.