aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-dht.h')
-rw-r--r--src/dht/gnunet-service-dht.h68
1 files changed, 16 insertions, 52 deletions
diff --git a/src/dht/gnunet-service-dht.h b/src/dht/gnunet-service-dht.h
index 2854131c5..d520cc905 100644
--- a/src/dht/gnunet-service-dht.h
+++ b/src/dht/gnunet-service-dht.h
@@ -26,10 +26,10 @@
26#ifndef GNUNET_SERVICE_DHT_H 26#ifndef GNUNET_SERVICE_DHT_H
27#define GNUNET_SERVICE_DHT_H 27#define GNUNET_SERVICE_DHT_H
28 28
29#include "gnunet_util_lib.h" 29#include "gnunet-service-dht_datacache.h"
30#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
31#include "gnunet_transport_service.h" 31#include "gnunet_transport_service.h"
32#include "gnunet_block_lib.h" 32
33 33
34#define DEBUG_DHT GNUNET_EXTRA_LOGGING 34#define DEBUG_DHT GNUNET_EXTRA_LOGGING
35 35
@@ -64,28 +64,16 @@ extern struct GNUNET_MessageHeader *GDS_my_hello;
64 * matches any of our pending queries, forward it to the respective 64 * matches any of our pending queries, forward it to the respective
65 * client(s). 65 * client(s).
66 * 66 *
67 * @param expiration when will the reply expire 67 * @param bd block details
68 * @param key the key of the query that triggered the reply 68 * @param query_hash hash of the original query, might not match key in @a bd
69 * @param query_hash the query hash of the response 69 * @param get_path_length number of entries in @a get_path
70 * @param get_path_length number of peers in @a get_path 70 * @param get_path path the reply has taken
71 * @param get_path path the reply took on get
72 * @param put_path_length number of peers in @a put_path
73 * @param put_path path the reply took on put
74 * @param type type of the reply
75 * @param data_size number of bytes in @a data
76 * @param data application payload data
77 */ 71 */
78void 72void
79GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, 73GDS_CLIENTS_handle_reply (const struct GDS_DATACACHE_BlockData *bd,
80 const struct GNUNET_HashCode *key,
81 const struct GNUNET_HashCode *query_hash, 74 const struct GNUNET_HashCode *query_hash,
82 unsigned int get_path_length, 75 unsigned int get_path_length,
83 const struct GNUNET_PeerIdentity *get_path, 76 const struct GNUNET_PeerIdentity *get_path);
84 unsigned int put_path_length,
85 const struct GNUNET_PeerIdentity *put_path,
86 enum GNUNET_BLOCK_Type type,
87 size_t data_size,
88 const void *data);
89 77
90 78
91/** 79/**
@@ -114,26 +102,14 @@ GDS_CLIENTS_process_get (uint32_t options,
114 * Check if some client is monitoring GET RESP messages and notify 102 * Check if some client is monitoring GET RESP messages and notify
115 * them in that case. 103 * them in that case.
116 * 104 *
117 * @param type The type of data in the result. 105 * @param bd block details
118 * @param get_path Peers on GET path (or NULL if not recorded). 106 * @param get_path Peers on GET path (or NULL if not recorded).
119 * @param get_path_length number of entries in @a get_path. 107 * @param get_path_length number of entries in @a get_path.
120 * @param put_path peers on the PUT path (or NULL if not recorded).
121 * @param put_path_length number of entries in @a get_path.
122 * @param exp Expiration time of the data.
123 * @param key Key of the @a data.
124 * @param data Pointer to the result data.
125 * @param size Number of bytes in @a data.
126 */ 108 */
127void 109void
128GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, 110GDS_CLIENTS_process_get_resp (const struct GDS_DATACACHE_BlockData *bd,
129 const struct GNUNET_PeerIdentity *get_path, 111 const struct GNUNET_PeerIdentity *get_path,
130 unsigned int get_path_length, 112 unsigned int get_path_length);
131 const struct GNUNET_PeerIdentity *put_path,
132 unsigned int put_path_length,
133 struct GNUNET_TIME_Absolute exp,
134 const struct GNUNET_HashCode *key,
135 const void *data,
136 size_t size);
137 113
138 114
139/** 115/**
@@ -141,27 +117,15 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type,
141 * them in that case. The @a path should include our own 117 * them in that case. The @a path should include our own
142 * peer ID (if recorded). 118 * peer ID (if recorded).
143 * 119 *
144 * @param options Options, for instance RecordRoute, DemultiplexEverywhere. 120 * @param options routing options to apply
145 * @param type The type of data in the request. 121 * @param bd details about the block
146 * @param hop_count Hop count so far. 122 * @param hop_count Hop count so far.
147 * @param path_length number of entries in path (or 0 if not recorded).
148 * @param path peers on the PUT path (or NULL if not recorded).
149 * @param desired_replication_level Desired replication level. 123 * @param desired_replication_level Desired replication level.
150 * @param exp Expiration time of the data.
151 * @param key Key under which data is to be stored.
152 * @param data Pointer to the data carried.
153 * @param size Number of bytes in data.
154 */ 124 */
155void 125void
156GDS_CLIENTS_process_put (uint32_t options, 126GDS_CLIENTS_process_put (enum GNUNET_DHT_RouteOption options,
157 enum GNUNET_BLOCK_Type type, 127 const struct GDS_DATACACHE_BlockData *bd,
158 uint32_t hop_count, 128 uint32_t hop_count,
159 uint32_t desired_replication_level, 129 uint32_t desired_replication_level);
160 unsigned int path_length,
161 const struct GNUNET_PeerIdentity *path,
162 struct GNUNET_TIME_Absolute exp,
163 const struct GNUNET_HashCode *key,
164 const void *data,
165 size_t size);
166 130
167#endif 131#endif