gnunet-service-ats_performance.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2011-2015 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 ats/gnunet-service-ats_performance.h
  19. * @brief ats service, interaction with 'performance' API
  20. * @author Matthias Wachs
  21. * @author Christian Grothoff
  22. */
  23. #ifndef GNUNET_SERVICE_ATS_PERFORMANCE_H
  24. #define GNUNET_SERVICE_ATS_PERFORMANCE_H
  25. #include "gnunet_util_lib.h"
  26. #include "gnunet_ats_service.h"
  27. #include "ats.h"
  28. /**
  29. * Transmit the given performance information to all performance
  30. * clients.
  31. *
  32. * @param peer peer for which this is an address suggestion
  33. * @param plugin_name 0-termintated string specifying the transport plugin
  34. * @param plugin_addr binary address for the plugin to use
  35. * @param plugin_addr_len number of bytes in @a plugin_addr
  36. * @param active #GNUNET_YES if this address is actively used
  37. * to maintain a connection to a peer;
  38. * #GNUNET_NO if the address is not actively used;
  39. * #GNUNET_SYSERR if this address is no longer available for ATS
  40. * @param prop performance data for the address
  41. * @param bandwidth_out assigned outbound bandwidth
  42. * @param bandwidth_in assigned inbound bandwidth
  43. */
  44. void
  45. GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
  46. const char *plugin_name,
  47. const void *plugin_addr,
  48. size_t plugin_addr_len,
  49. int active,
  50. const struct GNUNET_ATS_Properties *prop,
  51. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
  52. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
  53. /**
  54. * Register a new performance client.
  55. *
  56. * @param client handle of the new client
  57. * @param flag flag specifying the type of the client
  58. */
  59. void
  60. GAS_performance_add_client (struct GNUNET_SERVER_Client *client,
  61. enum StartFlag flag);
  62. /**
  63. * Initialize performance subsystem.
  64. *
  65. * @param server handle to our server
  66. * @param addresses the address handle to use
  67. */
  68. void
  69. GAS_performance_init (struct GNUNET_SERVER_Handle *server);
  70. /**
  71. * Shutdown performance subsystem.
  72. */
  73. void
  74. GAS_performance_done (void);
  75. #endif
  76. /* end of gnunet-service-ats_performance.h */