aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_datacache_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_datacache_plugin.h')
-rw-r--r--src/include/gnunet_datacache_plugin.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/include/gnunet_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h
index 24570be72..e144e155e 100644
--- a/src/include/gnunet_datacache_plugin.h
+++ b/src/include/gnunet_datacache_plugin.h
@@ -19,6 +19,9 @@
19 */ 19 */
20 20
21/** 21/**
22 * @addtogroup dht_libs DHT and support libraries
23 * @{
24 *
22 * @author Christian Grothoff 25 * @author Christian Grothoff
23 * 26 *
24 * @file 27 * @file
@@ -31,6 +34,7 @@
31#ifndef PLUGIN_DATACACHE_H 34#ifndef PLUGIN_DATACACHE_H
32#define PLUGIN_DATACACHE_H 35#define PLUGIN_DATACACHE_H
33 36
37
34#include "gnunet_datacache_lib.h" 38#include "gnunet_datacache_lib.h"
35 39
36#ifdef __cplusplus 40#ifdef __cplusplus
@@ -105,26 +109,14 @@ struct GNUNET_DATACACHE_PluginFunctions
105 * Store an item in the datastore. 109 * Store an item in the datastore.
106 * 110 *
107 * @param cls closure (internal context for the plugin) 111 * @param cls closure (internal context for the plugin)
108 * @param key key to store the value under
109 * @param xor_distance how close is @a key to our PID? 112 * @param xor_distance how close is @a key to our PID?
110 * @param size number of bytes in @a data 113 * @param block data to store
111 * @param data data to store
112 * @param type type of the value
113 * @param discard_time when to discard the value in any case
114 * @param path_info_len number of entries in @a path_info
115 * @param path_info a path through the network
116 * @return 0 if duplicate, -1 on error, number of bytes used otherwise 114 * @return 0 if duplicate, -1 on error, number of bytes used otherwise
117 */ 115 */
118 ssize_t 116 ssize_t
119 (*put) (void *cls, 117 (*put) (void *cls,
120 const struct GNUNET_HashCode *key,
121 uint32_t xor_distance, 118 uint32_t xor_distance,
122 size_t size, 119 const struct GNUNET_DATACACHE_Block *block);
123 const char *data,
124 enum GNUNET_BLOCK_Type type,
125 struct GNUNET_TIME_Absolute discard_time,
126 unsigned int path_info_len,
127 const struct GNUNET_DHT_PathElement *path_info);
128 120
129 121
130 /** 122 /**
@@ -158,14 +150,16 @@ struct GNUNET_DATACACHE_PluginFunctions
158 150
159 151
160 /** 152 /**
161 * Iterate over the results that are "close" to a particular key in 153 * Iterate over the results that are "close" to a particular key in the
162 * the datacache. "close" is defined as numerically larger than @a 154 * datacache. "close" is defined as returning the @a num_results that are
163 * key (when interpreted as a circular address space), with small 155 * numerically closest and larger than @a key and also @a num_results that
164 * distance. 156 * are numerically lower than @a key. Thus, the maximum number of results
157 * returned is actually twice @a num_results.
165 * 158 *
166 * @param cls closure (internal context for the plugin) 159 * @param cls closure (internal context for the plugin)
167 * @param key area of the keyspace to look into 160 * @param key area of the keyspace to look into
168 * @param num_results number of results that should be returned to @a iter 161 * @param type desired block type for the replies
162 * @param num_results half the number of results that should be returned to @a iter
169 * @param iter maybe NULL (to just count) 163 * @param iter maybe NULL (to just count)
170 * @param iter_cls closure for @a iter 164 * @param iter_cls closure for @a iter
171 * @return the number of results found 165 * @return the number of results found
@@ -173,6 +167,7 @@ struct GNUNET_DATACACHE_PluginFunctions
173 unsigned int 167 unsigned int
174 (*get_closest) (void *cls, 168 (*get_closest) (void *cls,
175 const struct GNUNET_HashCode *key, 169 const struct GNUNET_HashCode *key,
170 enum GNUNET_BLOCK_Type type,
176 unsigned int num_results, 171 unsigned int num_results,
177 GNUNET_DATACACHE_Iterator iter, 172 GNUNET_DATACACHE_Iterator iter,
178 void *iter_cls); 173 void *iter_cls);
@@ -189,3 +184,5 @@ struct GNUNET_DATACACHE_PluginFunctions
189#endif 184#endif
190 185
191/** @} */ /* end of group */ 186/** @} */ /* end of group */
187
188/** @} */ /* end of group addition */