gnunet-service-fs_pe.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. This file is part of GNUnet.
  3. (C) 2011 Christian Grothoff (and other contributing authors)
  4. GNUnet is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published
  6. by the Free Software Foundation; either version 3, or (at your
  7. 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. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNUnet; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17. /**
  18. * @file fs/gnunet-service-fs_pe.h
  19. * @brief API to manage query plan
  20. * @author Christian Grothoff
  21. */
  22. #ifndef GNUNET_SERVICE_FS_PE_H
  23. #define GNUNET_SERVICE_FS_PE_H
  24. #include "gnunet-service-fs.h"
  25. /**
  26. * Create a new query plan entry.
  27. *
  28. * @param cp peer with the entry
  29. * @param pr request with the entry
  30. */
  31. void
  32. GSF_plan_add_ (struct GSF_ConnectedPeer *cp, 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 */