gnunet-service-fs_pe.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2011 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. * @file fs/gnunet-service-fs_pe.h
  18. * @brief API to manage query plan
  19. * @author Christian Grothoff
  20. */
  21. #ifndef GNUNET_SERVICE_FS_PE_H
  22. #define GNUNET_SERVICE_FS_PE_H
  23. #include "gnunet-service-fs.h"
  24. /**
  25. * Create a new query plan entry.
  26. *
  27. * @param cp peer with the entry
  28. * @param pr request with the entry
  29. */
  30. void
  31. GSF_plan_add_ (struct GSF_ConnectedPeer *cp,
  32. struct GSF_PendingRequest *pr);
  33. /**
  34. * Notify the plan about a peer being no longer available;
  35. * destroy all entries associated with this peer.
  36. *
  37. * @param cp connected peer
  38. */
  39. void
  40. GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp);
  41. /**
  42. * Notify the plan about a request being done;
  43. * destroy all entries associated with this request.
  44. *
  45. * @param pr request that is done
  46. */
  47. void
  48. GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr);
  49. /**
  50. * Get the last transmission attempt time for the request plan list
  51. * referenced by 'rpr_head', that was sent to 'sender'
  52. *
  53. * @param pr_head request plan reference list to check.
  54. * @param sender the peer that we've sent the request to.
  55. * @param result the timestamp to fill.
  56. * @return GNUNET_YES if 'result' was changed, GNUNET_NO otherwise.
  57. */
  58. int
  59. GSF_request_plan_reference_get_last_transmission_ (struct GSF_PendingRequestPlanBijection *pr_head,
  60. struct GSF_ConnectedPeer *sender,
  61. struct GNUNET_TIME_Absolute *result);
  62. /**
  63. * Initialize plan subsystem.
  64. */
  65. void
  66. GSF_plan_init (void);
  67. /**
  68. * Shutdown plan subsystem.
  69. */
  70. void
  71. GSF_plan_done (void);
  72. #endif
  73. /* end of gnunet-service-fs_pe.h */