gnunet-service-ats_performance.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2011-2015 GNUnet e.V.
  4. GNUnet is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License,
  7. or (at your 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. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. SPDX-License-Identifier: AGPL3.0-or-later
  15. */
  16. /**
  17. * @file ats/gnunet-service-ats_performance.h
  18. * @brief ats service, interaction with 'performance' API
  19. * @author Matthias Wachs
  20. * @author Christian Grothoff
  21. */
  22. #ifndef GNUNET_SERVICE_ATS_PERFORMANCE_H
  23. #define GNUNET_SERVICE_ATS_PERFORMANCE_H
  24. #include "gnunet_util_lib.h"
  25. #include "gnunet_ats_service.h"
  26. #include "ats.h"
  27. /**
  28. * Transmit the given performance information to all performance
  29. * clients.
  30. *
  31. * @param peer peer for which this is an address suggestion
  32. * @param plugin_name 0-termintated string specifying the transport plugin
  33. * @param plugin_addr binary address for the plugin to use
  34. * @param plugin_addr_len number of bytes in @a plugin_addr
  35. * @param active #GNUNET_YES if this address is actively used
  36. * to maintain a connection to a peer;
  37. * #GNUNET_NO if the address is not actively used;
  38. * #GNUNET_SYSERR if this address is no longer available for ATS
  39. * @param prop performance data for the address
  40. * @param local_address_info information about the local flags 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. enum GNUNET_HELLO_AddressInfo
  52. local_address_info,
  53. struct GNUNET_BANDWIDTH_Value32NBO
  54. bandwidth_out,
  55. struct GNUNET_BANDWIDTH_Value32NBO
  56. bandwidth_in);
  57. /**
  58. * Register a new performance client.
  59. *
  60. * @param client handle of the new client
  61. * @param flag flag specifying the type of the client
  62. */
  63. void
  64. GAS_performance_add_client (struct GNUNET_SERVICE_Client *client,
  65. enum StartFlag flag);
  66. /**
  67. * Initialize performance subsystem.
  68. *
  69. * @param server handle to our server
  70. * @param addresses the address handle to use
  71. */
  72. void
  73. GAS_performance_init (void);
  74. /**
  75. * Shutdown performance subsystem.
  76. */
  77. void
  78. GAS_performance_done (void);
  79. #endif
  80. /* end of gnunet-service-ats_performance.h */