diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_tunnels.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnels.h | 88 |
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 | */ |
44 | enum CadetTunnelEState | 44 | enum 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 | */ |
93 | const char * | 91 | const char * |
94 | GCT_2s (const struct CadetTunnel *t); | 92 | GCT_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 | */ |
104 | struct CadetTunnel * | 102 | struct CadetTunnel * |
105 | GCT_create_tunnel (struct CadetPeer *destination); | 103 | GCT_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 | */ |
113 | void | 111 | void |
114 | GCT_destroy_tunnel_now (struct CadetTunnel *t); | 112 | GCT_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 | */ |
126 | int | 124 | int |
127 | GCT_add_inbound_connection (struct CadetTunnel *t, | 125 | GCT_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 | */ |
138 | void | 136 | void |
139 | GCT_connection_lost (struct CadetTConnection *ct); | 137 | GCT_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 | */ |
148 | struct CadetPeer * | 146 | struct CadetPeer * |
149 | GCT_get_destination (struct CadetTunnel *t); | 147 | GCT_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 | */ |
160 | void | 158 | void |
161 | GCT_consider_path (struct CadetTunnel *t, | 159 | GCT_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 | */ |
173 | struct GNUNET_CADET_ChannelTunnelNumber | 171 | struct GNUNET_CADET_ChannelTunnelNumber |
174 | GCT_add_channel (struct CadetTunnel *t, | 172 | GCT_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 | */ |
185 | void | 183 | void |
186 | GCT_remove_channel (struct CadetTunnel *t, | 184 | GCT_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 | */ |
197 | void | 195 | void |
198 | GCT_send_channel_destroy (struct CadetTunnel *t, | 196 | GCT_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 | */ |
225 | struct CadetTunnelQueueEntry * | 223 | struct CadetTunnelQueueEntry * |
226 | GCT_send (struct CadetTunnel *t, | 224 | GCT_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 | */ |
241 | void | 239 | void |
242 | GCT_send_cancel (struct CadetTunnelQueueEntry *q); | 240 | GCT_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 | */ |
251 | unsigned int | 249 | unsigned int |
252 | GCT_count_channels (struct CadetTunnel *t); | 250 | GCT_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 | */ |
261 | unsigned int | 259 | unsigned int |
262 | GCT_count_any_connections (const struct CadetTunnel *t); | 260 | GCT_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 | */ |
283 | void | 281 | void |
284 | GCT_iterate_connections (struct CadetTunnel *t, | 282 | GCT_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 | */ |
307 | void | 305 | void |
308 | GCT_iterate_channels (struct CadetTunnel *t, | 306 | GCT_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 | */ |
320 | enum CadetTunnelEState | 318 | enum CadetTunnelEState |
321 | GCT_get_estate (struct CadetTunnel *t); | 319 | GCT_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 | */ |
330 | void | 328 | void |
331 | GCT_handle_kx (struct CadetTConnection *ct, | 329 | GCT_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 | */ |
341 | void | 339 | void |
342 | GCT_handle_kx_auth (struct CadetTConnection *ct, | 340 | GCT_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 | */ |
352 | void | 350 | void |
353 | GCT_handle_encrypted (struct CadetTConnection *ct, | 351 | GCT_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 | */ |
363 | void | 361 | void |
364 | GCT_debug (const struct CadetTunnel *t, | 362 | GCT_debug(const struct CadetTunnel *t, |
365 | enum GNUNET_ErrorType level); | 363 | enum GNUNET_ErrorType level); |
366 | 364 | ||
367 | 365 | ||
368 | #endif | 366 | #endif |