aboutsummaryrefslogtreecommitdiff
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.h88
1 files changed, 43 insertions, 45 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h
index 47d9f98bf..0df35cd23 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.h
+++ b/src/cadet/gnunet-service-cadet_tunnels.h
@@ -12,12 +12,12 @@
12 WITHOUT ANY WARRANTY; without even the implied warranty of 12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Affero General Public License for more details. 14 Affero General Public License for more details.
15 15
16 You should have received a copy of the GNU Affero General Public License 16 You should have received a copy of the GNU Affero General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19 SPDX-License-Identifier: AGPL3.0-or-later 19 SPDX-License-Identifier: AGPL3.0-or-later
20*/ 20 */
21 21
22/** 22/**
23 * @file cadet/gnunet-service-cadet_tunnels.h 23 * @file cadet/gnunet-service-cadet_tunnels.h
@@ -41,8 +41,7 @@
41/** 41/**
42 * All the encryption states a tunnel can be in. 42 * All the encryption states a tunnel can be in.
43 */ 43 */
44enum CadetTunnelEState 44enum CadetTunnelEState {
45{
46 /** 45 /**
47 * Uninitialized status, we need to send KX. We will stay 46 * Uninitialized status, we need to send KX. We will stay
48 * in this state until the first connection is up. 47 * in this state until the first connection is up.
@@ -79,7 +78,6 @@ enum CadetTunnelEState
79 * Handshake completed: session key available. 78 * Handshake completed: session key available.
80 */ 79 */
81 CADET_TUNNEL_KEY_OK 80 CADET_TUNNEL_KEY_OK
82
83}; 81};
84 82
85 83
@@ -91,7 +89,7 @@ enum CadetTunnelEState
91 * @return Static string the destination peer's ID. 89 * @return Static string the destination peer's ID.
92 */ 90 */
93const char * 91const char *
94GCT_2s (const struct CadetTunnel *t); 92GCT_2s(const struct CadetTunnel *t);
95 93
96 94
97/** 95/**
@@ -102,7 +100,7 @@ GCT_2s (const struct CadetTunnel *t);
102 * @return new tunnel to @a destination 100 * @return new tunnel to @a destination
103 */ 101 */
104struct CadetTunnel * 102struct CadetTunnel *
105GCT_create_tunnel (struct CadetPeer *destination); 103GCT_create_tunnel(struct CadetPeer *destination);
106 104
107 105
108/** 106/**
@@ -111,7 +109,7 @@ GCT_create_tunnel (struct CadetPeer *destination);
111 * @param t tunnel to destroy 109 * @param t tunnel to destroy
112 */ 110 */
113void 111void
114GCT_destroy_tunnel_now (struct CadetTunnel *t); 112GCT_destroy_tunnel_now(struct CadetTunnel *t);
115 113
116 114
117/** 115/**
@@ -124,9 +122,9 @@ GCT_destroy_tunnel_now (struct CadetTunnel *t);
124 * #GNUNET_SYSERR on failure (duplicate connection) 122 * #GNUNET_SYSERR on failure (duplicate connection)
125 */ 123 */
126int 124int
127GCT_add_inbound_connection (struct CadetTunnel *t, 125GCT_add_inbound_connection(struct CadetTunnel *t,
128 const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, 126 const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
129 struct CadetPeerPath *path); 127 struct CadetPeerPath *path);
130 128
131 129
132/** 130/**
@@ -136,7 +134,7 @@ GCT_add_inbound_connection (struct CadetTunnel *t,
136 * @param ct binding of connection to tunnel of the connection that was lost. 134 * @param ct binding of connection to tunnel of the connection that was lost.
137 */ 135 */
138void 136void
139GCT_connection_lost (struct CadetTConnection *ct); 137GCT_connection_lost(struct CadetTConnection *ct);
140 138
141 139
142/** 140/**
@@ -146,7 +144,7 @@ GCT_connection_lost (struct CadetTConnection *ct);
146 * @return the destination of the tunnel 144 * @return the destination of the tunnel
147 */ 145 */
148struct CadetPeer * 146struct CadetPeer *
149GCT_get_destination (struct CadetTunnel *t); 147GCT_get_destination(struct CadetTunnel *t);
150 148
151 149
152/** 150/**
@@ -158,9 +156,9 @@ GCT_get_destination (struct CadetTunnel *t);
158 * @param off offset of the destination on path @a path 156 * @param off offset of the destination on path @a path
159 */ 157 */
160void 158void
161GCT_consider_path (struct CadetTunnel *t, 159GCT_consider_path(struct CadetTunnel *t,
162 struct CadetPeerPath *p, 160 struct CadetPeerPath *p,
163 unsigned int off); 161 unsigned int off);
164 162
165 163
166/** 164/**
@@ -171,8 +169,8 @@ GCT_consider_path (struct CadetTunnel *t,
171 * @return unique number identifying @a ch within @a t 169 * @return unique number identifying @a ch within @a t
172 */ 170 */
173struct GNUNET_CADET_ChannelTunnelNumber 171struct GNUNET_CADET_ChannelTunnelNumber
174GCT_add_channel (struct CadetTunnel *t, 172GCT_add_channel(struct CadetTunnel *t,
175 struct CadetChannel *ch); 173 struct CadetChannel *ch);
176 174
177 175
178/** 176/**
@@ -183,9 +181,9 @@ GCT_add_channel (struct CadetTunnel *t,
183 * @param ctn unique number identifying @a ch within @a t 181 * @param ctn unique number identifying @a ch within @a t
184 */ 182 */
185void 183void
186GCT_remove_channel (struct CadetTunnel *t, 184GCT_remove_channel(struct CadetTunnel *t,
187 struct CadetChannel *ch, 185 struct CadetChannel *ch,
188 struct GNUNET_CADET_ChannelTunnelNumber ctn); 186 struct GNUNET_CADET_ChannelTunnelNumber ctn);
189 187
190 188
191/** 189/**
@@ -195,8 +193,8 @@ GCT_remove_channel (struct CadetTunnel *t,
195 * @param ctn ID of the channel to destroy 193 * @param ctn ID of the channel to destroy
196 */ 194 */
197void 195void
198GCT_send_channel_destroy (struct CadetTunnel *t, 196GCT_send_channel_destroy(struct CadetTunnel *t,
199 struct GNUNET_CADET_ChannelTunnelNumber ctn); 197 struct GNUNET_CADET_ChannelTunnelNumber ctn);
200 198
201 199
202/** 200/**
@@ -223,10 +221,10 @@ typedef void
223 * @return Handle to cancel message. 221 * @return Handle to cancel message.
224 */ 222 */
225struct CadetTunnelQueueEntry * 223struct CadetTunnelQueueEntry *
226GCT_send (struct CadetTunnel *t, 224GCT_send(struct CadetTunnel *t,
227 const struct GNUNET_MessageHeader *message, 225 const struct GNUNET_MessageHeader *message,
228 GCT_SendContinuation cont, 226 GCT_SendContinuation cont,
229 void *cont_cls); 227 void *cont_cls);
230 228
231 229
232/** 230/**
@@ -239,7 +237,7 @@ GCT_send (struct CadetTunnel *t,
239 * @param q Handle to the queue entry to cancel. 237 * @param q Handle to the queue entry to cancel.
240 */ 238 */
241void 239void
242GCT_send_cancel (struct CadetTunnelQueueEntry *q); 240GCT_send_cancel(struct CadetTunnelQueueEntry *q);
243 241
244 242
245/** 243/**
@@ -249,7 +247,7 @@ GCT_send_cancel (struct CadetTunnelQueueEntry *q);
249 * @return number of channels using the tunnel 247 * @return number of channels using the tunnel
250 */ 248 */
251unsigned int 249unsigned int
252GCT_count_channels (struct CadetTunnel *t); 250GCT_count_channels(struct CadetTunnel *t);
253 251
254 252
255/** 253/**
@@ -259,7 +257,7 @@ GCT_count_channels (struct CadetTunnel *t);
259 * @return number of connections available for the tunnel 257 * @return number of connections available for the tunnel
260 */ 258 */
261unsigned int 259unsigned int
262GCT_count_any_connections (const struct CadetTunnel *t); 260GCT_count_any_connections(const struct CadetTunnel *t);
263 261
264 262
265/** 263/**
@@ -281,9 +279,9 @@ typedef void
281 * @param iter_cls Closure for @c iter. 279 * @param iter_cls Closure for @c iter.
282 */ 280 */
283void 281void
284GCT_iterate_connections (struct CadetTunnel *t, 282GCT_iterate_connections(struct CadetTunnel *t,
285 GCT_ConnectionIterator iter, 283 GCT_ConnectionIterator iter,
286 void *iter_cls); 284 void *iter_cls);
287 285
288 286
289/** 287/**
@@ -305,9 +303,9 @@ typedef void
305 * @param iter_cls Closure for @c iter. 303 * @param iter_cls Closure for @c iter.
306 */ 304 */
307void 305void
308GCT_iterate_channels (struct CadetTunnel *t, 306GCT_iterate_channels(struct CadetTunnel *t,
309 GCT_ChannelIterator iter, 307 GCT_ChannelIterator iter,
310 void *iter_cls); 308 void *iter_cls);
311 309
312 310
313/** 311/**
@@ -318,7 +316,7 @@ GCT_iterate_channels (struct CadetTunnel *t,
318 * @return Tunnel's encryption state. 316 * @return Tunnel's encryption state.
319 */ 317 */
320enum CadetTunnelEState 318enum CadetTunnelEState
321GCT_get_estate (struct CadetTunnel *t); 319GCT_get_estate(struct CadetTunnel *t);
322 320
323 321
324/** 322/**
@@ -328,8 +326,8 @@ GCT_get_estate (struct CadetTunnel *t);
328 * @param msg the key exchange message 326 * @param msg the key exchange message
329 */ 327 */
330void 328void
331GCT_handle_kx (struct CadetTConnection *ct, 329GCT_handle_kx(struct CadetTConnection *ct,
332 const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); 330 const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg);
333 331
334 332
335/** 333/**
@@ -339,8 +337,8 @@ GCT_handle_kx (struct CadetTConnection *ct,
339 * @param msg the key exchange message 337 * @param msg the key exchange message
340 */ 338 */
341void 339void
342GCT_handle_kx_auth (struct CadetTConnection *ct, 340GCT_handle_kx_auth(struct CadetTConnection *ct,
343 const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg); 341 const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg);
344 342
345 343
346/** 344/**
@@ -350,8 +348,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
350 * @param msg the encrypted message to decrypt 348 * @param msg the encrypted message to decrypt
351 */ 349 */
352void 350void
353GCT_handle_encrypted (struct CadetTConnection *ct, 351GCT_handle_encrypted(struct CadetTConnection *ct,
354 const struct GNUNET_CADET_TunnelEncryptedMessage *msg); 352 const struct GNUNET_CADET_TunnelEncryptedMessage *msg);
355 353
356 354
357/** 355/**
@@ -361,8 +359,8 @@ GCT_handle_encrypted (struct CadetTConnection *ct,
361 * @param level Debug level to use. 359 * @param level Debug level to use.
362 */ 360 */
363void 361void
364GCT_debug (const struct CadetTunnel *t, 362GCT_debug(const struct CadetTunnel *t,
365 enum GNUNET_ErrorType level); 363 enum GNUNET_ErrorType level);
366 364
367 365
368#endif 366#endif