From 1f5326cd1032cbcc914c7809df1a64994eeebbe9 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Wed, 13 Jun 2012 17:36:47 +0000 Subject: - big shorten algorithm rewrite - API change for lookup - tests fixed - introduces 3 zone system: root, private and shortened --- src/gns/gnunet-service-gns_resolver.h | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src/gns/gnunet-service-gns_resolver.h') 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 /* closure to pass to proc */ void* proc_cls; + + /* result of shorten */ + char result[MAX_DNS_NAME_LENGTH]; + + /* root zone */ + struct GNUNET_CRYPTO_ShortHashCode *root_zone; + + /* private zone */ + struct GNUNET_CRYPTO_ShortHashCode *private_zone; + + /* name of private zone */ + char private_zone_name[MAX_DNS_LABEL_LENGTH]; + + /* shorten zone */ + struct GNUNET_CRYPTO_ShortHashCode *shorten_zone; + + /* name of shorten zone */ + char shorten_zone_name[MAX_DNS_LABEL_LENGTH]; + }; /** @@ -309,18 +328,22 @@ gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone, * There is no guarantee that the shortened name will * actually be canonical/short etc. * - * @param zone the zone to perform the operation in - * @param pzone the private local zone + * @param zone the root zone to use + * @param pzone the private zone to use + * @param szone the shorten zone to use * @param name name to shorten - * @param key optional private key for background lookups and PSEU import + * @param private_zone_name name of the private zone + * @param shorten_zone_name name of the shorten zone * @param proc the processor to call on shorten result * @param proc_cls the closure to pass to proc */ void -gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone, - struct GNUNET_CRYPTO_ShortHashCode pzone, +gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode *zone, + struct GNUNET_CRYPTO_ShortHashCode *pzone, + struct GNUNET_CRYPTO_ShortHashCode *szone, const char* name, - struct GNUNET_CRYPTO_RsaPrivateKey *key, + const char* private_zone_name, + const char* shorten_zone_name, ShortenResultProcessor proc, void* proc_cls); -- cgit v1.2.3