GNUnet  0.11.x
Macros | Functions | Variables
gnunet-service-dht.h File Reference

GNUnet DHT globals. More...

#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
#include "gnunet_block_lib.h"
Include dependency graph for gnunet-service-dht.h:
This graph shows which files directly or indirectly include this file:

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_HandleGDS_cfg
 Configuration we use. More...
 
struct GNUNET_SERVICE_HandleGDS_service
 Handle for the service. More...
 
struct GNUNET_BLOCK_ContextGDS_block_context
 Our handle to the BLOCK library. More...
 
struct GNUNET_STATISTICS_HandleGDS_stats
 Handle for the statistics service. More...
 
struct GNUNET_MessageHeaderGDS_my_hello
 Our HELLO. More...
 

Detailed Description

GNUnet DHT globals.

Author
Christian Grothoff

Definition in file gnunet-service-dht.h.

Macro Definition Documentation

◆ DEBUG_DHT

#define DEBUG_DHT   GNUNET_EXTRA_LOGGING

Definition at line 34 of file gnunet-service-dht.h.

Function Documentation

◆ GDS_CLIENTS_handle_reply()

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).

Parameters
expirationwhen will the reply expire
keythe query this reply is for
get_path_lengthnumber of peers in get_path
get_pathpath the reply took on get
put_path_lengthnumber of peers in put_path
put_pathpath the reply took on put
typetype of the reply
data_sizenumber of bytes in data
dataapplication 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().

