gnunet-service-ats_scheduling.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2011 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_scheduling.h
  18. * @brief ats service, interaction with 'scheduling' API
  19. * @author Matthias Wachs
  20. * @author Christian Grothoff
  21. */
  22. #ifndef GNUNET_SERVICE_ATS_SCHEDULING_H
  23. #define GNUNET_SERVICE_ATS_SCHEDULING_H
  24. #include "gnunet_util_lib.h"
  25. /**
  26. * Register a new scheduling client.
  27. *
  28. * @param client handle of the new client
  29. * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  30. */
  31. int
  32. GAS_scheduling_add_client(struct GNUNET_SERVICE_Client *client);
  33. /**
  34. * Unregister a client (which may have been a scheduling client,
  35. * but this is not assured).
  36. *
  37. * @param client handle of the (now dead) client
  38. */
  39. void
  40. GAS_scheduling_remove_client(struct GNUNET_SERVICE_Client *client);
  41. /**
  42. * Transmit the given address suggestion and bandwidth update to all scheduling
  43. * clients.
  44. *
  45. * @param peer peer for which this is an address suggestion
  46. * @param session_id session ID to use
  47. * @param bandwidth_out assigned outbound bandwidth
  48. * @param bandwidth_in assigned inbound bandwidth
  49. */
  50. void
  51. GAS_scheduling_transmit_address_suggestion(const struct GNUNET_PeerIdentity *peer,
  52. uint32_t session_id,
  53. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
  54. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
  55. /**
  56. * Handle 'address add' messages from clients.
  57. *
  58. * @param client client that sent the request
  59. * @param m the request message
  60. */
  61. void
  62. GAS_handle_address_add(const struct AddressAddMessage *m);
  63. /**
  64. * Handle 'address update' messages from clients.
  65. *
  66. * @param m the request message
  67. */
  68. void
  69. GAS_handle_address_update(const struct AddressUpdateMessage *m);
  70. /**
  71. * Handle 'address destroyed' messages from clients.
  72. *
  73. * @param m the request message
  74. */
  75. void
  76. GAS_handle_address_destroyed(const struct AddressDestroyedMessage *m);
  77. #endif
  78. /* end of gnunet-service-ats_scheduling.h */