gnunet_dv_service.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. This file is part of GNUnet
  3. (C) 2009 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 include/gnunet_dv_service.h
  19. * @brief API to deal with dv service
  20. *
  21. * @author Christian Grothoff
  22. * @author Nathan Evans
  23. */
  24. #ifndef GNUNET_DV_SERVICE_H
  25. #define GNUNET_DV_SERVICE_H
  26. #ifdef __cplusplus
  27. extern "C"
  28. {
  29. #if 0 /* keep Emacsens' auto-indent happy */
  30. }
  31. #endif
  32. #endif
  33. #include "gnunet_common.h"
  34. #include "gnunet_configuration_lib.h"
  35. #include "gnunet_scheduler_lib.h"
  36. #include "gnunet_transport_plugin.h"
  37. /**
  38. * Version of the dv API.
  39. */
  40. #define GNUNET_DV_VERSION 0x00000000
  41. /**
  42. * Opaque handle for the dv service.
  43. */
  44. struct GNUNET_DV_Handle;
  45. /**
  46. * Send a message from the plugin to the DV service indicating that
  47. * a message should be sent via DV to some peer.
  48. *
  49. * @param dv_handle the handle to the DV api
  50. * @param target the final target of the message
  51. * @param msgbuf the msg(s) to send
  52. * @param msgbuf_size the size of msgbuf
  53. * @param priority priority to pass on to core when sending the message
  54. * @param timeout how long can this message be delayed (pass through to core)
  55. * @param addr the address of this peer (internally known to DV)
  56. * @param addrlen the length of the peer address
  57. * @param cont continuation to call once the message has been sent (or failed)
  58. * @param cont_cls closure for continuation
  59. *
  60. */
  61. int
  62. GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle,
  63. const struct GNUNET_PeerIdentity *target, const char *msgbuf,
  64. size_t msgbuf_size, unsigned int priority,
  65. struct GNUNET_TIME_Relative timeout, const void *addr,
  66. size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont,
  67. void *cont_cls);
  68. #if 0 /* keep Emacsens' auto-indent happy */
  69. {
  70. #endif
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif