gnunet-service-ats_performance.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 atsi performance data for the address
  41. * @param atsi_count number of performance records in @a atsi
  42. * @param bandwidth_out assigned outbound bandwidth
  43. * @param bandwidth_in assigned inbound bandwidth
  44. */
  45. void
  46. GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
  47. const char *plugin_name,
  48. const void *plugin_addr,
  49. size_t plugin_addr_len,
  50. int active,
  51. const struct GNUNET_ATS_Information *atsi,
  52. uint32_t atsi_count,
  53. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
  54. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
  55. /**
  56. * Register a new performance client.
  57. *
  58. * @param client handle of the new client
  59. * @param flag flag specifying the type of the client
  60. */
  61. void
  62. GAS_performance_add_client (struct GNUNET_SERVER_Client *client,
  63. enum StartFlag flag);
  64. /**
  65. * Initialize performance subsystem.
  66. *
  67. * @param server handle to our server
  68. * @param addresses the address handle to use
  69. */
  70. void
  71. GAS_performance_init (struct GNUNET_SERVER_Handle *server);
  72. /**
  73. * Shutdown performance subsystem.
  74. */
  75. void
  76. GAS_performance_done (void);
  77. #endif
  78. /* end of gnunet-service-ats_performance.h */