gnunet-service-fs_lc.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. * @return pending request handle for the request, NULL on error
  43. */
  44. struct GSF_PendingRequest *
  45. GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
  46. const struct GNUNET_MessageHeader
  47. *message);
  48. /**
  49. * Transmit a message to the given local client as soon as possible.
  50. * If the client disconnects before transmission, the message is
  51. * simply discarded.
  52. *
  53. * @param lc recipient
  54. * @param msg message to transmit to client
  55. */
  56. void
  57. GSF_local_client_transmit_ (struct GSF_LocalClient *lc,
  58. const struct GNUNET_MessageHeader *msg);
  59. /**
  60. * A client disconnected from us. Tear down the local client record.
  61. *
  62. * @param cls unused
  63. * @param client handle of the client
  64. */
  65. void
  66. GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client);
  67. #endif
  68. /* end of gnunet-service-fs_lc.h */