diff options
Diffstat (limited to 'src/include/gnunet_ats_service.h')
-rw-r--r-- | src/include/gnunet_ats_service.h | 105 |
1 files changed, 61 insertions, 44 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index 87bd4eba0..a6149ee5a 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -58,13 +58,21 @@ struct GNUNET_ATS_Handle; | |||
58 | * @param plugin_addr_len number of bytes in addr | 58 | * @param plugin_addr_len number of bytes in addr |
59 | * @param bandwidth assigned outbound bandwidth for the connection | 59 | * @param bandwidth assigned outbound bandwidth for the connection |
60 | */ | 60 | */ |
61 | typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification)(void *cls, | 61 | typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification) (void *cls, |
62 | const struct GNUNET_PeerIdentity *peer, | 62 | const struct |
63 | const char *plugin_name, | 63 | GNUNET_PeerIdentity |
64 | struct Session *session, | 64 | * peer, |
65 | const void *plugin_addr, | 65 | const char |
66 | size_t plugin_addr_len, | 66 | *plugin_name, |
67 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth); | 67 | struct Session * |
68 | session, | ||
69 | const void | ||
70 | *plugin_addr, | ||
71 | size_t | ||
72 | plugin_addr_len, | ||
73 | struct | ||
74 | GNUNET_BANDWIDTH_Value32NBO | ||
75 | bandwidth); | ||
68 | 76 | ||
69 | 77 | ||
70 | /** | 78 | /** |
@@ -75,10 +83,10 @@ typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification)(void *cls, | |||
75 | * @param alloc_cb_cls closure for 'alloc_cb' | 83 | * @param alloc_cb_cls closure for 'alloc_cb' |
76 | * @return ats context | 84 | * @return ats context |
77 | */ | 85 | */ |
78 | struct GNUNET_ATS_Handle * | 86 | struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct |
79 | GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 87 | GNUNET_CONFIGURATION_Handle *cfg, |
80 | GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb, | 88 | GNUNET_TRANSPORT_ATS_AllocationNotification |
81 | void *alloc_cb_cls); | 89 | alloc_cb, void *alloc_cb_cls); |
82 | 90 | ||
83 | 91 | ||
84 | /** | 92 | /** |
@@ -86,8 +94,7 @@ GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
86 | * | 94 | * |
87 | * @param atc handle | 95 | * @param atc handle |
88 | */ | 96 | */ |
89 | void | 97 | void GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); |
90 | GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); | ||
91 | 98 | ||
92 | 99 | ||
93 | /** | 100 | /** |
@@ -102,14 +109,20 @@ GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); | |||
102 | * @param ats performance data for the address (as far as known) | 109 | * @param ats performance data for the address (as far as known) |
103 | * @param ats_count number of performance records in 'ats' | 110 | * @param ats_count number of performance records in 'ats' |
104 | */ | 111 | */ |
105 | typedef void (*GNUNET_ATS_AddressSuggestionCallback)(void *cls, | 112 | typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, |
106 | const struct GNUNET_PeerIdentity *peer, | 113 | const struct |
107 | const char *plugin_name, | 114 | GNUNET_PeerIdentity * |
108 | const void *plugin_addr, | 115 | peer, |
109 | size_t plugin_addr_len, | 116 | const char *plugin_name, |
110 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth, | 117 | const void *plugin_addr, |
111 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 118 | size_t plugin_addr_len, |
112 | uint32_t ats_count); | 119 | struct |
120 | GNUNET_BANDWIDTH_Value32NBO | ||
121 | bandwidth, | ||
122 | const struct | ||
123 | GNUNET_TRANSPORT_ATS_Information | ||
124 | * ats, | ||
125 | uint32_t ats_count); | ||
113 | 126 | ||
114 | 127 | ||
115 | /** | 128 | /** |
@@ -127,11 +140,15 @@ struct GNUNET_ATS_SuggestionContext; | |||
127 | * @param cb function to call with the address | 140 | * @param cb function to call with the address |
128 | * @param cb_cls closure for cb | 141 | * @param cb_cls closure for cb |
129 | */ | 142 | */ |
130 | struct GNUNET_ATS_SuggestionContext * | 143 | struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct |
131 | GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc, | 144 | GNUNET_ATS_Handle |
132 | const struct GNUNET_PeerIdentity *peer, | 145 | *atc, |
133 | GNUNET_ATS_AddressSuggestionCallback cb, | 146 | const struct |
134 | void *cb_cls); | 147 | GNUNET_PeerIdentity |
148 | *peer, | ||
149 | GNUNET_ATS_AddressSuggestionCallback | ||
150 | cb, | ||
151 | void *cb_cls); | ||
135 | 152 | ||
136 | 153 | ||
137 | /** | 154 | /** |
@@ -159,13 +176,13 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); | |||
159 | */ | 176 | */ |
160 | void | 177 | void |
161 | GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | 178 | GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, |
162 | const struct GNUNET_PeerIdentity *peer, | 179 | const struct GNUNET_PeerIdentity *peer, |
163 | const char *plugin_name, | 180 | const char *plugin_name, |
164 | struct Session *session, | 181 | struct Session *session, |
165 | const void *plugin_addr, | 182 | const void *plugin_addr, |
166 | size_t plugin_addr_len, | 183 | size_t plugin_addr_len, |
167 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 184 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
168 | uint32_t ats_count); | 185 | uint32_t ats_count); |
169 | 186 | ||
170 | 187 | ||
171 | /** | 188 | /** |
@@ -178,7 +195,7 @@ GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | |||
178 | */ | 195 | */ |
179 | void | 196 | void |
180 | GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | 197 | GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, |
181 | const struct GNUNET_PeerIdentity *peer); | 198 | const struct GNUNET_PeerIdentity *peer); |
182 | 199 | ||
183 | 200 | ||
184 | /** | 201 | /** |
@@ -190,8 +207,8 @@ GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | |||
190 | */ | 207 | */ |
191 | void | 208 | void |
192 | GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | 209 | GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, |
193 | const struct GNUNET_PeerIdentity *peer, | 210 | const struct GNUNET_PeerIdentity *peer, |
194 | const struct Session *session); | 211 | const struct Session *session); |
195 | 212 | ||
196 | 213 | ||
197 | /** | 214 | /** |
@@ -214,14 +231,14 @@ GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | |||
214 | */ | 231 | */ |
215 | void | 232 | void |
216 | GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, | 233 | GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, |
217 | const struct GNUNET_PeerIdentity *peer, | 234 | const struct GNUNET_PeerIdentity *peer, |
218 | struct GNUNET_TIME_Absolute valid_until, | 235 | struct GNUNET_TIME_Absolute valid_until, |
219 | const char *plugin_name, | 236 | const char *plugin_name, |
220 | struct Session *session, | 237 | struct Session *session, |
221 | const void *plugin_addr, | 238 | const void *plugin_addr, |
222 | size_t plugin_addr_len, | 239 | size_t plugin_addr_len, |
223 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 240 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
224 | uint32_t ats_count); | 241 | uint32_t ats_count); |
225 | 242 | ||
226 | 243 | ||
227 | #endif | 244 | #endif |