You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

702 lines
24 KiB

  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2013 GNUnet e.V.
  4. GNUnet is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License,
  7. or (at your option) any later version.
  8. GNUnet is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. SPDX-License-Identifier: AGPL3.0-or-later
  15. */
  16. /**
  17. * @author Gabor X Toth
  18. * @author Christian Grothoff
  19. *
  20. * @file
  21. * PSYCstore service; implements persistent storage for the PSYC service
  22. *
  23. * @defgroup psycstore PSYC Store service
  24. * Persistent storage for the PSYC service.
  25. * @{
  26. */
  27. #ifndef GNUNET_PSYCSTORE_SERVICE_H
  28. #define GNUNET_PSYCSTORE_SERVICE_H
  29. #ifdef __cplusplus
  30. extern "C"
  31. {
  32. #if 0 /* keep Emacsens' auto-indent happy */
  33. }
  34. #endif
  35. #endif
  36. #include "gnunet_util_lib.h"
  37. #include "gnunet_psyc_util_lib.h"
  38. #include "gnunet_multicast_service.h"
  39. #include "gnunet_psyc_service.h"
  40. /**
  41. * Version number of GNUnet PSYCstore API.
  42. */
  43. #define GNUNET_PSYCSTORE_VERSION 0x00000000
  44. /**
  45. * Membership test failed.
  46. */
  47. #define GNUNET_PSYCSTORE_MEMBERSHIP_TEST_FAILED -2
  48. /**
  49. * Flags for stored messages.
  50. */
  51. enum GNUNET_PSYCSTORE_MessageFlags
  52. {
  53. /**
  54. * The message contains state modifiers.
  55. */
  56. GNUNET_PSYCSTORE_MESSAGE_STATE = 1 << 0,
  57. /**
  58. * The state modifiers have been applied to the state store.
  59. */
  60. GNUNET_PSYCSTORE_MESSAGE_STATE_APPLIED = 1 << 1,
  61. /**
  62. * The message contains a state hash.
  63. */
  64. GNUNET_PSYCSTORE_MESSAGE_STATE_HASH = 1 << 2
  65. };
  66. /**
  67. * Handle for a PSYCstore
  68. */
  69. struct GNUNET_PSYCSTORE_Handle;
  70. /**
  71. * Connect to the PSYCstore service.
  72. *
  73. * @param cfg Configuration to use.
  74. *
  75. * @return Handle for the connecton.
  76. */
  77. struct GNUNET_PSYCSTORE_Handle *
  78. GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
  79. /**
  80. * Disconnect from the PSYCstore service.
  81. *
  82. * @param h Handle for the connection.
  83. */
  84. void
  85. GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h);
  86. /**
  87. * Handle for an operation on the PSYCSTORE (useful to cancel the operation).
  88. */
  89. struct GNUNET_PSYCSTORE_OperationHandle;
  90. /**
  91. * Function called with the result of an asynchronous operation.
  92. *
  93. * @param cls
  94. * Closure.
  95. * @param result
  96. * Result of the operation.
  97. * @param err_msg
  98. * Error message, or NULL if there's no error.
  99. * @param err_msg_size
  100. * Size of @a err_msg
  101. */
  102. typedef void
  103. (*GNUNET_PSYCSTORE_ResultCallback) (void *cls,
  104. int64_t result,
  105. const char *err_msg,
  106. uint16_t err_msg_size);
  107. /**
  108. * Store join/leave events for a PSYC channel in order to be able to answer
  109. * membership test queries later.
  110. *
  111. * @param h
  112. * Handle for the PSYCstore.
  113. * @param channel_key
  114. * The channel where the event happened.
  115. * @param slave_key
  116. * Public key of joining/leaving slave.
  117. * @param did_join
  118. * #GNUNET_YES on join, #GNUNET_NO on part.
  119. * @param announced_at
  120. * ID of the message that announced the membership change.
  121. * @param effective_since
  122. * Message ID this membership change is in effect since.
  123. * For joins it is <= announced_at, for parts it is always 0.
  124. * @param group_generation
  125. * In case of a part, the last group generation the slave has access to.
  126. * It has relevance when a larger message have fragments with different
  127. * group generations.
  128. * @param result_cb
  129. * Callback to call with the result of the storage operation.
  130. * @param cls
  131. * Closure for the callback.
  132. *
  133. * @return Operation handle that can be used to cancel the operation.
  134. */
  135. struct GNUNET_PSYCSTORE_OperationHandle *
  136. GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
  137. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  138. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  139. int did_join,
  140. uint64_t announced_at,
  141. uint64_t effective_since,
  142. uint64_t group_generation,
  143. GNUNET_PSYCSTORE_ResultCallback result_cb,
  144. void *cls);
  145. /**
  146. * Test if a member was admitted to the channel at the given message ID.
  147. *
  148. * This is useful when relaying and replaying messages to check if a particular
  149. * slave has access to the message fragment with a given group generation. It
  150. * is also used when handling join requests to determine whether the slave is
  151. * currently admitted to the channel.
  152. *
  153. * @param h
  154. * Handle for the PSYCstore.
  155. * @param channel_key
  156. * The channel we are interested in.
  157. * @param slave_key
  158. * Public key of slave whose membership to check.
  159. * @param message_id
  160. * Message ID for which to do the membership test.
  161. * @param group_generation
  162. * Group generation of the fragment of the message to test.
  163. * It has relevance if the message consists of multiple fragments with
  164. * different group generations.
  165. * @param result_cb
  166. * Callback to call with the test result.
  167. * @param cls
  168. * Closure for the callback.
  169. *
  170. * @return Operation handle that can be used to cancel the operation.
  171. */
  172. struct GNUNET_PSYCSTORE_OperationHandle *
  173. GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
  174. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  175. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  176. uint64_t message_id,
  177. uint64_t group_generation,
  178. GNUNET_PSYCSTORE_ResultCallback result_cb,
  179. void *cls);
  180. /**
  181. * Store a message fragment sent to a channel.
  182. *
  183. * @param h Handle for the PSYCstore.
  184. * @param channel_key The channel the message belongs to.
  185. * @param msg Message to store.
  186. * @param psycstore_flags Flags indicating whether the PSYC message contains
  187. * state modifiers.
  188. * @param result_cb Callback to call with the result of the operation.
  189. * @param cls Closure for the callback.
  190. *
  191. * @return Handle that can be used to cancel the operation.
  192. */
  193. struct GNUNET_PSYCSTORE_OperationHandle *
  194. GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
  195. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  196. const struct GNUNET_MULTICAST_MessageHeader *msg,
  197. enum GNUNET_PSYCSTORE_MessageFlags psycstore_flags,
  198. GNUNET_PSYCSTORE_ResultCallback result_cb,
  199. void *cls);
  200. /**
  201. * Function called with one message fragment, as the result of a
  202. * GNUNET_PSYCSTORE_fragment_get() or GNUNET_PSYCSTORE_message_get() call.
  203. *
  204. * @param cls Closure.
  205. * @param message The retrieved message fragment. A NULL value indicates that
  206. * there are no more results to be returned.
  207. * @param psycstore_flags Flags stored with the message.
  208. *
  209. * @return #GNUNET_NO to stop calling this callback with further fragments,
  210. * #GNUNET_YES to continue.
  211. */
  212. typedef int
  213. (*GNUNET_PSYCSTORE_FragmentCallback) (void *cls,
  214. struct GNUNET_MULTICAST_MessageHeader *message,
  215. enum GNUNET_PSYCSTORE_MessageFlags psycstore_flags);
  216. /**
  217. * Retrieve message fragments by fragment ID range.
  218. *
  219. * @param h
  220. * Handle for the PSYCstore.
  221. * @param channel_key
  222. * The channel we are interested in.
  223. * @param slave_key
  224. * The slave requesting the fragment. If not NULL, a membership test is
  225. * performed first and the fragment is only returned if the slave has
  226. * access to it.
  227. * @param first_fragment_id
  228. * First fragment ID to retrieve.
  229. * Use 0 to get the latest message fragment.
  230. * @param last_fragment_id
  231. * Last consecutive fragment ID to retrieve.
  232. * Use 0 to get the latest message fragment.
  233. * @param fragment_cb
  234. * Callback to call with the retrieved fragments.
  235. * @param result_cb
  236. * Callback to call with the result of the operation.
  237. * @param cls
  238. * Closure for the callbacks.
  239. *
  240. * @return Handle that can be used to cancel the operation.
  241. */
  242. struct GNUNET_PSYCSTORE_OperationHandle *
  243. GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
  244. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  245. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  246. uint64_t first_message_id,
  247. uint64_t last_message_id,
  248. GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
  249. GNUNET_PSYCSTORE_ResultCallback result_cb,
  250. void *cls);
  251. /**
  252. * Retrieve latest message fragments.
  253. *
  254. * @param h
  255. * Handle for the PSYCstore.
  256. * @param channel_key
  257. * The channel we are interested in.
  258. * @param slave_key
  259. * The slave requesting the fragment. If not NULL, a membership test is
  260. * performed first and the fragment is only returned if the slave has
  261. * access to it.
  262. * @param first_fragment_id
  263. * First fragment ID to retrieve.
  264. * Use 0 to get the latest message fragment.
  265. * @param last_fragment_id
  266. * Last consecutive fragment ID to retrieve.
  267. * Use 0 to get the latest message fragment.
  268. * @param fragment_limit
  269. * Maximum number of fragments to retrieve.
  270. * @param fragment_cb
  271. * Callback to call with the retrieved fragments.
  272. * @param result_cb
  273. * Callback to call with the result of the operation.
  274. * @param cls
  275. * Closure for the callbacks.
  276. *
  277. * @return Handle that can be used to cancel the operation.
  278. */
  279. struct GNUNET_PSYCSTORE_OperationHandle *
  280. GNUNET_PSYCSTORE_fragment_get_latest (struct GNUNET_PSYCSTORE_Handle *h,
  281. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  282. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  283. uint64_t fragment_limit,
  284. GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
  285. GNUNET_PSYCSTORE_ResultCallback result_cb,
  286. void *cls);
  287. /**
  288. * Retrieve all fragments of messages in a message ID range.
  289. *
  290. * @param h
  291. * Handle for the PSYCstore.
  292. * @param channel_key
  293. * The channel we are interested in.
  294. * @param slave_key
  295. * The slave requesting the message.
  296. * If not NULL, a membership test is performed first
  297. * and the message is only returned if the slave has access to it.
  298. * @param first_message_id
  299. * First message ID to retrieve.
  300. * @param last_message_id
  301. * Last consecutive message ID to retrieve.
  302. * @param fragment_limit
  303. * Maximum number of fragments to retrieve.
  304. * @param method_prefix
  305. * Retrieve only messages with a matching method prefix.
  306. * @param fragment_cb
  307. * Callback to call with the retrieved fragments.
  308. * @param result_cb
  309. * Callback to call with the result of the operation.
  310. * @param cls
  311. * Closure for the callbacks.
  312. *
  313. * @return Handle that can be used to cancel the operation.
  314. */
  315. struct GNUNET_PSYCSTORE_OperationHandle *
  316. GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
  317. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  318. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  319. uint64_t first_message_id,
  320. uint64_t last_message_id,
  321. uint64_t fragment_limit,
  322. const char *method_prefix,
  323. GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
  324. GNUNET_PSYCSTORE_ResultCallback result_cb,
  325. void *cls);
  326. /**
  327. * Retrieve all fragments of the latest messages.
  328. *
  329. * @param h
  330. * Handle for the PSYCstore.
  331. * @param channel_key
  332. * The channel we are interested in.
  333. * @param slave_key
  334. * The slave requesting the message.
  335. * If not NULL, a membership test is performed first
  336. * and the message is only returned if the slave has access to it.
  337. * @param message_limit
  338. * Maximum number of messages to retrieve.
  339. * @param method_prefix
  340. * Retrieve only messages with a matching method prefix.
  341. * @param fragment_cb
  342. * Callback to call with the retrieved fragments.
  343. * @param result_cb
  344. * Callback to call with the result of the operation.
  345. * @param cls
  346. * Closure for the callbacks.
  347. *
  348. * @return Handle that can be used to cancel the operation.
  349. */
  350. struct GNUNET_PSYCSTORE_OperationHandle *
  351. GNUNET_PSYCSTORE_message_get_latest (struct GNUNET_PSYCSTORE_Handle *h,
  352. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  353. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  354. uint64_t message_limit,
  355. const char *method_prefix,
  356. GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
  357. GNUNET_PSYCSTORE_ResultCallback result_cb,
  358. void *cls);
  359. /**
  360. * Retrieve a fragment of message specified by its message ID and fragment
  361. * offset.
  362. *
  363. * @param h
  364. * Handle for the PSYCstore.
  365. * @param channel_key
  366. * The channel we are interested in.
  367. * @param slave_key
  368. * The slave requesting the message fragment. If not NULL, a membership
  369. * test is performed first and the message fragment is only returned
  370. * if the slave has access to it.
  371. * @param message_id
  372. * Message ID to retrieve. Use 0 to get the latest message.
  373. * @param fragment_offset
  374. * Offset of the fragment to retrieve.
  375. * @param fragment_cb
  376. * Callback to call with the retrieved fragments.
  377. * @param result_cb
  378. * Callback to call with the result of the operation.
  379. * @param cls
  380. * Closure for the callbacks.
  381. *
  382. * @return Handle that can be used to cancel the operation.
  383. */
  384. struct GNUNET_PSYCSTORE_OperationHandle *
  385. GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
  386. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  387. const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
  388. uint64_t message_id,
  389. uint64_t fragment_offset,
  390. GNUNET_PSYCSTORE_FragmentCallback fragment_cb,
  391. GNUNET_PSYCSTORE_ResultCallback result_cb,
  392. void *cls);
  393. /**
  394. * Callback used to return the latest value of counters for the channel master.
  395. *
  396. * @see GNUNET_PSYCSTORE_counters_get()
  397. *
  398. * @param cls Closure.
  399. * @param result_code
  400. * Status code for the operation:
  401. * #GNUNET_OK: success, counter values are returned.
  402. * #GNUNET_NO: no message has been sent to the channel yet.
  403. * #GNUNET_SYSERR: an error occurred.
  404. * @param max_fragment_id
  405. * Latest message fragment ID, used by multicast.
  406. * @param max_message_id
  407. * Latest message ID, used by PSYC.
  408. * @param max_group_generation
  409. * Latest group generation, used by PSYC.
  410. * @param max_state_message_id
  411. * Latest message ID containing state modifiers that
  412. * was applied to the state store. Used for the state sync process.
  413. */
  414. typedef void
  415. (*GNUNET_PSYCSTORE_CountersCallback) (void *cls,
  416. int result_code,
  417. uint64_t max_fragment_id,
  418. uint64_t max_message_id,
  419. uint64_t max_group_generation,
  420. uint64_t max_state_message_id);
  421. /**
  422. * Retrieve latest values of counters for a channel.
  423. *
  424. * The current value of counters are needed
  425. * - when a channel master is restarted, so that it can continue incrementing
  426. * the counters from their last value.
  427. * - when a channel slave rejoins and starts the state synchronization process.
  428. *
  429. * @param h
  430. * Handle for the PSYCstore.
  431. * @param channel_key
  432. * Public key that identifies the channel.
  433. * @param counters_cb
  434. * Callback to call with the result.
  435. * @param cls
  436. * Closure for the @a ccb callback.
  437. *
  438. * @return Handle that can be used to cancel the operation.
  439. */
  440. struct GNUNET_PSYCSTORE_OperationHandle *
  441. GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
  442. struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  443. GNUNET_PSYCSTORE_CountersCallback counters_cb,
  444. void *cls);
  445. /**
  446. * Apply modifiers of a message to the current channel state.
  447. *
  448. * An error is returned if there are missing messages containing state
  449. * operations before the current one.
  450. *
  451. * @param h
  452. * Handle for the PSYCstore.
  453. * @param channel_key
  454. * The channel we are interested in.
  455. * @param message_id
  456. * ID of the message that contains the @a modifiers.
  457. * @param state_delta
  458. * Value of the @e state_delta PSYC header variable of the message.
  459. * @param result_cb
  460. * Callback to call with the result of the operation.
  461. * @param cls
  462. * Closure for the @a result_cb callback.
  463. *
  464. * @return Handle that can be used to cancel the operation.
  465. */
  466. struct GNUNET_PSYCSTORE_OperationHandle *
  467. GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
  468. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  469. uint64_t message_id,
  470. uint64_t state_delta,
  471. GNUNET_PSYCSTORE_ResultCallback result_cb,
  472. void *cls);
  473. /**
  474. * Store synchronized state.
  475. *
  476. * @param h
  477. * Handle for the PSYCstore.
  478. * @param channel_key
  479. * The channel we are interested in.
  480. * @param max_state_message_id
  481. * ID of the last stateful message before @a state_hash_message_id.
  482. * @param state_hash_message_id
  483. * ID of the message that contains the state_hash PSYC header variable.
  484. * @param modifier_count
  485. * Number of elements in the @a modifiers array.
  486. * @param modifiers
  487. * Full state to store.
  488. * @param result_cb
  489. * Callback to call with the result of the operation.
  490. * @param cls
  491. * Closure for the callback.
  492. *
  493. * @return Handle that can be used to cancel the operation.
  494. */
  495. struct GNUNET_PSYCSTORE_OperationHandle *
  496. GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
  497. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  498. uint64_t max_state_message_id,
  499. uint64_t state_hash_message_id,
  500. size_t modifier_count,
  501. const struct GNUNET_PSYC_Modifier *modifiers,
  502. GNUNET_PSYCSTORE_ResultCallback result_cb,
  503. void *cls);
  504. /**
  505. * Reset the state of a channel.
  506. *
  507. * Delete all state variables stored for the given channel.
  508. *
  509. * @param h
  510. * Handle for the PSYCstore.
  511. * @param channel_key
  512. * The channel we are interested in.
  513. * @param result_cb
  514. * Callback to call with the result of the operation.
  515. * @param cls
  516. * Closure for the callback.
  517. *
  518. * @return Handle that can be used to cancel the operation.
  519. */
  520. struct GNUNET_PSYCSTORE_OperationHandle *
  521. GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
  522. const struct GNUNET_CRYPTO_EddsaPublicKey
  523. *channel_key,
  524. GNUNET_PSYCSTORE_ResultCallback result_cb,
  525. void *cls);
  526. /**
  527. * Update signed values of state variables in the state store.
  528. *
  529. * @param h
  530. * Handle for the PSYCstore.
  531. * @param channel_key
  532. * The channel we are interested in.
  533. * @param message_id
  534. * Message ID that contained the state @a hash.
  535. * @param hash
  536. * Hash of the serialized full state.
  537. * @param result_cb
  538. * Callback to call with the result of the operation.
  539. * @param cls
  540. * Closure for the callback.
  541. *
  542. */
  543. struct GNUNET_PSYCSTORE_OperationHandle *
  544. GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
  545. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  546. uint64_t message_id,
  547. const struct GNUNET_HashCode *hash,
  548. GNUNET_PSYCSTORE_ResultCallback result_cb,
  549. void *cls);
  550. /**
  551. * Function called with the value of a state variable.
  552. *
  553. * @param cls
  554. * Closure.
  555. * @param name
  556. * Name of the state variable. A NULL value indicates that there are no more
  557. * state variables to be returned.
  558. * @param value
  559. * Value of the state variable.
  560. * @param value_size
  561. * Number of bytes in @a value.
  562. *
  563. * @return #GNUNET_NO to stop calling this callback with further variables,
  564. * #GNUNET_YES to continue.
  565. */;
  566. typedef int
  567. (*GNUNET_PSYCSTORE_StateCallback) (void *cls, const char *name,
  568. const void *value, uint32_t value_size);
  569. /**
  570. * Retrieve the best matching state variable.
  571. *
  572. * @param h
  573. * Handle for the PSYCstore.
  574. * @param channel_key
  575. * The channel we are interested in.
  576. * @param name
  577. * Name of variable to match, the returned variable might be less specific.
  578. * @param state_cb
  579. * Callback to return the matching state variable.
  580. * @param result_cb
  581. * Callback to call with the result of the operation.
  582. * @param cls
  583. * Closure for the callbacks.
  584. *
  585. * @return Handle that can be used to cancel the operation.
  586. */
  587. struct GNUNET_PSYCSTORE_OperationHandle *
  588. GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
  589. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  590. const char *name,
  591. GNUNET_PSYCSTORE_StateCallback state_cb,
  592. GNUNET_PSYCSTORE_ResultCallback result_cb,
  593. void *cls);
  594. /**
  595. * Retrieve all state variables for a channel with the given prefix.
  596. *
  597. * @param h
  598. * Handle for the PSYCstore.
  599. * @param channel_key
  600. * The channel we are interested in.
  601. * @param name_prefix
  602. * Prefix of state variable names to match.
  603. * @param state_cb
  604. * Callback to return matching state variables.
  605. * @param result_cb
  606. * Callback to call with the result of the operation.
  607. * @param cls
  608. * Closure for the callbacks.
  609. *
  610. * @return Handle that can be used to cancel the operation.
  611. */
  612. struct GNUNET_PSYCSTORE_OperationHandle *
  613. GNUNET_PSYCSTORE_state_get_prefix (struct GNUNET_PSYCSTORE_Handle *h,
  614. const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
  615. const char *name_prefix,
  616. GNUNET_PSYCSTORE_StateCallback state_cb,
  617. GNUNET_PSYCSTORE_ResultCallback result_cb,
  618. void *cls);
  619. /**
  620. * Cancel an operation.
  621. *
  622. * @param op Handle for the operation to cancel.
  623. */
  624. int
  625. GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op);
  626. #if 0 /* keep Emacsens' auto-indent happy */
  627. {
  628. #endif
  629. #ifdef __cplusplus
  630. }
  631. #endif
  632. /* ifndef GNUNET_PSYCSTORE_SERVICE_H */
  633. #endif
  634. /** @} */ /* end of group */