NAMESTORE/JSON: fix parsing exp and flags
[oweals/gnunet.git] / src / hostlist / gnunet-daemon-hostlist_client.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2009 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 /**
21  * @file hostlist/gnunet-daemon-hostlist_client.h
22  * @brief hostlist support.  Downloads HELLOs via HTTP.
23  * @author Christian Grothoff
24  */
25 #ifndef GNUNET_DAEMON_HOSTLIST_CLIENT_H
26 #define GNUNET_DAEMON_HOSTLIST_CLIENT_H
27
28 #include "gnunet_core_service.h"
29 #include "gnunet_statistics_service.h"
30 #include "gnunet_util_lib.h"
31
32
33 /**
34  * Function that handles an advertised URI.
35  *
36  * @param uri 0-termianted URI of a hostlist
37  */
38 typedef void
39 (*GNUNET_HOSTLIST_UriHandler)(const char *uri);
40
41
42 /**
43  * Start downloading hostlists from hostlist servers as necessary.
44  *
45  * @param c configuration to use
46  * @param st statistics handle to use
47  * @param[out] ch set to handler for CORE connect events
48  * @param[out] dh set to handler for CORE disconnect events
49  * @param[out] msgh set to handler for CORE advertisement messages
50  * @param learn should we learn hostlist URLs from CORE
51  * @return #GNUNET_OK on success
52  */
53 int
54 GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
55                               struct GNUNET_STATISTICS_Handle *st,
56                               GNUNET_CORE_ConnectEventHandler *ch,
57                               GNUNET_CORE_DisconnectEventHandler *dh,
58                               GNUNET_HOSTLIST_UriHandler *msgh,
59                               int learn);
60
61
62 /**
63  * Stop downloading hostlists from hostlist servers as necessary.
64  */
65 void
66 GNUNET_HOSTLIST_client_stop (void);
67
68
69 #endif
70 /* end of gnunet-daemon-hostlist_client.h */