aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_gns_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-13 16:40:41 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-13 16:40:41 +0000
commitee32003b7e606767f9b89715cb956d863fe067d9 (patch)
treeeca3af3ac8a6c0852352861a69ea9e919343b03c /src/include/gnunet_gns_service.h
parent597dc76d129d291cd9dbe2fbd6914e54ae0ef118 (diff)
downloadgnunet-ee32003b7e606767f9b89715cb956d863fe067d9.tar.gz
gnunet-ee32003b7e606767f9b89715cb956d863fe067d9.zip
-working on new, simplified GNS API
Diffstat (limited to 'src/include/gnunet_gns_service.h')
-rw-r--r--src/include/gnunet_gns_service.h110
1 files changed, 12 insertions, 98 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 34af525c8..47d02ac7c 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -154,7 +154,6 @@ enum GNUNET_GNS_RecordType
154 * Initialize the connection with the GNS service. 154 * Initialize the connection with the GNS service.
155 * 155 *
156 * @param cfg configuration to use 156 * @param cfg configuration to use
157 *
158 * @return handle to the GNS service, or NULL on error 157 * @return handle to the GNS service, or NULL on error
159 */ 158 */
160struct GNUNET_GNS_Handle * 159struct GNUNET_GNS_Handle *
@@ -187,56 +186,34 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
187 186
188 187
189/** 188/**
190 * Perform an asynchronous lookup operation on the GNS 189 * Perform an asynchronous lookup operation on the GNS.
191 * in the default zone.
192 * 190 *
193 * @param handle handle to the GNS service 191 * @param handle handle to the GNS service
194 * @param name the name to look up 192 * @param name the name to look up
195 * @param type the GNUNET_GNS_RecordType to look for 193 * @param zone zone to look in
196 * @param only_cached GNUNET_NO to only check locally not DHT for performance 194 * @param type the record type to look for
197 * @param shorten_key the private key of the shorten zone (can be NULL) 195 * @param only_cached #GNUNET_NO to only check locally (not in the DHT)
196 * @param shorten_zone_key the private key of the shorten zone (can be NULL);
197 * specify to enable automatic shortening (given a PSEU
198 * record, if a given pseudonym is not yet used in the
199 * shorten zone, we automatically add the respective zone
200 * under that name)
198 * @param proc function to call on result 201 * @param proc function to call on result
199 * @param proc_cls closure for processor 202 * @param proc_cls closure for processor
200 *
201 * @return handle to the queued request 203 * @return handle to the queued request
202 */ 204 */
203struct GNUNET_GNS_LookupRequest* 205struct GNUNET_GNS_LookupRequest*
204GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, 206GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
205 const char * name, 207 const char *name,
208 const struct GNUNET_CRYPTO_EccPublicKey *zone,
206 enum GNUNET_GNS_RecordType type, 209 enum GNUNET_GNS_RecordType type,
207 int only_cached, 210 int only_cached,
208 struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, 211 struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key,
209 GNUNET_GNS_LookupResultProcessor proc, 212 GNUNET_GNS_LookupResultProcessor proc,
210 void *proc_cls); 213 void *proc_cls);
211 214
212 215
213/** 216/**
214 * Perform an asynchronous lookup operation on the GNS
215 * in the zone specified by 'zone'.
216 *
217 * @param handle handle to the GNS service
218 * @param name the name to look up
219 * @param zone the zone to start the resolution in
220 * @param type the GNUNET_GNS_RecordType to look for
221 * @param only_cached GNUNET_YES to only check locally not DHT for performance
222 * @param shorten_key the private key of the shorten zone (can be NULL)
223 * @param proc function to call on result
224 * @param proc_cls closure for processor
225 *
226 * @return handle to the queued request
227 */
228struct GNUNET_GNS_LookupRequest*
229GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle,
230 const char * name,
231 struct GNUNET_CRYPTO_ShortHashCode *zone,
232 enum GNUNET_GNS_RecordType type,
233 int only_cached,
234 struct GNUNET_CRYPTO_EccPrivateKey *shorten_key,
235 GNUNET_GNS_LookupResultProcessor proc,
236 void *proc_cls);
237
238
239/**
240 * Cancel pending lookup request 217 * Cancel pending lookup request
241 * 218 *
242 * @param lr the lookup request to cancel 219 * @param lr the lookup request to cancel
@@ -244,69 +221,6 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle,
244void 221void
245GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr); 222GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr);
246 223
247/* *************** Standard API: shorten ******************* */
248
249
250/**
251 * Processor called on for a name shortening result
252 * called only once
253 *
254 * @param cls closure
255 * @param short_name the shortened name or NULL if no result / error
256 */
257typedef void (*GNUNET_GNS_ShortenResultProcessor) (void *cls,
258 const char* short_name);
259
260
261/**
262 * Perform a name shortening operation on the GNS.
263 *
264 * @param handle handle to the GNS service
265 * @param name the name to look up
266 * @param private_zone the public zone of the private zone
267 * @param shorten_zone the public zone of the shorten zone
268 * @param proc function to call on result
269 * @param proc_cls closure for processor
270 * @return handle to the operation
271 */
272struct GNUNET_GNS_ShortenRequest*
273GNUNET_GNS_shorten (struct GNUNET_GNS_Handle *handle,
274 const char * name,
275 struct GNUNET_CRYPTO_ShortHashCode *private_zone,
276 struct GNUNET_CRYPTO_ShortHashCode *shorten_zone,
277 GNUNET_GNS_ShortenResultProcessor proc,
278 void *proc_cls);
279
280
281/**
282 * Perform a name shortening operation on the GNS.
283 *
284 * @param handle handle to the GNS service
285 * @param name the name to look up
286 * @param private_zone the public zone of the private zone
287 * @param shorten_zone the public zone of the shorten zone
288 * @param zone the zone to start the resolution in
289 * @param proc function to call on result
290 * @param proc_cls closure for processor
291 * @return handle to the operation
292 */
293struct GNUNET_GNS_ShortenRequest*
294GNUNET_GNS_shorten_zone (struct GNUNET_GNS_Handle *handle,
295 const char * name,
296 struct GNUNET_CRYPTO_ShortHashCode *private_zone,
297 struct GNUNET_CRYPTO_ShortHashCode *shorten_zone,
298 struct GNUNET_CRYPTO_ShortHashCode *zone,
299 GNUNET_GNS_ShortenResultProcessor proc,
300 void *proc_cls);
301
302
303/**
304 * Cancel pending shorten request
305 *
306 * @param sr the lookup request to cancel
307 */
308void
309GNUNET_GNS_cancel_shorten_request (struct GNUNET_GNS_ShortenRequest *sr);
310 224
311 225
312/* *************** Standard API: get authority ******************* */ 226/* *************** Standard API: get authority ******************* */