glitch in the license text detected by hyazinthe, thank you!
[oweals/gnunet.git] / src / include / gnunet_transport_manipulation_service.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2009-2014, 2016 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU Affero General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      Affero General Public License for more details.
14 */
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
30 #ifndef GNUNET_TRANSPORT_MANIPULATION_SERVICE_H
31 #define GNUNET_TRANSPORT_MANIPULATION_SERVICE_H
32
33
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #if 0                           /* keep Emacsens' auto-indent happy */
38 }
39 #endif
40 #endif
41
42 #include "gnunet_util_lib.h"
43 #include "gnunet_ats_service.h"
44
45 /**
46  * Version number of the transport API.
47  */
48 #define GNUNET_TRANSPORT_MANIPULATION_VERSION 0x00000003
49
50 /**
51  * Handle for transport manipulation.
52  */
53 struct GNUNET_TRANSPORT_ManipulationHandle;
54
55
56 /**
57  * Connect to the transport service.  Note that the connection may
58  * complete (or fail) asynchronously.
59  *
60  * @param cfg configuration to use
61  * @return NULL on error
62  */
63 struct GNUNET_TRANSPORT_ManipulationHandle *
64 GNUNET_TRANSPORT_manipulation_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
65
66
67 /**
68  * Disconnect from the transport service.
69  *
70  * @param handle handle returned from connect
71  */
72 void
73 GNUNET_TRANSPORT_manipulation_disconnect (struct GNUNET_TRANSPORT_ManipulationHandle *handle);
74
75
76 /**
77  * Set transport metrics for a peer and a direction
78  *
79  * @param handle transport handle
80  * @param peer the peer to set the metric for
81  * @param prop the performance metrics to set
82  * @param delay_in inbound delay to introduce
83  * @param delay_out outbound delay to introduce
84  *
85  * Note: Delay restrictions in receiving direction will be enforced
86  * with one message delay.
87  */
88 void
89 GNUNET_TRANSPORT_manipulation_set (struct GNUNET_TRANSPORT_ManipulationHandle *handle,
90                                    const struct GNUNET_PeerIdentity *peer,
91                                    const struct GNUNET_ATS_Properties *prop,
92                                    struct GNUNET_TIME_Relative delay_in,
93                                    struct GNUNET_TIME_Relative delay_out);
94
95
96 #if 0                           /* keep Emacsens' auto-indent happy */
97 {
98 #endif
99 #ifdef __cplusplus
100 }
101 #endif
102
103 /* ifndef GNUNET_TRANSPORT_MANIPULATION_SERVICE_H */
104 #endif
105
106 /** @} */  /* end of group */
107
108 /* end of gnunet_transport_manipulation_service.h */