GNUnet  0.10.x
gnunet-service-gns_resolver.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009-2013 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 
41 void
43  struct GNUNET_DHT_Handle *dht,
44  const struct GNUNET_CONFIGURATION_Handle *c,
45  unsigned long long max_bg_queries);
46 
47 
51 void
52 GNS_resolver_done(void);
53 
54 
58 struct GNS_ResolverHandle;
59 
60 
68 typedef void
69 (*GNS_ResultProcessor)(void *cls,
70  uint32_t rd_count,
71  const struct GNUNET_GNSRECORD_Data *rd);
72 
73 
86 struct GNS_ResolverHandle *
88  uint32_t record_type,
89  const char *name,
92  void *proc_cls);
93 
94 
100 void
102 
103 #endif
struct GNS_ResolverHandle * GNS_resolver_lookup(const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, uint32_t record_type, const char *name, enum GNUNET_GNS_LocalOptions options, GNS_ResultProcessor proc, void *proc_cls)
Lookup of a record in a specific zone calls RecordLookupProcessor on result or timeout.
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
void GNS_resolver_done(void)
Cleanup resolver: Terminate pending lookups.
GNUNET_GNS_LocalOptions
Options for the GNS lookup.
GNS_ResultProcessor proc
called when resolution phase finishes
IPC messages between GNS API and GNS service.
Handle to a currenty pending resolution.
void * proc_cls
closure passed to proc
Connection to the DHT service.
Definition: dht_api.c:198
static char * zone
Name of the zone we manage.
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_lookup_cancel(struct GNS_ResolverHandle *rh)
Cancel active resolution (i.e.
int record_type
Desired type for the resolution.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
const char * name
void(* GNS_ResultProcessor)(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Function called with results for a GNS resolution.
configuration data
Definition: configuration.c:83
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
Connection to the NAMECACHE service.
Definition: namecache_api.c:93
static struct GNUNET_DHT_Handle * dht
Handle to the DHT.