gnunet_transport_manipulation_service.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2009-2014, 2016 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. * @author Christian Grothoff
  18. *
  19. * @file
  20. * Low-level P2P IO
  21. *
  22. * @defgroup transport Transport service
  23. * Low-level P2P IO
  24. *
  25. * @see [Documentation](https://gnunet.org/transport-service)
  26. *
  27. * @{
  28. */
  29. #ifndef GNUNET_TRANSPORT_MANIPULATION_SERVICE_H
  30. #define GNUNET_TRANSPORT_MANIPULATION_SERVICE_H
  31. #ifdef __cplusplus
  32. extern "C"
  33. {
  34. #if 0 /* keep Emacsens' auto-indent happy */
  35. }
  36. #endif
  37. #endif
  38. #include "gnunet_util_lib.h"
  39. #include "gnunet_ats_service.h"
  40. /**
  41. * Version number of the transport API.
  42. */
  43. #define GNUNET_TRANSPORT_MANIPULATION_VERSION 0x00000003
  44. /**
  45. * Handle for transport manipulation.
  46. */
  47. struct GNUNET_TRANSPORT_ManipulationHandle;
  48. /**
  49. * Connect to the transport service. Note that the connection may
  50. * complete (or fail) asynchronously.
  51. *
  52. * @param cfg configuration to use
  53. * @return NULL on error
  54. */
  55. struct GNUNET_TRANSPORT_ManipulationHandle *
  56. GNUNET_TRANSPORT_manipulation_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
  57. /**
  58. * Disconnect from the transport service.
  59. *
  60. * @param handle handle returned from connect
  61. */
  62. void
  63. GNUNET_TRANSPORT_manipulation_disconnect (struct GNUNET_TRANSPORT_ManipulationHandle *handle);
  64. /**
  65. * Set transport metrics for a peer and a direction
  66. *
  67. * @param handle transport handle
  68. * @param peer the peer to set the metric for
  69. * @param prop the performance metrics to set
  70. * @param delay_in inbound delay to introduce
  71. * @param delay_out outbound delay to introduce
  72. *
  73. * Note: Delay restrictions in receiving direction will be enforced
  74. * with one message delay.
  75. */
  76. void
  77. GNUNET_TRANSPORT_manipulation_set (struct GNUNET_TRANSPORT_ManipulationHandle *handle,
  78. const struct GNUNET_PeerIdentity *peer,
  79. const struct GNUNET_ATS_Properties *prop,
  80. struct GNUNET_TIME_Relative delay_in,
  81. struct GNUNET_TIME_Relative delay_out);
  82. #if 0 /* keep Emacsens' auto-indent happy */
  83. {
  84. #endif
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. /* ifndef GNUNET_TRANSPORT_MANIPULATION_SERVICE_H */
  89. #endif
  90. /** @} */ /* end of group */
  91. /* end of gnunet_transport_manipulation_service.h */