aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_dht_service.h
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-03-17 13:51:14 +0000
committerNathan S. Evans <evans@in.tum.de>2010-03-17 13:51:14 +0000
commitb72f6ef6daf67fbd316c603ef7fe230edfc805a8 (patch)
treefdd23bfc302bd9f0e250832b992e07fc955c4050 /src/include/gnunet_dht_service.h
parent68cca4e157f48845199c05938892cc0e14bcbd29 (diff)
downloadgnunet-b72f6ef6daf67fbd316c603ef7fe230edfc805a8.tar.gz
gnunet-b72f6ef6daf67fbd316c603ef7fe230edfc805a8.zip
dht api
Diffstat (limited to 'src/include/gnunet_dht_service.h')
-rw-r--r--src/include/gnunet_dht_service.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index 4bf3ce15b..dfb880b4a 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -52,8 +52,8 @@ struct GNUNET_DHT_Handle;
52 * @return NULL on error 52 * @return NULL on error
53 */ 53 */
54struct GNUNET_DHT_Handle * 54struct GNUNET_DHT_Handle *
55GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 55GNUNET_DHT_connect (struct GNUNET_SCHEDULER_Handle *sched,
56 struct GNUNET_SCHEDULER_Handle *sched); 56 const struct GNUNET_CONFIGURATION_Handle *cfg);
57 57
58 58
59/** 59/**
@@ -62,7 +62,7 @@ GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
62 * @param h connection to shut down 62 * @param h connection to shut down
63 */ 63 */
64void 64void
65GNUNET_DHT_connect (struct GNUNET_DHT_Handle *h); 65GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *h);
66 66
67 67
68/** 68/**
@@ -90,6 +90,7 @@ typedef void (*GNUNET_DHT_Iterator)(void *cls,
90 const void *data); 90 const void *data);
91 91
92 92
93
93/** 94/**
94 * Perform an asynchronous GET operation on the DHT identified. 95 * Perform an asynchronous GET operation on the DHT identified.
95 * 96 *
@@ -109,12 +110,40 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *h,
109 110
110 111
111/** 112/**
113 * Iterator called on each result obtained from a FIND_PEER
114 * operation
115 *
116 * @param cls closure
117 * @param key the key that was searched
118 * @param data the HELLO of the peer that was returned
119 */
120typedef void (*GNUNET_DHT_PeerIterator)(void *cls,
121 const GNUNET_HashCode * key,
122 const void *data);
123
124/**
125 * Perform an asynchronous FIND_PEER operation on the DHT.
126 *
127 * @param h handle to the DHT service
128 * @param key the key to look up
129 * @param iter function to call on each result
130 * @param iter_cls closure for iter
131 *
132 * @return handle to stop the request
133 */
134struct GNUNET_DHT_GetHandle *
135GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *h,
136 const GNUNET_HashCode * key,
137 GNUNET_DHT_PeerIterator iter,
138 void *iter_cls);
139
140/**
112 * Stop async DHT-get. Frees associated resources. 141 * Stop async DHT-get. Frees associated resources.
113 * 142 *
114 * @param record GET operation to stop. 143 * @param record GET operation to stop.
115 */ 144 */
116void 145void
117GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *record); 146GNUNET_DHT_get_stop (struct GNUNET_DHT_Handle *handle, struct GNUNET_DHT_GetHandle *get_handle);
118 147
119 148
120/** 149/**