1171 {
1172  struct ForwardReplyContext frc;
1173  size_t msize;
1174 
1175  msize = sizeof(struct GNUNET_DHT_ClientResultMessage) + data_size
1176  + (get_path_length + put_path_length) * sizeof(struct
1178  if (msize >= GNUNET_MAX_MESSAGE_SIZE)
1179  {
1180  GNUNET_break (0);
1181  return;
1182  }
1184  key))
1185  {
1187  "No matching client for reply for key %s\n",
1188  GNUNET_h2s (key));
1190  gettext_noop (
1191  "# REPLIES ignored for CLIENTS (no match)"),
1192  1,
1193  GNUNET_NO);
1194  return; /* no matching request, fast exit! */
1195  }
1196  frc.expiration = expiration;
1197  frc.get_path = get_path;
1198  frc.put_path = put_path;
1199  frc.data = data;
1200  frc.data_size = data_size;
1201  frc.get_path_length = get_path_length;
1202  frc.put_path_length = put_path_length;
1203  frc.type = type;
1205  "Forwarding reply for key %s to client\n",
1206  GNUNET_h2s (key));
1208  key,
1209  &forward_reply,
1210  &frc);
1211 }
Closure for forward_reply()
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storgage location of this message...
Definition: dht.h:159
struct GNUNET_STATISTICS_Handle * GDS_stats
Handle for the statistics service.
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
static struct GNUNET_CONTAINER_MultiHashMap * forward_map
Hashmap for fast key based lookup, maps keys to struct ClientQueryRecord entries. ...
#define GNUNET_NO
Definition: gnunet_common.h:78
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
#define LOG(kind,...)
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message...
The identity of the host (wraps the signing key of the peer).
uint32_t get_path_length
The number of peer identities recorded from the storage location to this peer.
Definition: dht.h:165
int GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
static int forward_reply(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterator over hash map entries that send a given reply to each of the matching clients.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
uint32_t data
The data value.
Reply to a GET send from the service to a client.
Definition: dht.h:143
#define gettext_noop(String)
Definition: gettext.h:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GDS_CLIENTS_process_get()

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.

Parameters
optionsOptions, for instance RecordRoute, DemultiplexEverywhere.
typeThe type of data in the request.
hop_countHop count so far.
path_lengthnumber of entries in path (or 0 if not recorded).
pathpeers on the GET path (or NULL if not recorded).
desired_replication_levelDesired replication level.
keyKey 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_non_null, 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().

1234 {
1235  struct ClientMonitorRecord *m;
1236  struct ClientHandle **cl;
1237  unsigned int cl_size;
1238 
1239  cl = NULL;
1240  cl_size = 0;
1241  for (m = monitor_head; NULL != m; m = m->next)
1242  {
1243  if (((GNUNET_BLOCK_TYPE_ANY == m->type) ||
1244  (m->type == type)) &&
1245  ((NULL == m->key) ||
1246  (0 == memcmp (key,
1247  m->key,
1248  sizeof(struct GNUNET_HashCode)))))
1249  {
1250  struct GNUNET_MQ_Envelope *env;
1251  struct GNUNET_DHT_MonitorGetMessage *mmsg;
1252  struct GNUNET_PeerIdentity *msg_path;
1253  size_t msize;
1254  unsigned int i;
1255 
1256  /* Don't send duplicates */
1257  for (i = 0; i < cl_size; i++)
1258  if (cl[i] == m->ch)
1259  break;
1260  if (i < cl_size)
1261  continue;
1262  GNUNET_array_append (cl,
1263  cl_size,
1264  m->ch);
1265 
1266  msize = path_length * sizeof(struct GNUNET_PeerIdentity);
1267  env = GNUNET_MQ_msg_extra (mmsg,
1268  msize,
1270  mmsg->options = htonl (options);
1271  mmsg->type = htonl (type);
1272  mmsg->hop_count = htonl (hop_count);
1273  mmsg->desired_replication_level = htonl (desired_replication_level);
1274  mmsg->get_path_length = htonl (path_length);
1275  mmsg->key = *key;
1276  msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1];
1277  GNUNET_memcpy (msg_path,
1278  path,
1279  path_length * sizeof(struct GNUNET_PeerIdentity));
1280  GNUNET_MQ_send (m->ch->mq,
1281  env);
1282  }
1283  }
1284  GNUNET_free_non_null (cl);
1285 }
struct ClientHandle * ch
Client to notify of these requests.
uint32_t options
Message options, actually an &#39;enum GNUNET_DHT_RouteOption&#39; value.
Definition: dht.h:333
struct GNUNET_HashCode * key
Key of data of interest, NULL for all.
Any type of block, used as a wildcard when searching.
static struct ClientMonitorRecord * monitor_head
List of active monitoring requests.
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
struct ClientMonitorRecord * next
Next element in DLL.
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
enum GNUNET_BLOCK_Type type
Type of blocks that are of interest.
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:359
A 512-bit hashcode.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET
Receive information about transiting GETs.
Struct containing information about a client, handle to connect to it, and any pending messages that ...
struct GNUNET_HashCode key
The key used in the DHT.
uint32_t get_path_length
Number of peers recorded in the outgoing path from source to the storage location of this message...
Definition: dht.h:354
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_MQ_Handle * mq
The message queue to this client.
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:348
#define GNUNET_array_append(arr, size, element)
Append an element to a list (growing the list by one).
The identity of the host (wraps the signing key of the peer).
Struct containing paremeters of monitoring requests.
uint32_t type
The type of data in the request.
Definition: dht.h:338
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Message to monitor get requests going through peer, DHT service -> clients.
Definition: dht.h:323
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
uint32_t hop_count
Hop count.
Definition: dht.h:343
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GDS_CLIENTS_process_get_resp()

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.

Parameters
typeThe type of data in the result.
get_pathPeers on GET path (or NULL if not recorded).
get_path_lengthnumber of entries in get_path.
put_pathpeers on the PUT path (or NULL if not recorded).
put_path_lengthnumber of entries in get_path.
expExpiration time of the data.
keyKey of the data.
dataPointer to the result data.
sizeNumber of bytes in data.
typeThe type of data in the result.
get_pathPeers on GET path (or NULL if not recorded).
get_path_lengthnumber of entries in get_path.
put_pathpeers on the PUT path (or NULL if not recorded).
put_path_lengthnumber of entries in get_path.
expExpiration time of the data.
keyKey of the data.
dataPointer to the result data.
sizeNumber 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_non_null, 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().

1312 {
1313  struct ClientMonitorRecord *m;
1314  struct ClientHandle **cl;
1315  unsigned int cl_size;
1316 
1317  cl = NULL;
1318  cl_size = 0;
1319  for (m = monitor_head; NULL != m; m = m->next)
1320  {
1321  if (((GNUNET_BLOCK_TYPE_ANY == m->type) || (m->type == type) ) &&
1322  ((NULL == m->key) ||
1323  (memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) ))
1324  {
1325  struct GNUNET_MQ_Envelope *env;
1326  struct GNUNET_DHT_MonitorGetRespMessage *mmsg;
1327  struct GNUNET_PeerIdentity *path;
1328  size_t msize;
1329  unsigned int i;
1330 
1331  /* Don't send duplicates */
1332  for (i = 0; i < cl_size; i++)
1333  if (cl[i] == m->ch)
1334  break;
1335  if (i < cl_size)
1336  continue;
1337  GNUNET_array_append (cl,
1338  cl_size,
1339  m->ch);
1340 
1341  msize = size;
1342  msize += (get_path_length + put_path_length)
1343  * sizeof(struct GNUNET_PeerIdentity);
1344  env = GNUNET_MQ_msg_extra (mmsg,
1345  msize,
1347  mmsg->type = htonl (type);
1348  mmsg->put_path_length = htonl (put_path_length);
1349  mmsg->get_path_length = htonl (get_path_length);
1351  mmsg->key = *key;
1352  path = (struct GNUNET_PeerIdentity *) &mmsg[1];
1353  GNUNET_memcpy (path,
1354  put_path,
1355  put_path_length * sizeof(struct GNUNET_PeerIdentity));
1356  GNUNET_memcpy (path,
1357  get_path,
1358  get_path_length * sizeof(struct GNUNET_PeerIdentity));
1359  GNUNET_memcpy (&path[get_path_length],
1360  data,
1361  size);
1362  GNUNET_MQ_send (m->ch->mq,
1363  env);
1364  }
1365  }
1366  GNUNET_free_non_null (cl);
1367 }
struct ClientHandle * ch
Client to notify of these requests.
struct GNUNET_HashCode * key
Key of data of interest, NULL for all.
Any type of block, used as a wildcard when searching.
static struct ClientMonitorRecord * monitor_head
List of active monitoring requests.
uint32_t get_path_length
Length of the GET path that follows (if tracked).
Definition: dht.h:387
struct GNUNET_HashCode key
The key of the corresponding GET request.
Definition: dht.h:397
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
struct ClientMonitorRecord * next
Next element in DLL.
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
uint32_t put_path_length
Length of the PUT path that follows (if tracked).
Definition: dht.h:382
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
enum GNUNET_BLOCK_Type type
Type of blocks that are of interest.
A 512-bit hashcode.
Struct containing information about a client, handle to connect to it, and any pending messages that ...
struct GNUNET_HashCode key
The key used in the DHT.
static unsigned int size
Size of the "table".
Definition: peer.c:67
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_MQ_Handle * mq
The message queue to this client.
#define GNUNET_array_append(arr, size, element)
Append an element to a list (growing the list by one).
The identity of the host (wraps the signing key of the peer).
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET_RESP
Receive information about transiting GET responses.
Struct containing paremeters of monitoring requests.
uint32_t type
Content type.
Definition: dht.h:377
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
struct GNUNET_TIME_AbsoluteNBO expiration_time
When does the content expire?
Definition: dht.h:392
uint32_t data
The data value.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
Definition: time.c:657
Message to monitor get results going through peer, DHT service -> clients.
Definition: dht.h:367
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GDS_CLIENTS_process_put()

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.

Parameters
optionsOptions, for instance RecordRoute, DemultiplexEverywhere.
typeThe type of data in the request.
hop_countHop count so far.
path_lengthnumber of entries in path (or 0 if not recorded).
pathpeers on the PUT path (or NULL if not recorded).
desired_replication_levelDesired replication level.
expExpiration time of the data.
keyKey under which data is to be stored.
dataPointer to the data carried.
sizeNumber 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_non_null, 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().

1396 {
1397  struct ClientMonitorRecord *m;
1398  struct ClientHandle **cl;
1399  unsigned int cl_size;
1400 
1401  cl = NULL;
1402  cl_size = 0;
1403  for (m = monitor_head; NULL != m; m = m->next)
1404  {
1405  if (((GNUNET_BLOCK_TYPE_ANY == m->type) || (m->type == type) ) &&
1406  ((NULL == m->key) ||
1407  (memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) ))
1408  {
1409  struct GNUNET_MQ_Envelope *env;
1410  struct GNUNET_DHT_MonitorPutMessage *mmsg;
1411  struct GNUNET_PeerIdentity *msg_path;
1412  size_t msize;
1413  unsigned int i;
1414 
1415  /* Don't send duplicates */
1416  for (i = 0; i < cl_size; i++)
1417  if (cl[i] == m->ch)
1418  break;
1419  if (i < cl_size)
1420  continue;
1421  GNUNET_array_append (cl,
1422  cl_size,
1423  m->ch);
1424 
1425  msize = size;
1426  msize += path_length * sizeof(struct GNUNET_PeerIdentity);
1427  env = GNUNET_MQ_msg_extra (mmsg,
1428  msize,
1430  mmsg->options = htonl (options);
1431  mmsg->type = htonl (type);
1432  mmsg->hop_count = htonl (hop_count);
1433  mmsg->desired_replication_level = htonl (desired_replication_level);
1434  mmsg->put_path_length = htonl (path_length);
1435  mmsg->key = *key;
1437  msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1];
1438  GNUNET_memcpy (msg_path,
1439  path,
1440  path_length * sizeof(struct GNUNET_PeerIdentity));
1441  GNUNET_memcpy (&msg_path[path_length],
1442  data,
1443  size);
1444  GNUNET_MQ_send (m->ch->mq,
1445  env);
1446  }
1447  }
1448  GNUNET_free_non_null (cl);
1449 }
struct ClientHandle * ch
Client to notify of these requests.
uint32_t hop_count
Hop count so far.
Definition: dht.h:248
struct GNUNET_HashCode * key
Key of data of interest, NULL for all.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
Receive information about transiting PUTs.
Any type of block, used as a wildcard when searching.
static struct ClientMonitorRecord * monitor_head
List of active monitoring requests.
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:253
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
struct ClientMonitorRecord * next
Next element in DLL.
uint32_t type
The type of data in the request.
Definition: dht.h:243
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:104
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
enum GNUNET_BLOCK_Type type
Type of blocks that are of interest.
Message to monitor put requests going through peer, DHT service -> clients.
Definition: dht.h:228
struct GNUNET_TIME_AbsoluteNBO expiration_time
How long should this data persist?
Definition: dht.h:264
A 512-bit hashcode.
Struct containing information about a client, handle to connect to it, and any pending messages that ...
struct GNUNET_HashCode key
The key used in the DHT.
static unsigned int size
Size of the "table".
Definition: peer.c:67
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_MQ_Handle * mq
The message queue to this client.
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storage location of this message...
Definition: dht.h:259
#define GNUNET_array_append(arr, size, element)
Append an element to a list (growing the list by one).
The identity of the host (wraps the signing key of the peer).
Struct containing paremeters of monitoring requests.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:353
uint32_t options
Message options, actually an &#39;enum GNUNET_DHT_RouteOption&#39; value.
Definition: dht.h:238
uint32_t data
The data value.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
Definition: time.c:657
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:269
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ GDS_cfg

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().

◆ GDS_service

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().

◆ GDS_block_context

struct GNUNET_BLOCK_Context* GDS_block_context

◆ GDS_stats

struct GNUNET_STATISTICS_Handle* GDS_stats

◆ GDS_my_hello

struct GNUNET_MessageHeader* GDS_my_hello

Our HELLO.

Definition at line 45 of file gnunet-service-dht.c.

Referenced by handle_find_peer().