summaryrefslogtreecommitdiff
path: root/src/cadet/cadet_protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/cadet_protocol.h')
-rw-r--r--src/cadet/cadet_protocol.h58
1 files changed, 18 insertions, 40 deletions
diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h
index 762babb8a..6252a1da5 100644
--- a/src/cadet/cadet_protocol.h
+++ b/src/cadet/cadet_protocol.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/cadet_protocol.h 22 * @file cadet/cadet_protocol.h
@@ -46,7 +46,7 @@ struct GNUNET_CADET_TunnelMessage;
46extern "C" 46extern "C"
47{ 47{
48#if 0 48#if 0
49 /* keep Emacsens' auto-indent happy */ 49/* keep Emacsens' auto-indent happy */
50} 50}
51#endif 51#endif
52#endif 52#endif
@@ -66,8 +66,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
66/** 66/**
67 * Message for cadet connection creation. 67 * Message for cadet connection creation.
68 */ 68 */
69struct GNUNET_CADET_ConnectionCreateMessage 69struct GNUNET_CADET_ConnectionCreateMessage {
70{
71 /** 70 /**
72 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE 71 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
73 * 72 *
@@ -100,8 +99,7 @@ struct GNUNET_CADET_ConnectionCreateMessage
100/** 99/**
101 * Message for ack'ing a connection 100 * Message for ack'ing a connection
102 */ 101 */
103struct GNUNET_CADET_ConnectionCreateAckMessage 102struct GNUNET_CADET_ConnectionCreateAckMessage {
104{
105 /** 103 /**
106 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK 104 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK
107 */ 105 */
@@ -116,15 +114,13 @@ struct GNUNET_CADET_ConnectionCreateAckMessage
116 * ID of the connection. 114 * ID of the connection.
117 */ 115 */
118 struct GNUNET_CADET_ConnectionTunnelIdentifier cid; 116 struct GNUNET_CADET_ConnectionTunnelIdentifier cid;
119
120}; 117};
121 118
122 119
123/** 120/**
124 * Message for notifying a disconnection in a path 121 * Message for notifying a disconnection in a path
125 */ 122 */
126struct GNUNET_CADET_ConnectionBrokenMessage 123struct GNUNET_CADET_ConnectionBrokenMessage {
127{
128 /** 124 /**
129 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN. 125 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN.
130 */ 126 */
@@ -155,8 +151,7 @@ struct GNUNET_CADET_ConnectionBrokenMessage
155/** 151/**
156 * Message to destroy a connection. 152 * Message to destroy a connection.
157 */ 153 */
158struct GNUNET_CADET_ConnectionDestroyMessage 154struct GNUNET_CADET_ConnectionDestroyMessage {
159{
160 /** 155 /**
161 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY 156 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY
162 */ 157 */
@@ -185,8 +180,7 @@ struct GNUNET_CADET_ConnectionDestroyMessage
185 * against the respective #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED 180 * against the respective #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED
186 * messages. 181 * messages.
187 */ 182 */
188struct CadetEncryptedMessageIdentifier 183struct CadetEncryptedMessageIdentifier {
189{
190 /** 184 /**
191 * This number is incremented by one per message. It may wrap around. 185 * This number is incremented by one per message. It may wrap around.
192 * In network byte order. 186 * In network byte order.
@@ -199,7 +193,6 @@ struct CadetEncryptedMessageIdentifier
199 * Flags to be used in GNUNET_CADET_KX. 193 * Flags to be used in GNUNET_CADET_KX.
200 */ 194 */
201enum GNUNET_CADET_KX_Flags { 195enum GNUNET_CADET_KX_Flags {
202
203 /** 196 /**
204 * Should the peer reply with its KX details? 197 * Should the peer reply with its KX details?
205 */ 198 */
@@ -215,8 +208,7 @@ enum GNUNET_CADET_KX_Flags {
215/** 208/**
216 * Message for a Key eXchange for a tunnel. 209 * Message for a Key eXchange for a tunnel.
217 */ 210 */
218struct GNUNET_CADET_TunnelKeyExchangeMessage 211struct GNUNET_CADET_TunnelKeyExchangeMessage {
219{
220 /** 212 /**
221 * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX or 213 * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX or
222 * #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH as part 214 * #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH as part
@@ -264,7 +256,6 @@ struct GNUNET_CADET_TunnelKeyExchangeMessage
264 * using 'gcry_sexp_sprint'. 256 * using 'gcry_sexp_sprint'.
265 */ 257 */
266 struct GNUNET_CRYPTO_EcdhePublicKey ratchet_key; 258 struct GNUNET_CRYPTO_EcdhePublicKey ratchet_key;
267
268}; 259};
269 260
270 261
@@ -272,9 +263,7 @@ struct GNUNET_CADET_TunnelKeyExchangeMessage
272 * Message for a Key eXchange for a tunnel, with authentication. 263 * Message for a Key eXchange for a tunnel, with authentication.
273 * Used as a response to the initial KX as well as for rekeying. 264 * Used as a response to the initial KX as well as for rekeying.
274 */ 265 */
275struct GNUNET_CADET_TunnelKeyExchangeAuthMessage 266struct GNUNET_CADET_TunnelKeyExchangeAuthMessage {
276{
277
278 /** 267 /**
279 * Message header with key material. 268 * Message header with key material.
280 */ 269 */
@@ -294,7 +283,6 @@ struct GNUNET_CADET_TunnelKeyExchangeAuthMessage
294 * signature or payload data. 283 * signature or payload data.
295 */ 284 */
296 struct GNUNET_HashCode auth; 285 struct GNUNET_HashCode auth;
297
298}; 286};
299 287
300 288
@@ -302,9 +290,7 @@ struct GNUNET_CADET_TunnelKeyExchangeAuthMessage
302 * Encrypted axolotl header with numbers that identify which 290 * Encrypted axolotl header with numbers that identify which
303 * keys in which ratchet are to be used to decrypt the body. 291 * keys in which ratchet are to be used to decrypt the body.
304 */ 292 */
305struct GNUNET_CADET_AxHeader 293struct GNUNET_CADET_AxHeader {
306{
307
308 /** 294 /**
309 * Number of messages sent with the current ratchet key. 295 * Number of messages sent with the current ratchet key.
310 */ 296 */
@@ -319,15 +305,13 @@ struct GNUNET_CADET_AxHeader
319 * Current ratchet key. 305 * Current ratchet key.
320 */ 306 */
321 struct GNUNET_CRYPTO_EcdhePublicKey DHRs; 307 struct GNUNET_CRYPTO_EcdhePublicKey DHRs;
322
323}; 308};
324 309
325 310
326/** 311/**
327 * Axolotl-encrypted tunnel message with application payload. 312 * Axolotl-encrypted tunnel message with application payload.
328 */ 313 */
329struct GNUNET_CADET_TunnelEncryptedMessage 314struct GNUNET_CADET_TunnelEncryptedMessage {
330{
331 /** 315 /**
332 * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED 316 * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED
333 */ 317 */
@@ -370,8 +354,7 @@ struct GNUNET_CADET_TunnelEncryptedMessage
370/** 354/**
371 * Message to create a Channel. 355 * Message to create a Channel.
372 */ 356 */
373struct GNUNET_CADET_ChannelOpenMessage 357struct GNUNET_CADET_ChannelOpenMessage {
374{
375 /** 358 /**
376 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN 359 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN
377 */ 360 */
@@ -398,8 +381,7 @@ struct GNUNET_CADET_ChannelOpenMessage
398 * Message to acknowledge opening a channel of type 381 * Message to acknowledge opening a channel of type
399 * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK. 382 * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK.
400 */ 383 */
401struct GNUNET_CADET_ChannelOpenAckMessage 384struct GNUNET_CADET_ChannelOpenAckMessage {
402{
403 /** 385 /**
404 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK 386 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK
405 */ 387 */
@@ -427,8 +409,7 @@ struct GNUNET_CADET_ChannelOpenAckMessage
427 * Message to destroy a channel of type 409 * Message to destroy a channel of type
428 * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY. 410 * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY.
429 */ 411 */
430struct GNUNET_CADET_ChannelDestroyMessage 412struct GNUNET_CADET_ChannelDestroyMessage {
431{
432 /** 413 /**
433 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY 414 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY
434 */ 415 */
@@ -449,8 +430,7 @@ struct GNUNET_CADET_ChannelDestroyMessage
449/** 430/**
450 * Number used to uniquely identify messages in a CADET Channel. 431 * Number used to uniquely identify messages in a CADET Channel.
451 */ 432 */
452struct ChannelMessageIdentifier 433struct ChannelMessageIdentifier {
453{
454 /** 434 /**
455 * Unique ID of the message, cycles around, in NBO. 435 * Unique ID of the message, cycles around, in NBO.
456 */ 436 */
@@ -461,8 +441,7 @@ struct ChannelMessageIdentifier
461/** 441/**
462 * Message for cadet data traffic. 442 * Message for cadet data traffic.
463 */ 443 */
464struct GNUNET_CADET_ChannelAppDataMessage 444struct GNUNET_CADET_ChannelAppDataMessage {
465{
466 /** 445 /**
467 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA. 446 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA.
468 */ 447 */
@@ -487,8 +466,7 @@ struct GNUNET_CADET_ChannelAppDataMessage
487/** 466/**
488 * Message to acknowledge end-to-end data. 467 * Message to acknowledge end-to-end data.
489 */ 468 */
490struct GNUNET_CADET_ChannelDataAckMessage 469struct GNUNET_CADET_ChannelDataAckMessage {
491{
492 /** 470 /**
493 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK 471 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK
494 */ 472 */