aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_gns_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-03-05 20:00:21 +0100
committerChristian Grothoff <christian@grothoff.org>2018-03-05 20:00:34 +0100
commit0f4032609d5372978e0c038ee05f51ce9c131876 (patch)
tree3fb3beaf77177f4aca197a350b6dd0381fe1a502 /src/include/gnunet_gns_service.h
parent044170c00077438d30ab0c832a7193eb093aae30 (diff)
downloadgnunet-0f4032609d5372978e0c038ee05f51ce9c131876.tar.gz
gnunet-0f4032609d5372978e0c038ee05f51ce9c131876.zip
add convenience API to gnunetgns lib
Diffstat (limited to 'src/include/gnunet_gns_service.h')
-rw-r--r--src/include/gnunet_gns_service.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 2ef946a82..1eb67ed50 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -66,6 +66,12 @@ struct GNUNET_GNS_Handle;
66 */ 66 */
67struct GNUNET_GNS_LookupRequest; 67struct GNUNET_GNS_LookupRequest;
68 68
69/**
70 * Handle to control a lookup operation where the
71 * TLD is resolved to a zone as part of the lookup operation.
72 */
73struct GNUNET_GNS_LookupWithTldRequest;
74
69 75
70/** 76/**
71 * Initialize the connection with the GNS service. 77 * Initialize the connection with the GNS service.
@@ -154,6 +160,54 @@ void
154GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr); 160GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr);
155 161
156 162
163/**
164 * Iterator called on obtained result for a GNS lookup
165 * where "not GNS" is a valid answer.
166 *
167 * @param cls closure
168 * @param gns_tld #GNUNET_YES if a GNS lookup was attempted,
169 * #GNUNET_NO if the TLD is not configured for GNS
170 * @param rd_count number of records in @a rd
171 * @param rd the records in the reply
172 */
173typedef void
174(*GNUNET_GNS_LookupResultProcessor2) (void *cls,
175 int gns_tld,
176 uint32_t rd_count,
177 const struct GNUNET_GNSRECORD_Data *rd);
178
179
180/**
181 * Perform an asynchronous lookup operation on the GNS,
182 * determining the zone using the TLD of the given name
183 * and the current configuration to resolve TLDs to zones.
184 *
185 * @param handle handle to the GNS service
186 * @param name the name to look up, including TLD
187 * @param type the record type to look up
188 * @param options local options for the lookup
189 * @param proc processor to call on result
190 * @param proc_cls closure for @a proc
191 * @return handle to the get request
192 */
193struct GNUNET_GNS_LookupWithTldRequest*
194GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
195 const char *name,
196 uint32_t type,
197 enum GNUNET_GNS_LocalOptions options,
198 GNUNET_GNS_LookupResultProcessor2 proc,
199 void *proc_cls);
200
201
202/**
203 * Cancel pending lookup request
204 *
205 * @param ltr the lookup request to cancel
206 */
207void
208GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr);
209
210
157#if 0 /* keep Emacsens' auto-indent happy */ 211#if 0 /* keep Emacsens' auto-indent happy */
158{ 212{
159#endif 213#endif