GNUnet  0.11.x
gnunet_resolver_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2001-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  */
20 
32 #ifndef GNUNET_RESOLVER_SERVICE_H
33 #define GNUNET_RESOLVER_SERVICE_H
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #if 0 /* keep Emacsens' auto-indent happy */
39 }
40 #endif
41 #endif
42 
44 #include "gnunet_scheduler_lib.h"
45 #include "gnunet_time_lib.h"
46 
47 
55 typedef void
57  const struct sockaddr *addr,
58  socklen_t addrlen);
59 
60 
66 
72 void
74 
75 
79 void
81 
82 
94 GNUNET_RESOLVER_ip_get (const char *hostname,
95  int af,
98  void *callback_cls);
99 
100 
114  void *cls);
115 
116 
124 typedef void
126  const char *hostname);
127 
133 char *
135 
136 
149 GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
150  socklen_t salen,
151  int do_resolve,
154  void *cls);
155 
156 
165 void
167 
168 
169 #if 0 /* keep Emacsens' auto-indent happy */
170 {
171 #endif
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 /* ifndef GNUNET_RESOLVER_SERVICE_H */
177 #endif
178  /* end of group resolver */
180 
181 /* end of gnunet_resolver_service.h */
void GNUNET_RESOLVER_request_cancel(struct GNUNET_RESOLVER_RequestHandle *rh)
Cancel a request that is still pending with the resolver.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
struct GNUNET_RESOLVER_RequestHandle * GNUNET_RESOLVER_ip_get(const char *hostname, int af, struct GNUNET_TIME_Relative timeout, GNUNET_RESOLVER_AddressCallback callback, void *callback_cls)
Convert a string to one or more IP addresses.
Definition: resolver_api.c:939
struct GNUNET_RESOLVER_RequestHandle * GNUNET_RESOLVER_hostname_get(const struct sockaddr *sa, socklen_t salen, int do_resolve, struct GNUNET_TIME_Relative timeout, GNUNET_RESOLVER_HostnameCallback callback, void *cls)
Perform a reverse DNS lookup.
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
Definition: gnunet-abd.c:61
char * GNUNET_RESOLVER_local_fqdn_get(void)
Get local fully qualified domain name.
int af
Desired address family.
Definition: resolver_api.c:145
void(* GNUNET_RESOLVER_AddressCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Function called by the resolver for each address obtained from DNS.
struct GNUNET_RESOLVER_RequestHandle * GNUNET_RESOLVER_hostname_resolve(int af, struct GNUNET_TIME_Relative timeout, GNUNET_RESOLVER_AddressCallback callback, void *cls)
Resolve our hostname to an IP address.
Handle to a request given to the resolver.
Definition: resolver_api.c:102
void(* GNUNET_RESOLVER_HostnameCallback)(void *cls, const char *hostname)
Function called by the resolver for each hostname obtained from DNS.
static char * hostname
Our hostname; we give this to all the peers we start.
configuration data
Definition: configuration.c:85
void GNUNET_RESOLVER_disconnect(void)
Destroy the connection to the resolver service.
Definition: resolver_api.c:269
void * cls
Closure for the callbacks.
Definition: resolver_api.c:129
void GNUNET_RESOLVER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Create the connection to the resolver service.
Definition: resolver_api.c:257
Time for relative time used by GNUnet, in microseconds.