34#define MAX_DHT_PUT_FREQ GNUNET_TIME_relative_multiply ( \
35 GNUNET_TIME_UNIT_SECONDS, 5)
40#define DEFAULT_PUT_REPLICATION 5
206 "Retrieved block `%s' of type %u for DHT PUT\n",
GNUNET_h2s (
key),
static unsigned int replication
Desired replication level.
static char * data
The data to insert into the dht.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_TIME_Relative expiration
User supplied expiration value.
static unsigned int anonymity
static uint32_t type
Type string converted to DNS type value.
struct GNUNET_DHT_Handle * GSF_dht
Handle for DHT operations.
struct GNUNET_DATASTORE_Handle * GSF_dsh
Our connection to the datastore.
shared data structures of gnunet-service-fs.c
static void gather_dht_put_blocks(void *cls)
Task that is run periodically to obtain blocks for DHT PUTs.
#define MAX_DHT_PUT_FREQ
How often do we at most PUT content into the DHT?
static struct PutOperator operators[]
ANY-terminated list of our operators (one per type of block that we're putting into the DHT).
static void delay_dht_put_task(void *cls)
Task that is run periodically to obtain blocks for DHT PUTs.
void GSF_put_init_()
Setup the module.
static void process_dht_put_content(void *cls, 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, uint64_t uid)
Store content in DHT.
void GSF_put_done_()
Shutdown the module.
static void delay_dht_put_blocks(void *cls)
Continuation called after DHT PUT operation has finished.
#define DEFAULT_PUT_REPLICATION
How many replicas do we try to create per PUT?
static void schedule_next_put(struct PutOperator *po)
Calculate when to run the next PUT operation and schedule it.
support for putting content into the DHT
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
@ GNUNET_BLOCK_TYPE_ANY
Identifier for any block.
@ GNUNET_BLOCK_TYPE_FS_UBLOCK
Type of a block representing any type of search result (universal).
void GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe)
Cancel a datastore operation.
struct GNUNET_DATASTORE_QueueEntry * GNUNET_DATASTORE_get_zero_anonymity(struct GNUNET_DATASTORE_Handle *h, uint64_t next_uid, unsigned int queue_priority, unsigned int max_queue_size, enum GNUNET_BLOCK_Type type, GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls)
Get a single zero-anonymity value from the datastore.
void GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph)
Cancels a DHT PUT operation.
struct GNUNET_DHT_PutHandle * GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle, const struct GNUNET_HashCode *key, uint32_t desired_replication_level, enum GNUNET_DHT_RouteOption options, enum GNUNET_BLOCK_Type type, size_t size, const void *data, struct GNUNET_TIME_Absolute exp, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Perform a PUT operation storing data in the DHT.
#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY
Default republication frequency for stored data in the DHT.
@ GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE
Each peer along the way should process the request (otherwise only peers locally closest to the key w...
#define GNUNET_log(kind,...)
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_DEBUG
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.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
static unsigned int size
Size of the "table".
Entry in our priority queue.
Entry in list of pending tasks.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
Context for each zero-anonymity iterator.
enum GNUNET_BLOCK_Type dht_put_type
Type we request from the datastore.
struct GNUNET_SCHEDULER_Task * dht_task
ID of task that collects blocks for DHT PUTs.
uint64_t zero_anonymity_count_estimate
How many entries with zero anonymity of our type do we currently estimate to have in the database?
uint64_t next_uid
Next UID to request when iterating the database.
struct GNUNET_DATASTORE_QueueEntry * dht_qe
Request to datastore for DHT PUTs (or NULL).
uint64_t result_count
Count of results received from the database.
struct GNUNET_DHT_PutHandle * dht_put
Handle to PUT operation.