diff options
Diffstat (limited to 'src/cadet/cadet_protocol.h')
-rw-r--r-- | src/cadet/cadet_protocol.h | 136 |
1 files changed, 77 insertions, 59 deletions
diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h index 6a6099e97..7e4a6ae16 100644 --- a/src/cadet/cadet_protocol.h +++ b/src/cadet/cadet_protocol.h | |||
@@ -161,11 +161,15 @@ struct GNUNET_CADET_ConnectionDestroyMessage | |||
161 | }; | 161 | }; |
162 | 162 | ||
163 | 163 | ||
164 | /******************************************************************************/ | ||
165 | /******************************* TUNNEL ***********************************/ | ||
166 | /******************************************************************************/ | ||
167 | |||
164 | /** | 168 | /** |
165 | * Unique identifier (counter) for an encrypted message in a channel. | 169 | * Unique identifier (counter) for an encrypted message in a channel. |
166 | * Used to match #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK | 170 | * Used to match #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK |
167 | * and #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL messages | 171 | * and #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL messages |
168 | * against the respective #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED | 172 | * against the respective #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED |
169 | * messages. | 173 | * messages. |
170 | */ | 174 | */ |
171 | struct CadetEncryptedMessageIdentifier | 175 | struct CadetEncryptedMessageIdentifier |
@@ -179,56 +183,6 @@ struct CadetEncryptedMessageIdentifier | |||
179 | 183 | ||
180 | 184 | ||
181 | /** | 185 | /** |
182 | * Message to acknowledge cadet encrypted traffic. | ||
183 | */ | ||
184 | struct GNUNET_CADET_ConnectionEncryptedAckMessage | ||
185 | { | ||
186 | /** | ||
187 | * Type: #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK | ||
188 | */ | ||
189 | struct GNUNET_MessageHeader header; | ||
190 | |||
191 | /** | ||
192 | * Maximum packet ID authorized. | ||
193 | */ | ||
194 | struct CadetEncryptedMessageIdentifier cemi; | ||
195 | |||
196 | /** | ||
197 | * ID of the connection. | ||
198 | */ | ||
199 | struct GNUNET_CADET_ConnectionTunnelIdentifier cid; | ||
200 | }; | ||
201 | |||
202 | |||
203 | /** | ||
204 | * Message to query a peer about its Flow Control status regarding a tunnel. | ||
205 | */ | ||
206 | struct GNUNET_CADET_ConnectionHopByHopPollMessage | ||
207 | { | ||
208 | /** | ||
209 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL | ||
210 | */ | ||
211 | struct GNUNET_MessageHeader header; | ||
212 | |||
213 | /** | ||
214 | * Last packet sent. | ||
215 | */ | ||
216 | struct CadetEncryptedMessageIdentifier cemi; | ||
217 | |||
218 | /** | ||
219 | * ID of the connection. | ||
220 | */ | ||
221 | struct GNUNET_CADET_ConnectionTunnelIdentifier cid; | ||
222 | |||
223 | }; | ||
224 | |||
225 | |||
226 | |||
227 | /******************************************************************************/ | ||
228 | /******************************* TUNNEL ***********************************/ | ||
229 | /******************************************************************************/ | ||
230 | |||
231 | /** | ||
232 | * Flags to be used in GNUNET_CADET_KX. | 186 | * Flags to be used in GNUNET_CADET_KX. |
233 | */ | 187 | */ |
234 | enum GNUNET_CADET_KX_Flags { | 188 | enum GNUNET_CADET_KX_Flags { |
@@ -279,16 +233,23 @@ struct GNUNET_CADET_TunnelKeyExchangeMessage | |||
279 | * using 'gcry_sexp_sprint'. | 233 | * using 'gcry_sexp_sprint'. |
280 | */ | 234 | */ |
281 | struct GNUNET_CRYPTO_EcdhePublicKey ratchet_key; | 235 | struct GNUNET_CRYPTO_EcdhePublicKey ratchet_key; |
236 | |||
237 | #ifdef NEW_CADET | ||
238 | /** | ||
239 | * Proof that sender could compute the 3-DH, in lieu of a signature. | ||
240 | */ | ||
241 | struct GNUNET_HashCode triple_dh_proof; | ||
242 | #endif | ||
282 | }; | 243 | }; |
283 | 244 | ||
284 | 245 | ||
285 | /** | 246 | /** |
286 | * Axolotl tunnel message. | 247 | * Axolotl tunnel message. |
287 | */ | 248 | */ |
288 | struct GNUNET_CADET_ConnectionEncryptedMessage | 249 | struct GNUNET_CADET_TunnelEncryptedMessage |
289 | { | 250 | { |
290 | /** | 251 | /** |
291 | * Type: #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED | 252 | * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED |
292 | */ | 253 | */ |
293 | struct GNUNET_MessageHeader header; | 254 | struct GNUNET_MessageHeader header; |
294 | 255 | ||
@@ -334,6 +295,56 @@ struct GNUNET_CADET_ConnectionEncryptedMessage | |||
334 | }; | 295 | }; |
335 | 296 | ||
336 | 297 | ||
298 | /** | ||
299 | * Message to query a peer about its Flow Control status regarding a tunnel. | ||
300 | * | ||
301 | * It is NOT yet clear if we need this. | ||
302 | */ | ||
303 | struct GNUNET_CADET_ConnectionHopByHopPollMessage | ||
304 | { | ||
305 | /** | ||
306 | * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL | ||
307 | */ | ||
308 | struct GNUNET_MessageHeader header; | ||
309 | |||
310 | /** | ||
311 | * Last packet sent. | ||
312 | */ | ||
313 | struct CadetEncryptedMessageIdentifier cemi; | ||
314 | |||
315 | /** | ||
316 | * ID of the connection. | ||
317 | */ | ||
318 | struct GNUNET_CADET_ConnectionTunnelIdentifier cid; | ||
319 | |||
320 | }; | ||
321 | |||
322 | |||
323 | /** | ||
324 | * Message to acknowledge cadet encrypted traffic, used for | ||
325 | * flow-control on a hop-by-hop basis on the connection-level. Note | ||
326 | * that we do use the @e cemi from the tunnel layer as the connection | ||
327 | * layer's header is included/shared with the tunnel layer messages, | ||
328 | * and we only do flow control for the payload. | ||
329 | */ | ||
330 | struct GNUNET_CADET_ConnectionEncryptedAckMessage | ||
331 | { | ||
332 | /** | ||
333 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK | ||
334 | */ | ||
335 | struct GNUNET_MessageHeader header; | ||
336 | |||
337 | /** | ||
338 | * Maximum packet ID authorized. | ||
339 | */ | ||
340 | struct CadetEncryptedMessageIdentifier cemi; | ||
341 | |||
342 | /** | ||
343 | * ID of the connection. | ||
344 | */ | ||
345 | struct GNUNET_CADET_ConnectionTunnelIdentifier cid; | ||
346 | }; | ||
347 | |||
337 | 348 | ||
338 | /******************************************************************************/ | 349 | /******************************************************************************/ |
339 | /******************************* CHANNEL ***********************************/ | 350 | /******************************* CHANNEL ***********************************/ |
@@ -344,10 +355,10 @@ struct GNUNET_CADET_ConnectionEncryptedMessage | |||
344 | /** | 355 | /** |
345 | * Message to create a Channel. | 356 | * Message to create a Channel. |
346 | */ | 357 | */ |
347 | struct GNUNET_CADET_ChannelCreateMessage | 358 | struct GNUNET_CADET_ChannelOpenMessage |
348 | { | 359 | { |
349 | /** | 360 | /** |
350 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE | 361 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN |
351 | */ | 362 | */ |
352 | struct GNUNET_MessageHeader header; | 363 | struct GNUNET_MessageHeader header; |
353 | 364 | ||
@@ -379,6 +390,13 @@ struct GNUNET_CADET_ChannelManageMessage | |||
379 | */ | 390 | */ |
380 | struct GNUNET_MessageHeader header; | 391 | struct GNUNET_MessageHeader header; |
381 | 392 | ||
393 | #ifdef NEW_CADET | ||
394 | /** | ||
395 | * For alignment. | ||
396 | */ | ||
397 | uint32_t reserved GNUNET_PACKED; | ||
398 | #endif | ||
399 | |||
382 | /** | 400 | /** |
383 | * ID of the channel | 401 | * ID of the channel |
384 | */ | 402 | */ |
@@ -391,7 +409,7 @@ struct GNUNET_CADET_ChannelManageMessage | |||
391 | /** | 409 | /** |
392 | * Message for cadet data traffic. | 410 | * Message for cadet data traffic. |
393 | */ | 411 | */ |
394 | struct GNUNET_CADET_ChannelDataMessage | 412 | struct GNUNET_CADET_ChannelAppDataMessage |
395 | { | 413 | { |
396 | /** | 414 | /** |
397 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, | 415 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, |
@@ -422,7 +440,7 @@ struct GNUNET_CADET_ChannelDataMessage | |||
422 | struct GNUNET_CADET_ChannelDataAckMessage | 440 | struct GNUNET_CADET_ChannelDataAckMessage |
423 | { | 441 | { |
424 | /** | 442 | /** |
425 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK | 443 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK |
426 | */ | 444 | */ |
427 | struct GNUNET_MessageHeader header; | 445 | struct GNUNET_MessageHeader header; |
428 | 446 | ||