Store naming information on a GNUnet node. More...
Macros | |
#define | GNUNET_NAMECACHE_MAX_VALUE_SIZE (63 * 1024) |
Maximum size of a value that can be stored in the namecache. More... | |
Typedefs | |
typedef void(* | GNUNET_NAMECACHE_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg) |
Continuation called to notify client about result of the operation. More... | |
typedef void(* | GNUNET_NAMECACHE_BlockProcessor) (void *cls, const struct GNUNET_GNSRECORD_Block *block) |
Process a record that was stored in the namecache. More... | |
Functions | |
struct GNUNET_NAMECACHE_Handle * | GNUNET_NAMECACHE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Connect to the namecache service. More... | |
void | GNUNET_NAMECACHE_disconnect (struct GNUNET_NAMECACHE_Handle *h) |
Disconnect from the namecache service (and free associated resources). More... | |
struct GNUNET_NAMECACHE_QueueEntry * | GNUNET_NAMECACHE_block_cache (struct GNUNET_NAMECACHE_Handle *h, const struct GNUNET_GNSRECORD_Block *block, GNUNET_NAMECACHE_ContinuationWithStatus cont, void *cont_cls) |
Store an item in the namecache. More... | |
struct GNUNET_NAMECACHE_QueueEntry * | GNUNET_NAMECACHE_lookup_block (struct GNUNET_NAMECACHE_Handle *h, const struct GNUNET_HashCode *derived_hash, GNUNET_NAMECACHE_BlockProcessor proc, void *proc_cls) |
Get a result for a particular key from the namecache. More... | |
void | GNUNET_NAMECACHE_cancel (struct GNUNET_NAMECACHE_QueueEntry *qe) |
Cancel a namecache operation. More... | |
Store naming information on a GNUnet node.
Naming information can either be records for which this peer/user is authoritative, or blocks which are cached, encrypted naming data from other peers.
#define GNUNET_NAMECACHE_MAX_VALUE_SIZE (63 * 1024) |
Maximum size of a value that can be stored in the namecache.
Definition at line 71 of file gnunet_namecache_service.h.
typedef void(* GNUNET_NAMECACHE_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg) |
Continuation called to notify client about result of the operation.
cls | closure |
success | GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate) GNUNET_NO if content was already there or not found GNUNET_YES (or other positive value) on success |
emsg | NULL on success, otherwise an error message |
Definition at line 105 of file gnunet_namecache_service.h.
typedef void(* GNUNET_NAMECACHE_BlockProcessor) (void *cls, const struct GNUNET_GNSRECORD_Block *block) |
Process a record that was stored in the namecache.
cls | closure |
block | block that was stored in the namecache |
Definition at line 134 of file gnunet_namecache_service.h.
struct GNUNET_NAMECACHE_Handle * GNUNET_NAMECACHE_connect | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Connect to the namecache service.
cfg | configuration to use |
Connect to the namecache service.
cfg | configuration to use |
Definition at line 403 of file namecache_api.c.
References cfg, GNUNET_ARM_Handle::cfg, GNUNET_free, GNUNET_new, h, GNUNET_ARM_Handle::mq, and reconnect().
Referenced by run().
void GNUNET_NAMECACHE_disconnect | ( | struct GNUNET_NAMECACHE_Handle * | h | ) |
Disconnect from the namecache service (and free associated resources).
Must not be called from within operation callbacks of the API.
h | handle to the namecache |
h | handle to the namecache |
Definition at line 426 of file namecache_api.c.
References GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), h, GNUNET_ARM_Handle::mq, q, and GNUNET_ARM_Handle::reconnect_task.
Referenced by do_shutdown(), and shutdown_task().
struct GNUNET_NAMECACHE_QueueEntry * GNUNET_NAMECACHE_block_cache | ( | struct GNUNET_NAMECACHE_Handle * | h, |
const struct GNUNET_GNSRECORD_Block * | block, | ||
GNUNET_NAMECACHE_ContinuationWithStatus | cont, | ||
void * | cont_cls | ||
) |
Store an item in the namecache.
If the item is already present, it is replaced with the new record.
h | handle to the namecache |
block | block to store |
cont | continuation to call when done |
cont_cls | closure for cont |
Definition at line 463 of file namecache_api.c.
References GNUNET_DATASTORE_QueueEntry::cont, GNUNET_DATASTORE_QueueEntry::cont_cls, env, get_op_id(), GNUNET_CONTAINER_DLL_insert_tail, GNUNET_GNSRECORD_block_get_size(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, h, GNUNET_ARM_Handle::mq, msg, and qe.
Referenced by handle_dht_response(), and refresh_block().
struct GNUNET_NAMECACHE_QueueEntry * GNUNET_NAMECACHE_lookup_block | ( | struct GNUNET_NAMECACHE_Handle * | h, |
const struct GNUNET_HashCode * | derived_hash, | ||
GNUNET_NAMECACHE_BlockProcessor | proc, | ||
void * | proc_cls | ||
) |
Get a result for a particular key from the namecache.
The processor will only be called once.
h | handle to the namecache |
derived_hash | hash of zone key combined with name to lookup then at the end once with NULL |
proc | function to call on the matching block, or with NULL if there is no matching block |
proc_cls | closure for proc |
The processor will only be called once.
h | handle to the namecache |
derived_hash | hash of zone key combined with name to lookup |
proc | function to call on the matching block, or with NULL if there is no matching block |
proc_cls | closure for proc |
Definition at line 512 of file namecache_api.c.
References env, get_op_id(), GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, h, LOG, GNUNET_ARM_Handle::mq, msg, and qe.
Referenced by recursive_gns_resolution_namecache(), and run().
void GNUNET_NAMECACHE_cancel | ( | struct GNUNET_NAMECACHE_QueueEntry * | qe | ) |
Cancel a namecache operation.
The final callback from the operation must not have been done yet. Must be called on any namecache operation that has not yet completed prior to calling GNUNET_NAMECACHE_disconnect.
qe | operation to cancel |
The final callback from the operation must not have been done yet.
qe | operation to cancel |
Definition at line 553 of file namecache_api.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, h, and qe.
Referenced by do_shutdown(), GNS_resolver_done(), GNS_resolver_lookup_cancel(), and shutdown_task().