diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-03-05 20:00:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-03-05 20:00:34 +0100 |
commit | 0f4032609d5372978e0c038ee05f51ce9c131876 (patch) | |
tree | 3fb3beaf77177f4aca197a350b6dd0381fe1a502 /src/include/gnunet_gns_service.h | |
parent | 044170c00077438d30ab0c832a7193eb093aae30 (diff) | |
download | gnunet-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.h | 54 |
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 | */ |
67 | struct GNUNET_GNS_LookupRequest; | 67 | struct 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 | */ | ||
73 | struct 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 | |||
154 | GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr); | 160 | GNUNET_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 | */ | ||
173 | typedef 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 | */ | ||
193 | struct GNUNET_GNS_LookupWithTldRequest* | ||
194 | GNUNET_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 | */ | ||
207 | void | ||
208 | GNUNET_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 |