Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_dht.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2013, 2017 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 /**
20  * @file cadet/gnunet-service-cadet_dht.h
21  * @brief cadet service; dealing with DHT requests and results
22  * @author Bartlomiej Polot
23  * @author Christian Grothoff
24  *
25  * All functions in this file should use the prefix GCD (Gnunet Cadet Dht)
26  */
27 #ifndef GNUNET_SERVICE_CADET_DHT_H
28 #define GNUNET_SERVICE_CADET_DHT_H
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #if 0                           /* keep Emacsens' auto-indent happy */
34 }
35 #endif
36 #endif
37
38 #include "platform.h"
39 #include "gnunet_util_lib.h"
40
41 /**
42  * Handle for DHT search operation.
43  */
44 struct GCD_search_handle;
45
46
47 /**
48  * Initialize the DHT subsystem.
49  *
50  * @param c Configuration.
51  */
52 void
53 GCD_init (const struct GNUNET_CONFIGURATION_Handle *c);
54
55
56 /**
57  * Shut down the DHT subsystem.
58  */
59 void
60 GCD_shutdown (void);
61
62
63 /**
64  * Function called by the HELLO subsystem whenever OUR hello
65  * changes. Re-triggers the DHT PUT immediately.
66  */
67 void
68 GCD_hello_update (void);
69
70 /**
71  * Search DHT for paths to @a peeR_id
72  *
73  * @param peer_id peer to search for
74  * @return handle to abort search
75  */
76 struct GCD_search_handle *
77 GCD_search (const struct GNUNET_PeerIdentity *peer_id);
78
79
80 /**
81  * Stop DHT search started with #GCD_search().
82  *
83  * @param h handle to search to stop
84  */
85 void
86 GCD_search_stop (struct GCD_search_handle *h);
87
88
89 #if 0                           /* keep Emacsens' auto-indent happy */
90 {
91 #endif
92 #ifdef __cplusplus
93 }
94 #endif
95
96 /* ifndef GNUNET_CADET_SERVICE_DHT_H */
97 #endif
98 /* end of gnunet-service-cadet_dht.h */