2 This file is part of GNUnet.
3 Copyright (C) 2013, 2017 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * @file cadet/gnunet-service-cadet_dht.h
23 * @brief cadet service; dealing with DHT requests and results
24 * @author Bartlomiej Polot
25 * @author Christian Grothoff
27 * All functions in this file should use the prefix GCD (Gnunet Cadet Dht)
29 #ifndef GNUNET_SERVICE_CADET_DHT_H
30 #define GNUNET_SERVICE_CADET_DHT_H
35 #if 0 /* keep Emacsens' auto-indent happy */
41 #include "gnunet_util_lib.h"
44 * Handle for DHT search operation.
46 struct GCD_search_handle;
50 * Callback called on each path found over the DHT.
53 * @param path An unchecked, unoptimized path to the target node.
54 * After callback will no longer be valid, unless #GCPP_acquire() is called!
57 (*GCD_search_callback) (void *cls,
58 struct CadetPeerPath *path);
62 * Initialize the DHT subsystem.
64 * @param c Configuration.
67 GCD_init (const struct GNUNET_CONFIGURATION_Handle *c);
70 * Shut down the DHT subsystem.
77 * Search DHT for paths to @a peeR_id
79 * @param peer_id peer to search for
80 * @param callback function to call with results
81 * @param callback_cls closure for @a callback
82 * @return handle to abort search
84 struct GCD_search_handle *
85 GCD_search (const struct GNUNET_PeerIdentity *peer_id,
86 GCD_search_callback callback,
91 * Stop DHT search started with #GCD_search().
93 * @param h handle to search to stop
96 GCD_search_stop (struct GCD_search_handle *h);
99 #if 0 /* keep Emacsens' auto-indent happy */
106 /* ifndef GNUNET_CADET_SERVICE_DHT_H */
108 /* end of gnunet-service-cadet_dht.h */