2
0

gnunet-service-fs_lc.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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_lc.h
  19. * @brief API to handle 'local clients'
  20. * @author Christian Grothoff
  21. */
  22. #ifndef GNUNET_SERVICE_FS_LC_H
  23. #define GNUNET_SERVICE_FS_LC_H
  24. #include "gnunet-service-fs.h"
  25. /**
  26. * Look up a local client record or create one if it
  27. * doesn't exist yet.
  28. *
  29. * @param client handle of the client
  30. * @return handle to local client entry
  31. */
  32. struct GSF_LocalClient *
  33. GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client);
  34. /**
  35. * Handle START_SEARCH-message (search request from local client).
  36. * Only responsible for creating the request entry itself and setting
  37. * up reply callback and cancellation on client disconnect. Does NOT
  38. * execute the actual request strategy (planning).
  39. *
  40. * @param client identification of the client
  41. * @param message the actual message
  42. * @param prptr where to store the pending request handle for the request
  43. * @return GNUNET_YES to start local processing,
  44. * GNUNET_NO to not (yet) start local processing,
  45. * GNUNET_SYSERR on error
  46. */
  47. int
  48. GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
  49. const struct GNUNET_MessageHeader
  50. *message,
  51. struct GSF_PendingRequest **prptr);
  52. /**
  53. * Transmit a message to the given local client as soon as possible.
  54. * If the client disconnects before transmission, the message is
  55. * simply discarded.
  56. *
  57. * @param lc recipient
  58. * @param msg message to transmit to client
  59. */
  60. void
  61. GSF_local_client_transmit_ (struct GSF_LocalClient *lc,
  62. const struct GNUNET_MessageHeader *msg);
  63. /**
  64. * A client disconnected from us. Tear down the local client record.
  65. *
  66. * @param cls unused
  67. * @param client handle of the client
  68. */
  69. void
  70. GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client);
  71. #endif
  72. /* end of gnunet-service-fs_lc.h */