diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_dht.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_dht.h | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/src/cadet/gnunet-service-cadet_dht.h b/src/cadet/gnunet-service-cadet_dht.h index b70dfe975..5d7ab29a0 100644 --- a/src/cadet/gnunet-service-cadet_dht.h +++ b/src/cadet/gnunet-service-cadet_dht.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013, 2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 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 | 6 | it under the terms of the GNU General Public License as published |
@@ -22,10 +22,10 @@ | |||
22 | * @file cadet/gnunet-service-cadet_dht.h | 22 | * @file cadet/gnunet-service-cadet_dht.h |
23 | * @brief cadet service; dealing with DHT requests and results | 23 | * @brief cadet service; dealing with DHT requests and results |
24 | * @author Bartlomiej Polot | 24 | * @author Bartlomiej Polot |
25 | * @author Christian Grothoff | ||
25 | * | 26 | * |
26 | * All functions in this file should use the prefix GMD (Gnunet Cadet Dht) | 27 | * All functions in this file should use the prefix GCD (Gnunet Cadet Dht) |
27 | */ | 28 | */ |
28 | |||
29 | #ifndef GNUNET_SERVICE_CADET_DHT_H | 29 | #ifndef GNUNET_SERVICE_CADET_DHT_H |
30 | #define GNUNET_SERVICE_CADET_DHT_H | 30 | #define GNUNET_SERVICE_CADET_DHT_H |
31 | 31 | ||
@@ -40,23 +40,11 @@ extern "C" | |||
40 | #include "platform.h" | 40 | #include "platform.h" |
41 | #include "gnunet_util_lib.h" | 41 | #include "gnunet_util_lib.h" |
42 | 42 | ||
43 | struct GCD_search_handle; | ||
44 | |||
45 | |||
46 | /** | 43 | /** |
47 | * Callback called on each path found over the DHT. | 44 | * Handle for DHT search operation. |
48 | * | ||
49 | * @param cls Closure. | ||
50 | * @param path An unchecked, unoptimized path to the target node. | ||
51 | * After callback will no longer be valid! | ||
52 | */ | 45 | */ |
53 | typedef void | 46 | struct GCD_search_handle; |
54 | (*GCD_search_callback) (void *cls, | ||
55 | const struct CadetPeerPath *path); | ||
56 | 47 | ||
57 | /******************************************************************************/ | ||
58 | /******************************** API ***********************************/ | ||
59 | /******************************************************************************/ | ||
60 | 48 | ||
61 | /** | 49 | /** |
62 | * Initialize the DHT subsystem. | 50 | * Initialize the DHT subsystem. |
@@ -66,6 +54,7 @@ typedef void | |||
66 | void | 54 | void |
67 | GCD_init (const struct GNUNET_CONFIGURATION_Handle *c); | 55 | GCD_init (const struct GNUNET_CONFIGURATION_Handle *c); |
68 | 56 | ||
57 | |||
69 | /** | 58 | /** |
70 | * Shut down the DHT subsystem. | 59 | * Shut down the DHT subsystem. |
71 | */ | 60 | */ |
@@ -73,14 +62,32 @@ void | |||
73 | GCD_shutdown (void); | 62 | GCD_shutdown (void); |
74 | 63 | ||
75 | 64 | ||
65 | /** | ||
66 | * Function called by the HELLO subsystem whenever OUR hello | ||
67 | * changes. Re-triggers the DHT PUT immediately. | ||
68 | */ | ||
69 | void | ||
70 | GCD_hello_update (void); | ||
71 | |||
72 | /** | ||
73 | * Search DHT for paths to @a peeR_id | ||
74 | * | ||
75 | * @param peer_id peer to search for | ||
76 | * @return handle to abort search | ||
77 | */ | ||
76 | struct GCD_search_handle * | 78 | struct GCD_search_handle * |
77 | GCD_search (const struct GNUNET_PeerIdentity *peer_id, | 79 | GCD_search (const struct GNUNET_PeerIdentity *peer_id); |
78 | GCD_search_callback callback, void *cls); | ||
79 | 80 | ||
80 | 81 | ||
82 | /** | ||
83 | * Stop DHT search started with #GCD_search(). | ||
84 | * | ||
85 | * @param h handle to search to stop | ||
86 | */ | ||
81 | void | 87 | void |
82 | GCD_search_stop (struct GCD_search_handle *h); | 88 | GCD_search_stop (struct GCD_search_handle *h); |
83 | 89 | ||
90 | |||
84 | #if 0 /* keep Emacsens' auto-indent happy */ | 91 | #if 0 /* keep Emacsens' auto-indent happy */ |
85 | { | 92 | { |
86 | #endif | 93 | #endif |
@@ -88,6 +95,6 @@ GCD_search_stop (struct GCD_search_handle *h); | |||
88 | } | 95 | } |
89 | #endif | 96 | #endif |
90 | 97 | ||
91 | /* ifndef GNUNET_CADET_SERVICE_LOCAL_H */ | 98 | /* ifndef GNUNET_CADET_SERVICE_DHT_H */ |
92 | #endif | 99 | #endif |
93 | /* end of gnunet-cadet-service_LOCAL.h */ | 100 | /* end of gnunet-service-cadet_dht.h */ |