gnunet-service-ats_scheduling.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2011 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_scheduling.h
  19. * @brief ats service, interaction with 'scheduling' API
  20. * @author Matthias Wachs
  21. * @author Christian Grothoff
  22. */
  23. #ifndef GNUNET_SERVICE_ATS_SCHEDULING_H
  24. #define GNUNET_SERVICE_ATS_SCHEDULING_H
  25. #include "gnunet_util_lib.h"
  26. /**
  27. * Register a new scheduling client.
  28. *
  29. * @param client handle of the new client
  30. * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  31. */
  32. int
  33. GAS_scheduling_add_client (struct GNUNET_SERVER_Client *client);
  34. /**
  35. * Unregister a client (which may have been a scheduling client,
  36. * but this is not assured).
  37. *
  38. * @param client handle of the (now dead) client
  39. */
  40. void
  41. GAS_scheduling_remove_client (struct GNUNET_SERVER_Client *client);
  42. /**
  43. * Transmit the given address suggestion and bandwidth update to all scheduling
  44. * clients.
  45. *
  46. * @param peer peer for which this is an address suggestion
  47. * @param session_id session ID to use
  48. * @param bandwidth_out assigned outbound bandwidth
  49. * @param bandwidth_in assigned inbound bandwidth
  50. */
  51. void
  52. GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *peer,
  53. uint32_t session_id,
  54. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
  55. struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
  56. /**
  57. * Handle 'address add' messages from clients.
  58. *
  59. * @param cls unused, NULL
  60. * @param client client that sent the request
  61. * @param message the request message
  62. */
  63. void
  64. GAS_handle_address_add (void *cls,
  65. struct GNUNET_SERVER_Client *client,
  66. const struct GNUNET_MessageHeader *message);
  67. /**
  68. * Handle 'address update' messages from clients.
  69. *
  70. * @param cls unused, NULL
  71. * @param client client that sent the request
  72. * @param message the request message
  73. */
  74. void
  75. GAS_handle_address_update (void *cls,
  76. struct GNUNET_SERVER_Client *client,
  77. const struct GNUNET_MessageHeader *message);
  78. /**
  79. * Handle 'address destroyed' messages from clients.
  80. *
  81. * @param cls unused, NULL
  82. * @param client client that sent the request
  83. * @param message the request message
  84. */
  85. void
  86. GAS_handle_address_destroyed (void *cls,
  87. struct GNUNET_SERVER_Client *client,
  88. const struct GNUNET_MessageHeader *message);
  89. /**
  90. * Initialize scheduling subsystem.
  91. *
  92. * @param server handle to our server
  93. * @param ah the address handle to use
  94. */
  95. void
  96. GAS_scheduling_init (struct GNUNET_SERVER_Handle *server);
  97. /**
  98. * Shutdown scheduling subsystem.
  99. */
  100. void
  101. GAS_scheduling_done (void);
  102. #endif
  103. /* end of gnunet-service-ats_scheduling.h */