GNUnet  0.10.x
cadet_protocol.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2007 - 2017 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
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/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 
28 #ifndef CADET_PROTOCOL_H_
29 #define CADET_PROTOCOL_H_
30 
34 #define DEBUG_KX 0
35 #if DEBUG_KX
36 #warning NEVER run this in production! KX debugging is on!
37 #endif
38 
39 #include "platform.h"
40 #include "gnunet_util_lib.h"
41 #include "cadet.h"
42 
43 #ifdef __cplusplus
44 
45 struct GNUNET_CADET_TunnelMessage;
46 extern "C"
47 {
48 #if 0
49  /* keep Emacsens' auto-indent happy */
50 }
51 #endif
52 #endif
53 
54 /******************************************************************************/
55 /******************** CADET NETWORK MESSAGES **************************/
56 /******************************************************************************/
57 
59 
60 
61 /******************************************************************************/
62 /***************************** CONNECTION **********************************/
63 /******************************************************************************/
64 
65 
70 {
78 
86 
91 
96  /* struct GNUNET_PeerIdentity peers[path_length]; */
97 };
98 
99 
104 {
109 
114 
119 
120 };
121 
122 
127 {
132 
137 
142 
146  struct GNUNET_PeerIdentity peer1;
147 
151  struct GNUNET_PeerIdentity peer2;
152 };
153 
154 
159 {
164 
169 
174 };
175 
176 
177 /******************************************************************************/
178 /******************************* TUNNEL ***********************************/
179 /******************************************************************************/
180 
189 {
194  uint32_t pid GNUNET_PACKED;
195 };
196 
197 
202 
207 
212 };
213 
214 
219 {
226 
231  uint32_t flags GNUNET_PACKED;
232 
237 
243  struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key;
244 
245 #if DEBUG_KX
246 
251  struct GNUNET_CRYPTO_EcdhePrivateKey ephemeral_key_XXX; // for debugging KX-crypto!
252 
258  struct GNUNET_CRYPTO_EddsaPrivateKey private_key_XXX; // for debugging KX-crypto!
259 #endif
260 
266  struct GNUNET_CRYPTO_EcdhePublicKey ratchet_key;
267 
268 };
269 
270 
276 {
277 
282 
283 #if DEBUG_KX
284 
289  struct GNUNET_CRYPTO_EcdhePublicKey r_ephemeral_key_XXX; // for debugging KX-crypto!
290 #endif
291 
296  struct GNUNET_HashCode auth;
297 
298 };
299 
300 
306 {
307 
311  uint32_t Ns GNUNET_PACKED;
312 
316  uint32_t PNs GNUNET_PACKED;
317 
322 
323 };
324 
325 
330 {
335 
340 
345 
351  struct GNUNET_ShortHashCode hmac;
352 
357  struct GNUNET_CADET_AxHeader ax_header;
358 
362 };
363 
364 
365 /******************************************************************************/
366 /******************************* CHANNEL ***********************************/
367 /******************************************************************************/
368 
369 
374 {
379 
383  uint32_t opt GNUNET_PACKED;
384 
388  struct GNUNET_HashCode h_port;
389 
394 };
395 
396 
402 {
407 
412 
417 
423 };
424 
425 
431 {
436 
441 
446 };
447 
448 
453 {
457  uint32_t mid GNUNET_PACKED;
458 };
459 
460 
465 {
470 
475 
480 
484 };
485 
486 
491 {
496 
501 
509  uint64_t futures GNUNET_PACKED;
510 
515 };
516 
517 
519 
520 #if 0 /* keep Emacsens' auto-indent happy */
521 {
522 #endif
523 #ifdef __cplusplus
524 }
525 #endif
526 
527 /* ifndef CADET_PROTOCOL_H */
528 #endif
529 /* end of cadet_protocol.h */
Axolotl-encrypted tunnel message with application payload.
Message to destroy a connection.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE.
Message for ack&#39;ing a connection.
uint32_t mid
Unique ID of the message, cycles around, in NBO.
Should the peer reply with its KX details?
Encrypted axolotl header with numbers that identify which keys in which ratchet are to be used to dec...
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
A 256-bit hashcode.
GNUNET_CADET_KX_Flags
Flags to be used in GNUNET_CADET_KX.
Message for a Key eXchange for a tunnel, with authentication.
Message for cadet data traffic.
Message for notifying a disconnection in a path.
A 512-bit hashcode.
Unique identifier (counter) for an encrypted message in a channel.
Private ECC key encoded for transmission.
Message to acknowledge end-to-end data.
Message to acknowledge opening a channel of type GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK.
Message to create a Channel.
Message to destroy a channel of type GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY.
Number used to uniquely identify messages in a CADET Channel.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
Private ECC key encoded for transmission.
The identity of the host (wraps the signing key of the peer).
The peer should reply with its KX details?
#define GNUNET_PACKED
gcc-ism to get packed structs.
static uint16_t port
Port number.
Definition: gnunet-bcd.c:79
Hash uniquely identifying a connection below a tunnel.
Message for a Key eXchange for a tunnel.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
Number identifying a CADET channel within a tunnel.
Header for all communications.
uint32_t options
Connection options in network byte order.
static unsigned long long reserved
How much space have we currently reserved?
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
Message for cadet connection creation.