GNUnet  0.20.0
gnunet-service-fs_put.h File Reference

support for putting content into the DHT More...

Include dependency graph for gnunet-service-fs_put.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GSF_put_init_ (void)
 Setup the module. More...
 
void GSF_put_done_ (void)
 Shutdown the module. More...
 

Detailed Description

support for putting content into the DHT

Author
Christian Grothoff

Definition in file gnunet-service-fs_put.h.

Function Documentation

◆ GSF_put_init_()

void GSF_put_init_ ( void  )

Setup the module.

Definition at line 244 of file gnunet-service-fs_put.c.

245 {
246  unsigned int i;
247 
248  i = 0;
249  while (operators[i].dht_put_type != GNUNET_BLOCK_TYPE_ANY)
250  {
251  operators[i].dht_task =
253  i++;
254  }
255 }
@ GNUNET_BLOCK_TYPE_ANY
Identifier for any block.
static void gather_dht_put_blocks(void *cls)
Task that is run periodically to obtain blocks for DHT PUTs.
static struct PutOperator operators[]
ANY-terminated list of our operators (one per type of block that we're putting into the DHT).
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.
Definition: scheduler.c:1299
struct GNUNET_SCHEDULER_Task * dht_task
ID of task that collects blocks for DHT PUTs.

References PutOperator::dht_put_type, PutOperator::dht_task, gather_dht_put_blocks(), GNUNET_BLOCK_TYPE_ANY, GNUNET_SCHEDULER_add_now(), and operators.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GSF_put_done_()

void GSF_put_done_ ( void  )

Shutdown the module.

Definition at line 262 of file gnunet-service-fs_put.c.

263 {
264  struct PutOperator *po;
265  unsigned int i;
266 
267  i = 0;
268  while ((po = &operators[i])->dht_put_type != GNUNET_BLOCK_TYPE_ANY)
269  {
270  if (NULL != po->dht_task)
271  {
273  po->dht_task = NULL;
274  }
275  if (NULL != po->dht_put)
276  {
278  po->dht_put = NULL;
279  }
280  if (NULL != po->dht_qe)
281  {
283  po->dht_qe = NULL;
284  }
285  i++;
286  }
287 }
void GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe)
Cancel a datastore operation.
void GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph)
Cancels a DHT PUT operation.
Definition: dht_api.c:1148
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:975
Context for each zero-anonymity iterator.
enum GNUNET_BLOCK_Type dht_put_type
Type we request from the datastore.
struct GNUNET_DATASTORE_QueueEntry * dht_qe
Request to datastore for DHT PUTs (or NULL).
struct GNUNET_DHT_PutHandle * dht_put
Handle to PUT operation.

References PutOperator::dht_put, PutOperator::dht_put_type, PutOperator::dht_qe, PutOperator::dht_task, GNUNET_BLOCK_TYPE_ANY, GNUNET_DATASTORE_cancel(), GNUNET_DHT_put_cancel(), GNUNET_SCHEDULER_cancel(), and operators.

Referenced by shutdown_task().

Here is the call graph for this function:
Here is the caller graph for this function: