On 07/20/2018 09:38 PM, Schanzenbach, Martin wrote:
> Hi,
> 
> we already had a discussion some time ago wrt reverse lookups of names.
> I currently have a (usability) need, where I want to translate a PKEY back to 
> TLD, if possible.
> After the recent changes this would involve (fora given key P):
> 
> 1. Checking if a local identity matches P, if yes, return it. -> trivial
> 2. Check _all_ local namespaces if they contain P, if yes, return 
> <label>.<identity> -> requires some iterations

Right, we probably should extend the namespace API to do this one for
you in one call.

> 3. Check config file for .<label> = P, if found, return -> how the * do I do 
> this??

Well, that's a simple iteration over the values in the [gns] section.
The GNUNET_CONFIGUATION_-API has an iteration function for that.  Just
check if "name" starts with "." and then try to parse the value as a PKEY.

> My questions:
> 
> - Does the introduction of this functionality make sense (for the GNS API) in 
> general?

Sure, certainly as a convenience API (I'd not make it an IPC call to the
GNS sevice, but simply have a gns_reverse_api.c that implements 1-3.
Note that you probably want to do 1/3/2 in this order.

> - If yes, how to do (3.)? I would need a "reverse" lookup of the TLD 
> delegations from the config...

Trivial, if you have the config. Note that the existing gns_tld_api.c
already has this logic, might be good to refactor the code to avoid
duplication...

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
GNUnet-developers mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnunet-developers

Reply via email to