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