aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_fs_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r--src/include/gnunet_fs_service.h174
1 files changed, 0 insertions, 174 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index a49d8fb98..d60044732 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -93,180 +93,6 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword,
93 93
94 94
95/** 95/**
96 * Iterator over all known pseudonyms.
97 *
98 * @param cls closure
99 * @param pseudonym public key of pseudonym
100 * @param name name of the pseudonym (might be NULL)
101 * @param unique_name unique name of the pseudonym (might be NULL)
102 * @param md meta data known about the pseudonym
103 * @param rating the local rating of the pseudonym
104 * @return #GNUNET_OK to continue iteration, #GNUNET_SYSERR to abort
105 */
106typedef int (*GNUNET_FS_PseudonymIterator) (void *cls,
107 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
108 const char *name,
109 const char *unique_name,
110 const struct GNUNET_CONTAINER_MetaData *md,
111 int32_t rating);
112
113
114/**
115 * Change the rank of a pseudonym.
116 *
117 * @param cfg overall configuration
118 * @param pseudonym identity of the pseudonym
119 * @param delta by how much should the rating be changed?
120 * @return new rating of the pseudonym
121 */
122int
123GNUNET_FS_pseudonym_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
124 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
125 int32_t delta);
126
127
128/**
129 * Add a pseudonym to the set of known pseudonyms.
130 * For all pseudonym advertisements that we discover
131 * FS should automatically call this function.
132 *
133 * @param cfg overall configuration
134 * @param pseudonym the pseudonym identifier
135 * @param meta metadata for the pseudonym
136 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
137 */
138int
139GNUNET_FS_pseudonym_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
140 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
141 const struct GNUNET_CONTAINER_MetaData *meta);
142
143
144/**
145 * List all known pseudonyms.
146 *
147 * @param cfg overall configuration
148 * @param iterator function to call for each pseudonym
149 * @param iterator_cls closure for iterator
150 * @return number of pseudonyms found
151 */
152int
153GNUNET_FS_pseudonym_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
154 GNUNET_FS_PseudonymIterator iterator,
155 void *iterator_cls);
156
157
158/**
159 * Handle for a discovery callback registration.
160 */
161struct GNUNET_FS_Pseudonym_DiscoveryHandle;
162
163
164/**
165 * Register callback to be invoked whenever we discover
166 * a new pseudonym.
167 *
168 * @param cfg our configuration
169 * @param iterator function to invoke on discovery
170 * @param iterator_cls closure for iterator
171 * @return registration handle
172 */
173struct GNUNET_FS_Pseudonym_DiscoveryHandle *
174GNUNET_FS_pseudonym_discovery_callback_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
175 GNUNET_FS_PseudonymIterator iterator,
176 void *iterator_cls);
177
178
179/**
180 * Unregister pseudonym discovery callback.
181 *
182 * @param dh registration to unregister
183 */
184void
185GNUNET_FS_pseudonym_discovery_callback_unregister (struct GNUNET_FS_Pseudonym_DiscoveryHandle *dh);
186
187
188/**
189 * Return unique variant of the pseudonym name. Use after
190 * GNUNET_FS_pseudonym_id_to_name() to make sure that name is unique.
191 *
192 * @param cfg configuration
193 * @param pseudonym cryptographic ID of the pseudonym
194 * @param name name to uniquify
195 * @param suffix if not NULL, filled with the suffix value
196 * @return NULL on failure (should never happen), name on success.
197 * Free the name with GNUNET_free().
198 */
199char *
200GNUNET_FS_pseudonym_name_uniquify (const struct GNUNET_CONFIGURATION_Handle *cfg,
201 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
202 const char *name,
203 unsigned int *suffix);
204
205
206/**
207 * Get pseudonym name, metadata and rank. This is a wrapper around
208 * internal read_info() call, and ensures that returned data is not
209 * invalid (not NULL). Writing back information returned by this
210 * function will give a name "no-name" to pseudonyms that have no
211 * name. This side-effect is unavoidable, but hardly harmful.
212 *
213 * @param cfg configuration
214 * @param pseudonym cryptographic ID of the pseudonym
215 * @param ret_meta a location to store metadata pointer. NULL, if metadata
216 * is not needed. Destroy with GNUNET_CONTAINER_meta_data_destroy().
217 * @param ret_rank a location to store rank. NULL, if rank not needed.
218 * @param ret_name a location to store human-readable name. Name is not unique.
219 * NULL, if name is not needed. Free with GNUNET_free().
220 * @param name_is_a_dup is set to #GNUNET_YES, if ret_name was filled with
221 * a duplicate of a "no-name" placeholder
222 * @return #GNUNET_OK on success. #GNUENT_SYSERR if the data was
223 * unobtainable (in that case ret_* are filled with placeholders -
224 * empty metadata container, rank -1 and a "no-name" name).
225 */
226int
227GNUNET_FS_pseudonym_get_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
228 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
229 struct GNUNET_CONTAINER_MetaData **ret_meta,
230 int32_t *ret_rank,
231 char **ret_name,
232 int *name_is_a_dup);
233
234
235/**
236 * Get the pseudonym ID belonging to the given pseudonym name.
237 *
238 * @param cfg configuration to use
239 * @param ns_uname unique (!) human-readable name for the pseudonym
240 * @param pseudonym set to pseudonym ID based on 'ns_uname'
241 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
242 */
243int
244GNUNET_FS_pseudonym_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
245 const char *ns_uname,
246 struct GNUNET_CRYPTO_EccPublicKey *pseudonym);
247
248
249/**
250 * Set the pseudonym metadata, rank and name.
251 *
252 * @param cfg overall configuration
253 * @param pseudonym id of the pseudonym
254 * @param name name to set. Must be the non-unique version of it.
255 * May be NULL, in which case it erases pseudonym's name!
256 * @param md metadata to set
257 * May be NULL, in which case it erases pseudonym's metadata!
258 * @param rank rank to assign
259 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
260 */
261int
262GNUNET_FS_pseudonym_set_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
263 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
264 const char *name,
265 const struct GNUNET_CONTAINER_MetaData *md,
266 int32_t rank);
267
268
269/**
270 * Get a unique key from a URI. This is for putting URIs 96 * Get a unique key from a URI. This is for putting URIs
271 * into HashMaps. The key may change between FS implementations. 97 * into HashMaps. The key may change between FS implementations.
272 * 98 *