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