[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUnet-developers] Reverse GNS lookups, revisited
From: |
Christian Grothoff |
Subject: |
Re: [GNUnet-developers] Reverse GNS lookups, revisited |
Date: |
Fri, 20 Jul 2018 23:35:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
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...
signature.asc
Description: OpenPGP digital signature