diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-04-22 19:41:27 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-04-22 19:41:27 +0000 |
commit | 9ba0af50e8f41d40163bbac21003261928084c48 (patch) | |
tree | 9eff0d2fb85f06339e4e997f60c5880c7ed765c2 /src/include/gnunet_dht_service.h | |
parent | c7b9b0df9172a3d5049ecc8d477932f58cc70ced (diff) | |
download | gnunet-9ba0af50e8f41d40163bbac21003261928084c48.tar.gz gnunet-9ba0af50e8f41d40163bbac21003261928084c48.zip |
- Missing header file
Diffstat (limited to 'src/include/gnunet_dht_service.h')
-rw-r--r-- | src/include/gnunet_dht_service.h | 96 |
1 files changed, 74 insertions, 22 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index bb9e64ff6..df9233f4d 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -217,37 +217,85 @@ GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | |||
217 | 217 | ||
218 | /* *************** Extended API: monitor ******************* */ | 218 | /* *************** Extended API: monitor ******************* */ |
219 | 219 | ||
220 | /** | ||
221 | * Handle to monitor requests | ||
222 | */ | ||
220 | struct GNUNET_DHT_MonitorHandle; | 223 | struct GNUNET_DHT_MonitorHandle; |
221 | 224 | ||
222 | /** | 225 | /** |
223 | * Callback called on each request going through the DHT. | 226 | * Callback called on each GET request going through the DHT. |
227 | * | ||
228 | * @param cls Closure. | ||
229 | * @param options Options, for instance RecordRoute, DemultiplexEverywhere. | ||
230 | * @param type The type of data in the request. | ||
231 | * @param hop_count Hop count so far. | ||
232 | * @param path_length number of entries in path (or 0 if not recorded). | ||
233 | * @param path peers on the GET path (or NULL if not recorded). | ||
234 | * @param desired_replication_level Desired replication level. | ||
235 | * @param key Key of the requested data. | ||
236 | */ | ||
237 | typedef void (*GNUNET_DHT_MonitorGetCB) (void *cls, | ||
238 | enum GNUNET_DHT_RouteOption options, | ||
239 | enum GNUNET_BLOCK_Type type, | ||
240 | uint32_t hop_count, | ||
241 | uint32_t desired_replication_level, | ||
242 | unsigned int path_length, | ||
243 | const struct GNUNET_PeerIdentity *path, | ||
244 | const GNUNET_HashCode * key); | ||
245 | |||
246 | /** | ||
247 | * Callback called on each GET reply going through the DHT. | ||
224 | * | 248 | * |
225 | * @param cls Closure. | 249 | * @param cls Closure. |
226 | * @param mtype Type of the DHT message monitored. | 250 | * @param type The type of data in the result. |
227 | * @param exp When will this value expire. | 251 | * @param get_path Peers on GET path (or NULL if not recorded). |
228 | * @param key Key of the result/request. | ||
229 | * @param get_path Peers on reply path (or NULL if not recorded). | ||
230 | * @param get_path_length number of entries in get_path. | 252 | * @param get_path_length number of entries in get_path. |
231 | * @param put_path peers on the PUT path (or NULL if not recorded). | 253 | * @param put_path peers on the PUT path (or NULL if not recorded). |
232 | * @param put_path_length number of entries in get_path. | 254 | * @param put_path_length number of entries in get_path. |
233 | * @param desired_replication_level Desired replication level. | 255 | * @param exp Expiration time of the data. |
234 | * @param type Type of the result/request. | 256 | * @param key Key of the data. |
235 | * @param data Pointer to the result data. | 257 | * @param data Pointer to the result data. |
236 | * @param size Number of bytes in data. | 258 | * @param size Number of bytes in data. |
237 | */ | 259 | */ |
238 | typedef void (*GNUNET_DHT_MonitorCB) (void *cls, | 260 | typedef void (*GNUNET_DHT_MonitorGetRespCB) (void *cls, |
239 | uint16_t mtype, | 261 | enum GNUNET_BLOCK_Type type, |
240 | struct GNUNET_TIME_Absolute exp, | 262 | const struct GNUNET_PeerIdentity |
241 | const GNUNET_HashCode * key, | 263 | *get_path, |
242 | const struct GNUNET_PeerIdentity * | 264 | unsigned int get_path_length, |
243 | get_path, unsigned int get_path_length, | 265 | const struct GNUNET_PeerIdentity |
244 | const struct GNUNET_PeerIdentity * | 266 | * put_path, |
245 | put_path, unsigned int put_path_length, | 267 | unsigned int put_path_length, |
246 | uint32_t desired_replication_level, | 268 | struct GNUNET_TIME_Absolute exp, |
247 | enum GNUNET_DHT_RouteOption options, | 269 | const GNUNET_HashCode * key, |
248 | enum GNUNET_BLOCK_Type type, | 270 | const void *data, |
249 | const void *data, | 271 | size_t size); |
250 | size_t size); | 272 | |
273 | /** | ||
274 | * Callback called on each PUT request going through the DHT. | ||
275 | * | ||
276 | * @param cls Closure. | ||
277 | * @param options Options, for instance RecordRoute, DemultiplexEverywhere. | ||
278 | * @param type The type of data in the request. | ||
279 | * @param hop_count Hop count so far. | ||
280 | * @param path_length number of entries in path (or 0 if not recorded). | ||
281 | * @param path peers on the PUT path (or NULL if not recorded). | ||
282 | * @param desired_replication_level Desired replication level. | ||
283 | * @param exp Expiration time of the data. | ||
284 | * @param key Key under which data is to be stored. | ||
285 | * @param data Pointer to the data carried. | ||
286 | * @param size Number of bytes in data. | ||
287 | */ | ||
288 | typedef void (*GNUNET_DHT_MonitorPutCB) (void *cls, | ||
289 | enum GNUNET_DHT_RouteOption options, | ||
290 | enum GNUNET_BLOCK_Type type, | ||
291 | uint32_t hop_count, | ||
292 | uint32_t desired_replication_level, | ||
293 | unsigned int path_length, | ||
294 | const struct GNUNET_PeerIdentity *path, | ||
295 | struct GNUNET_TIME_Absolute exp, | ||
296 | const GNUNET_HashCode * key, | ||
297 | const void *data, | ||
298 | size_t size); | ||
251 | 299 | ||
252 | /** | 300 | /** |
253 | * Start monitoring the local DHT service. | 301 | * Start monitoring the local DHT service. |
@@ -255,7 +303,9 @@ typedef void (*GNUNET_DHT_MonitorCB) (void *cls, | |||
255 | * @param handle Handle to the DHT service. | 303 | * @param handle Handle to the DHT service. |
256 | * @param type Type of blocks that are of interest. | 304 | * @param type Type of blocks that are of interest. |
257 | * @param key Key of data of interest, NULL for all. | 305 | * @param key Key of data of interest, NULL for all. |
258 | * @param cb Callback to process all monitored data. | 306 | * @param get_cb Callback to process monitored get messages. |
307 | * @param get_resp_cb Callback to process monitored get response messages. | ||
308 | * @param put_cb Callback to process monitored put messages. | ||
259 | * @param cb_cls Closure for cb. | 309 | * @param cb_cls Closure for cb. |
260 | * | 310 | * |
261 | * @return Handle to stop monitoring. | 311 | * @return Handle to stop monitoring. |
@@ -264,7 +314,9 @@ struct GNUNET_DHT_MonitorHandle * | |||
264 | GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | 314 | GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, |
265 | enum GNUNET_BLOCK_Type type, | 315 | enum GNUNET_BLOCK_Type type, |
266 | const GNUNET_HashCode *key, | 316 | const GNUNET_HashCode *key, |
267 | GNUNET_DHT_MonitorCB cb, | 317 | GNUNET_DHT_MonitorGetCB get_cb, |
318 | GNUNET_DHT_MonitorGetRespCB get_resp_cb, | ||
319 | GNUNET_DHT_MonitorPutCB put_cb, | ||
268 | void *cb_cls); | 320 | void *cb_cls); |
269 | 321 | ||
270 | 322 | ||