GNUnet 0.22.2
gnunet-service-gns_resolver.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-2020 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
25#ifndef GNS_RESOLVER_H
26#define GNS_RESOLVER_H
27#include "gns.h"
28#include "gnunet_dht_service.h"
29#include "gnunet_gns_service.h"
31
41void
43 struct GNUNET_DHT_Handle *dht,
44 const struct GNUNET_CONFIGURATION_Handle *c,
45 unsigned long long max_bg_queries);
46
47
51void
53
54
59
60
68typedef void
69(*GNS_ResultProcessor)(void *cls,
70 uint32_t rd_count,
71 const struct GNUNET_GNSRECORD_Data *rd);
72
73
88struct GNS_ResolverHandle *
90 uint32_t record_type,
91 const char *name,
93 uint16_t recursion_depth_limit,
95 void *proc_cls);
96
97
103void
105
106#endif
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
IPC messages between GNS API and GNS service.
static struct GNUNET_DHT_Handle * dht
Handle to the DHT.
static char * name
Name (label) of the records to list.
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static struct GNUNET_NotificationContext * nc
Notification context for broadcasting to monitors.
void GNS_resolver_init(struct GNUNET_NAMECACHE_Handle *nc, struct GNUNET_DHT_Handle *dht, const struct GNUNET_CONFIGURATION_Handle *c, unsigned long long max_bg_queries)
Initialize the resolver subsystem.
void GNS_resolver_done(void)
Cleanup resolver: Terminate pending lookups.
void GNS_resolver_lookup_cancel(struct GNS_ResolverHandle *rh)
Cancel active resolution (i.e.
void(* GNS_ResultProcessor)(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Function called with results for a GNS resolution.
struct GNS_ResolverHandle * GNS_resolver_lookup(const struct GNUNET_CRYPTO_PublicKey *zone, uint32_t record_type, const char *name, enum GNUNET_GNS_LocalOptions options, uint16_t recursion_depth_limit, GNS_ResultProcessor proc, void *proc_cls)
Lookup of a record in a specific zone calls RecordLookupProcessor on result or timeout.
API to the DHT service.
API to the GNS service.
API that can be used to store naming information on a GNUnet node.
GNUNET_GNS_LocalOptions
Options for the GNS lookup.
Handle to a currently pending resolution.
void * proc_cls
closure passed to proc
int record_type
Desired type for the resolution.
GNS_ResultProcessor proc
called when resolution phase finishes
An identity key as per LSD0001.
Connection to the DHT service.
Definition: dht_api.c:235
Connection to the NAMECACHE service.
Definition: namecache_api.c:93