aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.h')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.h83
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 */
59void 59void
60GCC_destroy_without_core (struct CadetConnection *cc); 60GCC_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 */
70void 70void
71GCC_destroy_without_tunnel (struct CadetConnection *cc); 71GCC_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 */
80struct CadetConnection * 80struct CadetConnection *
81GCC_lookup (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); 81GCC_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 */
96struct CadetConnection * 96struct CadetConnection *
97GCC_create (struct CadetPeer *destination, 97GCC_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 */
118struct CadetConnection * 118struct CadetConnection *
119GCC_create_inbound (struct CadetPeer *destination, 119GCC_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 */
139void 139void
140GCC_transmit (struct CadetConnection *cc, 140GCC_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 */
149void 149void
150GCC_handle_connection_create_ack (struct CadetConnection *cc); 150GCC_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 */
160void 160void
161GCC_handle_duplicate_create (struct CadetConnection *cc); 161GCC_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 */
170void 170void
171GCC_handle_kx (struct CadetConnection *cc, 171GCC_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 */
181void 181void
182GCC_handle_kx_auth (struct CadetConnection *cc, 182GCC_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 */
189struct CadetConnectionMetrics 189struct 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 */
234const struct CadetConnectionMetrics * 231const struct CadetConnectionMetrics *
235GCC_get_metrics (struct CadetConnection *cc); 232GCC_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 */
244void 241void
245GCC_handle_encrypted (struct CadetConnection *cc, 242GCC_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 */
255void 252void
256GCC_ack_expected (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); 253GCC_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 */
267void 264void
268GCC_ack_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); 265GCC_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 */
279void 276void
280GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, 277GCC_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 */
290struct CadetTConnection * 287struct CadetTConnection *
291GCC_get_ct (struct CadetConnection *cc); 288GCC_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 */
301struct CadetPeerPath * 298struct CadetPeerPath *
302GCC_get_path (struct CadetConnection *cc, 299GCC_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 */
312const struct GNUNET_CADET_ConnectionTunnelIdentifier * 309const struct GNUNET_CADET_ConnectionTunnelIdentifier *
313GCC_get_id (struct CadetConnection *cc); 310GCC_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 */
321const char * 318const char *
322GCC_2s (const struct CadetConnection *cc); 319GCC_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 */
331void 328void
332GCC_debug (struct CadetConnection *cc, 329GCC_debug(struct CadetConnection *cc,
333 enum GNUNET_ErrorType level); 330 enum GNUNET_ErrorType level);
334 331
335 332
336#endif 333#endif