diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-04-21 13:36:41 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-04-21 13:36:41 +0200 |
commit | de63d950345774c45b8d36969d6ecf9fee43dd9b (patch) | |
tree | 5c39e690395eb1165af91c64d1487f55dc47962c /src/include | |
parent | ab281595eeb270120f89ec954a572f4fcf78fc53 (diff) | |
parent | 1c2ab4aa3b9b563ad2098984b5751e67d3267778 (diff) | |
download | gnunet-de63d950345774c45b8d36969d6ecf9fee43dd9b.tar.gz gnunet-de63d950345774c45b8d36969d6ecf9fee43dd9b.zip |
Merge remote-tracking branch 'origin/master' into credentials
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_cadet_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_datastore_plugin.h | 112 | ||||
-rw-r--r-- | src/include/gnunet_disk_lib.h | 3 | ||||
-rw-r--r-- | src/include/gnunet_json_lib.h | 11 |
4 files changed, 63 insertions, 65 deletions
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h index f76f17a51..e2edbcc2c 100644 --- a/src/include/gnunet_cadet_service.h +++ b/src/include/gnunet_cadet_service.h | |||
@@ -221,7 +221,7 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle); | |||
221 | * Can be NULL. | 221 | * Can be NULL. |
222 | * @param disconnects Function called when a channel is disconnected. | 222 | * @param disconnects Function called when a channel is disconnected. |
223 | * @param handlers Callbacks for messages we care about, NULL-terminated. | 223 | * @param handlers Callbacks for messages we care about, NULL-terminated. |
224 | * @return Port handle. | 224 | * @return Port handle, NULL if port is in use |
225 | */ | 225 | */ |
226 | struct GNUNET_CADET_Port * | 226 | struct GNUNET_CADET_Port * |
227 | GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, | 227 | GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, |
diff --git a/src/include/gnunet_datastore_plugin.h b/src/include/gnunet_datastore_plugin.h index 516ba525c..36a3fbec2 100644 --- a/src/include/gnunet_datastore_plugin.h +++ b/src/include/gnunet_datastore_plugin.h | |||
@@ -134,7 +134,8 @@ typedef void | |||
134 | * @param cls closure | 134 | * @param cls closure |
135 | * @param key key for the item stored | 135 | * @param key key for the item stored |
136 | * @param size size of the item stored | 136 | * @param size size of the item stored |
137 | * @param status #GNUNET_OK or #GNUNET_SYSERROR | 137 | * @param status #GNUNET_OK if inserted, #GNUNET_NO if updated, |
138 | * or #GNUNET_SYSERROR if error | ||
138 | * @param msg error message on error | 139 | * @param msg error message on error |
139 | */ | 140 | */ |
140 | typedef void | 141 | typedef void |
@@ -152,6 +153,7 @@ typedef void | |||
152 | * | 153 | * |
153 | * @param cls closure | 154 | * @param cls closure |
154 | * @param key key for the item | 155 | * @param key key for the item |
156 | * @param absent true if the key was not found in the bloom filter | ||
155 | * @param size number of bytes in @a data | 157 | * @param size number of bytes in @a data |
156 | * @param data content stored | 158 | * @param data content stored |
157 | * @param type type of the content | 159 | * @param type type of the content |
@@ -165,15 +167,16 @@ typedef void | |||
165 | typedef void | 167 | typedef void |
166 | (*PluginPut) (void *cls, | 168 | (*PluginPut) (void *cls, |
167 | const struct GNUNET_HashCode *key, | 169 | const struct GNUNET_HashCode *key, |
168 | uint32_t size, | 170 | bool absent, |
169 | const void *data, | 171 | uint32_t size, |
170 | enum GNUNET_BLOCK_Type type, | 172 | const void *data, |
171 | uint32_t priority, | 173 | enum GNUNET_BLOCK_Type type, |
172 | uint32_t anonymity, | 174 | uint32_t priority, |
173 | uint32_t replication, | 175 | uint32_t anonymity, |
174 | struct GNUNET_TIME_Absolute expiration, | 176 | uint32_t replication, |
175 | PluginPutCont cont, | 177 | struct GNUNET_TIME_Absolute expiration, |
176 | void *cont_cls); | 178 | PluginPutCont cont, |
179 | void *cont_cls); | ||
177 | 180 | ||
178 | 181 | ||
179 | /** | 182 | /** |
@@ -209,11 +212,6 @@ typedef void | |||
209 | * @param next_uid return the result with lowest uid >= next_uid | 212 | * @param next_uid return the result with lowest uid >= next_uid |
210 | * @param random if true, return a random result instead of using next_uid | 213 | * @param random if true, return a random result instead of using next_uid |
211 | * @param key maybe NULL (to match all entries) | 214 | * @param key maybe NULL (to match all entries) |
212 | * @param vhash hash of the value, maybe NULL (to | ||
213 | * match all values that have the right key). | ||
214 | * Note that for DBlocks there is no difference | ||
215 | * betwen key and vhash, but for other blocks | ||
216 | * there may be! | ||
217 | * @param type entries of which type are relevant? | 215 | * @param type entries of which type are relevant? |
218 | * Use 0 for any type. | 216 | * Use 0 for any type. |
219 | * @param proc function to call on the matching value; | 217 | * @param proc function to call on the matching value; |
@@ -225,68 +223,62 @@ typedef void | |||
225 | uint64_t next_uid, | 223 | uint64_t next_uid, |
226 | bool random, | 224 | bool random, |
227 | const struct GNUNET_HashCode *key, | 225 | const struct GNUNET_HashCode *key, |
228 | const struct GNUNET_HashCode *vhash, | ||
229 | enum GNUNET_BLOCK_Type type, | 226 | enum GNUNET_BLOCK_Type type, |
230 | PluginDatumProcessor proc, | 227 | PluginDatumProcessor proc, |
231 | void *proc_cls); | 228 | void *proc_cls); |
232 | 229 | ||
233 | 230 | ||
234 | /** | 231 | /** |
235 | * Get a random item (additional constraints may apply depending on | 232 | * Remove continuation. |
236 | * the specific implementation). Calls @a proc with all values ZERO or | ||
237 | * NULL if no item applies, otherwise @a proc is called once and only | ||
238 | * once with an item. | ||
239 | * | 233 | * |
240 | * @param cls closure | 234 | * @param cls closure |
241 | * @param proc function to call the value (once only). | 235 | * @param key key for the content removed |
242 | * @param proc_cls closure for @a proc | 236 | * @param size number of bytes removed |
237 | * @param status #GNUNET_OK if removed, #GNUNET_NO if not found, | ||
238 | * or #GNUNET_SYSERROR if error | ||
239 | * @param msg error message on error | ||
243 | */ | 240 | */ |
244 | typedef void | 241 | typedef void |
245 | (*PluginGetRandom) (void *cls, | 242 | (*PluginRemoveCont) (void *cls, |
246 | PluginDatumProcessor proc, | 243 | const struct GNUNET_HashCode *key, |
247 | void *proc_cls); | 244 | uint32_t size, |
245 | int status, | ||
246 | const char *msg); | ||
248 | 247 | ||
249 | 248 | ||
250 | /** | 249 | /** |
251 | * Update continuation. | 250 | * Remove a particular key in the datastore. |
252 | * | 251 | * |
253 | * @param cls closure | 252 | * @param cls closure |
254 | * @param status #GNUNET_OK or #GNUNET_SYSERR | 253 | * @param key key for the content |
255 | * @param msg error message on error | 254 | * @param size number of bytes in data |
255 | * @param data content stored | ||
256 | * @param cont continuation called with success or failure status | ||
257 | * @param cont_cls continuation closure for @a cont | ||
256 | */ | 258 | */ |
257 | typedef void | 259 | typedef void |
258 | (*PluginUpdateCont) (void *cls, | 260 | (*PluginRemoveKey) (void *cls, |
259 | int status, | 261 | const struct GNUNET_HashCode *key, |
260 | const char *msg); | 262 | uint32_t size, |
263 | const void *data, | ||
264 | PluginRemoveCont cont, | ||
265 | void *cont_cls); | ||
261 | 266 | ||
262 | 267 | ||
263 | /** | 268 | /** |
264 | * Update the priority, replication and expiration for a particular | 269 | * Get a random item (additional constraints may apply depending on |
265 | * unique ID in the datastore. If the expiration time in value is | 270 | * the specific implementation). Calls @a proc with all values ZERO or |
266 | * different than the time found in the datastore, the higher value | 271 | * NULL if no item applies, otherwise @a proc is called once and only |
267 | * should be kept. The specified priority and replication is added | 272 | * once with an item. |
268 | * to the existing value. | ||
269 | * | 273 | * |
270 | * @param cls closure | 274 | * @param cls closure |
271 | * @param uid unique identifier of the datum | 275 | * @param proc function to call the value (once only). |
272 | * @param priority by how much should the priority | 276 | * @param proc_cls closure for @a proc |
273 | * change? | ||
274 | * @param replication by how much should the replication | ||
275 | * change? | ||
276 | * @param expire new expiration time should be the | ||
277 | * MAX of any existing expiration time and | ||
278 | * this value | ||
279 | * @param cont continuation called with success or failure status | ||
280 | * @param cons_cls continuation closure | ||
281 | */ | 277 | */ |
282 | typedef void | 278 | typedef void |
283 | (*PluginUpdate) (void *cls, | 279 | (*PluginGetRandom) (void *cls, |
284 | uint64_t uid, | 280 | PluginDatumProcessor proc, |
285 | uint32_t priority, | 281 | void *proc_cls); |
286 | uint32_t replication, | ||
287 | struct GNUNET_TIME_Absolute expire, | ||
288 | PluginUpdateCont cont, | ||
289 | void *cont_cls); | ||
290 | 282 | ||
291 | 283 | ||
292 | /** | 284 | /** |
@@ -342,16 +334,6 @@ struct GNUNET_DATASTORE_PluginFunctions | |||
342 | PluginPut put; | 334 | PluginPut put; |
343 | 335 | ||
344 | /** | 336 | /** |
345 | * Update the priority for a particular key in the datastore. If | ||
346 | * the expiration time in value is different than the time found in | ||
347 | * the datastore, the higher value should be kept. For the | ||
348 | * anonymity level, the lower value is to be used. The specified | ||
349 | * priority should be added to the existing priority, ignoring the | ||
350 | * priority in value. | ||
351 | */ | ||
352 | PluginUpdate update; | ||
353 | |||
354 | /** | ||
355 | * Get a particular datum matching a given hash from the datastore. | 337 | * Get a particular datum matching a given hash from the datastore. |
356 | */ | 338 | */ |
357 | PluginGetKey get_key; | 339 | PluginGetKey get_key; |
@@ -388,6 +370,10 @@ struct GNUNET_DATASTORE_PluginFunctions | |||
388 | */ | 370 | */ |
389 | PluginGetKeys get_keys; | 371 | PluginGetKeys get_keys; |
390 | 372 | ||
373 | /** | ||
374 | * Function to remove an item from the database. | ||
375 | */ | ||
376 | PluginRemoveKey remove_key; | ||
391 | }; | 377 | }; |
392 | 378 | ||
393 | #endif | 379 | #endif |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 02c4b3674..be2885460 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -331,7 +331,8 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, | |||
331 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 331 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
332 | */ | 332 | */ |
333 | int | 333 | int |
334 | GNUNET_DISK_file_size (const char *filename, uint64_t *size, | 334 | GNUNET_DISK_file_size (const char *filename, |
335 | uint64_t *size, | ||
335 | int include_symbolic_links, | 336 | int include_symbolic_links, |
336 | int single_file_mode); | 337 | int single_file_mode); |
337 | 338 | ||
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h index ce721d8d8..f2682bea7 100644 --- a/src/include/gnunet_json_lib.h +++ b/src/include/gnunet_json_lib.h | |||
@@ -263,6 +263,17 @@ GNUNET_JSON_spec_absolute_time (const char *name, | |||
263 | 263 | ||
264 | 264 | ||
265 | /** | 265 | /** |
266 | * Absolute time in network byte order. | ||
267 | * | ||
268 | * @param name name of the JSON field | ||
269 | * @param[out] at where to store the absolute time found under @a name | ||
270 | */ | ||
271 | struct GNUNET_JSON_Specification | ||
272 | GNUNET_JSON_spec_absolute_time_nbo (const char *name, | ||
273 | struct GNUNET_TIME_AbsoluteNBO *at); | ||
274 | |||
275 | |||
276 | /** | ||
266 | * Relative time. | 277 | * Relative time. |
267 | * | 278 | * |
268 | * @param name name of the JSON field | 279 | * @param name name of the JSON field |