GNUnet 0.22.2
gnunet_dht_service.h File Reference

API to the DHT service. More...

#include "gnunet_util_lib.h"
#include "gnunet_block_lib.h"
Include dependency graph for gnunet_dht_service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_DHT_HopSignature
 Message signed by a peer when doing path tracking. More...
 
struct  GNUNET_DHT_PathElement
 A (signed) path tracking a block's flow through the DHT is represented by an array of path elements, each consisting of a peer on the path and a signature by which the peer affirms its routing decision. More...
 

Macros

#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY
 Default republication frequency for stored data in the DHT. More...
 
#define GNUNET_DHT_MAXIMUM_REPLICATION_LEVEL   16
 Maximum allowed replication level for all requests. More...
 

Typedefs

typedef void(* GNUNET_DHT_GetIterator) (void *cls, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *query_hash, const struct GNUNET_PeerIdentity *trunc_peer, const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length, enum GNUNET_BLOCK_Type type, size_t size, const void *data)
 Iterator called on each result obtained for a DHT operation that expects a reply. More...
 
typedef void(* GNUNET_DHT_MonitorGetCB) (void *cls, enum GNUNET_DHT_RouteOption options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, const struct GNUNET_HashCode *key)
 Callback called on each GET request going through the DHT. More...
 
typedef void(* GNUNET_DHT_MonitorGetRespCB) (void *cls, enum GNUNET_BLOCK_Type type, const struct GNUNET_PeerIdentity *trunc_peer, const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_length, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, const void *data, size_t size)
 Callback called on each GET reply going through the DHT. More...
 
typedef void(* GNUNET_DHT_MonitorPutCB) (void *cls, enum GNUNET_DHT_RouteOption options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, const struct GNUNET_PeerIdentity *trunc_peer, unsigned int path_length, const struct GNUNET_DHT_PathElement *path, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, const void *data, size_t size)
 Callback called on each PUT request going through the DHT. More...
 
typedef void(* GNUNET_DHT_HelloGetCallback) (void *cls, const char *hello_url)
 Signature called with the result of a HELLO GET operation. More...
 

Enumerations

enum  GNUNET_DHT_RouteOption {
  GNUNET_DHT_RO_NONE = 0 , GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE = 1 , GNUNET_DHT_RO_RECORD_ROUTE = 2 , GNUNET_DHT_RO_FIND_APPROXIMATE = 4 ,
  GNUNET_DHT_RO_TRUNCATED = 8 , GNUNET_DHT_RO_LAST_HOP = 32768
}
 Options for routing. More...
 

Functions

struct GNUNET_DHT_HandleGNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int ht_len)
 Initialize the connection with the DHT service. More...
 
void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle)
 Shutdown connection with the DHT service. More...
 
struct GNUNET_DHT_PutHandleGNUNET_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. More...
 
void GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph)
 Cancels a DHT PUT operation. More...
 
struct GNUNET_DHT_GetHandleGNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode *key, uint32_t desired_replication_level, enum GNUNET_DHT_RouteOption options, const void *xquery, size_t xquery_size, GNUNET_DHT_GetIterator iter, void *iter_cls)
 Perform an asynchronous GET operation on the DHT identified. More...
 
void GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle, unsigned int num_results, const struct GNUNET_HashCode *results)
 Tell the DHT not to return any of the following known results to this client. More...
 
void GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle)
 Stop async DHT-get. More...
 
struct GNUNET_DHT_MonitorHandleGNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode *key, GNUNET_DHT_MonitorGetCB get_cb, GNUNET_DHT_MonitorGetRespCB get_resp_cb, GNUNET_DHT_MonitorPutCB put_cb, void *cb_cls)
 Start monitoring the local DHT service. More...
 
void GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle)
 Stop monitoring. More...
 
char * GNUNET_DHT_pp2s (const struct GNUNET_DHT_PathElement *path, unsigned int path_len)
 Convert a peer path to a human-readable string. More...
 
unsigned int GNUNET_DHT_verify_path (const void *data, size_t data_size, struct GNUNET_TIME_Absolute exp_time, const struct GNUNET_PeerIdentity *trunc_peer, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_len, const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_len, const struct GNUNET_PeerIdentity *me)
 Verify signatures on a path consisting of put_path and get_path in reverse order (starting at the last element of the get_path). More...
 
struct GNUNET_DHT_HelloGetHandleGNUNET_DHT_hello_get (struct GNUNET_DHT_Handle *dht_handle, GNUNET_DHT_HelloGetCallback cb, void *cb_cls)
 Obtain HELLO URL of the DHT identified by dht_handle. More...
 
void GNUNET_DHT_hello_get_cancel (struct GNUNET_DHT_HelloGetHandle *hgh)
 Cancel hello get operation. More...
 
void GNUNET_DHT_hello_offer (struct GNUNET_DHT_Handle *dht_handle, const char *url, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
 Offer HELLO URL of the DHT identified by dht_handle. More...
 

Detailed Description

API to the DHT service.

Definition in file gnunet_dht_service.h.