shared data structures of gnunet-service-fs.c More...
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_core_service.h"
#include "gnunet_block_lib.h"
#include "fs.h"
Go to the source code of this file.
Data Structures | |
struct | GetMessage |
Message to the datastore service asking about specific content. More... | |
struct | MigrationStopMessage |
Message send by a peer that wants to be excluded from migration for a while. More... | |
Macros | |
#define | TTL_DECREMENT 5000 |
By which amount do we decrement the TTL for simple forwarding / indirection of the query; in milli-seconds. More... | |
#define | DATASTORE_LOAD_AUTODECLINE |
At what frequency should our datastore load decrease automatically (since if we don't use it, clearly the load must be going down). More... | |
#define | GET_MESSAGE_BIT_QUERY_ONLY 0 |
Only the (mandatory) query is included. More... | |
#define | GET_MESSAGE_BIT_RETURN_TO 1 |
The peer identity of a peer waiting for the reply is included (used if the response should be transmitted to someone other than the sender of the GET). More... | |
#define | GET_MESSAGE_BIT_TRANSMIT_TO 4 |
The peer identity of a peer that had claimed to have the content previously is included (can be used if responder-anonymity is not desired; note that the precursor presumably lacked a direct connection to the specified peer; still, the receiver is in no way required to limit forwarding only to the specified peer, it should only prefer it somewhat if possible). More... | |
Functions | |
void | GSF_consider_forwarding (void *cls, struct GSF_PendingRequest *pr, enum GNUNET_BLOCK_ReplyEvaluationResult result) |
Function to be called after we're done processing replies from the local lookup. More... | |
int | GSF_test_get_load_too_high_ (uint32_t priority) |
Test if the DATABASE (GET) load on this peer is too high to even consider processing the query at all. More... | |
void | GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start) |
We've just now completed a datastore request. More... | |
Variables | |
struct GNUNET_DATASTORE_Handle * | GSF_dsh |
Our connection to the datastore. More... | |
const struct GNUNET_CONFIGURATION_Handle * | GSF_cfg |
Our configuration. More... | |
struct GNUNET_STATISTICS_Handle * | GSF_stats |
Handle for reporting statistics. More... | |
struct GNUNET_CORE_Handle * | GSF_core |
Pointer to handle to the core service (points to NULL until we've connected to it). More... | |
struct GNUNET_DHT_Handle * | GSF_dht |
Handle for DHT operations. More... | |
struct GNUNET_LOAD_Value * | GSF_rt_entry_lifetime |
How long do requests typically stay in the routing table? More... | |
struct GNUNET_TIME_Relative | GSF_avg_latency |
Running average of the observed latency to other peers (round trip). More... | |
struct GNUNET_ATS_PerformanceHandle * | GSF_ats |
Handle to ATS service. More... | |
struct GNUNET_PeerIdentity | GSF_my_id |
Identity of this peer. More... | |
double | GSF_current_priorities |
Typical priorities we're seeing from other peers right now. More... | |
unsigned int | GSF_cover_query_count |
How many query messages have we received 'recently' that have not yet been claimed as cover traffic? More... | |
unsigned int | GSF_cover_content_count |
How many content messages have we received 'recently' that have not yet been claimed as cover traffic? More... | |
struct GNUNET_BLOCK_Context * | GSF_block_ctx |
Our block context. More... | |
int | GSF_enable_randomized_delays |
Are we introducing randomized delays for better anonymity? More... | |
unsigned int | GSF_datastore_queue_size |
Size of the datastore queue we assume for common requests. More... | |
shared data structures of gnunet-service-fs.c
Definition in file gnunet-service-fs.h.
#define TTL_DECREMENT 5000 |
By which amount do we decrement the TTL for simple forwarding / indirection of the query; in milli-seconds.
Set somewhat in accordance to your network latency (above the time it'll take you to send a packet and get a reply).
Definition at line 42 of file gnunet-service-fs.h.
#define DATASTORE_LOAD_AUTODECLINE |
At what frequency should our datastore load decrease automatically (since if we don't use it, clearly the load must be going down).
Definition at line 49 of file gnunet-service-fs.h.
#define GET_MESSAGE_BIT_QUERY_ONLY 0 |
Only the (mandatory) query is included.
Definition at line 55 of file gnunet-service-fs.h.
#define GET_MESSAGE_BIT_RETURN_TO 1 |
The peer identity of a peer waiting for the reply is included (used if the response should be transmitted to someone other than the sender of the GET).
Definition at line 63 of file gnunet-service-fs.h.
#define GET_MESSAGE_BIT_TRANSMIT_TO 4 |
The peer identity of a peer that had claimed to have the content previously is included (can be used if responder-anonymity is not desired; note that the precursor presumably lacked a direct connection to the specified peer; still, the receiver is in no way required to limit forwarding only to the specified peer, it should only prefer it somewhat if possible).
Definition at line 73 of file gnunet-service-fs.h.
void GSF_consider_forwarding | ( | void * | cls, |
struct GSF_PendingRequest * | pr, | ||
enum GNUNET_BLOCK_ReplyEvaluationResult | result | ||
) |
Function to be called after we're done processing replies from the local lookup.
If the result status code indicates that there may be more replies, plan forwarding the request.
cls | closure (NULL) |
pr | the pending request we were processing |
result | final datastore lookup result |
Definition at line 622 of file gnunet-service-fs.c.
References consider_request_for_forwarding(), GNUNET_BLOCK_REPLY_OK_LAST, GNUNET_YES, GSF_iterate_connected_peers_(), GSF_pending_request_test_active_(), and result.
Referenced by handle_p2p_get(), and start_p2p_processing().
int GSF_test_get_load_too_high_ | ( | uint32_t | priority | ) |
Test if the DATABASE (GET) load on this peer is too high to even consider processing the query at all.
priority | priority of the request (used as a reference point to compare with the load) |
Definition at line 542 of file gnunet-service-fs.c.
References datastore_get_load, GNUNET_LOAD_get_load(), GNUNET_NO, GNUNET_SYSERR, and GNUNET_YES.
Referenced by bound_priority(), and process_local_reply().
void GSF_update_datastore_delay_ | ( | struct GNUNET_TIME_Absolute | start | ) |
We've just now completed a datastore request.
Update our datastore load calculations.
start | time when the datastore request was issued |
Definition at line 522 of file gnunet-service-fs.c.
References datastore_get_load, GNUNET_LOAD_update(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_Relative::rel_value_us, and start.
Referenced by process_local_reply().
|
extern |
Our connection to the datastore.
Definition at line 221 of file gnunet-service-fs.c.
Referenced by consider_gathering(), gather_dht_put_blocks(), gather_migration_blocks(), handle_dht_reply(), handle_p2p_put(), handle_request(), process_local_reply(), run(), shutdown_task(), and start_local_query().
|
extern |
Our configuration.
Definition at line 226 of file gnunet-service-fs.c.
Referenced by GSF_cadet_start_server(), GSF_connected_peer_init_(), GSF_pending_request_init_(), GSF_push_init_(), main_init(), and run().
|
extern |
Handle for reporting statistics.
Definition at line 231 of file gnunet-service-fs.c.
Referenced by bound_priority(), cadet_reply_proc(), clean_request(), client_request_destroy(), client_response_handler(), connect_cb(), consider_peer_for_forwarding(), consider_request_for_forwarding(), disconnect_cb(), free_pending_request(), get_randomized_delay(), GNUNET_FS_handle_on_demand_block(), GSF_block_peer_migration_(), GSF_local_lookup_(), GSF_peer_connect_handler(), GSF_peer_disconnect_handler(), GSF_pending_request_create_(), GSF_plan_add_(), GSF_plan_notify_peer_disconnect_(), GSF_plan_notify_request_done_(), handle_client_start_search(), handle_datastore_reply(), handle_dht_reply(), handle_p2p_get(), handle_p2p_migration_stop(), handle_p2p_put(), handle_p2p_reply(), handle_reply(), handle_request(), merge_pr(), no_more_local_results(), plan(), process_local_reply(), process_reply(), put_migration_continuation(), run(), schedule_peer_transmission(), shutdown_task(), start_local_query(), test_exist_cb(), and test_put_load_too_high().
|
extern |
Pointer to handle to the core service (points to NULL until we've connected to it).
Definition at line 288 of file gnunet-service-fs.c.
Referenced by main_init(), and shutdown_task().
|
extern |
Handle for DHT operations.
Definition at line 236 of file gnunet-service-fs.c.
Referenced by GSF_dht_lookup_(), process_dht_put_content(), run(), and shutdown_task().
|
extern |
How long do requests typically stay in the routing table?
Definition at line 241 of file gnunet-service-fs.c.
Referenced by handle_p2p_get(), process_reply(), run(), and shutdown_task().
|
extern |
Running average of the observed latency to other peers (round trip).
Initialized to 5s as the initial default.
Definition at line 247 of file gnunet-service-fs.c.
Referenced by get_randomized_delay().
|
extern |
Handle to ATS service.
|
extern |
Identity of this peer.
Definition at line 298 of file gnunet-service-fs.c.
Referenced by GSF_peer_connect_handler(), main_init(), and peer_init_handler().
|
extern |
Typical priorities we're seeing from other peers right now.
Since most priorities will be zero, this value is the weighted average of non-zero priorities seen "recently". In order to ensure that new values do not dramatically change the ratio, values are first "capped" to a reasonable range (+N of the current value) and then averaged into the existing value by a ratio of 1:N. Hence receiving the largest possible priority can still only raise our "current_priorities" by at most 1.
Definition at line 260 of file gnunet-service-fs.c.
Referenced by bound_priority(), and plan().
|
extern |
How many query messages have we received 'recently' that have not yet been claimed as cover traffic?
Definition at line 271 of file gnunet-service-fs.c.
Referenced by age_cover_counters(), and handle_p2p_get().
|
extern |
How many content messages have we received 'recently' that have not yet been claimed as cover traffic?
Definition at line 277 of file gnunet-service-fs.c.
Referenced by age_cover_counters(), handle_p2p_put(), and handle_p2p_reply().
|
extern |
Our block context.
Definition at line 282 of file gnunet-service-fs.c.
Referenced by cadet_reply_proc(), GSF_pending_request_create_(), handle_p2p_put(), handle_reply(), process_local_reply(), process_reply(), refresh_bloomfilter(), run(), and shutdown_task().
|
extern |
Are we introducing randomized delays for better anonymity?
Definition at line 293 of file gnunet-service-fs.c.
Referenced by handle_p2p_reply(), and run().
|
extern |
Size of the datastore queue we assume for common requests.
Definition at line 265 of file gnunet-service-fs.c.
Referenced by handle_request(), run(), and start_local_query().