diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-13 17:36:47 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-13 17:36:47 +0000 |
commit | 1f5326cd1032cbcc914c7809df1a64994eeebbe9 (patch) | |
tree | bd04389845d0b3096d98e3e97033040486108830 /src/gns/gnunet-service-gns_resolver.h | |
parent | a8c5598ba43fcd61a5a340f14a3bab1613adbe7c (diff) | |
download | gnunet-1f5326cd1032cbcc914c7809df1a64994eeebbe9.tar.gz gnunet-1f5326cd1032cbcc914c7809df1a64994eeebbe9.zip |
- big shorten algorithm rewrite
- API change for lookup
- tests fixed
- introduces 3 zone system: root, private and shortened
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.h')
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h index 2a2c341d3..1b54d3c2c 100644 --- a/src/gns/gnunet-service-gns_resolver.h +++ b/src/gns/gnunet-service-gns_resolver.h | |||
@@ -206,6 +206,25 @@ struct NameShortenHandle | |||
206 | 206 | ||
207 | /* closure to pass to proc */ | 207 | /* closure to pass to proc */ |
208 | void* proc_cls; | 208 | void* proc_cls; |
209 | |||
210 | /* result of shorten */ | ||
211 | char result[MAX_DNS_NAME_LENGTH]; | ||
212 | |||
213 | /* root zone */ | ||
214 | struct GNUNET_CRYPTO_ShortHashCode *root_zone; | ||
215 | |||
216 | /* private zone */ | ||
217 | struct GNUNET_CRYPTO_ShortHashCode *private_zone; | ||
218 | |||
219 | /* name of private zone */ | ||
220 | char private_zone_name[MAX_DNS_LABEL_LENGTH]; | ||
221 | |||
222 | /* shorten zone */ | ||
223 | struct GNUNET_CRYPTO_ShortHashCode *shorten_zone; | ||
224 | |||
225 | /* name of shorten zone */ | ||
226 | char shorten_zone_name[MAX_DNS_LABEL_LENGTH]; | ||
227 | |||
209 | }; | 228 | }; |
210 | 229 | ||
211 | /** | 230 | /** |
@@ -309,18 +328,22 @@ gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone, | |||
309 | * There is no guarantee that the shortened name will | 328 | * There is no guarantee that the shortened name will |
310 | * actually be canonical/short etc. | 329 | * actually be canonical/short etc. |
311 | * | 330 | * |
312 | * @param zone the zone to perform the operation in | 331 | * @param zone the root zone to use |
313 | * @param pzone the private local zone | 332 | * @param pzone the private zone to use |
333 | * @param szone the shorten zone to use | ||
314 | * @param name name to shorten | 334 | * @param name name to shorten |
315 | * @param key optional private key for background lookups and PSEU import | 335 | * @param private_zone_name name of the private zone |
336 | * @param shorten_zone_name name of the shorten zone | ||
316 | * @param proc the processor to call on shorten result | 337 | * @param proc the processor to call on shorten result |
317 | * @param proc_cls the closure to pass to proc | 338 | * @param proc_cls the closure to pass to proc |
318 | */ | 339 | */ |
319 | void | 340 | void |
320 | gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone, | 341 | gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode *zone, |
321 | struct GNUNET_CRYPTO_ShortHashCode pzone, | 342 | struct GNUNET_CRYPTO_ShortHashCode *pzone, |
343 | struct GNUNET_CRYPTO_ShortHashCode *szone, | ||
322 | const char* name, | 344 | const char* name, |
323 | struct GNUNET_CRYPTO_RsaPrivateKey *key, | 345 | const char* private_zone_name, |
346 | const char* shorten_zone_name, | ||
324 | ShortenResultProcessor proc, | 347 | ShortenResultProcessor proc, |
325 | void* proc_cls); | 348 | void* proc_cls); |
326 | 349 | ||