You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.7 KiB

  1. diff --git a/src/include/Makefile.am b/src/include/Makefile.am
  2. index ca0f6050d..bd8eca256 100644
  3. --- a/src/include/Makefile.am
  4. +++ b/src/include/Makefile.am
  5. @@ -127,6 +127,7 @@ gnunetinclude_HEADERS = \
  6. gnunet_time_lib.h \
  7. gnunet_transport_service.h \
  8. gnunet_transport_address_service.h \
  9. + gnunet_transport_application_service.h \
  10. gnunet_transport_communication_service.h \
  11. gnunet_transport_core_service.h \
  12. gnunet_transport_hello_service.h \
  13. --- /dev/null 2019-04-03 22:31:17.799489053 +0200
  14. +++ b/src/include/gnunet_transport_application_service.h 2019-04-05 14:30:10.326602964 +0200
  15. @@ -0,0 +1,100 @@
  16. +/*
  17. + This file is part of GNUnet.
  18. + Copyright (C) 2010-2015, 2018, 2019 GNUnet e.V.
  19. +
  20. + GNUnet is free software: you can redistribute it and/or modify it
  21. + under the terms of the GNU Affero General Public License as published
  22. + by the Free Software Foundation, either version 3 of the License,
  23. + or (at your option) any later version.
  24. +
  25. + GNUnet is distributed in the hope that it will be useful, but
  26. + WITHOUT ANY WARRANTY; without even the implied warranty of
  27. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  28. + Affero General Public License for more details.
  29. +
  30. + You should have received a copy of the GNU Affero General Public License
  31. + along with this program. If not, see <http://www.gnu.org/licenses/>.
  32. +
  33. + SPDX-License-Identifier: AGPL3.0-or-later
  34. + */
  35. +/**
  36. + * @file
  37. + * Bandwidth allocation API for applications to interact with
  38. + *
  39. + * @author Christian Grothoff
  40. + * @author Matthias Wachs
  41. + *
  42. + * @defgroup TRANSPORT service
  43. + * Bandwidth allocation
  44. + *
  45. + * @{
  46. + */
  47. +#ifndef GNUNET_TRANSPORT_APPLICATION_SERVICE_H
  48. +#define GNUNET_TRANSPORT_APPLICATION_SERVICE_H
  49. +
  50. +#include "gnunet_constants.h"
  51. +#include "gnunet_util_lib.h"
  52. +
  53. +/**
  54. + * Handle to the TRANSPORT subsystem for making suggestions about
  55. + * connections the peer would like to have.
  56. + */
  57. +struct GNUNET_TRANSPORT_ApplicationHandle;
  58. +
  59. +
  60. +/**
  61. + * Initialize the TRANSPORT application client handle.
  62. + *
  63. + * @param cfg configuration to use
  64. + * @return ats application handle, NULL on error
  65. + */
  66. +struct GNUNET_TRANSPORT_ApplicationHandle *
  67. +GNUNET_TRANSPORT_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
  68. +
  69. +
  70. +/**
  71. + * Shutdown TRANSPORT application client.
  72. + *
  73. + * @param ch handle to destroy
  74. + */
  75. +void
  76. +GNUNET_TRANSPORT_application_done (struct GNUNET_TRANSPORT_ApplicationHandle *ch);
  77. +
  78. +
  79. +/**
  80. + * Handle for suggestion requests.
  81. + */
  82. +struct GNUNET_TRANSPORT_ApplicationSuggestHandle;
  83. +
  84. +
  85. +/**
  86. + * An application would like to communicate with a peer. TRANSPORT should
  87. + * allocate bandwith using a suitable address for requiremetns @a pk
  88. + * to transport.
  89. + *
  90. + * @param ch handle
  91. + * @param peer identity of the peer we need an address for
  92. + * @param pk what kind of application will the application require (can be
  93. + * #GNUNET_MQ_PREFERENCE_NONE, we will still try to connect)
  94. + * @param bw desired bandwith, can be zero (we will still try to connect)
  95. + * @return suggestion handle, NULL if request is already pending
  96. + */
  97. +struct GNUNET_TRANSPORT_ApplicationSuggestHandle *
  98. +GNUNET_TRANSPORT_application_suggest (struct GNUNET_TRANSPORT_ApplicationHandle *ch,
  99. + const struct GNUNET_PeerIdentity *peer,
  100. + enum GNUNET_MQ_PreferenceKind pk,
  101. + struct GNUNET_BANDWIDTH_Value32NBO bw);
  102. +
  103. +
  104. +/**
  105. + * We no longer care about communicating with a peer.
  106. + *
  107. + * @param sh handle
  108. + */
  109. +void
  110. +GNUNET_TRANSPORT_application_suggest_cancel (struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh);
  111. +
  112. +/** @} */ /* end of group */
  113. +
  114. +#endif
  115. +/* end of file gnunet_ats_application_service.h */