library to access the GNS service, including TLD lookup More...
#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_arm_service.h"
#include "gnunet_identity_service.h"
#include "gnunet_protocols.h"
#include "gnunet_dht_service.h"
#include "gns.h"
#include "gns_api.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_GNS_LookupWithTldRequest |
Handle to a lookup request. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "gns-tld-api", __VA_ARGS__) |
Functions | |
static const char * | get_tld (const char *name) |
Obtain the TLD of the given name. More... | |
static void | eat_tld (char *name, const char *tld) |
Eat the "TLD" (last bit) of the given name. More... | |
static void | process_lookup_result (void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Function called with the result of a GNS lookup. More... | |
static void | lookup_with_public_key (struct GNUNET_GNS_LookupWithTldRequest *ltr, const struct GNUNET_CRYPTO_PublicKey *pkey) |
Perform the actual resolution, starting with the zone identified by the given public key. More... | |
static void | identity_zone_cb (void *cls, const struct GNUNET_CRYPTO_PrivateKey *priv, const char *ego_name) |
Method called to with the ego we are to use for the lookup, when the ego is determined by a name. More... | |
enum GNUNET_GenericReturnValue | GNUNET_GNS_parse_ztld (const char *name, struct GNUNET_CRYPTO_PublicKey *ztld_key) |
Try to parse the zTLD into a public key. More... | |
struct GNUNET_GNS_LookupWithTldRequest * | GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle, const char *name, uint32_t type, enum GNUNET_GNS_LocalOptions options, GNUNET_GNS_LookupResultProcessor2 proc, void *proc_cls) |
Perform an asynchronous lookup operation on the GNS, determining the zone using the TLD of the given name and the current configuration to resolve TLDs to zones. More... | |
void * | GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr) |
Cancel pending lookup request. More... | |
library to access the GNS service, including TLD lookup
Definition in file gns_tld_api.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "gns-tld-api", __VA_ARGS__) |
Definition at line 38 of file gns_tld_api.c.
|
static |
Obtain the TLD of the given name.
name | a name |
Definition at line 107 of file gns_tld_api.c.
References name.
Referenced by GNUNET_GNS_lookup_with_tld(), and GNUNET_GNS_parse_ztld().
|
static |
Eat the "TLD" (last bit) of the given name.
[in,out] | name | a name |
tld | what to eat (can be more than just the tld) |
Definition at line 127 of file gns_tld_api.c.
References GNUNET_assert, GNUNET_GNS_EMPTY_LABEL_AT, and name.
Referenced by GNUNET_GNS_lookup_with_tld().
|
static |
Function called with the result of a GNS lookup.
cls | a struct GNUNET_GNS_LookupWithTldRequest * |
rd_count | number of records returned |
rd | array of rd_count records with the results |
Definition at line 150 of file gns_tld_api.c.
References GNUNET_GNS_lookup_with_tld_cancel(), GNUNET_YES, GNUNET_GNS_LookupWithTldRequest::lookup_proc, GNUNET_GNS_LookupWithTldRequest::lookup_proc_cls, GNUNET_GNS_LookupWithTldRequest::lr, rd, and rd_count.
Referenced by lookup_with_public_key().
|
static |
Perform the actual resolution, starting with the zone identified by the given public key.
pkey | public key to use for the zone, can be NULL |
Definition at line 169 of file gns_tld_api.c.
References GNUNET_GNS_LookupWithTldRequest::gns_handle, GNUNET_GNS_lookup(), GNUNET_GNS_LookupWithTldRequest::lr, GNUNET_GNS_LookupWithTldRequest::name, GNUNET_GNS_LookupWithTldRequest::options, pkey, process_lookup_result(), and GNUNET_GNS_LookupWithTldRequest::type.
Referenced by GNUNET_GNS_lookup_with_tld(), and identity_zone_cb().
|
static |
Method called to with the ego we are to use for the lookup, when the ego is determined by a name.
cls | a struct GNUNET_GNS_LookupWithTldRequest * |
ego | ego handle, NULL at the end of the iteration |
ctx | context we could store data to associate with ego |
ego_name | name of the ego |
Definition at line 192 of file gns_tld_api.c.
References ego_name, GNUNET_assert, GNUNET_CRYPTO_key_get_public(), GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNS_LO_LOCAL_MASTER, GNUNET_GNS_LO_NO_DHT, GNUNET_NO, GNUNET_GNS_LookupWithTldRequest::id_co, GNUNET_GNS_LookupWithTldRequest::lookup_proc, GNUNET_GNS_LookupWithTldRequest::lookup_proc_cls, lookup_with_public_key(), GNUNET_GNS_LookupWithTldRequest::name, GNUNET_GNS_LookupWithTldRequest::options, and pkey.
Referenced by GNUNET_GNS_lookup_with_tld().