diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.h | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h index d3de3347c..47b654cbb 100644 --- a/src/cadet/gnunet-service-cadet_connection.h +++ b/src/cadet/gnunet-service-cadet_connection.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file cadet/gnunet-service-cadet_connection.h | 22 | * @file cadet/gnunet-service-cadet_connection.h |
@@ -57,7 +57,7 @@ typedef void | |||
57 | * @param cc connection to destroy | 57 | * @param cc connection to destroy |
58 | */ | 58 | */ |
59 | void | 59 | void |
60 | GCC_destroy_without_core (struct CadetConnection *cc); | 60 | GCC_destroy_without_core(struct CadetConnection *cc); |
61 | 61 | ||
62 | 62 | ||
63 | /** | 63 | /** |
@@ -68,7 +68,7 @@ GCC_destroy_without_core (struct CadetConnection *cc); | |||
68 | * @param cc connection to destroy | 68 | * @param cc connection to destroy |
69 | */ | 69 | */ |
70 | void | 70 | void |
71 | GCC_destroy_without_tunnel (struct CadetConnection *cc); | 71 | GCC_destroy_without_tunnel(struct CadetConnection *cc); |
72 | 72 | ||
73 | 73 | ||
74 | /** | 74 | /** |
@@ -78,7 +78,7 @@ GCC_destroy_without_tunnel (struct CadetConnection *cc); | |||
78 | * @return NULL if connection was not found | 78 | * @return NULL if connection was not found |
79 | */ | 79 | */ |
80 | struct CadetConnection * | 80 | struct CadetConnection * |
81 | GCC_lookup (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | 81 | GCC_lookup(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); |
82 | 82 | ||
83 | 83 | ||
84 | /** | 84 | /** |
@@ -94,12 +94,12 @@ GCC_lookup (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | |||
94 | * @return handle to the connection | 94 | * @return handle to the connection |
95 | */ | 95 | */ |
96 | struct CadetConnection * | 96 | struct CadetConnection * |
97 | GCC_create (struct CadetPeer *destination, | 97 | GCC_create(struct CadetPeer *destination, |
98 | struct CadetPeerPath *path, | 98 | struct CadetPeerPath *path, |
99 | unsigned int off, | 99 | unsigned int off, |
100 | struct CadetTConnection *ct, | 100 | struct CadetTConnection *ct, |
101 | GCC_ReadyCallback ready_cb, | 101 | GCC_ReadyCallback ready_cb, |
102 | void *ready_cb_cls); | 102 | void *ready_cb_cls); |
103 | 103 | ||
104 | 104 | ||
105 | /** | 105 | /** |
@@ -116,12 +116,12 @@ GCC_create (struct CadetPeer *destination, | |||
116 | * a connection that takes precedence on @a path | 116 | * a connection that takes precedence on @a path |
117 | */ | 117 | */ |
118 | struct CadetConnection * | 118 | struct CadetConnection * |
119 | GCC_create_inbound (struct CadetPeer *destination, | 119 | GCC_create_inbound(struct CadetPeer *destination, |
120 | struct CadetPeerPath *path, | 120 | struct CadetPeerPath *path, |
121 | struct CadetTConnection *ct, | 121 | struct CadetTConnection *ct, |
122 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, | 122 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, |
123 | GCC_ReadyCallback ready_cb, | 123 | GCC_ReadyCallback ready_cb, |
124 | void *ready_cb_cls); | 124 | void *ready_cb_cls); |
125 | 125 | ||
126 | 126 | ||
127 | /** | 127 | /** |
@@ -137,8 +137,8 @@ GCC_create_inbound (struct CadetPeer *destination, | |||
137 | * connection identifier of this connection... | 137 | * connection identifier of this connection... |
138 | */ | 138 | */ |
139 | void | 139 | void |
140 | GCC_transmit (struct CadetConnection *cc, | 140 | GCC_transmit(struct CadetConnection *cc, |
141 | struct GNUNET_MQ_Envelope *env); | 141 | struct GNUNET_MQ_Envelope *env); |
142 | 142 | ||
143 | 143 | ||
144 | /** | 144 | /** |
@@ -147,7 +147,7 @@ GCC_transmit (struct CadetConnection *cc, | |||
147 | * @param cc the connection that got the ACK. | 147 | * @param cc the connection that got the ACK. |
148 | */ | 148 | */ |
149 | void | 149 | void |
150 | GCC_handle_connection_create_ack (struct CadetConnection *cc); | 150 | GCC_handle_connection_create_ack(struct CadetConnection *cc); |
151 | 151 | ||
152 | 152 | ||
153 | /** | 153 | /** |
@@ -158,7 +158,7 @@ GCC_handle_connection_create_ack (struct CadetConnection *cc); | |||
158 | * @param cc connection that got the duplicate CREATE | 158 | * @param cc connection that got the duplicate CREATE |
159 | */ | 159 | */ |
160 | void | 160 | void |
161 | GCC_handle_duplicate_create (struct CadetConnection *cc); | 161 | GCC_handle_duplicate_create(struct CadetConnection *cc); |
162 | 162 | ||
163 | 163 | ||
164 | /** | 164 | /** |
@@ -168,8 +168,8 @@ GCC_handle_duplicate_create (struct CadetConnection *cc); | |||
168 | * @param msg the key exchange message | 168 | * @param msg the key exchange message |
169 | */ | 169 | */ |
170 | void | 170 | void |
171 | GCC_handle_kx (struct CadetConnection *cc, | 171 | GCC_handle_kx(struct CadetConnection *cc, |
172 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); | 172 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); |
173 | 173 | ||
174 | 174 | ||
175 | /** | 175 | /** |
@@ -179,16 +179,14 @@ GCC_handle_kx (struct CadetConnection *cc, | |||
179 | * @param msg the key exchange message | 179 | * @param msg the key exchange message |
180 | */ | 180 | */ |
181 | void | 181 | void |
182 | GCC_handle_kx_auth (struct CadetConnection *cc, | 182 | GCC_handle_kx_auth(struct CadetConnection *cc, |
183 | const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg); | 183 | const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg); |
184 | 184 | ||
185 | 185 | ||
186 | /** | 186 | /** |
187 | * Performance metrics for a connection. | 187 | * Performance metrics for a connection. |
188 | */ | 188 | */ |
189 | struct CadetConnectionMetrics | 189 | struct CadetConnectionMetrics { |
190 | { | ||
191 | |||
192 | /** | 190 | /** |
193 | * Our current best estimate of the latency, based on a weighted | 191 | * Our current best estimate of the latency, based on a weighted |
194 | * average of at least @a latency_datapoints values. | 192 | * average of at least @a latency_datapoints values. |
@@ -221,7 +219,6 @@ struct CadetConnectionMetrics | |||
221 | * connections.) | 219 | * connections.) |
222 | */ | 220 | */ |
223 | unsigned long long num_successes; | 221 | unsigned long long num_successes; |
224 | |||
225 | }; | 222 | }; |
226 | 223 | ||
227 | 224 | ||
@@ -232,7 +229,7 @@ struct CadetConnectionMetrics | |||
232 | * @return the metrics | 229 | * @return the metrics |
233 | */ | 230 | */ |
234 | const struct CadetConnectionMetrics * | 231 | const struct CadetConnectionMetrics * |
235 | GCC_get_metrics (struct CadetConnection *cc); | 232 | GCC_get_metrics(struct CadetConnection *cc); |
236 | 233 | ||
237 | 234 | ||
238 | /** | 235 | /** |
@@ -242,8 +239,8 @@ GCC_get_metrics (struct CadetConnection *cc); | |||
242 | * @param msg the encrypted message to decrypt | 239 | * @param msg the encrypted message to decrypt |
243 | */ | 240 | */ |
244 | void | 241 | void |
245 | GCC_handle_encrypted (struct CadetConnection *cc, | 242 | GCC_handle_encrypted(struct CadetConnection *cc, |
246 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg); | 243 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg); |
247 | 244 | ||
248 | 245 | ||
249 | /** | 246 | /** |
@@ -253,7 +250,7 @@ GCC_handle_encrypted (struct CadetConnection *cc, | |||
253 | * @param cid connection identifier where we expect an ACK | 250 | * @param cid connection identifier where we expect an ACK |
254 | */ | 251 | */ |
255 | void | 252 | void |
256 | GCC_ack_expected (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | 253 | GCC_ack_expected(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); |
257 | 254 | ||
258 | 255 | ||
259 | /** | 256 | /** |
@@ -265,7 +262,7 @@ GCC_ack_expected (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | |||
265 | * may have gotten back to us via a different connection). | 262 | * may have gotten back to us via a different connection). |
266 | */ | 263 | */ |
267 | void | 264 | void |
268 | GCC_ack_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | 265 | GCC_ack_observed(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); |
269 | 266 | ||
270 | 267 | ||
271 | /** | 268 | /** |
@@ -277,8 +274,8 @@ GCC_ack_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); | |||
277 | * @param latency the observed latency | 274 | * @param latency the observed latency |
278 | */ | 275 | */ |
279 | void | 276 | void |
280 | GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, | 277 | GCC_latency_observed(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, |
281 | struct GNUNET_TIME_Relative latency); | 278 | struct GNUNET_TIME_Relative latency); |
282 | 279 | ||
283 | 280 | ||
284 | /** | 281 | /** |
@@ -288,7 +285,7 @@ GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, | |||
288 | * @return corresponding entry in the tunnel's connection list | 285 | * @return corresponding entry in the tunnel's connection list |
289 | */ | 286 | */ |
290 | struct CadetTConnection * | 287 | struct CadetTConnection * |
291 | GCC_get_ct (struct CadetConnection *cc); | 288 | GCC_get_ct(struct CadetConnection *cc); |
292 | 289 | ||
293 | 290 | ||
294 | /** | 291 | /** |
@@ -299,8 +296,8 @@ GCC_get_ct (struct CadetConnection *cc); | |||
299 | * @return path to @a cc | 296 | * @return path to @a cc |
300 | */ | 297 | */ |
301 | struct CadetPeerPath * | 298 | struct CadetPeerPath * |
302 | GCC_get_path (struct CadetConnection *cc, | 299 | GCC_get_path(struct CadetConnection *cc, |
303 | unsigned int *off); | 300 | unsigned int *off); |
304 | 301 | ||
305 | 302 | ||
306 | /** | 303 | /** |
@@ -310,7 +307,7 @@ GCC_get_path (struct CadetConnection *cc, | |||
310 | * @return unique number of the connection | 307 | * @return unique number of the connection |
311 | */ | 308 | */ |
312 | const struct GNUNET_CADET_ConnectionTunnelIdentifier * | 309 | const struct GNUNET_CADET_ConnectionTunnelIdentifier * |
313 | GCC_get_id (struct CadetConnection *cc); | 310 | GCC_get_id(struct CadetConnection *cc); |
314 | 311 | ||
315 | 312 | ||
316 | /** | 313 | /** |
@@ -319,7 +316,7 @@ GCC_get_id (struct CadetConnection *cc); | |||
319 | * @param cc Connection. | 316 | * @param cc Connection. |
320 | */ | 317 | */ |
321 | const char * | 318 | const char * |
322 | GCC_2s (const struct CadetConnection *cc); | 319 | GCC_2s(const struct CadetConnection *cc); |
323 | 320 | ||
324 | 321 | ||
325 | /** | 322 | /** |
@@ -329,8 +326,8 @@ GCC_2s (const struct CadetConnection *cc); | |||
329 | * @param level Debug level to use. | 326 | * @param level Debug level to use. |
330 | */ | 327 | */ |
331 | void | 328 | void |
332 | GCC_debug (struct CadetConnection *cc, | 329 | GCC_debug(struct CadetConnection *cc, |
333 | enum GNUNET_ErrorType level); | 330 | enum GNUNET_ErrorType level); |
334 | 331 | ||
335 | 332 | ||
336 | #endif | 333 | #endif |