diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-01-04 20:00:59 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-01-04 20:00:59 +0000 |
commit | 09372b5120f5905546bd4e73f02f8afeec7e1b1e (patch) | |
tree | c9f301491073ca43d34152683d7b108a52e24288 /src/include/gnunet_dht_service.h | |
parent | c3a877682c2ce72aa38c58642875563b918aca86 (diff) | |
download | gnunet-09372b5120f5905546bd4e73f02f8afeec7e1b1e.tar.gz gnunet-09372b5120f5905546bd4e73f02f8afeec7e1b1e.zip |
New DHT-monitor functionality
Diffstat (limited to 'src/include/gnunet_dht_service.h')
-rw-r--r-- | src/include/gnunet_dht_service.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index f047bd8f8..fd89642c6 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -214,6 +214,70 @@ void | |||
214 | GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | 214 | GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); |
215 | 215 | ||
216 | 216 | ||
217 | /* *************** Extended API: monitor ******************* */ | ||
218 | |||
219 | struct GNUNET_DHT_MonitorHandle; | ||
220 | |||
221 | /** | ||
222 | * Callback called on each request going through the DHT. | ||
223 | * | ||
224 | * @param cls Closure. | ||
225 | * @param mtype Type of the DHT message monitored. | ||
226 | * @param exp When will this value expire. | ||
227 | * @param key Key of the result/request. | ||
228 | * @param get_path Peers on reply path (or NULL if not recorded). | ||
229 | * @param get_path_length number of entries in get_path. | ||
230 | * @param put_path peers on the PUT path (or NULL if not recorded). | ||
231 | * @param put_path_length number of entries in get_path. | ||
232 | * @param desired_replication_level Desired replication level. | ||
233 | * @param type Type of the result/request. | ||
234 | * @param data Pointer to the result data. | ||
235 | * @param size Number of bytes in data. | ||
236 | */ | ||
237 | typedef void (*GNUNET_DHT_MonitorCB) (void *cls, | ||
238 | uint16_t mtype, | ||
239 | struct GNUNET_TIME_Absolute exp, | ||
240 | const GNUNET_HashCode * key, | ||
241 | const struct GNUNET_PeerIdentity * | ||
242 | get_path, unsigned int get_path_length, | ||
243 | const struct GNUNET_PeerIdentity * | ||
244 | put_path, unsigned int put_path_length, | ||
245 | uint32_t desired_replication_level, | ||
246 | enum GNUNET_DHT_RouteOption options, | ||
247 | enum GNUNET_BLOCK_Type type, | ||
248 | const void *data, | ||
249 | size_t size); | ||
250 | |||
251 | /** | ||
252 | * Start monitoring the local DHT service. | ||
253 | * | ||
254 | * @param handle Handle to the DHT service. | ||
255 | * @param type Type of blocks that are of interest. | ||
256 | * @param key Key of data of interest, NULL for all. | ||
257 | * @param cb Callback to process all monitored data. | ||
258 | * @param cb_cls Closure for cb. | ||
259 | * | ||
260 | * @return Handle to stop monitoring. | ||
261 | */ | ||
262 | struct GNUNET_DHT_MonitorHandle * | ||
263 | GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | ||
264 | enum GNUNET_BLOCK_Type type, | ||
265 | const GNUNET_HashCode *key, | ||
266 | GNUNET_DHT_MonitorCB cb, | ||
267 | void *cb_cls); | ||
268 | |||
269 | |||
270 | /** | ||
271 | * Stop monitoring. | ||
272 | * | ||
273 | * @param handle The handle to the monitor request returned by monitor_start. | ||
274 | * | ||
275 | * On return get_handle will no longer be valid, caller must not use again!!! | ||
276 | */ | ||
277 | void | ||
278 | GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle); | ||
279 | |||
280 | |||
217 | #if 0 /* keep Emacsens' auto-indent happy */ | 281 | #if 0 /* keep Emacsens' auto-indent happy */ |
218 | { | 282 | { |
219 | #endif | 283 | #endif |