gnunet-service-fs_pe.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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
  60. GSF_PendingRequestPlanBijection
  61. *pr_head,
  62. struct GSF_ConnectedPeer *
  63. sender,
  64. struct GNUNET_TIME_Absolute *
  65. result);
  66. /**
  67. * Initialize plan subsystem.
  68. */
  69. void
  70. GSF_plan_init (void);
  71. /**
  72. * Shutdown plan subsystem.
  73. */
  74. void
  75. GSF_plan_done (void);
  76. #endif
  77. /* end of gnunet-service-fs_pe.h */