diff options
author | Gabor X Toth <*@tg-x.net> | 2014-07-27 11:35:43 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2014-07-27 11:35:43 +0000 |
commit | 1ac8baae5380d8f83efb31390568b717e871823a (patch) | |
tree | dc363148002cba0f94d9e2c9a6f3b2576bb39793 /src/include | |
parent | 0ea6bab62cd1d29e32c5d442d865e1b6bf82bef1 (diff) | |
download | gnunet-1ac8baae5380d8f83efb31390568b717e871823a.tar.gz gnunet-1ac8baae5380d8f83efb31390568b717e871823a.zip |
psycstore: add option to perform membership test when retrieving fragment or message
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index 20af9f3d3..5a9969bce 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -46,6 +46,11 @@ extern "C" | |||
46 | #define GNUNET_PSYCSTORE_VERSION 0x00000000 | 46 | #define GNUNET_PSYCSTORE_VERSION 0x00000000 |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Membership test failed. | ||
50 | */ | ||
51 | #define GNUNET_PSYCSTORE_MEMBERSHIP_TEST_FAILED -2 | ||
52 | |||
53 | /** | ||
49 | * Flags for stored messages. | 54 | * Flags for stored messages. |
50 | */ | 55 | */ |
51 | enum GNUNET_PSYCSTORE_MessageFlags | 56 | enum GNUNET_PSYCSTORE_MessageFlags |
@@ -217,18 +222,29 @@ typedef int | |||
217 | /** | 222 | /** |
218 | * Retrieve a message fragment by fragment ID. | 223 | * Retrieve a message fragment by fragment ID. |
219 | * | 224 | * |
220 | * @param h Handle for the PSYCstore. | 225 | * @param h |
221 | * @param channel_key The channel we are interested in. | 226 | * Handle for the PSYCstore. |
222 | * @param fragment_id Fragment ID to check. Use 0 to get the latest message fragment. | 227 | * @param channel_key |
223 | * @param fcb Callback to call with the retrieved fragment. | 228 | * The channel we are interested in. |
224 | * @param rcb Callback to call with the result of the operation. | 229 | * @param slave_key |
225 | * @param cls Closure for the callbacks. | 230 | * The slave requesting the fragment. If not NULL, a membership test is |
231 | * performed first and the fragment is only returned if the slave has | ||
232 | * access to it. | ||
233 | * @param fragment_id | ||
234 | * Fragment ID to retrieve. Use 0 to get the latest message fragment. | ||
235 | * @param fcb | ||
236 | * Callback to call with the retrieved fragments. | ||
237 | * @param rcb | ||
238 | * Callback to call with the result of the operation. | ||
239 | * @param cls | ||
240 | * Closure for the callbacks. | ||
226 | * | 241 | * |
227 | * @return Handle that can be used to cancel the operation. | 242 | * @return Handle that can be used to cancel the operation. |
228 | */ | 243 | */ |
229 | struct GNUNET_PSYCSTORE_OperationHandle * | 244 | struct GNUNET_PSYCSTORE_OperationHandle * |
230 | GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, | 245 | GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, |
231 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, | 246 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, |
247 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, | ||
232 | uint64_t fragment_id, | 248 | uint64_t fragment_id, |
233 | GNUNET_PSYCSTORE_FragmentCallback fcb, | 249 | GNUNET_PSYCSTORE_FragmentCallback fcb, |
234 | GNUNET_PSYCSTORE_ResultCallback rcb, | 250 | GNUNET_PSYCSTORE_ResultCallback rcb, |
@@ -238,18 +254,29 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
238 | /** | 254 | /** |
239 | * Retrieve all fragments of a message. | 255 | * Retrieve all fragments of a message. |
240 | * | 256 | * |
241 | * @param h Handle for the PSYCstore. | 257 | * @param h |
242 | * @param channel_key The channel we are interested in. | 258 | * Handle for the PSYCstore. |
243 | * @param message_id Message ID to check. Use 0 to get the latest message. | 259 | * @param channel_key |
244 | * @param fcb Callback to call with the retrieved fragments. | 260 | * The channel we are interested in. |
245 | * @param rcb Callback to call with the result of the operation. | 261 | * @param slave_key |
246 | * @param cls Closure for the callbacks. | 262 | * The slave requesting the message. If not NULL, a membership test is |
263 | * performed first and the message is only returned if the slave has | ||
264 | * access to it. | ||
265 | * @param message_id | ||
266 | * Message ID to retrieve. Use 0 to get the latest message. | ||
267 | * @param fcb | ||
268 | * Callback to call with the retrieved fragments. | ||
269 | * @param rcb | ||
270 | * Callback to call with the result of the operation. | ||
271 | * @param cls | ||
272 | * Closure for the callbacks. | ||
247 | * | 273 | * |
248 | * @return Handle that can be used to cancel the operation. | 274 | * @return Handle that can be used to cancel the operation. |
249 | */ | 275 | */ |
250 | struct GNUNET_PSYCSTORE_OperationHandle * | 276 | struct GNUNET_PSYCSTORE_OperationHandle * |
251 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | 277 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, |
252 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, | 278 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, |
279 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, | ||
253 | uint64_t message_id, | 280 | uint64_t message_id, |
254 | GNUNET_PSYCSTORE_FragmentCallback fcb, | 281 | GNUNET_PSYCSTORE_FragmentCallback fcb, |
255 | GNUNET_PSYCSTORE_ResultCallback rcb, | 282 | GNUNET_PSYCSTORE_ResultCallback rcb, |
@@ -273,6 +300,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
273 | struct GNUNET_PSYCSTORE_OperationHandle * | 300 | struct GNUNET_PSYCSTORE_OperationHandle * |
274 | GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, | 301 | GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, |
275 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, | 302 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, |
303 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, | ||
276 | uint64_t message_id, | 304 | uint64_t message_id, |
277 | uint64_t fragment_offset, | 305 | uint64_t fragment_offset, |
278 | GNUNET_PSYCSTORE_FragmentCallback fcb, | 306 | GNUNET_PSYCSTORE_FragmentCallback fcb, |