GNUnet DHT service's datacache integration. More...
#include "gnunet_util_lib.h"
#include "gnunet_block_lib.h"
#include "gnunet_dht_service.h"
#include "gnunet_datacache_lib.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | GDS_DATACACHE_GetCallback) (void *cls, const struct GNUNET_DATACACHE_Block *bd) |
Handle a result for a GET operation. More... | |
Functions | |
void | GDS_DATACACHE_handle_put (const struct GNUNET_DATACACHE_Block *bd) |
Handle a datum we've received from another peer. More... | |
enum GNUNET_BLOCK_ReplyEvaluationResult | GDS_DATACACHE_handle_get (const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, const void *xquery, size_t xquery_size, struct GNUNET_BLOCK_Group *bg, GDS_DATACACHE_GetCallback gc, void *gc_cls) |
Handle a GET request we've received from another peer. More... | |
enum GNUNET_BLOCK_ReplyEvaluationResult | GDS_DATACACHE_get_closest (const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, const void *xquery, size_t xquery_size, struct GNUNET_BLOCK_Group *bg, GDS_DATACACHE_GetCallback cb, void *cb_cls) |
Handle a request for data close to a key that we have received from another peer. More... | |
void | GDS_DATACACHE_init (void) |
Initialize datacache subsystem. More... | |
void | GDS_DATACACHE_done (void) |
Shutdown datacache subsystem. More... | |
GNUnet DHT service's datacache integration.
Definition in file gnunet-service-dht_datacache.h.
typedef void(* GDS_DATACACHE_GetCallback) (void *cls, const struct GNUNET_DATACACHE_Block *bd) |
Handle a result for a GET operation.
cls | closure |
bd | block details |
Definition at line 52 of file gnunet-service-dht_datacache.h.
void GDS_DATACACHE_handle_put | ( | const struct GNUNET_DATACACHE_Block * | bd | ) |
Handle a datum we've received from another peer.
Cache if possible.
bd | block data to cache |
Definition at line 49 of file gnunet-service-dht_datacache.c.
Referenced by check_dht_p2p_result(), handle_dht_local_put(), and handle_dht_p2p_put().
enum GNUNET_BLOCK_ReplyEvaluationResult GDS_DATACACHE_handle_get | ( | const struct GNUNET_HashCode * | key, |
enum GNUNET_BLOCK_Type | type, | ||
const void * | xquery, | ||
size_t | xquery_size, | ||
struct GNUNET_BLOCK_Group * | bg, | ||
GDS_DATACACHE_GetCallback | gc, | ||
void * | gc_cls | ||
) |
Handle a GET request we've received from another peer.
key | the query |
type | requested data type |
xquery | extended query |
xquery_size | number of bytes in xquery |
bg | block group to use for evaluation of replies |
gc | function to call on the results |
gc_cls | closure for gc |
Definition at line 49 of file gnunet-service-dht_datacache.c.
Referenced by check_dht_local_get_result_seen(), and handle_dht_p2p_get().
enum GNUNET_BLOCK_ReplyEvaluationResult GDS_DATACACHE_get_closest | ( | const struct GNUNET_HashCode * | key, |
enum GNUNET_BLOCK_Type | type, | ||
const void * | xquery, | ||
size_t | xquery_size, | ||
struct GNUNET_BLOCK_Group * | bg, | ||
GDS_DATACACHE_GetCallback | cb, | ||
void * | cb_cls | ||
) |
Handle a request for data close to a key that we have received from another peer.
key | the location at which the peer is looking for data that is close |
type | requested data type |
xquery | extended query |
xquery_size | number of bytes in xquery |
bg | block group to use for evaluation of replies |
cb | function to call with the result |
cb_cls | closure for cb |
Definition at line 49 of file gnunet-service-dht_datacache.c.
Referenced by handle_dht_p2p_get().
void GDS_DATACACHE_init | ( | void | ) |
Initialize datacache subsystem.
Definition at line 273 of file gnunet-service-dht_datacache.c.
References datacache, GDS_cfg, and GNUNET_DATACACHE_create().
Referenced by run().
void GDS_DATACACHE_done | ( | void | ) |
Shutdown datacache subsystem.
Definition at line 281 of file gnunet-service-dht_datacache.c.
References datacache, and GNUNET_DATACACHE_destroy().
Referenced by shutdown_task().