41 #define LOG_TRAFFIC(kind, ...) GNUNET_log_from (kind, "dht-traffic", \ 44 #define LOG(kind, ...) GNUNET_log_from (kind, "dht-clients", __VA_ARGS__) 276 if (NULL != record->
hnode)
326 "Local client %p disconnects\n",
329 while (NULL != monitor)
331 if (monitor->
ch == ch)
335 next = monitor->
next;
345 monitor = monitor->
next;
348 while (NULL != (cqr = ch->
cqr_head))
367 "# GET requests from clients injected"),
388 "Initiating GET for %s, replication %u, already have %u replies\n",
483 "# PUT requests received from clients"),
491 "Handling local PUT of %lu-bytes for query %s\n",
500 ntohl (dht_msg->
type),
508 ntohl (dht_msg->
type),
528 ntohl (dht_msg->
type),
577 unsigned int put_path_length,
579 unsigned int get_path_length,
589 put_path_length, put_path,
611 size = ntohs (get->header.size);
613 xquery = (
const char *) &
get[1];
616 (
"# GET requests received from clients"), 1,
619 "Received GET request for %s from local client %p, xq: %.*s\n",
631 cqr->
xquery = (
void *) &cqr[1];
638 cqr->
replication = ntohl (get->desired_replication_level);
640 cqr->
type = ntohl (get->type);
651 ntohl (get->desired_replication_level),
656 if (NULL != retry_task)
724 unsigned int hash_count;
728 / sizeof(struct GNUNET_HashCode);
730 + hash_count *
sizeof(
struct GNUNET_HashCode))
752 unsigned int hash_count;
753 unsigned int old_count;
760 / sizeof(struct GNUNET_HashCode);
761 hc = (
const struct GNUNET_HashCode*) &seen[1];
768 if (NULL == (cqr = fui_ctx.
cqr))
781 sizeof(
struct GNUNET_HashCode) * hash_count);
822 "Removing client %p's record for key %s (by unique id)\n",
848 (
"# GET STOP requests received from clients"), 1,
851 "Received GET STOP request for %s from local client %p\n",
881 r->
get = ntohs (msg->
get);
883 r->
put = ntohs (msg->
put);
918 for (r = monitor_head; NULL != r; r = r->
next)
926 keys_match = ((0 != ntohs (msg->
filter_key)) &&
1022 "CLIENT-RESULT %s\n",
1028 "Record type mismatch, not passing request for key %s to local client\n",
1033 "# Key match, type mismatches in REPLY to CLIENT"),
1044 "Duplicate reply, not passing request for key %s to local client\n",
1049 "# Duplicate REPLIES to CLIENT request dropped"),
1064 "Evaluation result is %d for key %s for local client's query\n",
1102 _ (
"Unsupported block type (%u) in request!\n"), record->
type);
1135 "Sending reply to query %s for client %p\n",
1164 unsigned int get_path_length,
1166 unsigned int put_path_length,
1176 + (get_path_length + put_path_length) *
sizeof(
struct 1187 "No matching client for reply for key %s\n",
1191 "# REPLIES ignored for CLIENTS (no match)"),
1205 "Forwarding reply for key %s to client\n",
1230 uint32_t desired_replication_level,
1231 unsigned int path_length,
1237 unsigned int cl_size;
1241 for (m = monitor_head; NULL !=
m; m = m->
next)
1244 (m->
type == type)) &&
1245 ((NULL == m->
key) ||
1257 for (i = 0; i < cl_size; i++)
1270 mmsg->
options = htonl (options);
1271 mmsg->
type = htonl (type);
1305 unsigned int get_path_length,
1307 unsigned int put_path_length,
1315 unsigned int cl_size;
1319 for (m = monitor_head; NULL !=
m; m = m->
next)
1322 ((NULL == m->
key) ||
1332 for (i = 0; i < cl_size; i++)
1342 msize += (get_path_length + put_path_length)
1347 mmsg->
type = htonl (type);
1389 uint32_t desired_replication_level,
1390 unsigned int path_length,
1399 unsigned int cl_size;
1403 for (m = monitor_head; NULL !=
m; m = m->
next)
1406 ((NULL == m->
key) ||
1416 for (i = 0; i < cl_size; i++)
1430 mmsg->
options = htonl (options);
1431 mmsg->
type = htonl (type);
1474 if (NULL != retry_task)
1488 #define GDS_DHT_SERVICE_INIT(name, run) \ 1489 GNUNET_SERVICE_MAIN \ 1491 GNUNET_SERVICE_OPTION_NONE, \ 1493 &client_connect_cb, \ 1494 &client_disconnect_cb, \ 1496 GNUNET_MQ_hd_var_size (dht_local_put, \ 1497 GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT, \ 1498 struct GNUNET_DHT_ClientPutMessage, \ 1500 GNUNET_MQ_hd_var_size (dht_local_get, \ 1501 GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET, \ 1502 struct GNUNET_DHT_ClientGetMessage, \ 1504 GNUNET_MQ_hd_fixed_size (dht_local_get_stop, \ 1505 GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_STOP, \ 1506 struct GNUNET_DHT_ClientGetStopMessage, \ 1508 GNUNET_MQ_hd_fixed_size (dht_local_monitor, \ 1509 GNUNET_MESSAGE_TYPE_DHT_MONITOR_START, \ 1510 struct GNUNET_DHT_MonitorStartStopMessage, \ 1512 GNUNET_MQ_hd_fixed_size (dht_local_monitor_stop, \ 1513 GNUNET_MESSAGE_TYPE_DHT_MONITOR_STOP, \ 1514 struct GNUNET_DHT_MonitorStartStopMessage, \ 1516 GNUNET_MQ_hd_var_size (dht_local_get_result_seen, \ 1517 GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN, \ 1518 struct GNUNET_DHT_ClientGetResultSeenMessage, \ 1520 GNUNET_MQ_handler_end ()) 1529 if (NULL != retry_heap)
1535 if (NULL != forward_map)
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
Block does not match query (invalid result)
uint64_t unique_id
The unique identifier of this request.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_init(const char *data, size_t size, unsigned int k)
Create a Bloom filter from raw bits.
struct GNUNET_PeerIdentity * GDS_NEIGHBOURS_get_id()
Get the ID of the local node.
struct ClientQueryRecord * cqr_tail
Linked list of active queries of this client.
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT
Service returns result to client.
Closure for forward_reply()
const struct GNUNET_PeerIdentity * put_path
PUT path taken.
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
Functions with this signature are called whenever a client is disconnected on the network level...
struct ClientHandle * ch
Client to notify of these requests.
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Handle to an initialized block library.
uint64_t unique_id
Unique ID of the matching GET request.
static int check_dht_local_put(void *cls, const struct GNUNET_DHT_ClientPutMessage *dht_msg)
Check DHT PUT messages from the client.
struct GNUNET_MessageHeader * msg
uint32_t hop_count
Hop count so far.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
uint64_t rel_value_us
The actual value.
#define GNUNET_array_append(arr, len, element)
Append an element to an array (growing the array by one).
struct GNUNET_HashCode * key
Key of data of interest, NULL for all.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
Receive information about transiting PUTs.
DHT GET RESULTS KNOWN message sent from clients to service.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storgage location of this message...
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).
struct GNUNET_CONTAINER_HeapNode * GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, void *element, GNUNET_CONTAINER_HeapCostType cost)
Inserts a new element into the heap.
struct GNUNET_GETOPT_CommandLineOption options[]
static void handle_local_result(void *cls, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute expiration_time, const struct GNUNET_HashCode *key, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *get_path, const void *data, size_t data_size)
Handle a result from local datacache for a GET operation.
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
uint32_t desired_replication_level
Replication level for this message.
static struct GNUNET_SCHEDULER_Task * retry_task
Task that re-transmits requests (using retry_heap).
struct GNUNET_STATISTICS_Handle * GDS_stats
Handle for the statistics service.
#define DHT_BLOOM_SIZE
Size of the bloom filter the DHT uses to filter peers.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
static size_t data_size
Number of bytes in data.
static struct GNUNET_CONTAINER_MultiHashMap * forward_map
Hashmap for fast key based lookup, maps keys to struct ClientQueryRecord entries. ...
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_CONSTANTS_BLOOMFILTER_K
K-value that must be used for the bloom filters in 'GET' queries.
void __attribute__((destructor))
MINIMIZE heap size (way below 128k) since this process doesn't need much.
#define GNUNET_TIME_UNIT_SECONDS
One second.
uint32_t type
The type of data desired, GNUNET_BLOCK_TYPE_ANY for all.
struct ClientQueryRecord * next
Kept in a DLL with client.
struct GNUNET_HashCode key
The key of the corresponding GET request.
enum GNUNET_BLOCK_Type type
The type for the data for the GET request.
Message to insert data into the DHT, sent from clients to DHT service.
static void handle_dht_local_get_result_seen(void *cls, const struct GNUNET_DHT_ClientGetResultSeenMessage *seen)
Handler for "GET result seen" messages from the client.
struct ClientQueryRecord * prev
Kept in a DLL with client.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
struct ClientMonitorRecord * next
Next element in DLL.
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.
Block does not match xquery (valid result, not relevant for the request)
uint32_t type
The type of data in the request.
enum GNUNET_BLOCK_Type type
Type of the data.
int16_t get_resp
Flag whether to notify about GET_REPONSE messages.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
uint16_t put
Flag whether to notify about PUT messages.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_SERVICE_Handle * GDS_service
Handle for the service.
uint64_t abs_value_us
The actual value.
unsigned int get_path_length
Number of entries in get_path.
Internal representation of the hash map.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
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.
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 int check_dht_local_get(void *cls, const struct GNUNET_DHT_ClientGetMessage *get)
Check DHT GET messages from the client.
uint32_t desired_replication_level
Replication level for this message.
Handle to a client that is connected to a service.
static void transmit_next_request_task(void *cls)
Task that looks at the retry_heap and transmits all of the requests on the heap that are ready for tr...
struct ClientQueryRecord * cqr_head
Linked list of active queries of this client.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
struct GNUNET_TIME_Relative retry_frequency
What's the delay between re-try operations that we currently use for this request?
Closure for remove_by_unique_id().
static void handle_dht_local_monitor_stop(void *cls, const struct GNUNET_DHT_MonitorStartStopMessage *msg)
Handler for monitor stop messages.
uint32_t replication
Desired replication level.
struct ClientHandle * ch
Client responsible for the request.
uint64_t unique_id
Unique ID identifying this request.
uint32_t put_path_length
Length of the PUT path that follows (if tracked).
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
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.
enum GNUNET_BLOCK_Type type
Type of blocks that are of interest.
uint32_t type
The type of data to insert.
#define GNUNET_array_grow(arr, size, tsize)
Grow a well-typed (!) array.
Message to monitor put requests going through peer, DHT service -> clients.
static char * value
Value of the record to add/remove.
Valid result, but suppressed because it is a duplicate.
int16_t filter_key
Flag whether to use the provided key to filter messages.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
uint64_t unique_id
Unique ID identifying this request.
int16_t put
Flag whether to notify about PUT messages.
struct GNUNET_TIME_AbsoluteNBO expiration_time
How long should this data persist?
unsigned int put_path_length
Number of entries in put_path.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
Message to request monitoring messages, clients -> DHT service.
struct GNUNET_HashCode key
The key that was searched for.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate(struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type, struct GNUNET_BLOCK_Group *group, enum GNUNET_BLOCK_EvaluationOptions eo, const struct GNUNET_HashCode *query, const void *xquery, size_t xquery_size, const void *reply_block, size_t reply_block_size)
Function called to validate a reply or a request.
void GDS_DATACACHE_handle_put(struct GNUNET_TIME_Absolute expiration, const struct GNUNET_HashCode *key, 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 datum we've received from another peer.
Last possible valid result.
Closure for find_by_unique_id().
int 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.
Handle to a node in a heap.
uint64_t unique_id
Unique ID of the request.
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.
struct GNUNET_TIME_AbsoluteNBO expiration
When does this entry expire?
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
uint32_t type
The type for the data.
static void handle_dht_local_put(void *cls, const struct GNUNET_DHT_ClientPutMessage *dht_msg)
Handler for PUT messages.
Heap with the minimum cost at the root.
struct GNUNET_HashCode key
The key to store the value under.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
static char * expiration
Credential TTL.
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET
Receive information about transiting GETs.
struct GNUNET_SERVICE_Client * client
The handle to this client.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Entry in the local forwarding map for a client's GET request.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT.
unsigned int GNUNET_CONTAINER_heap_get_size(const struct GNUNET_CONTAINER_Heap *heap)
Get the current size of the heap.
Valid result, and there may be more.
Struct containing information about a client, handle to connect to it, and any pending messages that ...
struct GNUNET_TIME_AbsoluteNBO expiration
How long should this data persist?
uint32_t msg_options
Any message options for this request.
static unsigned int size
Size of the "table".
struct ClientHandle * ch
Client that issued the removal request.
size_t xquery_size
Number of bytes in xquery.
static struct ClientMonitorRecord * monitor_tail
List of active monitoring requests.
uint32_t get_path_length
Number of peers recorded in the outgoing path from source to the storage location of this message...
static void transmit_request(struct ClientQueryRecord *cqr)
Route the given request via the DHT.
static void GDS_CLIENTS_stop()
Shutdown client subsystem.
GNUNET_BLOCK_EvaluationResult
Possible ways for how a block may relate to a query.
static int find_by_unique_id(void *cls, const struct GNUNET_HashCode *key, void *value)
Function called for each existing DHT record for the given query.
const char * GNUNET_h2s_full(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
struct GNUNET_MQ_Envelope * env
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN.
struct GNUNET_MQ_Handle * mq
The message queue to this client.
static void remove_client_record(struct ClientQueryRecord *record)
Free data structures associated with the given query.
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
const struct GNUNET_CONFIGURATION_Handle * GDS_cfg
The configuration the DHT service is running with.
struct GNUNET_HashCode * seen_replies
Replies we have already seen for this request.
struct ClientMonitorRecord * prev
Previous element in DLL.
int 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_BLOCK_Group * GNUNET_BLOCK_group_create(struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type, uint32_t nonce, const void *raw_data, size_t raw_data_size,...)
Create a new block group.
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storage location of this message...
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message...
int16_t get_resp
Flag whether to notify about GET_REPONSE messages.
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Functions with this signature are called whenever a local client is connects to us.
int GDS_NEIGHBOURS_handle_get(enum GNUNET_BLOCK_Type type, enum GNUNET_DHT_RouteOption options, uint32_t desired_replication_level, uint32_t hop_count, const struct GNUNET_HashCode *key, const void *xquery, size_t xquery_size, struct GNUNET_BLOCK_Group *bg, struct GNUNET_CONTAINER_BloomFilter *peer_bf)
Perform a GET operation.
static struct GNUNET_CONTAINER_Heap * retry_heap
Heap with all of our client's request, sorted by retry time (earliest on top).
Specified block type not supported by this plugin.
uint32_t desired_replication_level
Replication level for this message.
Allow multiple values with the same key.
Handle to a message queue.
struct ClientQueryRecord * cqr
Where to store the result, if found.
int16_t get
Flag whether to notify about GET messages.
struct GNUNET_HashCode key
The key to store the value under.
GNUnet DHT service's datacache integration.
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.
int16_t get
Flag whether to notify about GET messages.
uint32_t get_path_length
The number of peer identities recorded from the storage location to this peer.
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.
struct GNUNET_HashCode key
Key of this request.
static int monitor
Monitor ARM activity.
static void handle_dht_local_get(void *cls, const struct GNUNET_DHT_ClientGetMessage *get)
Handler for DHT GET messages from the client.
Struct containing parameters of monitoring requests.
unsigned int seen_replies_count
Number of entries in 'seen_replies'.
#define LOG_TRAFFIC(kind,...)
Should routing details be logged to stderr (for debugging)?
DHT GET message sent from clients to service.
Query format does not match block type (invalid query).
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.
struct GNUNET_MQ_Handle * mq
#define GNUNET_log(kind,...)
Entry in list of pending tasks.
void * GNUNET_CONTAINER_heap_remove_root(struct GNUNET_CONTAINER_Heap *heap)
Remove root of the heap.
static void GDS_CLIENTS_init()
Initialize client subsystem.
size_t data_size
Number of bytes in data.
static int check_dht_local_get_result_seen(void *cls, const struct GNUNET_DHT_ClientGetResultSeenMessage *seen)
Check "GET result seen" messages from the client.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
uint32_t type
The type of data in the request.
enum GNUNET_BLOCK_EvaluationResult 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.
struct GNUNET_HashCode key
The key to filter messages by.
const struct GNUNET_PeerIdentity * get_path
GET path taken.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
Message which indicates the DHT should cancel outstanding requests and discard any state...
static void handle_dht_local_monitor(void *cls, const struct GNUNET_DHT_MonitorStartStopMessage *msg)
Handler for monitor start messages.
uint32_t type
Content type.
Time for absolute times used by GNUnet, in microseconds.
Message to monitor get requests going through peer, DHT service -> clients.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
uint32_t hop_count
Hop count.
struct GNUNET_BLOCK_Context * GDS_block_context
Our handle to the BLOCK library.
struct GNUNET_TIME_AbsoluteNBO expiration_time
When does the content expire?
static int remove_by_unique_id(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterator over hash map entries that frees all entries that match the given client and unique ID...
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_at(struct GNUNET_TIME_Absolute at, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run at the specified time.
uint32_t data
The data value.
void * GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node)
Removes a node from the heap.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
struct GNUNET_HashCode key
The key this request was about.
Query is valid, no reply given.
static void handle_dht_local_get_stop(void *cls, const struct GNUNET_DHT_ClientGetStopMessage *dht_stop_msg)
Handler for any generic DHT stop messages, calls the appropriate handler depending on message type (i...
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
void GNUNET_CONTAINER_bloomfilter_free(struct GNUNET_CONTAINER_BloomFilter *bf)
Free the space associated with a filter in memory, flush to drive if needed (do not free the space on...
Message to monitor get results going through peer, DHT service -> clients.
struct GNUNET_TIME_Absolute retry_time
What's the next time we should re-try this request?
struct GNUNET_TIME_Absolute expiration
Expiration time of the reply.
struct GNUNET_HashCode key
The key to store the value under.
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_malloc(size)
Wrapper around malloc.
struct GNUNET_CONTAINER_HeapNode * hnode
Pointer to this nodes heap location in the retry-heap (for fast removal)
Reply to a GET send from the service to a client.
struct GNUNET_HashCode key
The key we are searching for (to make it easy to find the corresponding GET inside the service)...
#define GNUNET_free(ptr)
Wrapper around free.
Time for relative time used by GNUnet, in microseconds.
void GNUNET_BLOCK_group_destroy(struct GNUNET_BLOCK_Group *bg)
Destroy resources used by a block group.
const void * xquery
Extended query (see gnunet_block_lib.h), allocated at the end of this struct.
int GNUNET_BLOCK_group_set_seen(struct GNUNET_BLOCK_Group *bg, const struct GNUNET_HashCode *seen_results, unsigned int seen_results_count)
Update block group to filter out the given results.
#define gettext_noop(String)
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
const void * data
Embedded payload.
int GDS_NEIGHBOURS_handle_put(enum GNUNET_BLOCK_Type type, enum GNUNET_DHT_RouteOption options, uint32_t desired_replication_level, struct GNUNET_TIME_Absolute expiration_time, uint32_t hop_count, struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *key, unsigned int put_path_length, struct GNUNET_PeerIdentity *put_path, const void *data, size_t data_size)
Perform a PUT operation.