31 #include "gnunet_signatures.h"
38 #define LOG(kind, ...) GNUNET_log_from (kind, "dht-api", __VA_ARGS__)
327 get_msg->
options = htonl ((uint32_t)
gh->options);
329 get_msg->
type = htonl (
gh->type);
330 get_msg->
key =
gh->key;
351 unsigned int transmission_offset_start)
358 unsigned int transmission_offset;
362 transmission_offset = transmission_offset_start;
363 while (transmission_offset < gh->seen_results_end)
365 delta =
gh->seen_results_end - transmission_offset;
372 msg->unique_id =
gh->unique_id;
374 &
gh->seen_results[transmission_offset],
378 transmission_offset +=
delta;
401 "Retransmitting request related to %s to DHT %p\n",
424 m->type = htonl (
mh->type);
425 m->get = htons (NULL !=
mh->get_cb);
426 m->get_resp = htons (NULL !=
mh->get_resp_cb);
427 m->put = htons (NULL !=
mh->put_cb);
430 m->filter_key = htons (1);
450 "Reconnecting with DHT %p\n",
457 "DHT reconnect failed!\n");
467 for (
mh =
h->monitor_head; NULL !=
mh;
mh =
mh->next)
489 "Disconnecting from DHT service, will try to reconnect in %s\n",
493 while (NULL != (
ph =
h->put_head))
546 if (NULL ==
mh->get_cb)
551 if ( (NULL !=
mh->key) &&
555 mh->get_cb (
mh->cb_cls,
558 ntohl (
msg->hop_count),
559 ntohl (
msg->desired_replication_level),
577 size_t msize = ntohs (
msg->header.
size) -
sizeof(*msg);
578 uint32_t getl = ntohl (
msg->get_path_length);
579 uint32_t putl = ntohl (
msg->put_path_length);
593 if ((getl + putl < getl) ||
614 size_t msize = ntohs (
msg->header.
size) -
sizeof(*msg);
617 uint32_t getl = ntohl (
msg->get_path_length);
618 uint32_t putl = ntohl (
msg->put_path_length);
636 if (NULL ==
mh->get_resp_cb)
641 if ( (NULL !=
mh->key) &&
645 mh->get_resp_cb (
mh->cb_cls,
654 (
const void *) &path[getl + putl],
672 size_t msize = ntohs (
msg->header.
size) -
sizeof(*msg);
673 uint32_t putl = ntohl (
msg->put_path_length);
707 size_t msize = ntohs (
msg->header.
size) -
sizeof(*msg);
708 uint32_t putl = ntohl (
msg->put_path_length);
728 if (NULL ==
mh->put_cb)
733 if ( (NULL !=
mh->key) &&
737 mh->put_cb (
mh->cb_cls,
740 ntohl (
msg->hop_count),
741 ntohl (
msg->desired_replication_level),
747 (
const void *) &path[putl],
765 size_t msize = ntohs (
msg->header.
size) -
sizeof(*msg);
766 uint32_t put_path_length = ntohl (
msg->put_path_length);
767 uint32_t get_path_length = ntohl (
msg->get_path_length);
783 if ( (get_path_length + put_path_length >
785 (get_path_length + put_path_length <
810 size_t msize = ntohs (crm->
header.
size) -
sizeof(*crm);
816 uint32_t put_path_length
818 uint32_t get_path_length
829 = &put_path[put_path_length];
831 = &get_path[get_path_length];
834 * (get_path_length + put_path_length);
836 = msize - meta_length;
845 "Ignoring reply for %s: UID mismatch: %llu/%llu\n",
868 "Giving %u byte reply for %s to application (GP: %s, PP: %s)\n",
869 (
unsigned int) data_length,
931 uint16_t
len = ntohs (hdr->
size);
932 const char *
buf = (
const char *) &hdr[1];
935 if (
'\0' !=
buf[
len -
sizeof (*hdr) - 1])
955 const char *url = (
const char *) &hdr[1];
958 while (NULL != (hgh =
handle->hgh_head))
1031 "Failed to connect to the DHT service!\n");
1040 unsigned int ht_len)
1068 while (NULL != (
ph =
handle->put_head))
1070 if (NULL !=
ph->cont)
1071 ph->cont (
ph->cont_cls);
1092 uint32_t desired_replication_level,
1116 "Sending PUT for %s to DHT via %p\n",
1122 ph->cont_cls = cont_cls;
1133 put_msg->
type = htonl ((uint32_t)
type);
1152 if (NULL !=
ph->env)
1185 "Sending query for %s to DHT %p\n",
1191 gh->iter_cls = iter_cls;
1195 gh->xquery_size = xquery_size;
1214 unsigned int num_results,
1217 unsigned int needed;
1221 needed = had + num_results;
1242 "Sending STOP for %s to DHT via %p\n",
1313 m->type = htonl (
mh->type);
1314 m->get = htons (NULL !=
mh->get_cb);
1315 m->get_resp = htons (NULL !=
mh->get_resp_cb);
1316 m->put = htons (NULL !=
mh->put_cb);
1317 if (NULL !=
mh->key)
1319 m->filter_key = htons (1);
1331 unsigned int path_len)
1335 size_t plen = path_len * 5 + 1;
1340 for (
unsigned int i = 0; i < path_len; i++)
1346 (i == path_len - 1) ?
"" :
"-");
1358 unsigned int put_path_len,
1360 unsigned int get_path_len,
1366 .purpose.size = htonl (
sizeof (hs)),
1371 if (0 == get_path_len + put_path_len)
1374 "%s is verifying signatures with GPL: %u PPL: %u!\n",
1378 for (
unsigned int j = 0; j<put_path_len; j++)
1383 for (
unsigned int j = 0; j<get_path_len; j++)
1391 i = put_path_len + get_path_len;
1401 pred = (NULL == bpid) ? &
zero : bpid;
1405 unsigned int off = i - 1;
1407 pred = (off >= put_path_len)
1408 ? &get_path[off - put_path_len].
pred
1409 : &put_path[off].
pred;
1411 if (i == get_path_len + put_path_len - 1)
1417 unsigned int off = i + 1;
1419 succ = (off >= put_path_len)
1420 ? &get_path[off - put_path_len].
pred
1421 : &put_path[off].
pred;
1425 pe = (i >= put_path_len)
1426 ? &get_path[i - put_path_len]
1486 size_t slen = strlen (url) + 1;
struct GNUNET_GETOPT_CommandLineOption options[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
@ GNUNET_BLOCK_TYPE_ANY
Identifier for any block.
#define GNUNET_SIGNATURE_PURPOSE_DHT_HOP
Signature by which a peer affirms that it forwarded a message in the DHT.
static void send_get(struct GNUNET_DHT_GetHandle *gh)
Send GET message for a get_handle to DHT.
static void handle_monitor_get_resp(void *cls, const struct GNUNET_DHT_MonitorGetRespMessage *msg)
Process a get response monitor message from the service.
static enum GNUNET_GenericReturnValue try_connect(struct GNUNET_DHT_Handle *h)
Try to (re)connect to the DHT service.
static void handle_client_result(void *cls, const struct GNUNET_DHT_ClientResultMessage *msg)
Process a client result message received from the service.
static void handle_client_hello(void *cls, const struct GNUNET_MessageHeader *hdr)
Process a client HELLO message received from the service.
static void try_reconnect(void *cls)
Try reconnecting to the dht service.
static enum GNUNET_GenericReturnValue process_client_result(void *cls, const struct GNUNET_HashCode *key, void *value)
Process a given reply that might match the given request.
static enum GNUNET_GenericReturnValue check_monitor_get_resp(void *cls, const struct GNUNET_DHT_MonitorGetRespMessage *msg)
Validate a get response monitor message from the service.
static void mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static void handle_monitor_get(void *cls, const struct GNUNET_DHT_MonitorGetMessage *msg)
Process a get monitor message from the service.
static enum GNUNET_GenericReturnValue check_client_result(void *cls, const struct GNUNET_DHT_ClientResultMessage *msg)
Verify that client result message received from the service is well-formed.
static enum GNUNET_GenericReturnValue check_client_hello(void *cls, const struct GNUNET_MessageHeader *hdr)
Process a client HELLO message received from the service.
static void do_disconnect(struct GNUNET_DHT_Handle *h)
Try reconnecting to the DHT service.
static void handle_put_cont(void *cls)
Process a MQ PUT transmission notification.
static enum GNUNET_GenericReturnValue add_get_request_to_pending(void *cls, const struct GNUNET_HashCode *key, void *value)
Add the GET request corresponding to the given route handle to the pending queue (if it is not alread...
static void send_get_known_results(struct GNUNET_DHT_GetHandle *gh, unsigned int transmission_offset_start)
Send GET message(s) for indicating which results are already known for a get_handle to DHT.
static void handle_monitor_put(void *cls, const struct GNUNET_DHT_MonitorPutMessage *msg)
Process a put monitor message from the service.
static enum GNUNET_GenericReturnValue check_monitor_put(void *cls, const struct GNUNET_DHT_MonitorPutMessage *msg)
Check validity of a put monitor message from the service.
static void send_monitor_start(struct GNUNET_DHT_MonitorHandle *mh)
Send GNUNET_MESSAGE_TYPE_DHT_MONITOR_START message.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static size_t data_size
Number of bytes in data.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct GNUNET_ATS_PerformanceHandle * ph
ATS performance handle used.
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
static struct GNUNET_CADET_Handle * mh
Cadet handle.
static GNUNET_NETWORK_STRUCT_END struct GNUNET_PeerIdentity me
Our own peer identity.
static struct GNUNET_DHT_GetHandle * get_handle
Handle for the get request.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
uint32_t data
The data value.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
static char * value
Value of the record to add/remove.
static struct GNUNET_TRANSPORT_HelloGetHandle * gh
Pending GNUNET_TRANSPORT_hello_get() operation.
static unsigned int results
static const struct GNUNET_IDENTITY_PrivateKey zero
Public key of all zeros.
Helper library for handling HELLOs.
Constants for network protocols.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
uint64_t GNUNET_CRYPTO_random_u64(enum GNUNET_CRYPTO_Quality mode, uint64_t max)
Generate a random unsigned 64-bit value.
#define GNUNET_CRYPTO_eddsa_verify(purp, ps, sig, pub)
Verify EdDSA signature.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
void GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph)
Cancels a DHT PUT operation.
GNUNET_DHT_RouteOption
Options for routing.
char * GNUNET_DHT_pp2s(const struct GNUNET_DHT_PathElement *path, unsigned int path_len)
Convert a peer path to a human-readable string.
struct GNUNET_DHT_MonitorHandle * GNUNET_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.
void GNUNET_DHT_hello_get_cancel(struct GNUNET_DHT_HelloGetHandle *hgh)
Cancel hello get operation.
void GNUNET_DHT_get_stop(struct GNUNET_DHT_GetHandle *get_handle)
Stop async DHT-get.
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.
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.
struct GNUNET_DHT_Handle * GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int ht_len)
Initialize the connection with the DHT service.
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.
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.
void(* GNUNET_DHT_HelloGetCallback)(void *cls, const char *hello_url)
Signature called with the result of a HELLO GET operation.
struct GNUNET_DHT_PutHandle * GNUNET_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.
struct GNUNET_DHT_HelloGetHandle * GNUNET_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.
void GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle)
Shutdown connection with the DHT service.
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.
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.
struct GNUNET_DHT_GetHandle * GNUNET_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.
unsigned int GNUNET_DHT_verify_path(const void *data, size_t data_size, struct GNUNET_TIME_Absolute exp_time, const struct GNUNET_PeerIdentity *bpid, 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 las...
void GNUNET_DHT_monitor_stop(struct GNUNET_DHT_MonitorHandle *mh)
Stop monitoring.
@ GNUNET_DHT_RO_TRUNCATED
Flag set if the path was truncated.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_array_grow(arr, size, tsize)
Grow a well-typed (!) array.
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Call a callback once the envelope has been sent, that is, sending it can not be canceled anymore.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET
Receive information about transiting GETs.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET_RESP
Receive information about transiting GET responses.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT
Client wants to store item in DHT.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_START
Request information about transiting messages.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN
Certain results are already known to the client, filter those.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
Receive information about transiting PUTs.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_STOP
Client wants to stop search in DHT.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT
Service returns result to client.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_STOP
Stop information about transiting messages.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_HELLO_GET
Client requests DHT service's HELLO URL.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_HELLO_URL
HELLO URL send between client and service (in either direction).
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET
Client wants to lookup item in DHT.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
static unsigned int size
Size of the "table".
static enum GNUNET_GenericReturnValue get_cb(void *cls, const struct GNUNET_HashCode *key, void *value)
Function called during GET to find matching blocks.
static enum GNUNET_GenericReturnValue put_cb(void *cls, const struct GNUNET_HashCode *key, void *value)
Function called during PUT to detect if an equivalent block already exists.
static struct GNUNET_TIME_Relative delta
struct GNUNET_MQ_Handle * mq
Our connection to the ARM service.
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration that we are using.
struct GNUNET_SCHEDULER_Task * reconnect_task
ID of the reconnect task (if any).
Internal representation of the hash map.
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
DHT GET message sent from clients to service.
uint64_t unique_id
Unique ID identifying this request, if 0 then the client will not expect a response.
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
struct GNUNET_HashCode key
The key to search for.
uint32_t type
The type for the data for the GET request; actually an 'enum GNUNET_BLOCK_Type'.
uint32_t desired_replication_level
Replication level for this message.
DHT GET RESULTS KNOWN message sent from clients to service.
Message which indicates the DHT should cancel outstanding requests and discard any state.
uint64_t unique_id
Unique ID identifying this request.
struct GNUNET_HashCode key
Key of this request.
uint32_t reserved
Always zero.
Message to insert data into the DHT, sent from clients to DHT service.
struct GNUNET_HashCode key
The key to store the value under.
uint32_t type
The type of data to insert.
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
uint32_t desired_replication_level
Replication level for this message.
struct GNUNET_TIME_AbsoluteNBO expiration
How long should this data persist?
Reply to a GET send from the service to a client.
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storgage location of this message.
uint64_t unique_id
Unique ID of the matching GET request.
struct GNUNET_TIME_AbsoluteNBO expiration
When does this entry expire?
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT.
uint32_t type
The type for the data.
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
uint32_t get_path_length
The number of peer identities recorded from the storage location to this peer.
GNUNET_DHT_GetIterator iter
Iterator to call on data receipt.
enum GNUNET_BLOCK_Type type
Type of the block we are looking for.
void * iter_cls
Closure for iter.
unsigned int seen_results_end
Offset into the seen_results array marking the end of the positions that are actually used.
struct GNUNET_HashCode * seen_results
Array of hash codes over the results that we have already seen.
size_t xquery_size
Size of the extended query, allocated at the end of this struct.
uint32_t desired_replication_level
Desired replication level.
struct GNUNET_HashCode key
Key that this get request is for.
uint64_t unique_id
Unique identifier for this request (for key collisions).
struct GNUNET_DHT_Handle * dht_handle
Main handle to this DHT api.
enum GNUNET_DHT_RouteOption options
Routing options.
unsigned int seen_results_size
Size of the seen_results array.
Connection to the DHT service.
struct GNUNET_CONTAINER_MultiHashMap * active_requests
Hash map containing the current outstanding unique GET requests (values are of type struct GNUNET_DHT...
struct GNUNET_TIME_Relative retry_time
How quickly should we retry? Used for exponential back-off on connect-errors.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task for trying to reconnect.
struct GNUNET_DHT_PutHandle * put_tail
Tail of active PUT requests.
struct GNUNET_DHT_MonitorHandle * monitor_tail
Tail of linked list of messages we would like to monitor.
struct GNUNET_MQ_Handle * mq
Connection to DHT service.
struct GNUNET_DHT_PutHandle * put_head
Head of active PUT requests.
struct GNUNET_DHT_MonitorHandle * monitor_head
Head of linked list of messages we would like to monitor.
struct GNUNET_DHT_HelloGetHandle * hgh_tail
DLL.
uint64_t uid_gen
Generator for unique ids.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
struct GNUNET_DHT_HelloGetHandle * hgh_head
DLL.
Handle to get a HELLO URL from the DHT for manual bootstrapping.
struct GNUNET_DHT_Handle * dht_handle
Connection to the DHT service.
GNUNET_DHT_HelloGetCallback cb
Function to call with the result.
void * cb_cls
Closure for cb.
struct GNUNET_DHT_HelloGetHandle * prev
DLL.
struct GNUNET_DHT_HelloGetHandle * next
DLL.
Message signed by a peer when doing path tracking.
struct GNUNET_HashCode h_data
Hash over the payload of the block.
struct GNUNET_CRYPTO_EccSignaturePurpose purpose
Must be GNUNET_SIGNATURE_PURPOSE_DHT_HOP.
struct GNUNET_PeerIdentity pred
Previous hop the message was received from.
struct GNUNET_PeerIdentity succ
Next hop the message was forwarded to.
Message to monitor get requests going through peer, DHT service -> clients.
Message to monitor get results going through peer, DHT service -> clients.
Handle to a monitoring request.
GNUNET_DHT_MonitorGetRespCB get_resp_cb
Callback for each received message of type get response.
struct GNUNET_HashCode * key
Key being looked for, NULL == all.
struct GNUNET_DHT_MonitorHandle * prev
DLL.
struct GNUNET_DHT_MonitorHandle * next
DLL.
GNUNET_DHT_MonitorPutCB put_cb
Callback for each received message of type put.
struct GNUNET_DHT_Handle * dht_handle
Main handle to this DHT api.
GNUNET_DHT_MonitorGetCB get_cb
Callback for each received message of type get.
void * cb_cls
Closure for get_cb, put_cb and get_resp_cb.
enum GNUNET_BLOCK_Type type
Type of block looked for.
Message to monitor put requests going through peer, DHT service -> clients.
Message to request monitoring messages, clients -> DHT service.
A (signed) path tracking a block's flow through the DHT is represented by an array of path elements,...
struct GNUNET_PeerIdentity pred
Previous peer on the path (matches "pred" in the signed field).
struct GNUNET_CRYPTO_EddsaSignature sig
Signature affirming the hop of type GNUNET_SIGNATURE_PURPOSE_DHT_HOP.
struct GNUNET_DHT_Handle * dht_handle
Main handle to this DHT api.
struct GNUNET_DHT_PutHandle * prev
Kept in a DLL.
void * cont_cls
Closure for cont.
struct GNUNET_MQ_Envelope * env
Envelope from the PUT operation.
struct GNUNET_DHT_PutHandle * next
Kept in a DLL.
GNUNET_SCHEDULER_TaskCallback cont
Continuation to call when done.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task to reconnect to the service.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration to use.
struct GNUNET_MQ_Handle * mq
Connection to DNS service, or NULL.
Handle to a message queue.
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model