summaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_tunnels.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_tunnels.h')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.h89
1 files changed, 46 insertions, 43 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h
index 0df35cd23..ef07badea 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.h
+++ b/src/cadet/gnunet-service-cadet_tunnels.h
@@ -1,4 +1,3 @@
1
2/* 1/*
3 This file is part of GNUnet. 2 This file is part of GNUnet.
4 Copyright (C) 2001-2017 GNUnet e.V. 3 Copyright (C) 2001-2017 GNUnet e.V.
@@ -41,7 +40,8 @@
41/** 40/**
42 * All the encryption states a tunnel can be in. 41 * All the encryption states a tunnel can be in.
43 */ 42 */
44enum CadetTunnelEState { 43enum CadetTunnelEState
44{
45 /** 45 /**
46 * Uninitialized status, we need to send KX. We will stay 46 * Uninitialized status, we need to send KX. We will stay
47 * in this state until the first connection is up. 47 * in this state until the first connection is up.
@@ -89,7 +89,7 @@ enum CadetTunnelEState {
89 * @return Static string the destination peer's ID. 89 * @return Static string the destination peer's ID.
90 */ 90 */
91const char * 91const char *
92GCT_2s(const struct CadetTunnel *t); 92GCT_2s (const struct CadetTunnel *t);
93 93
94 94
95/** 95/**
@@ -100,7 +100,7 @@ GCT_2s(const struct CadetTunnel *t);
100 * @return new tunnel to @a destination 100 * @return new tunnel to @a destination
101 */ 101 */
102struct CadetTunnel * 102struct CadetTunnel *
103GCT_create_tunnel(struct CadetPeer *destination); 103GCT_create_tunnel (struct CadetPeer *destination);
104 104
105 105
106/** 106/**
@@ -109,7 +109,7 @@ GCT_create_tunnel(struct CadetPeer *destination);
109 * @param t tunnel to destroy 109 * @param t tunnel to destroy
110 */ 110 */
111void 111void
112GCT_destroy_tunnel_now(struct CadetTunnel *t); 112GCT_destroy_tunnel_now (struct CadetTunnel *t);
113 113
114 114
115/** 115/**
@@ -122,9 +122,10 @@ GCT_destroy_tunnel_now(struct CadetTunnel *t);
122 * #GNUNET_SYSERR on failure (duplicate connection) 122 * #GNUNET_SYSERR on failure (duplicate connection)
123 */ 123 */
124int 124int
125GCT_add_inbound_connection(struct CadetTunnel *t, 125GCT_add_inbound_connection (struct CadetTunnel *t,
126 const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, 126 const struct
127 struct CadetPeerPath *path); 127 GNUNET_CADET_ConnectionTunnelIdentifier *cid,
128 struct CadetPeerPath *path);
128 129
129 130
130/** 131/**
@@ -134,7 +135,7 @@ GCT_add_inbound_connection(struct CadetTunnel *t,
134 * @param ct binding of connection to tunnel of the connection that was lost. 135 * @param ct binding of connection to tunnel of the connection that was lost.
135 */ 136 */
136void 137void
137GCT_connection_lost(struct CadetTConnection *ct); 138GCT_connection_lost (struct CadetTConnection *ct);
138 139
139 140
140/** 141/**
@@ -144,7 +145,7 @@ GCT_connection_lost(struct CadetTConnection *ct);
144 * @return the destination of the tunnel 145 * @return the destination of the tunnel
145 */ 146 */
146struct CadetPeer * 147struct CadetPeer *
147GCT_get_destination(struct CadetTunnel *t); 148GCT_get_destination (struct CadetTunnel *t);
148 149
149 150
150/** 151/**
@@ -156,9 +157,9 @@ GCT_get_destination(struct CadetTunnel *t);
156 * @param off offset of the destination on path @a path 157 * @param off offset of the destination on path @a path
157 */ 158 */
158void 159void
159GCT_consider_path(struct CadetTunnel *t, 160GCT_consider_path (struct CadetTunnel *t,
160 struct CadetPeerPath *p, 161 struct CadetPeerPath *p,
161 unsigned int off); 162 unsigned int off);
162 163
163 164
164/** 165/**
@@ -169,8 +170,8 @@ GCT_consider_path(struct CadetTunnel *t,
169 * @return unique number identifying @a ch within @a t 170 * @return unique number identifying @a ch within @a t
170 */ 171 */
171struct GNUNET_CADET_ChannelTunnelNumber 172struct GNUNET_CADET_ChannelTunnelNumber
172GCT_add_channel(struct CadetTunnel *t, 173GCT_add_channel (struct CadetTunnel *t,
173 struct CadetChannel *ch); 174 struct CadetChannel *ch);
174 175
175 176
176/** 177/**
@@ -181,9 +182,9 @@ GCT_add_channel(struct CadetTunnel *t,
181 * @param ctn unique number identifying @a ch within @a t 182 * @param ctn unique number identifying @a ch within @a t
182 */ 183 */
183void 184void
184GCT_remove_channel(struct CadetTunnel *t, 185GCT_remove_channel (struct CadetTunnel *t,
185 struct CadetChannel *ch, 186 struct CadetChannel *ch,
186 struct GNUNET_CADET_ChannelTunnelNumber ctn); 187 struct GNUNET_CADET_ChannelTunnelNumber ctn);
187 188
188 189
189/** 190/**
@@ -193,8 +194,8 @@ GCT_remove_channel(struct CadetTunnel *t,
193 * @param ctn ID of the channel to destroy 194 * @param ctn ID of the channel to destroy
194 */ 195 */
195void 196void
196GCT_send_channel_destroy(struct CadetTunnel *t, 197GCT_send_channel_destroy (struct CadetTunnel *t,
197 struct GNUNET_CADET_ChannelTunnelNumber ctn); 198 struct GNUNET_CADET_ChannelTunnelNumber ctn);
198 199
199 200
200/** 201/**
@@ -207,7 +208,8 @@ GCT_send_channel_destroy(struct CadetTunnel *t,
207 */ 208 */
208typedef void 209typedef void
209(*GCT_SendContinuation)(void *cls, 210(*GCT_SendContinuation)(void *cls,
210 const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); 211 const struct
212 GNUNET_CADET_ConnectionTunnelIdentifier *cid);
211 213
212 214
213/** 215/**
@@ -221,10 +223,10 @@ typedef void
221 * @return Handle to cancel message. 223 * @return Handle to cancel message.
222 */ 224 */
223struct CadetTunnelQueueEntry * 225struct CadetTunnelQueueEntry *
224GCT_send(struct CadetTunnel *t, 226GCT_send (struct CadetTunnel *t,
225 const struct GNUNET_MessageHeader *message, 227 const struct GNUNET_MessageHeader *message,
226 GCT_SendContinuation cont, 228 GCT_SendContinuation cont,
227 void *cont_cls); 229 void *cont_cls);
228 230
229 231
230/** 232/**
@@ -237,7 +239,7 @@ GCT_send(struct CadetTunnel *t,
237 * @param q Handle to the queue entry to cancel. 239 * @param q Handle to the queue entry to cancel.
238 */ 240 */
239void 241void
240GCT_send_cancel(struct CadetTunnelQueueEntry *q); 242GCT_send_cancel (struct CadetTunnelQueueEntry *q);
241 243
242 244
243/** 245/**
@@ -247,7 +249,7 @@ GCT_send_cancel(struct CadetTunnelQueueEntry *q);
247 * @return number of channels using the tunnel 249 * @return number of channels using the tunnel
248 */ 250 */
249unsigned int 251unsigned int
250GCT_count_channels(struct CadetTunnel *t); 252GCT_count_channels (struct CadetTunnel *t);
251 253
252 254
253/** 255/**
@@ -257,7 +259,7 @@ GCT_count_channels(struct CadetTunnel *t);
257 * @return number of connections available for the tunnel 259 * @return number of connections available for the tunnel
258 */ 260 */
259unsigned int 261unsigned int
260GCT_count_any_connections(const struct CadetTunnel *t); 262GCT_count_any_connections (const struct CadetTunnel *t);
261 263
262 264
263/** 265/**
@@ -279,9 +281,9 @@ typedef void
279 * @param iter_cls Closure for @c iter. 281 * @param iter_cls Closure for @c iter.
280 */ 282 */
281void 283void
282GCT_iterate_connections(struct CadetTunnel *t, 284GCT_iterate_connections (struct CadetTunnel *t,
283 GCT_ConnectionIterator iter, 285 GCT_ConnectionIterator iter,
284 void *iter_cls); 286 void *iter_cls);
285 287
286 288
287/** 289/**
@@ -303,9 +305,9 @@ typedef void
303 * @param iter_cls Closure for @c iter. 305 * @param iter_cls Closure for @c iter.
304 */ 306 */
305void 307void
306GCT_iterate_channels(struct CadetTunnel *t, 308GCT_iterate_channels (struct CadetTunnel *t,
307 GCT_ChannelIterator iter, 309 GCT_ChannelIterator iter,
308 void *iter_cls); 310 void *iter_cls);
309 311
310 312
311/** 313/**
@@ -316,7 +318,7 @@ GCT_iterate_channels(struct CadetTunnel *t,
316 * @return Tunnel's encryption state. 318 * @return Tunnel's encryption state.
317 */ 319 */
318enum CadetTunnelEState 320enum CadetTunnelEState
319GCT_get_estate(struct CadetTunnel *t); 321GCT_get_estate (struct CadetTunnel *t);
320 322
321 323
322/** 324/**
@@ -326,8 +328,8 @@ GCT_get_estate(struct CadetTunnel *t);
326 * @param msg the key exchange message 328 * @param msg the key exchange message
327 */ 329 */
328void 330void
329GCT_handle_kx(struct CadetTConnection *ct, 331GCT_handle_kx (struct CadetTConnection *ct,
330 const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); 332 const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg);
331 333
332 334
333/** 335/**
@@ -337,8 +339,9 @@ GCT_handle_kx(struct CadetTConnection *ct,
337 * @param msg the key exchange message 339 * @param msg the key exchange message
338 */ 340 */
339void 341void
340GCT_handle_kx_auth(struct CadetTConnection *ct, 342GCT_handle_kx_auth (struct CadetTConnection *ct,
341 const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg); 343 const struct
344 GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg);
342 345
343 346
344/** 347/**
@@ -348,8 +351,8 @@ GCT_handle_kx_auth(struct CadetTConnection *ct,
348 * @param msg the encrypted message to decrypt 351 * @param msg the encrypted message to decrypt
349 */ 352 */
350void 353void
351GCT_handle_encrypted(struct CadetTConnection *ct, 354GCT_handle_encrypted (struct CadetTConnection *ct,
352 const struct GNUNET_CADET_TunnelEncryptedMessage *msg); 355 const struct GNUNET_CADET_TunnelEncryptedMessage *msg);
353 356
354 357
355/** 358/**
@@ -359,8 +362,8 @@ GCT_handle_encrypted(struct CadetTConnection *ct,
359 * @param level Debug level to use. 362 * @param level Debug level to use.
360 */ 363 */
361void 364void
362GCT_debug(const struct CadetTunnel *t, 365GCT_debug (const struct CadetTunnel *t,
363 enum GNUNET_ErrorType level); 366 enum GNUNET_ErrorType level);
364 367
365 368
366#endif 369#endif