summaryrefslogtreecommitdiff
path: root/src/include/gnunet_dht_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_dht_service.h')
-rw-r--r--src/include/gnunet_dht_service.h76
1 files changed, 39 insertions, 37 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index e22d2b5df..573a800e5 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -51,7 +51,8 @@ extern "C"
51/** 51/**
52 * Default republication frequency for stored data in the DHT. 52 * Default republication frequency for stored data in the DHT.
53 */ 53 */
54#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60) 54#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply ( \
55 GNUNET_TIME_UNIT_MINUTES, 60)
55 56
56 57
57 58
@@ -74,7 +75,8 @@ struct GNUNET_DHT_FindPeerHandle;
74/** 75/**
75 * Options for routing. 76 * Options for routing.
76 */ 77 */
77enum GNUNET_DHT_RouteOption { 78enum GNUNET_DHT_RouteOption
79{
78 /** 80 /**
79 * Default. Do nothing special. 81 * Default. Do nothing special.
80 */ 82 */
@@ -118,8 +120,8 @@ enum GNUNET_DHT_RouteOption {
118 * @return NULL on error 120 * @return NULL on error
119 */ 121 */
120struct GNUNET_DHT_Handle * 122struct GNUNET_DHT_Handle *
121GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 123GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
122 unsigned int ht_len); 124 unsigned int ht_len);
123 125
124 126
125/** 127/**
@@ -128,7 +130,7 @@ GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
128 * @param handle connection to shut down 130 * @param handle connection to shut down
129 */ 131 */
130void 132void
131GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle); 133GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle);
132 134
133 135
134/* *************** Standard API: get and put ******************* */ 136/* *************** Standard API: get and put ******************* */
@@ -159,16 +161,16 @@ struct GNUNET_DHT_PutHandle;
159 * (size too big) 161 * (size too big)
160 */ 162 */
161struct GNUNET_DHT_PutHandle * 163struct GNUNET_DHT_PutHandle *
162GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle, 164GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
163 const struct GNUNET_HashCode *key, 165 const struct GNUNET_HashCode *key,
164 uint32_t desired_replication_level, 166 uint32_t desired_replication_level,
165 enum GNUNET_DHT_RouteOption options, 167 enum GNUNET_DHT_RouteOption options,
166 enum GNUNET_BLOCK_Type type, 168 enum GNUNET_BLOCK_Type type,
167 size_t size, 169 size_t size,
168 const void *data, 170 const void *data,
169 struct GNUNET_TIME_Absolute exp, 171 struct GNUNET_TIME_Absolute exp,
170 GNUNET_SCHEDULER_TaskCallback cont, 172 GNUNET_SCHEDULER_TaskCallback cont,
171 void *cont_cls); 173 void *cont_cls);
172 174
173 175
174/** 176/**
@@ -183,7 +185,7 @@ GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle,
183 * @param ph put operation to cancel ('cont' will no longer be called) 185 * @param ph put operation to cancel ('cont' will no longer be called)
184 */ 186 */
185void 187void
186GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph); 188GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph);
187 189
188 190
189/** 191/**
@@ -233,15 +235,15 @@ typedef void
233 * @return handle to stop the async get 235 * @return handle to stop the async get
234 */ 236 */
235struct GNUNET_DHT_GetHandle * 237struct GNUNET_DHT_GetHandle *
236GNUNET_DHT_get_start(struct GNUNET_DHT_Handle *handle, 238GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle,
237 enum GNUNET_BLOCK_Type type, 239 enum GNUNET_BLOCK_Type type,
238 const struct GNUNET_HashCode *key, 240 const struct GNUNET_HashCode *key,
239 uint32_t desired_replication_level, 241 uint32_t desired_replication_level,
240 enum GNUNET_DHT_RouteOption options, 242 enum GNUNET_DHT_RouteOption options,
241 const void *xquery, 243 const void *xquery,
242 size_t xquery_size, 244 size_t xquery_size,
243 GNUNET_DHT_GetIterator iter, 245 GNUNET_DHT_GetIterator iter,
244 void *iter_cls); 246 void *iter_cls);
245 247
246 248
247/** 249/**
@@ -255,9 +257,9 @@ GNUNET_DHT_get_start(struct GNUNET_DHT_Handle *handle,
255 * to be blocked 257 * to be blocked
256 */ 258 */
257void 259void
258GNUNET_DHT_get_filter_known_results(struct GNUNET_DHT_GetHandle *get_handle, 260GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle,
259 unsigned int num_results, 261 unsigned int num_results,
260 const struct GNUNET_HashCode *results); 262 const struct GNUNET_HashCode *results);
261 263
262/** 264/**
263 * Stop async DHT-get. Frees associated resources. 265 * Stop async DHT-get. Frees associated resources.
@@ -265,7 +267,7 @@ GNUNET_DHT_get_filter_known_results(struct GNUNET_DHT_GetHandle *get_handle,
265 * @param get_handle GET operation to stop. 267 * @param get_handle GET operation to stop.
266 */ 268 */
267void 269void
268GNUNET_DHT_get_stop(struct GNUNET_DHT_GetHandle *get_handle); 270GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle);
269 271
270 272
271/* *************** Extended API: monitor ******************* */ 273/* *************** Extended API: monitor ******************* */
@@ -368,13 +370,13 @@ typedef void
368 * @return Handle to stop monitoring. 370 * @return Handle to stop monitoring.
369 */ 371 */
370struct GNUNET_DHT_MonitorHandle * 372struct GNUNET_DHT_MonitorHandle *
371GNUNET_DHT_monitor_start(struct GNUNET_DHT_Handle *handle, 373GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle,
372 enum GNUNET_BLOCK_Type type, 374 enum GNUNET_BLOCK_Type type,
373 const struct GNUNET_HashCode *key, 375 const struct GNUNET_HashCode *key,
374 GNUNET_DHT_MonitorGetCB get_cb, 376 GNUNET_DHT_MonitorGetCB get_cb,
375 GNUNET_DHT_MonitorGetRespCB get_resp_cb, 377 GNUNET_DHT_MonitorGetRespCB get_resp_cb,
376 GNUNET_DHT_MonitorPutCB put_cb, 378 GNUNET_DHT_MonitorPutCB put_cb,
377 void *cb_cls); 379 void *cb_cls);
378 380
379 381
380/** 382/**
@@ -385,7 +387,7 @@ GNUNET_DHT_monitor_start(struct GNUNET_DHT_Handle *handle,
385 * #GNUNET_DHT_monitor_start(). 387 * #GNUNET_DHT_monitor_start().
386 */ 388 */
387void 389void
388GNUNET_DHT_monitor_stop(struct GNUNET_DHT_MonitorHandle *handle); 390GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle);
389 391
390 392
391#if 0 /* keep Emacsens' auto-indent happy */ 393#if 0 /* keep Emacsens' auto-indent happy */