![]() |
GNUnet
0.11.x
|
GNUnet DHT globals. More...
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
#include "gnunet_block_lib.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_DHT GNUNET_EXTRA_LOGGING |
Functions | |
void | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, const struct GNUNET_HashCode *key, unsigned int get_path_length, const struct GNUNET_PeerIdentity *get_path, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, enum GNUNET_BLOCK_Type type, size_t data_size, const void *data) |
Handle a reply we've received from another peer. More... | |
void | GDS_CLIENTS_process_get (uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, const struct GNUNET_HashCode *key) |
Check if some client is monitoring GET messages and notify them in that case. More... | |
void | GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, const void *data, size_t size) |
Check if some client is monitoring GET RESP messages and notify them in that case. More... | |
void | GDS_CLIENTS_process_put (uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, const void *data, size_t size) |
Check if some client is monitoring PUT messages and notify them in that case. More... | |
Variables | |
const struct GNUNET_CONFIGURATION_Handle * | GDS_cfg |
Configuration we use. More... | |
struct GNUNET_SERVICE_Handle * | GDS_service |
Handle for the service. More... | |
struct GNUNET_BLOCK_Context * | GDS_block_context |
Our handle to the BLOCK library. More... | |
struct GNUNET_STATISTICS_Handle * | GDS_stats |
Handle for the statistics service. More... | |
struct GNUNET_MessageHeader * | GDS_my_hello |
Our HELLO. More... | |
GNUnet DHT globals.
Definition in file gnunet-service-dht.h.
#define DEBUG_DHT GNUNET_EXTRA_LOGGING |
Definition at line 34 of file gnunet-service-dht.h.
void GDS_CLIENTS_handle_reply | ( | struct GNUNET_TIME_Absolute | expiration, |
const struct GNUNET_HashCode * | key, | ||
unsigned int | get_path_length, | ||
const struct GNUNET_PeerIdentity * | get_path, | ||
unsigned int | put_path_length, | ||
const struct GNUNET_PeerIdentity * | put_path, | ||
enum GNUNET_BLOCK_Type | type, | ||
size_t | data_size, | ||
const void * | data | ||
) |
Handle a reply we've received from another peer.
If the reply matches any of our pending queries, forward it to the respective client(s).
expiration | when will the reply expire |
key | the query this reply is for |
get_path_length | number of peers in get_path |
get_path | path the reply took on get |
put_path_length | number of peers in put_path |
put_path | path the reply took on put |
type | type of the reply |
data_size | number of bytes in data |
data | application payload data |
Definition at line 1162 of file gnunet-service-dht_clients.c.
References data, ForwardReplyContext::data, data_size, ForwardReplyContext::data_size, expiration, ForwardReplyContext::expiration, forward_reply(), ForwardReplyContext::get_path, GNUNET_DHT_ClientResultMessage::get_path_length, ForwardReplyContext::get_path_length, gettext_noop, GNUNET_break, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_MAX_MESSAGE_SIZE, GNUNET_NO, GNUNET_STATISTICS_update(), LOG, ForwardReplyContext::put_path, GNUNET_DHT_ClientResultMessage::put_path_length, ForwardReplyContext::put_path_length, ClientQueryRecord::type, and ForwardReplyContext::type.
Referenced by handle_dht_local_put(), handle_dht_p2p_put(), handle_local_result(), and process_reply_with_path().
void GDS_CLIENTS_process_get | ( | uint32_t | options, |
enum GNUNET_BLOCK_Type | type, | ||
uint32_t | hop_count, | ||
uint32_t | desired_replication_level, | ||
unsigned int | path_length, | ||
const struct GNUNET_PeerIdentity * | path, | ||
const struct GNUNET_HashCode * | key | ||
) |
Check if some client is monitoring GET messages and notify them in that case.
options | Options, for instance RecordRoute, DemultiplexEverywhere. |
type | The type of data in the request. |
hop_count | Hop count so far. |
path_length | number of entries in path (or 0 if not recorded). |
path | peers on the GET path (or NULL if not recorded). |
desired_replication_level | Desired replication level. |
key | Key of the requested data. |
Definition at line 1227 of file gnunet-service-dht_clients.c.
References ClientMonitorRecord::ch, GNUNET_DHT_MonitorGetMessage::desired_replication_level, env, GNUNET_DHT_MonitorGetMessage::get_path_length, GNUNET_array_append, GNUNET_BLOCK_TYPE_ANY, GNUNET_free, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_DHT_MonitorGetMessage::hop_count, ClientMonitorRecord::key, GNUNET_DHT_MonitorGetMessage::key, ClientQueryRecord::key, m, ClientHandle::mq, ClientMonitorRecord::next, GNUNET_DHT_MonitorGetMessage::options, ClientMonitorRecord::type, and GNUNET_DHT_MonitorGetMessage::type.
Referenced by handle_dht_local_get(), and handle_dht_p2p_get().
void GDS_CLIENTS_process_get_resp | ( | enum GNUNET_BLOCK_Type | type, |
const struct GNUNET_PeerIdentity * | get_path, | ||
unsigned int | get_path_length, | ||
const struct GNUNET_PeerIdentity * | put_path, | ||
unsigned int | put_path_length, | ||
struct GNUNET_TIME_Absolute | exp, | ||
const struct GNUNET_HashCode * | key, | ||
const void * | data, | ||
size_t | size | ||
) |
Check if some client is monitoring GET RESP messages and notify them in that case.
type | The type of data in the result. |
get_path | Peers on GET path (or NULL if not recorded). |
get_path_length | number of entries in get_path. |
put_path | peers on the PUT path (or NULL if not recorded). |
put_path_length | number of entries in get_path. |
exp | Expiration time of the data. |
key | Key of the data. |
data | Pointer to the result data. |
size | Number of bytes in data. |
type | The type of data in the result. |
get_path | Peers on GET path (or NULL if not recorded). |
get_path_length | number of entries in get_path. |
put_path | peers on the PUT path (or NULL if not recorded). |
put_path_length | number of entries in get_path. |
exp | Expiration time of the data. |
key | Key of the data. |
data | Pointer to the result data. |
size | Number of bytes in data. |
Definition at line 1303 of file gnunet-service-dht_clients.c.
References ClientMonitorRecord::ch, env, GNUNET_DHT_MonitorGetRespMessage::expiration_time, GNUNET_DHT_MonitorGetRespMessage::get_path_length, GNUNET_array_append, GNUNET_BLOCK_TYPE_ANY, GNUNET_free, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET_RESP, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_TIME_absolute_hton(), ClientMonitorRecord::key, GNUNET_DHT_MonitorGetRespMessage::key, ClientQueryRecord::key, m, ClientHandle::mq, ClientMonitorRecord::next, GNUNET_DHT_MonitorGetRespMessage::put_path_length, size, ClientMonitorRecord::type, and GNUNET_DHT_MonitorGetRespMessage::type.
Referenced by process_reply_with_path().
void GDS_CLIENTS_process_put | ( | uint32_t | options, |
enum GNUNET_BLOCK_Type | type, | ||
uint32_t | hop_count, | ||
uint32_t | desired_replication_level, | ||
unsigned int | path_length, | ||
const struct GNUNET_PeerIdentity * | path, | ||
struct GNUNET_TIME_Absolute | exp, | ||
const struct GNUNET_HashCode * | key, | ||
const void * | data, | ||
size_t | size | ||
) |
Check if some client is monitoring PUT messages and notify them in that case.
options | Options, for instance RecordRoute, DemultiplexEverywhere. |
type | The type of data in the request. |
hop_count | Hop count so far. |
path_length | number of entries in path (or 0 if not recorded). |
path | peers on the PUT path (or NULL if not recorded). |
desired_replication_level | Desired replication level. |
exp | Expiration time of the data. |
key | Key under which data is to be stored. |
data | Pointer to the data carried. |
size | Number of bytes in data. |
Definition at line 1386 of file gnunet-service-dht_clients.c.
References ClientMonitorRecord::ch, GNUNET_DHT_MonitorPutMessage::desired_replication_level, env, GNUNET_DHT_MonitorPutMessage::expiration_time, GNUNET_array_append, GNUNET_BLOCK_TYPE_ANY, GNUNET_free, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_TIME_absolute_hton(), GNUNET_DHT_MonitorPutMessage::hop_count, ClientMonitorRecord::key, GNUNET_DHT_MonitorPutMessage::key, ClientQueryRecord::key, m, ClientHandle::mq, ClientMonitorRecord::next, GNUNET_DHT_MonitorPutMessage::options, GNUNET_DHT_MonitorPutMessage::put_path_length, size, ClientMonitorRecord::type, and GNUNET_DHT_MonitorPutMessage::type.
Referenced by handle_dht_local_put(), and handle_dht_p2p_put().
const struct GNUNET_CONFIGURATION_Handle* GDS_cfg |
Configuration we use.
Configuration we use.
Definition at line 231 of file gnunet-service-dht_clients.c.
Referenced by GDS_DATACACHE_init(), GDS_HELLO_init(), GDS_NEIGHBOURS_init(), GDS_NSE_init(), run(), and try_connect().
struct GNUNET_SERVICE_Handle* GDS_service |
Handle for the service.
Definition at line 226 of file gnunet-service-dht_clients.c.
Referenced by core_init(), and run().
struct GNUNET_BLOCK_Context* GDS_block_context |
Our handle to the BLOCK library.
Definition at line 216 of file gnunet-service-dht_clients.c.
Referenced by datacache_get_iterator(), handle_dht_p2p_get(), handle_dht_p2p_put(), handle_find_peer(), process(), run(), send_find_peer_message(), and shutdown_task().
struct GNUNET_STATISTICS_Handle* GDS_stats |
Handle for the statistics service.
Definition at line 221 of file gnunet-service-dht_clients.c.
Referenced by datacache_get_iterator(), expire_oldest_entry(), GDS_DATACACHE_handle_get(), GDS_DATACACHE_handle_put(), GDS_NEIGHBOURS_handle_get(), GDS_NEIGHBOURS_handle_put(), GDS_NEIGHBOURS_handle_reply(), GDS_ROUTING_add(), get_forward_count(), handle_core_connect(), handle_core_disconnect(), handle_dht_p2p_get(), handle_dht_p2p_put(), handle_dht_p2p_result(), handle_find_peer(), process(), process_hello(), run(), select_peer(), send_find_peer_message(), shutdown_task(), and update_network_size_estimate().
struct GNUNET_MessageHeader* GDS_my_hello |