diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-18 14:49:17 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-18 14:49:17 +0100 |
commit | e02d76e46cd00724d32f81375e8981524ee6f3e2 (patch) | |
tree | 91a6aea89bfda7865f04244e2fb2a6ebb019bc3a /src | |
parent | 9f1d39a86ddb227f91ad75f740d59adeb9b6ee31 (diff) | |
download | gnunet-e02d76e46cd00724d32f81375e8981524ee6f3e2.tar.gz gnunet-e02d76e46cd00724d32f81375e8981524ee6f3e2.zip |
more rename festivities
Diffstat (limited to 'src')
23 files changed, 310 insertions, 293 deletions
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h index 8218fd1ed..c16fb2917 100644 --- a/src/cadet/cadet.h +++ b/src/cadet/cadet.h | |||
@@ -135,12 +135,12 @@ struct GNUNET_CADET_PortMessage | |||
135 | /** | 135 | /** |
136 | * Message for a client to create channels. | 136 | * Message for a client to create channels. |
137 | */ | 137 | */ |
138 | struct GNUNET_CADET_ChannelCreateMessageMessage | 138 | struct GNUNET_CADET_ChannelOpenMessageMessage |
139 | { | 139 | { |
140 | /** | 140 | /** |
141 | * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE | 141 | * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE |
142 | * | 142 | * |
143 | * Size: sizeof(struct GNUNET_CADET_ChannelCreateMessageMessage) | 143 | * Size: sizeof(struct GNUNET_CADET_ChannelOpenMessageMessage) |
144 | */ | 144 | */ |
145 | struct GNUNET_MessageHeader header; | 145 | struct GNUNET_MessageHeader header; |
146 | 146 | ||
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index 281d8c5f3..4a662487c 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c | |||
@@ -588,7 +588,7 @@ request_data (void *cls) | |||
588 | */ | 588 | */ |
589 | static void | 589 | static void |
590 | handle_channel_created (void *cls, | 590 | handle_channel_created (void *cls, |
591 | const struct GNUNET_CADET_ChannelCreateMessageMessage *msg) | 591 | const struct GNUNET_CADET_ChannelOpenMessageMessage *msg) |
592 | { | 592 | { |
593 | struct GNUNET_CADET_Handle *h = cls; | 593 | struct GNUNET_CADET_Handle *h = cls; |
594 | struct GNUNET_CADET_Channel *ch; | 594 | struct GNUNET_CADET_Channel *ch; |
@@ -1281,8 +1281,8 @@ do_reconnect (struct GNUNET_CADET_Handle *h) | |||
1281 | { | 1281 | { |
1282 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1282 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1283 | GNUNET_MQ_hd_fixed_size (channel_created, | 1283 | GNUNET_MQ_hd_fixed_size (channel_created, |
1284 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE, | 1284 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN, |
1285 | struct GNUNET_CADET_ChannelCreateMessageMessage, | 1285 | struct GNUNET_CADET_ChannelOpenMessageMessage, |
1286 | h), | 1286 | h), |
1287 | GNUNET_MQ_hd_fixed_size (channel_destroy, | 1287 | GNUNET_MQ_hd_fixed_size (channel_destroy, |
1288 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, | 1288 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, |
@@ -1314,7 +1314,7 @@ do_reconnect (struct GNUNET_CADET_Handle *h) | |||
1314 | h), | 1314 | h), |
1315 | // FIXME | 1315 | // FIXME |
1316 | // GNUNET_MQ_hd_fixed_Y size (channel_destroyed, | 1316 | // GNUNET_MQ_hd_fixed_Y size (channel_destroyed, |
1317 | // GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED, | 1317 | // GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED, |
1318 | // struct GNUNET_CADET_ChannelDestroyMessage); | 1318 | // struct GNUNET_CADET_ChannelDestroyMessage); |
1319 | GNUNET_MQ_handler_end () | 1319 | GNUNET_MQ_handler_end () |
1320 | }; | 1320 | }; |
@@ -1453,7 +1453,7 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle) | |||
1453 | msg = (struct GNUNET_MessageHeader *) &th[1]; | 1453 | msg = (struct GNUNET_MessageHeader *) &th[1]; |
1454 | switch (ntohs(msg->type)) | 1454 | switch (ntohs(msg->type)) |
1455 | { | 1455 | { |
1456 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 1456 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
1457 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 1457 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
1458 | case GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN: | 1458 | case GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN: |
1459 | case GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE: | 1459 | case GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE: |
@@ -1575,7 +1575,7 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | |||
1575 | const struct GNUNET_HashCode *port, | 1575 | const struct GNUNET_HashCode *port, |
1576 | enum GNUNET_CADET_ChannelOption options) | 1576 | enum GNUNET_CADET_ChannelOption options) |
1577 | { | 1577 | { |
1578 | struct GNUNET_CADET_ChannelCreateMessageMessage *msg; | 1578 | struct GNUNET_CADET_ChannelOpenMessageMessage *msg; |
1579 | struct GNUNET_MQ_Envelope *env; | 1579 | struct GNUNET_MQ_Envelope *env; |
1580 | struct GNUNET_CADET_Channel *ch; | 1580 | struct GNUNET_CADET_Channel *ch; |
1581 | struct GNUNET_CADET_ClientChannelNumber chid; | 1581 | struct GNUNET_CADET_ClientChannelNumber chid; |
@@ -1591,7 +1591,7 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | |||
1591 | ch->ctx = channel_ctx; | 1591 | ch->ctx = channel_ctx; |
1592 | ch->peer = GNUNET_PEER_intern (peer); | 1592 | ch->peer = GNUNET_PEER_intern (peer); |
1593 | 1593 | ||
1594 | env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE); | 1594 | env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); |
1595 | msg->channel_id = ch->chid; | 1595 | msg->channel_id = ch->chid; |
1596 | msg->port = *port; | 1596 | msg->port = *port; |
1597 | msg->peer = *peer; | 1597 | msg->peer = *peer; |
diff --git a/src/cadet/cadet_common.c b/src/cadet/cadet_common.c index 0606aac50..95a3144e4 100644 --- a/src/cadet/cadet_common.c +++ b/src/cadet/cadet_common.c | |||
@@ -167,14 +167,14 @@ GC_m2s (uint16_t m) | |||
167 | /** | 167 | /** |
168 | * Transport payload data. | 168 | * Transport payload data. |
169 | */ | 169 | */ |
170 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 170 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
171 | s = "DATA"; | 171 | s = "DATA"; |
172 | break; | 172 | break; |
173 | 173 | ||
174 | /** | 174 | /** |
175 | * Confirm receipt of payload data. | 175 | * Confirm receipt of payload data. |
176 | */ | 176 | */ |
177 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 177 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
178 | s = "DATA_ACK"; | 178 | s = "DATA_ACK"; |
179 | break; | 179 | break; |
180 | 180 | ||
@@ -188,7 +188,7 @@ GC_m2s (uint16_t m) | |||
188 | /** | 188 | /** |
189 | * Encrypted. | 189 | * Encrypted. |
190 | */ | 190 | */ |
191 | case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED: | 191 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED: |
192 | s = "ENCRYPTED"; | 192 | s = "ENCRYPTED"; |
193 | break; | 193 | break; |
194 | 194 | ||
@@ -202,14 +202,14 @@ GC_m2s (uint16_t m) | |||
202 | /** | 202 | /** |
203 | * ACK for a data packet. | 203 | * ACK for a data packet. |
204 | */ | 204 | */ |
205 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK: | 205 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK: |
206 | s = "ACK"; | 206 | s = "ACK"; |
207 | break; | 207 | break; |
208 | 208 | ||
209 | /** | 209 | /** |
210 | * POLL for ACK. | 210 | * POLL for ACK. |
211 | */ | 211 | */ |
212 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL: | 212 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL: |
213 | s = "POLL"; | 213 | s = "POLL"; |
214 | break; | 214 | break; |
215 | 215 | ||
@@ -237,7 +237,7 @@ GC_m2s (uint16_t m) | |||
237 | /** | 237 | /** |
238 | * Ask the cadet service to create a new tunnel | 238 | * Ask the cadet service to create a new tunnel |
239 | */ | 239 | */ |
240 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 240 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
241 | s = "CHAN_CREAT"; | 241 | s = "CHAN_CREAT"; |
242 | break; | 242 | break; |
243 | 243 | ||
@@ -251,14 +251,14 @@ GC_m2s (uint16_t m) | |||
251 | /** | 251 | /** |
252 | * Confirm the creation of a channel. | 252 | * Confirm the creation of a channel. |
253 | */ | 253 | */ |
254 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 254 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
255 | s = "CHAN_ACK"; | 255 | s = "CHAN_ACK"; |
256 | break; | 256 | break; |
257 | 257 | ||
258 | /** | 258 | /** |
259 | * Confirm the creation of a channel. | 259 | * Confirm the creation of a channel. |
260 | */ | 260 | */ |
261 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 261 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
262 | s = "CHAN_NACK"; | 262 | s = "CHAN_NACK"; |
263 | break; | 263 | break; |
264 | 264 | ||
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 | ||
diff --git a/src/cadet/gnunet-service-cadet-new.c b/src/cadet/gnunet-service-cadet-new.c index 64bb25403..3e149e9bb 100644 --- a/src/cadet/gnunet-service-cadet-new.c +++ b/src/cadet/gnunet-service-cadet-new.c | |||
@@ -272,7 +272,7 @@ GSC_bind (struct CadetClient *c, | |||
272 | uint32_t options) | 272 | uint32_t options) |
273 | { | 273 | { |
274 | struct GNUNET_MQ_Envelope *env; | 274 | struct GNUNET_MQ_Envelope *env; |
275 | struct GNUNET_CADET_ChannelCreateMessageMessage *msg; | 275 | struct GNUNET_CADET_ChannelOpenMessageMessage *msg; |
276 | struct GNUNET_CADET_ClientChannelNumber lid; | 276 | struct GNUNET_CADET_ClientChannelNumber lid; |
277 | 277 | ||
278 | lid = client_get_next_lid (c); | 278 | lid = client_get_next_lid (c); |
@@ -284,7 +284,7 @@ GSC_bind (struct CadetClient *c, | |||
284 | 284 | ||
285 | /* notify local client about incoming connection! */ | 285 | /* notify local client about incoming connection! */ |
286 | env = GNUNET_MQ_msg (msg, | 286 | env = GNUNET_MQ_msg (msg, |
287 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE); | 287 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); |
288 | msg->channel_id = lid; | 288 | msg->channel_id = lid; |
289 | msg->port = *port; | 289 | msg->port = *port; |
290 | msg->opt = htonl (options); | 290 | msg->opt = htonl (options); |
@@ -464,7 +464,7 @@ handle_port_close (void *cls, | |||
464 | */ | 464 | */ |
465 | static void | 465 | static void |
466 | handle_channel_create (void *cls, | 466 | handle_channel_create (void *cls, |
467 | const struct GNUNET_CADET_ChannelCreateMessageMessage *ccm) | 467 | const struct GNUNET_CADET_ChannelOpenMessageMessage *ccm) |
468 | { | 468 | { |
469 | struct CadetClient *c = cls; | 469 | struct CadetClient *c = cls; |
470 | struct CadetChannel *ch; | 470 | struct CadetChannel *ch; |
@@ -1310,8 +1310,8 @@ GNUNET_SERVICE_MAIN | |||
1310 | struct GNUNET_CADET_PortMessage, | 1310 | struct GNUNET_CADET_PortMessage, |
1311 | NULL), | 1311 | NULL), |
1312 | GNUNET_MQ_hd_fixed_size (channel_create, | 1312 | GNUNET_MQ_hd_fixed_size (channel_create, |
1313 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE, | 1313 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN, |
1314 | struct GNUNET_CADET_ChannelCreateMessageMessage, | 1314 | struct GNUNET_CADET_ChannelOpenMessageMessage, |
1315 | NULL), | 1315 | NULL), |
1316 | GNUNET_MQ_hd_fixed_size (channel_destroy, | 1316 | GNUNET_MQ_hd_fixed_size (channel_destroy, |
1317 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, | 1317 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, |
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index fb6379de5..32e4c6269 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -68,10 +68,10 @@ struct ChannelMessageIdentifier | |||
68 | /** | 68 | /** |
69 | * Message to create a Channel. | 69 | * Message to create a Channel. |
70 | */ | 70 | */ |
71 | struct GNUNET_CADET_ChannelCreateMessage | 71 | struct GNUNET_CADET_ChannelOpenMessage |
72 | { | 72 | { |
73 | /** | 73 | /** |
74 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE | 74 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN |
75 | */ | 75 | */ |
76 | struct GNUNET_MessageHeader header; | 76 | struct GNUNET_MessageHeader header; |
77 | 77 | ||
@@ -96,7 +96,7 @@ struct GNUNET_CADET_ChannelCreateMessage | |||
96 | /** | 96 | /** |
97 | * Message for cadet data traffic. | 97 | * Message for cadet data traffic. |
98 | */ | 98 | */ |
99 | struct GNUNET_CADET_ChannelDataMessage | 99 | struct GNUNET_CADET_ChannelAppDataMessage |
100 | { | 100 | { |
101 | /** | 101 | /** |
102 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, | 102 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, |
@@ -126,7 +126,7 @@ struct GNUNET_CADET_ChannelDataMessage | |||
126 | struct GNUNET_CADET_ChannelDataAckMessage | 126 | struct GNUNET_CADET_ChannelDataAckMessage |
127 | { | 127 | { |
128 | /** | 128 | /** |
129 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK | 129 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK |
130 | */ | 130 | */ |
131 | struct GNUNET_MessageHeader header; | 131 | struct GNUNET_MessageHeader header; |
132 | 132 | ||
@@ -219,7 +219,7 @@ struct CadetReliableMessage | |||
219 | /** | 219 | /** |
220 | * Data message we are trying to send. | 220 | * Data message we are trying to send. |
221 | */ | 221 | */ |
222 | struct GNUNET_CADET_ChannelDataMessage data_message; | 222 | struct GNUNET_CADET_ChannelAppDataMessage data_message; |
223 | 223 | ||
224 | /* followed by variable-size payload */ | 224 | /* followed by variable-size payload */ |
225 | }; | 225 | }; |
@@ -265,8 +265,8 @@ struct CadetChannel | |||
265 | 265 | ||
266 | /** | 266 | /** |
267 | * Last entry in the tunnel's queue relating to control messages | 267 | * Last entry in the tunnel's queue relating to control messages |
268 | * (#GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE or | 268 | * (#GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN or |
269 | * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK). Used to cancel | 269 | * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK). Used to cancel |
270 | * transmission in case we receive updated information. | 270 | * transmission in case we receive updated information. |
271 | */ | 271 | */ |
272 | struct CadetTunnelQueueEntry *last_control_qe; | 272 | struct CadetTunnelQueueEntry *last_control_qe; |
@@ -531,7 +531,7 @@ static void | |||
531 | send_create (void *cls) | 531 | send_create (void *cls) |
532 | { | 532 | { |
533 | struct CadetChannel *ch = cls; | 533 | struct CadetChannel *ch = cls; |
534 | struct GNUNET_CADET_ChannelCreateMessage msgcc; | 534 | struct GNUNET_CADET_ChannelOpenMessage msgcc; |
535 | uint32_t options; | 535 | uint32_t options; |
536 | 536 | ||
537 | options = 0; | 537 | options = 0; |
@@ -542,7 +542,7 @@ send_create (void *cls) | |||
542 | if (ch->out_of_order) | 542 | if (ch->out_of_order) |
543 | options |= GNUNET_CADET_OPTION_OUT_OF_ORDER; | 543 | options |= GNUNET_CADET_OPTION_OUT_OF_ORDER; |
544 | msgcc.header.size = htons (sizeof (msgcc)); | 544 | msgcc.header.size = htons (sizeof (msgcc)); |
545 | msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE); | 545 | msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); |
546 | msgcc.opt = htonl (options); | 546 | msgcc.opt = htonl (options); |
547 | msgcc.port = ch->port; | 547 | msgcc.port = ch->port; |
548 | msgcc.gid = ch->gid; | 548 | msgcc.gid = ch->gid; |
@@ -698,7 +698,7 @@ send_channel_ack (struct CadetChannel *ch) | |||
698 | { | 698 | { |
699 | struct GNUNET_CADET_ChannelDataAckMessage msg; | 699 | struct GNUNET_CADET_ChannelDataAckMessage msg; |
700 | 700 | ||
701 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK); | 701 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK); |
702 | msg.header.size = htons (sizeof (msg)); | 702 | msg.header.size = htons (sizeof (msg)); |
703 | msg.gid = ch->gid; | 703 | msg.gid = ch->gid; |
704 | msg.mid.mid = htonl (ntohl (ch->mid_recv.mid) - 1); | 704 | msg.mid.mid = htonl (ntohl (ch->mid_recv.mid) - 1); |
@@ -1003,8 +1003,8 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1003 | /* Everything is correct, send the message. */ | 1003 | /* Everything is correct, send the message. */ |
1004 | crm = GNUNET_malloc (sizeof (*crm) + payload_size); | 1004 | crm = GNUNET_malloc (sizeof (*crm) + payload_size); |
1005 | crm->ch = ch; | 1005 | crm->ch = ch; |
1006 | crm->data_message.header.size = htons (sizeof (struct GNUNET_CADET_ChannelDataMessage) + payload_size); | 1006 | crm->data_message.header.size = htons (sizeof (struct GNUNET_CADET_ChannelAppDataMessage) + payload_size); |
1007 | crm->data_message.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA); | 1007 | crm->data_message.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA); |
1008 | ch->mid_send.mid = htonl (ntohl (ch->mid_send.mid) + 1); | 1008 | ch->mid_send.mid = htonl (ntohl (ch->mid_send.mid) + 1); |
1009 | crm->data_message.mid = ch->mid_send; | 1009 | crm->data_message.mid = ch->mid_send; |
1010 | crm->data_message.gid = ch->gid; | 1010 | crm->data_message.gid = ch->gid; |
diff --git a/src/cadet/gnunet-service-cadet-new_connection.c b/src/cadet/gnunet-service-cadet-new_connection.c index 95342d631..440d64fb6 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.c +++ b/src/cadet/gnunet-service-cadet-new_connection.c | |||
@@ -268,7 +268,7 @@ GCC_handle_kx (struct CadetConnection *cc, | |||
268 | */ | 268 | */ |
269 | void | 269 | void |
270 | GCC_handle_encrypted (struct CadetConnection *cc, | 270 | GCC_handle_encrypted (struct CadetConnection *cc, |
271 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 271 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
272 | { | 272 | { |
273 | GCT_handle_encrypted (cc->ct, | 273 | GCT_handle_encrypted (cc->ct, |
274 | msg); | 274 | msg); |
diff --git a/src/cadet/gnunet-service-cadet-new_connection.h b/src/cadet/gnunet-service-cadet-new_connection.h index 440fb9019..32452024c 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.h +++ b/src/cadet/gnunet-service-cadet-new_connection.h | |||
@@ -118,7 +118,7 @@ GCC_handle_kx (struct CadetConnection *cc, | |||
118 | */ | 118 | */ |
119 | void | 119 | void |
120 | GCC_handle_encrypted (struct CadetConnection *cc, | 120 | GCC_handle_encrypted (struct CadetConnection *cc, |
121 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg); | 121 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg); |
122 | 122 | ||
123 | 123 | ||
124 | /** | 124 | /** |
diff --git a/src/cadet/gnunet-service-cadet-new_core.c b/src/cadet/gnunet-service-cadet-new_core.c index b925200a6..d81600b9d 100644 --- a/src/cadet/gnunet-service-cadet-new_core.c +++ b/src/cadet/gnunet-service-cadet-new_core.c | |||
@@ -137,8 +137,8 @@ route_message (struct CadetPeer *prev, | |||
137 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. | 137 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. |
138 | */ | 138 | */ |
139 | static int | 139 | static int |
140 | check_create (void *cls, | 140 | check_connection_create (void *cls, |
141 | const struct GNUNET_CADET_ConnectionCreateMessage *msg) | 141 | const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
142 | { | 142 | { |
143 | uint16_t size = ntohs (msg->header.size) - sizeof (*msg); | 143 | uint16_t size = ntohs (msg->header.size) - sizeof (*msg); |
144 | 144 | ||
@@ -170,8 +170,8 @@ destroy_route (struct CadetRoute *route) | |||
170 | * @param msg Message itself. | 170 | * @param msg Message itself. |
171 | */ | 171 | */ |
172 | static void | 172 | static void |
173 | handle_create (void *cls, | 173 | handle_connection_create (void *cls, |
174 | const struct GNUNET_CADET_ConnectionCreateMessage *msg) | 174 | const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
175 | { | 175 | { |
176 | struct CadetPeer *peer = cls; | 176 | struct CadetPeer *peer = cls; |
177 | uint16_t size = ntohs (msg->header.size) - sizeof (*msg); | 177 | uint16_t size = ntohs (msg->header.size) - sizeof (*msg); |
@@ -235,8 +235,8 @@ handle_connection_ack (void *cls, | |||
235 | * @deprecated duplicate logic with #handle_destroy(); dedup! | 235 | * @deprecated duplicate logic with #handle_destroy(); dedup! |
236 | */ | 236 | */ |
237 | static void | 237 | static void |
238 | handle_broken (void *cls, | 238 | handle_connection_broken (void *cls, |
239 | const struct GNUNET_CADET_ConnectionBrokenMessage *msg) | 239 | const struct GNUNET_CADET_ConnectionBrokenMessage *msg) |
240 | { | 240 | { |
241 | struct CadetPeer *peer = cls; | 241 | struct CadetPeer *peer = cls; |
242 | struct CadetConnection *cc; | 242 | struct CadetConnection *cc; |
@@ -281,8 +281,8 @@ handle_broken (void *cls, | |||
281 | * @param msg Message itself. | 281 | * @param msg Message itself. |
282 | */ | 282 | */ |
283 | static void | 283 | static void |
284 | handle_destroy (void *cls, | 284 | handle_connection_destroy (void *cls, |
285 | const struct GNUNET_CADET_ConnectionDestroyMessage *msg) | 285 | const struct GNUNET_CADET_ConnectionDestroyMessage *msg) |
286 | { | 286 | { |
287 | struct CadetPeer *peer = cls; | 287 | struct CadetPeer *peer = cls; |
288 | struct CadetConnection *cc; | 288 | struct CadetConnection *cc; |
@@ -318,26 +318,26 @@ handle_destroy (void *cls, | |||
318 | 318 | ||
319 | 319 | ||
320 | /** | 320 | /** |
321 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK | 321 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_HOP_BY_HOP_ENCRYPTED_ACK. |
322 | * | 322 | * |
323 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 323 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
324 | * @param msg Message itself. | 324 | * @param msg Message itself. |
325 | */ | 325 | */ |
326 | static void | 326 | static void |
327 | handle_ack (void *cls, | 327 | handle_hop_by_hop_encrypted_ack (void *cls, |
328 | const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg) | 328 | const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg) |
329 | { | 329 | { |
330 | struct CadetPeer *peer = cls; | 330 | struct CadetPeer *peer = cls; |
331 | 331 | ||
332 | #if FIXME | 332 | #if FIXME |
333 | GCC_handle_ack (peer, | 333 | GCC_handle_poll (peer, |
334 | msg); | 334 | msg); |
335 | #endif | 335 | #endif |
336 | } | 336 | } |
337 | 337 | ||
338 | 338 | ||
339 | /** | 339 | /** |
340 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL | 340 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL |
341 | * | 341 | * |
342 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 342 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
343 | * @param msg Message itself. | 343 | * @param msg Message itself. |
@@ -362,8 +362,8 @@ handle_poll (void *cls, | |||
362 | * @param msg Message itself. | 362 | * @param msg Message itself. |
363 | */ | 363 | */ |
364 | static void | 364 | static void |
365 | handle_kx (void *cls, | 365 | handle_tunnel_kx (void *cls, |
366 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) | 366 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
367 | { | 367 | { |
368 | struct CadetPeer *peer = cls; | 368 | struct CadetPeer *peer = cls; |
369 | struct CadetConnection *cc; | 369 | struct CadetConnection *cc; |
@@ -405,22 +405,22 @@ handle_kx (void *cls, | |||
405 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. | 405 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. |
406 | */ | 406 | */ |
407 | static int | 407 | static int |
408 | check_encrypted (void *cls, | 408 | check_tunnel_encrypted (void *cls, |
409 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 409 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
410 | { | 410 | { |
411 | return GNUNET_YES; | 411 | return GNUNET_YES; |
412 | } | 412 | } |
413 | 413 | ||
414 | 414 | ||
415 | /** | 415 | /** |
416 | * Handle for #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED. | 416 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED. |
417 | * | 417 | * |
418 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 418 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
419 | * @param msg Message itself. | 419 | * @param msg Message itself. |
420 | */ | 420 | */ |
421 | static void | 421 | static void |
422 | handle_encrypted (void *cls, | 422 | handle_tunnel_encrypted (void *cls, |
423 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 423 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
424 | { | 424 | { |
425 | struct CadetPeer *peer = cls; | 425 | struct CadetPeer *peer = cls; |
426 | struct CadetConnection *cc; | 426 | struct CadetConnection *cc; |
@@ -532,7 +532,7 @@ void | |||
532 | GCO_init (const struct GNUNET_CONFIGURATION_Handle *c) | 532 | GCO_init (const struct GNUNET_CONFIGURATION_Handle *c) |
533 | { | 533 | { |
534 | struct GNUNET_MQ_MessageHandler handlers[] = { | 534 | struct GNUNET_MQ_MessageHandler handlers[] = { |
535 | GNUNET_MQ_hd_var_size (create, | 535 | GNUNET_MQ_hd_var_size (connection_create, |
536 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, | 536 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, |
537 | struct GNUNET_CADET_ConnectionCreateMessage, | 537 | struct GNUNET_CADET_ConnectionCreateMessage, |
538 | NULL), | 538 | NULL), |
@@ -540,29 +540,29 @@ GCO_init (const struct GNUNET_CONFIGURATION_Handle *c) | |||
540 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, | 540 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, |
541 | struct GNUNET_CADET_ConnectionCreateMessageAckMessage, | 541 | struct GNUNET_CADET_ConnectionCreateMessageAckMessage, |
542 | NULL), | 542 | NULL), |
543 | GNUNET_MQ_hd_fixed_size (broken, | 543 | GNUNET_MQ_hd_fixed_size (connection_broken, |
544 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, | 544 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, |
545 | struct GNUNET_CADET_ConnectionBrokenMessage, | 545 | struct GNUNET_CADET_ConnectionBrokenMessage, |
546 | NULL), | 546 | NULL), |
547 | GNUNET_MQ_hd_fixed_size (destroy, | 547 | GNUNET_MQ_hd_fixed_size (connection_destroy, |
548 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, | 548 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, |
549 | struct GNUNET_CADET_ConnectionDestroyMessage, | 549 | struct GNUNET_CADET_ConnectionDestroyMessage, |
550 | NULL), | 550 | NULL), |
551 | GNUNET_MQ_hd_fixed_size (ack, | 551 | GNUNET_MQ_hd_fixed_size (hop_by_hop_encrypted_ack, |
552 | GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK, | 552 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK, |
553 | struct GNUNET_CADET_ConnectionEncryptedAckMessage, | 553 | struct GNUNET_CADET_ConnectionEncryptedAckMessage, |
554 | NULL), | 554 | NULL), |
555 | GNUNET_MQ_hd_fixed_size (poll, | 555 | GNUNET_MQ_hd_fixed_size (poll, |
556 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL, | 556 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL, |
557 | struct GNUNET_CADET_ConnectionHopByHopPollMessage, | 557 | struct GNUNET_CADET_ConnectionHopByHopPollMessage, |
558 | NULL), | 558 | NULL), |
559 | GNUNET_MQ_hd_fixed_size (kx, | 559 | GNUNET_MQ_hd_fixed_size (tunnel_kx, |
560 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX, | 560 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX, |
561 | struct GNUNET_CADET_TunnelKeyExchangeMessage, | 561 | struct GNUNET_CADET_TunnelKeyExchangeMessage, |
562 | NULL), | 562 | NULL), |
563 | GNUNET_MQ_hd_var_size (encrypted, | 563 | GNUNET_MQ_hd_var_size (tunnel_encrypted, |
564 | GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED, | 564 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED, |
565 | struct GNUNET_CADET_ConnectionEncryptedMessage, | 565 | struct GNUNET_CADET_TunnelEncryptedMessage, |
566 | NULL), | 566 | NULL), |
567 | GNUNET_MQ_handler_end () | 567 | GNUNET_MQ_handler_end () |
568 | }; | 568 | }; |
diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c index 2425a4503..d874011aa 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.c +++ b/src/cadet/gnunet-service-cadet-new_tunnels.c | |||
@@ -762,7 +762,7 @@ t_ax_decrypt (struct CadetTunnel *t, | |||
762 | */ | 762 | */ |
763 | static void | 763 | static void |
764 | t_h_encrypt (struct CadetTunnel *t, | 764 | t_h_encrypt (struct CadetTunnel *t, |
765 | struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 765 | struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
766 | { | 766 | { |
767 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 767 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
768 | struct CadetTunnelAxolotl *ax; | 768 | struct CadetTunnelAxolotl *ax; |
@@ -791,8 +791,8 @@ t_h_encrypt (struct CadetTunnel *t, | |||
791 | */ | 791 | */ |
792 | static void | 792 | static void |
793 | t_h_decrypt (struct CadetTunnel *t, | 793 | t_h_decrypt (struct CadetTunnel *t, |
794 | const struct GNUNET_CADET_ConnectionEncryptedMessage *src, | 794 | const struct GNUNET_CADET_TunnelEncryptedMessage *src, |
795 | struct GNUNET_CADET_ConnectionEncryptedMessage *dst) | 795 | struct GNUNET_CADET_TunnelEncryptedMessage *dst) |
796 | { | 796 | { |
797 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 797 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
798 | struct CadetTunnelAxolotl *ax; | 798 | struct CadetTunnelAxolotl *ax; |
@@ -843,13 +843,13 @@ delete_skipped_key (struct CadetTunnel *t, | |||
843 | static ssize_t | 843 | static ssize_t |
844 | try_old_ax_keys (struct CadetTunnel *t, | 844 | try_old_ax_keys (struct CadetTunnel *t, |
845 | void *dst, | 845 | void *dst, |
846 | const struct GNUNET_CADET_ConnectionEncryptedMessage *src, | 846 | const struct GNUNET_CADET_TunnelEncryptedMessage *src, |
847 | size_t size) | 847 | size_t size) |
848 | { | 848 | { |
849 | struct CadetTunnelSkippedKey *key; | 849 | struct CadetTunnelSkippedKey *key; |
850 | struct GNUNET_ShortHashCode *hmac; | 850 | struct GNUNET_ShortHashCode *hmac; |
851 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 851 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
852 | struct GNUNET_CADET_ConnectionEncryptedMessage plaintext_header; | 852 | struct GNUNET_CADET_TunnelEncryptedMessage plaintext_header; |
853 | struct GNUNET_CRYPTO_SymmetricSessionKey *valid_HK; | 853 | struct GNUNET_CRYPTO_SymmetricSessionKey *valid_HK; |
854 | size_t esize; | 854 | size_t esize; |
855 | size_t res; | 855 | size_t res; |
@@ -859,7 +859,7 @@ try_old_ax_keys (struct CadetTunnel *t, | |||
859 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 859 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
860 | "Trying skipped keys\n"); | 860 | "Trying skipped keys\n"); |
861 | hmac = &plaintext_header.hmac; | 861 | hmac = &plaintext_header.hmac; |
862 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 862 | esize = size - sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
863 | 863 | ||
864 | /* Find a correct Header Key */ | 864 | /* Find a correct Header Key */ |
865 | valid_HK = NULL; | 865 | valid_HK = NULL; |
@@ -882,8 +882,8 @@ try_old_ax_keys (struct CadetTunnel *t, | |||
882 | return -1; | 882 | return -1; |
883 | 883 | ||
884 | /* Should've been checked in -cadet_connection.c handle_cadet_encrypted. */ | 884 | /* Should've been checked in -cadet_connection.c handle_cadet_encrypted. */ |
885 | GNUNET_assert (size > sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage)); | 885 | GNUNET_assert (size > sizeof (struct GNUNET_CADET_TunnelEncryptedMessage)); |
886 | len = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 886 | len = size - sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
887 | GNUNET_assert (len >= sizeof (struct GNUNET_MessageHeader)); | 887 | GNUNET_assert (len >= sizeof (struct GNUNET_MessageHeader)); |
888 | 888 | ||
889 | /* Decrypt header */ | 889 | /* Decrypt header */ |
@@ -1021,18 +1021,18 @@ store_ax_keys (struct CadetTunnel *t, | |||
1021 | static ssize_t | 1021 | static ssize_t |
1022 | t_ax_decrypt_and_validate (struct CadetTunnel *t, | 1022 | t_ax_decrypt_and_validate (struct CadetTunnel *t, |
1023 | void *dst, | 1023 | void *dst, |
1024 | const struct GNUNET_CADET_ConnectionEncryptedMessage *src, | 1024 | const struct GNUNET_CADET_TunnelEncryptedMessage *src, |
1025 | size_t size) | 1025 | size_t size) |
1026 | { | 1026 | { |
1027 | struct CadetTunnelAxolotl *ax; | 1027 | struct CadetTunnelAxolotl *ax; |
1028 | struct GNUNET_ShortHashCode msg_hmac; | 1028 | struct GNUNET_ShortHashCode msg_hmac; |
1029 | struct GNUNET_HashCode hmac; | 1029 | struct GNUNET_HashCode hmac; |
1030 | struct GNUNET_CADET_ConnectionEncryptedMessage plaintext_header; | 1030 | struct GNUNET_CADET_TunnelEncryptedMessage plaintext_header; |
1031 | uint32_t Np; | 1031 | uint32_t Np; |
1032 | uint32_t PNp; | 1032 | uint32_t PNp; |
1033 | size_t esize; /* Size of encryped payload */ | 1033 | size_t esize; /* Size of encryped payload */ |
1034 | 1034 | ||
1035 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 1035 | esize = size - sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
1036 | ax = &t->ax; | 1036 | ax = &t->ax; |
1037 | 1037 | ||
1038 | /* Try current HK */ | 1038 | /* Try current HK */ |
@@ -1411,7 +1411,7 @@ handle_plaintext_keepalive (void *cls, | |||
1411 | */ | 1411 | */ |
1412 | static int | 1412 | static int |
1413 | check_plaintext_data (void *cls, | 1413 | check_plaintext_data (void *cls, |
1414 | const struct GNUNET_CADET_ChannelDataMessage *msg) | 1414 | const struct GNUNET_CADET_ChannelAppDataMessage *msg) |
1415 | { | 1415 | { |
1416 | return GNUNET_OK; | 1416 | return GNUNET_OK; |
1417 | } | 1417 | } |
@@ -1425,7 +1425,7 @@ check_plaintext_data (void *cls, | |||
1425 | */ | 1425 | */ |
1426 | static void | 1426 | static void |
1427 | handle_plaintext_data (void *cls, | 1427 | handle_plaintext_data (void *cls, |
1428 | const struct GNUNET_CADET_ChannelDataMessage *msg) | 1428 | const struct GNUNET_CADET_ChannelAppDataMessage *msg) |
1429 | { | 1429 | { |
1430 | struct CadetTunnel *t = cls; | 1430 | struct CadetTunnel *t = cls; |
1431 | GNUNET_break (0); // FIXME! | 1431 | GNUNET_break (0); // FIXME! |
@@ -1455,7 +1455,7 @@ handle_plaintext_data_ack (void *cls, | |||
1455 | */ | 1455 | */ |
1456 | static void | 1456 | static void |
1457 | handle_plaintext_channel_create (void *cls, | 1457 | handle_plaintext_channel_create (void *cls, |
1458 | const struct GNUNET_CADET_ChannelCreateMessage *cc) | 1458 | const struct GNUNET_CADET_ChannelOpenMessage *cc) |
1459 | { | 1459 | { |
1460 | struct CadetTunnel *t = cls; | 1460 | struct CadetTunnel *t = cls; |
1461 | GNUNET_break (0); // FIXME! | 1461 | GNUNET_break (0); // FIXME! |
@@ -1558,23 +1558,23 @@ GCT_create_tunnel (struct CadetPeer *destination) | |||
1558 | struct GNUNET_MessageHeader, | 1558 | struct GNUNET_MessageHeader, |
1559 | NULL), | 1559 | NULL), |
1560 | GNUNET_MQ_hd_var_size (plaintext_data, | 1560 | GNUNET_MQ_hd_var_size (plaintext_data, |
1561 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA, | 1561 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA, |
1562 | struct GNUNET_CADET_ChannelDataMessage, | 1562 | struct GNUNET_CADET_ChannelAppDataMessage, |
1563 | NULL), | 1563 | NULL), |
1564 | GNUNET_MQ_hd_fixed_size (plaintext_data_ack, | 1564 | GNUNET_MQ_hd_fixed_size (plaintext_data_ack, |
1565 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK, | 1565 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK, |
1566 | struct GNUNET_CADET_ChannelDataAckMessage, | 1566 | struct GNUNET_CADET_ChannelDataAckMessage, |
1567 | NULL), | 1567 | NULL), |
1568 | GNUNET_MQ_hd_fixed_size (plaintext_channel_create, | 1568 | GNUNET_MQ_hd_fixed_size (plaintext_channel_create, |
1569 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE, | 1569 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN, |
1570 | struct GNUNET_CADET_ChannelCreateMessage, | 1570 | struct GNUNET_CADET_ChannelOpenMessage, |
1571 | NULL), | 1571 | NULL), |
1572 | GNUNET_MQ_hd_fixed_size (plaintext_channel_nack, | 1572 | GNUNET_MQ_hd_fixed_size (plaintext_channel_nack, |
1573 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED, | 1573 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED, |
1574 | struct GNUNET_CADET_ChannelManageMessage, | 1574 | struct GNUNET_CADET_ChannelManageMessage, |
1575 | NULL), | 1575 | NULL), |
1576 | GNUNET_MQ_hd_fixed_size (plaintext_channel_ack, | 1576 | GNUNET_MQ_hd_fixed_size (plaintext_channel_ack, |
1577 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK, | 1577 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK, |
1578 | struct GNUNET_CADET_ChannelManageMessage, | 1578 | struct GNUNET_CADET_ChannelManageMessage, |
1579 | NULL), | 1579 | NULL), |
1580 | GNUNET_MQ_hd_fixed_size (plaintext_channel_destroy, | 1580 | GNUNET_MQ_hd_fixed_size (plaintext_channel_destroy, |
@@ -1692,7 +1692,7 @@ GCT_handle_kx (struct CadetTConnection *ct, | |||
1692 | */ | 1692 | */ |
1693 | void | 1693 | void |
1694 | GCT_handle_encrypted (struct CadetTConnection *ct, | 1694 | GCT_handle_encrypted (struct CadetTConnection *ct, |
1695 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 1695 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
1696 | { | 1696 | { |
1697 | struct CadetTunnel *t = ct->t; | 1697 | struct CadetTunnel *t = ct->t; |
1698 | uint16_t size = ntohs (msg->header.size); | 1698 | uint16_t size = ntohs (msg->header.size); |
@@ -1758,14 +1758,14 @@ GCT_send (struct CadetTunnel *t, | |||
1758 | struct CadetTunnelQueueEntry *tq; | 1758 | struct CadetTunnelQueueEntry *tq; |
1759 | uint16_t payload_size; | 1759 | uint16_t payload_size; |
1760 | struct GNUNET_MQ_Envelope *env; | 1760 | struct GNUNET_MQ_Envelope *env; |
1761 | struct GNUNET_CADET_ConnectionEncryptedMessage *ax_msg; | 1761 | struct GNUNET_CADET_TunnelEncryptedMessage *ax_msg; |
1762 | 1762 | ||
1763 | /* FIXME: what about KX not yet being ready? (see "is_ready()" check in old code!) */ | 1763 | /* FIXME: what about KX not yet being ready? (see "is_ready()" check in old code!) */ |
1764 | 1764 | ||
1765 | payload_size = ntohs (message->size); | 1765 | payload_size = ntohs (message->size); |
1766 | env = GNUNET_MQ_msg_extra (ax_msg, | 1766 | env = GNUNET_MQ_msg_extra (ax_msg, |
1767 | payload_size, | 1767 | payload_size, |
1768 | GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED); | 1768 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED); |
1769 | t_ax_encrypt (t, | 1769 | t_ax_encrypt (t, |
1770 | &ax_msg[1], | 1770 | &ax_msg[1], |
1771 | message, | 1771 | message, |
diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.h b/src/cadet/gnunet-service-cadet-new_tunnels.h index d565077b0..59a5a1958 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.h +++ b/src/cadet/gnunet-service-cadet-new_tunnels.h | |||
@@ -336,7 +336,7 @@ GCT_handle_kx (struct CadetTConnection *ct, | |||
336 | */ | 336 | */ |
337 | void | 337 | void |
338 | GCT_handle_encrypted (struct CadetTConnection *ct, | 338 | GCT_handle_encrypted (struct CadetTConnection *ct, |
339 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg); | 339 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg); |
340 | 340 | ||
341 | 341 | ||
342 | /** | 342 | /** |
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index eff6af40b..20ed582bd 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c | |||
@@ -125,7 +125,7 @@ struct CadetReliableMessage | |||
125 | */ | 125 | */ |
126 | struct GNUNET_TIME_Absolute timestamp; | 126 | struct GNUNET_TIME_Absolute timestamp; |
127 | 127 | ||
128 | /* struct GNUNET_CADET_ChannelDataMessage with payload */ | 128 | /* struct GNUNET_CADET_ChannelAppDataMessage with payload */ |
129 | }; | 129 | }; |
130 | 130 | ||
131 | 131 | ||
@@ -368,7 +368,7 @@ is_loopback (const struct CadetChannel *ch) | |||
368 | * @param rel Reliability data for retransmission. | 368 | * @param rel Reliability data for retransmission. |
369 | */ | 369 | */ |
370 | static struct CadetReliableMessage * | 370 | static struct CadetReliableMessage * |
371 | copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid, | 371 | copy_message (const struct GNUNET_CADET_ChannelAppDataMessage *msg, uint32_t mid, |
372 | struct CadetChannelReliability *rel) | 372 | struct CadetChannelReliability *rel) |
373 | { | 373 | { |
374 | struct CadetReliableMessage *copy; | 374 | struct CadetReliableMessage *copy; |
@@ -378,7 +378,7 @@ copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid, | |||
378 | copy = GNUNET_malloc (sizeof (*copy) + size); | 378 | copy = GNUNET_malloc (sizeof (*copy) + size); |
379 | copy->mid = mid; | 379 | copy->mid = mid; |
380 | copy->rel = rel; | 380 | copy->rel = rel; |
381 | copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA; | 381 | copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA; |
382 | GNUNET_memcpy (©[1], msg, size); | 382 | GNUNET_memcpy (©[1], msg, size); |
383 | 383 | ||
384 | return copy; | 384 | return copy; |
@@ -393,7 +393,7 @@ copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid, | |||
393 | * @param rel Reliability data to the corresponding direction. | 393 | * @param rel Reliability data to the corresponding direction. |
394 | */ | 394 | */ |
395 | static void | 395 | static void |
396 | add_buffered_data (const struct GNUNET_CADET_ChannelDataMessage *msg, | 396 | add_buffered_data (const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
397 | struct CadetChannelReliability *rel) | 397 | struct CadetChannelReliability *rel) |
398 | { | 398 | { |
399 | struct CadetReliableMessage *copy; | 399 | struct CadetReliableMessage *copy; |
@@ -573,7 +573,7 @@ send_client_create (struct CadetChannel *ch) | |||
573 | */ | 573 | */ |
574 | static void | 574 | static void |
575 | send_client_data (struct CadetChannel *ch, | 575 | send_client_data (struct CadetChannel *ch, |
576 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 576 | const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
577 | int fwd) | 577 | int fwd) |
578 | { | 578 | { |
579 | if (fwd) | 579 | if (fwd) |
@@ -631,7 +631,7 @@ send_client_buffered_data (struct CadetChannel *ch, | |||
631 | { | 631 | { |
632 | if (copy->mid == rel->mid_recv || GNUNET_NO == ch->reliable) | 632 | if (copy->mid == rel->mid_recv || GNUNET_NO == ch->reliable) |
633 | { | 633 | { |
634 | struct GNUNET_CADET_ChannelDataMessage *msg = (struct GNUNET_CADET_ChannelDataMessage *) ©[1]; | 634 | struct GNUNET_CADET_ChannelAppDataMessage *msg = (struct GNUNET_CADET_ChannelAppDataMessage *) ©[1]; |
635 | 635 | ||
636 | LOG (GNUNET_ERROR_TYPE_DEBUG, " have %u! now expecting %u\n", | 636 | LOG (GNUNET_ERROR_TYPE_DEBUG, " have %u! now expecting %u\n", |
637 | copy->mid, rel->mid_recv + 1); | 637 | copy->mid, rel->mid_recv + 1); |
@@ -731,7 +731,7 @@ channel_retransmit_message (void *cls) | |||
731 | struct CadetChannelReliability *rel = cls; | 731 | struct CadetChannelReliability *rel = cls; |
732 | struct CadetReliableMessage *copy; | 732 | struct CadetReliableMessage *copy; |
733 | struct CadetChannel *ch; | 733 | struct CadetChannel *ch; |
734 | struct GNUNET_CADET_ChannelDataMessage *payload; | 734 | struct GNUNET_CADET_ChannelAppDataMessage *payload; |
735 | int fwd; | 735 | int fwd; |
736 | 736 | ||
737 | rel->retry_task = NULL; | 737 | rel->retry_task = NULL; |
@@ -743,7 +743,7 @@ channel_retransmit_message (void *cls) | |||
743 | return; | 743 | return; |
744 | } | 744 | } |
745 | 745 | ||
746 | payload = (struct GNUNET_CADET_ChannelDataMessage *) ©[1]; | 746 | payload = (struct GNUNET_CADET_ChannelAppDataMessage *) ©[1]; |
747 | fwd = (rel == ch->root_rel); | 747 | fwd = (rel == ch->root_rel); |
748 | 748 | ||
749 | /* Message not found in the queue that we are going to use. */ | 749 | /* Message not found in the queue that we are going to use. */ |
@@ -808,7 +808,7 @@ ch_message_sent (void *cls, | |||
808 | 808 | ||
809 | switch (chq->type) | 809 | switch (chq->type) |
810 | { | 810 | { |
811 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 811 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
812 | LOG (GNUNET_ERROR_TYPE_DEBUG, "data MID %u sent\n", copy->mid); | 812 | LOG (GNUNET_ERROR_TYPE_DEBUG, "data MID %u sent\n", copy->mid); |
813 | GNUNET_assert (chq == copy->chq); | 813 | GNUNET_assert (chq == copy->chq); |
814 | copy->timestamp = GNUNET_TIME_absolute_get (); | 814 | copy->timestamp = GNUNET_TIME_absolute_get (); |
@@ -844,16 +844,16 @@ ch_message_sent (void *cls, | |||
844 | break; | 844 | break; |
845 | 845 | ||
846 | 846 | ||
847 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 847 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
848 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 848 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
849 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 849 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
850 | LOG (GNUNET_ERROR_TYPE_DEBUG, "sent %s\n", GC_m2s (chq->type)); | 850 | LOG (GNUNET_ERROR_TYPE_DEBUG, "sent %s\n", GC_m2s (chq->type)); |
851 | rel = chq->rel; | 851 | rel = chq->rel; |
852 | GNUNET_assert (rel->uniq == chq); | 852 | GNUNET_assert (rel->uniq == chq); |
853 | rel->uniq = NULL; | 853 | rel->uniq = NULL; |
854 | 854 | ||
855 | if (CADET_CHANNEL_READY != rel->ch->state | 855 | if (CADET_CHANNEL_READY != rel->ch->state |
856 | && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK != type | 856 | && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK != type |
857 | && GNUNET_NO == rel->ch->destroy) | 857 | && GNUNET_NO == rel->ch->destroy) |
858 | { | 858 | { |
859 | GNUNET_assert (NULL == rel->retry_task); | 859 | GNUNET_assert (NULL == rel->retry_task); |
@@ -882,10 +882,10 @@ ch_message_sent (void *cls, | |||
882 | static void | 882 | static void |
883 | send_create (struct CadetChannel *ch) | 883 | send_create (struct CadetChannel *ch) |
884 | { | 884 | { |
885 | struct GNUNET_CADET_ChannelCreateMessage msgcc; | 885 | struct GNUNET_CADET_ChannelOpenMessage msgcc; |
886 | 886 | ||
887 | msgcc.header.size = htons (sizeof (msgcc)); | 887 | msgcc.header.size = htons (sizeof (msgcc)); |
888 | msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE); | 888 | msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); |
889 | msgcc.chid = ch->gid; | 889 | msgcc.chid = ch->gid; |
890 | msgcc.port = ch->port; | 890 | msgcc.port = ch->port; |
891 | msgcc.opt = htonl (channel_get_options (ch)); | 891 | msgcc.opt = htonl (channel_get_options (ch)); |
@@ -906,7 +906,7 @@ send_ack (struct CadetChannel *ch, int fwd) | |||
906 | struct GNUNET_CADET_ChannelManageMessage msg; | 906 | struct GNUNET_CADET_ChannelManageMessage msg; |
907 | 907 | ||
908 | msg.header.size = htons (sizeof (msg)); | 908 | msg.header.size = htons (sizeof (msg)); |
909 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK); | 909 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK); |
910 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 910 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
911 | " sending channel %s ack for channel %s\n", | 911 | " sending channel %s ack for channel %s\n", |
912 | GC_f2s (fwd), GCCH_2s (ch)); | 912 | GC_f2s (fwd), GCCH_2s (ch)); |
@@ -946,7 +946,7 @@ send_nack (struct CadetChannel *ch) | |||
946 | struct GNUNET_CADET_ChannelManageMessage msg; | 946 | struct GNUNET_CADET_ChannelManageMessage msg; |
947 | 947 | ||
948 | msg.header.size = htons (sizeof (msg)); | 948 | msg.header.size = htons (sizeof (msg)); |
949 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED); | 949 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED); |
950 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 950 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
951 | " sending channel NACK for channel %s\n", | 951 | " sending channel NACK for channel %s\n", |
952 | GCCH_2s (ch)); | 952 | GCCH_2s (ch)); |
@@ -1300,29 +1300,29 @@ handle_loopback (struct CadetChannel *ch, | |||
1300 | 1300 | ||
1301 | switch (type) | 1301 | switch (type) |
1302 | { | 1302 | { |
1303 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 1303 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
1304 | /* Don't send hop ACK, wait for client to ACK */ | 1304 | /* Don't send hop ACK, wait for client to ACK */ |
1305 | LOG (GNUNET_ERROR_TYPE_DEBUG, "SEND loopback %u (%u)\n", | 1305 | LOG (GNUNET_ERROR_TYPE_DEBUG, "SEND loopback %u (%u)\n", |
1306 | ntohl (((struct GNUNET_CADET_ChannelDataMessage *) msgh)->mid), ntohs (msgh->size)); | 1306 | ntohl (((struct GNUNET_CADET_ChannelAppDataMessage *) msgh)->mid), ntohs (msgh->size)); |
1307 | GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd); | 1307 | GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelAppDataMessage *) msgh, fwd); |
1308 | break; | 1308 | break; |
1309 | 1309 | ||
1310 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 1310 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
1311 | GCCH_handle_data_ack (ch, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd); | 1311 | GCCH_handle_data_ack (ch, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd); |
1312 | break; | 1312 | break; |
1313 | 1313 | ||
1314 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 1314 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
1315 | GCCH_handle_create (ch->t, | 1315 | GCCH_handle_create (ch->t, |
1316 | (struct GNUNET_CADET_ChannelCreateMessage *) msgh); | 1316 | (struct GNUNET_CADET_ChannelOpenMessage *) msgh); |
1317 | break; | 1317 | break; |
1318 | 1318 | ||
1319 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 1319 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
1320 | GCCH_handle_ack (ch, | 1320 | GCCH_handle_ack (ch, |
1321 | (struct GNUNET_CADET_ChannelManageMessage *) msgh, | 1321 | (struct GNUNET_CADET_ChannelManageMessage *) msgh, |
1322 | fwd); | 1322 | fwd); |
1323 | break; | 1323 | break; |
1324 | 1324 | ||
1325 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 1325 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
1326 | GCCH_handle_nack (ch); | 1326 | GCCH_handle_nack (ch); |
1327 | break; | 1327 | break; |
1328 | 1328 | ||
@@ -1536,7 +1536,7 @@ GCCH_send_data_ack (struct CadetChannel *ch, int fwd) | |||
1536 | rel = fwd ? ch->dest_rel : ch->root_rel; | 1536 | rel = fwd ? ch->dest_rel : ch->root_rel; |
1537 | ack = rel->mid_recv - 1; | 1537 | ack = rel->mid_recv - 1; |
1538 | 1538 | ||
1539 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK); | 1539 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK); |
1540 | msg.header.size = htons (sizeof (msg)); | 1540 | msg.header.size = htons (sizeof (msg)); |
1541 | msg.chid = ch->gid; | 1541 | msg.chid = ch->gid; |
1542 | msg.mid = htonl (ack); | 1542 | msg.mid = htonl (ack); |
@@ -1544,7 +1544,7 @@ GCCH_send_data_ack (struct CadetChannel *ch, int fwd) | |||
1544 | msg.futures = 0LL; | 1544 | msg.futures = 0LL; |
1545 | for (copy = rel->head_recv; NULL != copy; copy = copy->next) | 1545 | for (copy = rel->head_recv; NULL != copy; copy = copy->next) |
1546 | { | 1546 | { |
1547 | if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA) | 1547 | if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA) |
1548 | { | 1548 | { |
1549 | LOG (GNUNET_ERROR_TYPE_DEBUG, " Type %s, expected DATA\n", | 1549 | LOG (GNUNET_ERROR_TYPE_DEBUG, " Type %s, expected DATA\n", |
1550 | GC_m2s (copy->type)); | 1550 | GC_m2s (copy->type)); |
@@ -1748,8 +1748,8 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1748 | size_t size) | 1748 | size_t size) |
1749 | { | 1749 | { |
1750 | struct CadetChannelReliability *rel; | 1750 | struct CadetChannelReliability *rel; |
1751 | struct GNUNET_CADET_ChannelDataMessage *payload; | 1751 | struct GNUNET_CADET_ChannelAppDataMessage *payload; |
1752 | uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelDataMessage) + size; | 1752 | uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelAppDataMessage) + size; |
1753 | unsigned char cbuf[p2p_size]; | 1753 | unsigned char cbuf[p2p_size]; |
1754 | unsigned char buffer; | 1754 | unsigned char buffer; |
1755 | 1755 | ||
@@ -1775,12 +1775,12 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1775 | rel->client_allowed = GNUNET_NO; | 1775 | rel->client_allowed = GNUNET_NO; |
1776 | 1776 | ||
1777 | /* Ok, everything is correct, send the message. */ | 1777 | /* Ok, everything is correct, send the message. */ |
1778 | payload = (struct GNUNET_CADET_ChannelDataMessage *) cbuf; | 1778 | payload = (struct GNUNET_CADET_ChannelAppDataMessage *) cbuf; |
1779 | payload->mid = htonl (rel->mid_send); | 1779 | payload->mid = htonl (rel->mid_send); |
1780 | rel->mid_send++; | 1780 | rel->mid_send++; |
1781 | GNUNET_memcpy (&payload[1], message, size); | 1781 | GNUNET_memcpy (&payload[1], message, size); |
1782 | payload->header.size = htons (p2p_size); | 1782 | payload->header.size = htons (p2p_size); |
1783 | payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA); | 1783 | payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA); |
1784 | payload->chid = ch->gid; | 1784 | payload->chid = ch->gid; |
1785 | LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n"); | 1785 | LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n"); |
1786 | GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL); | 1786 | GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL); |
@@ -1846,7 +1846,7 @@ GCCH_handle_local_destroy (struct CadetChannel *ch, | |||
1846 | */ | 1846 | */ |
1847 | int | 1847 | int |
1848 | GCCH_handle_local_create (struct CadetClient *c, | 1848 | GCCH_handle_local_create (struct CadetClient *c, |
1849 | struct GNUNET_CADET_ChannelCreateMessageMessage *msg) | 1849 | struct GNUNET_CADET_ChannelOpenMessageMessage *msg) |
1850 | { | 1850 | { |
1851 | struct CadetChannel *ch; | 1851 | struct CadetChannel *ch; |
1852 | struct CadetTunnel *t; | 1852 | struct CadetTunnel *t; |
@@ -1914,7 +1914,7 @@ GCCH_handle_local_create (struct CadetClient *c, | |||
1914 | */ | 1914 | */ |
1915 | void | 1915 | void |
1916 | GCCH_handle_data (struct CadetChannel *ch, | 1916 | GCCH_handle_data (struct CadetChannel *ch, |
1917 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 1917 | const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
1918 | int fwd) | 1918 | int fwd) |
1919 | { | 1919 | { |
1920 | struct CadetChannelReliability *rel; | 1920 | struct CadetChannelReliability *rel; |
@@ -1972,7 +1972,7 @@ GCCH_handle_data (struct CadetChannel *ch, | |||
1972 | 1972 | ||
1973 | mid = ntohl (msg->mid); | 1973 | mid = ntohl (msg->mid); |
1974 | LOG (GNUNET_ERROR_TYPE_INFO, "<== %s (%s %4u) on chan %s (%p) %s [%5u]\n", | 1974 | LOG (GNUNET_ERROR_TYPE_INFO, "<== %s (%s %4u) on chan %s (%p) %s [%5u]\n", |
1975 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA), GC_m2s (payload_type), mid, | 1975 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA), GC_m2s (payload_type), mid, |
1976 | GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); | 1976 | GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); |
1977 | 1977 | ||
1978 | if ( (GNUNET_NO == ch->reliable) || | 1978 | if ( (GNUNET_NO == ch->reliable) || |
@@ -2069,7 +2069,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch, | |||
2069 | ack = ntohl (msg->mid); | 2069 | ack = ntohl (msg->mid); |
2070 | LOG (GNUNET_ERROR_TYPE_INFO, | 2070 | LOG (GNUNET_ERROR_TYPE_INFO, |
2071 | "<== %s (0x%010lX %4u) on chan %s (%p) %s [%5u]\n", | 2071 | "<== %s (0x%010lX %4u) on chan %s (%p) %s [%5u]\n", |
2072 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK), msg->futures, ack, | 2072 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK), msg->futures, ack, |
2073 | GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); | 2073 | GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); |
2074 | 2074 | ||
2075 | if (GNUNET_YES == fwd) | 2075 | if (GNUNET_YES == fwd) |
@@ -2151,7 +2151,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch, | |||
2151 | */ | 2151 | */ |
2152 | struct CadetChannel * | 2152 | struct CadetChannel * |
2153 | GCCH_handle_create (struct CadetTunnel *t, | 2153 | GCCH_handle_create (struct CadetTunnel *t, |
2154 | const struct GNUNET_CADET_ChannelCreateMessage *msg) | 2154 | const struct GNUNET_CADET_ChannelOpenMessage *msg) |
2155 | { | 2155 | { |
2156 | struct GNUNET_CADET_ClientChannelNumber chid; | 2156 | struct GNUNET_CADET_ClientChannelNumber chid; |
2157 | struct GNUNET_CADET_ChannelNumber gid; | 2157 | struct GNUNET_CADET_ChannelNumber gid; |
@@ -2179,7 +2179,7 @@ GCCH_handle_create (struct CadetTunnel *t, | |||
2179 | 2179 | ||
2180 | LOG (GNUNET_ERROR_TYPE_INFO, | 2180 | LOG (GNUNET_ERROR_TYPE_INFO, |
2181 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", | 2181 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", |
2182 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE), chid, port, | 2182 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN), chid, port, |
2183 | GCCH_2s (ch), ch, GC_f2s (GNUNET_YES), ntohs (msg->header.size)); | 2183 | GCCH_2s (ch), ch, GC_f2s (GNUNET_YES), ntohs (msg->header.size)); |
2184 | 2184 | ||
2185 | if (GNUNET_YES == new_channel || GCT_is_loopback (t)) | 2185 | if (GNUNET_YES == new_channel || GCT_is_loopback (t)) |
@@ -2252,7 +2252,7 @@ GCCH_handle_nack (struct CadetChannel *ch) | |||
2252 | { | 2252 | { |
2253 | LOG (GNUNET_ERROR_TYPE_INFO, | 2253 | LOG (GNUNET_ERROR_TYPE_INFO, |
2254 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", | 2254 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", |
2255 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED), ch->gid, 0, | 2255 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED), ch->gid, 0, |
2256 | GCCH_2s (ch), ch, "---", 0); | 2256 | GCCH_2s (ch), ch, "---", 0); |
2257 | 2257 | ||
2258 | send_client_nack (ch); | 2258 | send_client_nack (ch); |
@@ -2277,7 +2277,7 @@ GCCH_handle_ack (struct CadetChannel *ch, | |||
2277 | { | 2277 | { |
2278 | LOG (GNUNET_ERROR_TYPE_INFO, | 2278 | LOG (GNUNET_ERROR_TYPE_INFO, |
2279 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", | 2279 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", |
2280 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK), ch->gid, 0, | 2280 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK), ch->gid, 0, |
2281 | GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); | 2281 | GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); |
2282 | 2282 | ||
2283 | /* If this is a remote (non-loopback) channel, find 'fwd'. */ | 2283 | /* If this is a remote (non-loopback) channel, find 'fwd'. */ |
@@ -2383,13 +2383,13 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2383 | data_id = 0; | 2383 | data_id = 0; |
2384 | switch (type) | 2384 | switch (type) |
2385 | { | 2385 | { |
2386 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 2386 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
2387 | { | 2387 | { |
2388 | struct GNUNET_CADET_ChannelDataMessage *data_msg; | 2388 | struct GNUNET_CADET_ChannelAppDataMessage *data_msg; |
2389 | struct GNUNET_MessageHeader *payload_msg; | 2389 | struct GNUNET_MessageHeader *payload_msg; |
2390 | uint16_t payload_type; | 2390 | uint16_t payload_type; |
2391 | 2391 | ||
2392 | data_msg = (struct GNUNET_CADET_ChannelDataMessage *) message; | 2392 | data_msg = (struct GNUNET_CADET_ChannelAppDataMessage *) message; |
2393 | data_id = ntohl (data_msg->mid); | 2393 | data_id = ntohl (data_msg->mid); |
2394 | payload_msg = (struct GNUNET_MessageHeader *) &data_msg[1]; | 2394 | payload_msg = (struct GNUNET_MessageHeader *) &data_msg[1]; |
2395 | payload_type = ntohs (payload_msg->type); | 2395 | payload_type = ntohs (payload_msg->type); |
@@ -2397,7 +2397,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2397 | info[31] = '\0'; | 2397 | info[31] = '\0'; |
2398 | break; | 2398 | break; |
2399 | } | 2399 | } |
2400 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 2400 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
2401 | { | 2401 | { |
2402 | struct GNUNET_CADET_ChannelDataAckMessage *ack_msg; | 2402 | struct GNUNET_CADET_ChannelDataAckMessage *ack_msg; |
2403 | ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message; | 2403 | ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message; |
@@ -2406,15 +2406,15 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2406 | (unsigned long int) ack_msg->futures); | 2406 | (unsigned long int) ack_msg->futures); |
2407 | break; | 2407 | break; |
2408 | } | 2408 | } |
2409 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 2409 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
2410 | { | 2410 | { |
2411 | struct GNUNET_CADET_ChannelCreateMessage *cc_msg; | 2411 | struct GNUNET_CADET_ChannelOpenMessage *cc_msg; |
2412 | cc_msg = (struct GNUNET_CADET_ChannelCreateMessage *) message; | 2412 | cc_msg = (struct GNUNET_CADET_ChannelOpenMessage *) message; |
2413 | SPRINTF (info, " 0x%08X", ntohl (cc_msg->chid.cn)); | 2413 | SPRINTF (info, " 0x%08X", ntohl (cc_msg->chid.cn)); |
2414 | break; | 2414 | break; |
2415 | } | 2415 | } |
2416 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 2416 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
2417 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 2417 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
2418 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 2418 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
2419 | { | 2419 | { |
2420 | struct GNUNET_CADET_ChannelManageMessage *m_msg; | 2420 | struct GNUNET_CADET_ChannelManageMessage *m_msg; |
@@ -2438,7 +2438,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2438 | 2438 | ||
2439 | switch (type) | 2439 | switch (type) |
2440 | { | 2440 | { |
2441 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 2441 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
2442 | if (GNUNET_YES == ch->reliable) | 2442 | if (GNUNET_YES == ch->reliable) |
2443 | { | 2443 | { |
2444 | chq = GNUNET_new (struct CadetChannelQueue); | 2444 | chq = GNUNET_new (struct CadetChannelQueue); |
@@ -2484,9 +2484,9 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2484 | break; | 2484 | break; |
2485 | 2485 | ||
2486 | 2486 | ||
2487 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 2487 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
2488 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 2488 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
2489 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 2489 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
2490 | chq = GNUNET_new (struct CadetChannelQueue); | 2490 | chq = GNUNET_new (struct CadetChannelQueue); |
2491 | chq->type = type; | 2491 | chq->type = type; |
2492 | chq->rel = fwd ? ch->root_rel : ch->dest_rel; | 2492 | chq->rel = fwd ? ch->root_rel : ch->dest_rel; |
@@ -2521,7 +2521,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2521 | 2521 | ||
2522 | 2522 | ||
2523 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 2523 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
2524 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 2524 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
2525 | fire_and_forget (message, ch, GNUNET_YES); | 2525 | fire_and_forget (message, ch, GNUNET_YES); |
2526 | break; | 2526 | break; |
2527 | 2527 | ||
diff --git a/src/cadet/gnunet-service-cadet_channel.h b/src/cadet/gnunet-service-cadet_channel.h index c6a1df9ff..9e887362b 100644 --- a/src/cadet/gnunet-service-cadet_channel.h +++ b/src/cadet/gnunet-service-cadet_channel.h | |||
@@ -224,7 +224,7 @@ GCCH_handle_local_destroy (struct CadetChannel *ch, | |||
224 | */ | 224 | */ |
225 | int | 225 | int |
226 | GCCH_handle_local_create (struct CadetClient *c, | 226 | GCCH_handle_local_create (struct CadetClient *c, |
227 | struct GNUNET_CADET_ChannelCreateMessageMessage *msg); | 227 | struct GNUNET_CADET_ChannelOpenMessageMessage *msg); |
228 | 228 | ||
229 | /** | 229 | /** |
230 | * Handler for cadet network payload traffic. | 230 | * Handler for cadet network payload traffic. |
@@ -238,7 +238,7 @@ GCCH_handle_local_create (struct CadetClient *c, | |||
238 | */ | 238 | */ |
239 | void | 239 | void |
240 | GCCH_handle_data (struct CadetChannel *ch, | 240 | GCCH_handle_data (struct CadetChannel *ch, |
241 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 241 | const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
242 | int fwd); | 242 | int fwd); |
243 | 243 | ||
244 | 244 | ||
@@ -268,7 +268,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch, | |||
268 | */ | 268 | */ |
269 | struct CadetChannel * | 269 | struct CadetChannel * |
270 | GCCH_handle_create (struct CadetTunnel *t, | 270 | GCCH_handle_create (struct CadetTunnel *t, |
271 | const struct GNUNET_CADET_ChannelCreateMessage *msg); | 271 | const struct GNUNET_CADET_ChannelOpenMessage *msg); |
272 | 272 | ||
273 | 273 | ||
274 | /** | 274 | /** |
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 4eed0ec1c..931b32b95 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -616,7 +616,7 @@ send_ack (struct CadetConnection *c, | |||
616 | 616 | ||
617 | /* Build ACK message and send on conn */ | 617 | /* Build ACK message and send on conn */ |
618 | msg.header.size = htons (sizeof (msg)); | 618 | msg.header.size = htons (sizeof (msg)); |
619 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK); | 619 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK); |
620 | msg.cemi = ack_cemi; | 620 | msg.cemi = ack_cemi; |
621 | msg.cid = c->id; | 621 | msg.cid = c->id; |
622 | 622 | ||
@@ -747,7 +747,7 @@ conn_message_sent (void *cls, | |||
747 | } | 747 | } |
748 | else /* CONN_CREATE or CONN_ACK */ | 748 | else /* CONN_CREATE or CONN_ACK */ |
749 | { | 749 | { |
750 | GNUNET_assert (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED != type); | 750 | GNUNET_assert (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED != type); |
751 | forced = GNUNET_YES; | 751 | forced = GNUNET_YES; |
752 | } | 752 | } |
753 | 753 | ||
@@ -774,7 +774,7 @@ conn_message_sent (void *cls, | |||
774 | schedule_next_keepalive (c, fwd); | 774 | schedule_next_keepalive (c, fwd); |
775 | break; | 775 | break; |
776 | 776 | ||
777 | case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED: | 777 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED: |
778 | if (GNUNET_YES == sent) | 778 | if (GNUNET_YES == sent) |
779 | { | 779 | { |
780 | fc->last_pid_sent = pid; | 780 | fc->last_pid_sent = pid; |
@@ -806,7 +806,7 @@ conn_message_sent (void *cls, | |||
806 | connection_reset_timeout (c, fwd); | 806 | connection_reset_timeout (c, fwd); |
807 | break; | 807 | break; |
808 | 808 | ||
809 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL: | 809 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL: |
810 | fc->poll_msg = NULL; | 810 | fc->poll_msg = NULL; |
811 | if (2 == c->destroy) | 811 | if (2 == c->destroy) |
812 | { | 812 | { |
@@ -827,7 +827,7 @@ conn_message_sent (void *cls, | |||
827 | LOG (GNUNET_ERROR_TYPE_DEBUG, " task %u\n", fc->poll_task); | 827 | LOG (GNUNET_ERROR_TYPE_DEBUG, " task %u\n", fc->poll_task); |
828 | break; | 828 | break; |
829 | 829 | ||
830 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK: | 830 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK: |
831 | fc->ack_msg = NULL; | 831 | fc->ack_msg = NULL; |
832 | break; | 832 | break; |
833 | 833 | ||
@@ -1469,7 +1469,7 @@ send_poll (void *cls) | |||
1469 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Polling connection %s %s\n", | 1469 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Polling connection %s %s\n", |
1470 | GCC_2s (c), GC_f2s (fwd)); | 1470 | GCC_2s (c), GC_f2s (fwd)); |
1471 | 1471 | ||
1472 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL); | 1472 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL); |
1473 | msg.header.size = htons (sizeof (msg)); | 1473 | msg.header.size = htons (sizeof (msg)); |
1474 | msg.cid = c->id; | 1474 | msg.cid = c->id; |
1475 | msg.cemi = fc->last_pid_sent; | 1475 | msg.cemi = fc->last_pid_sent; |
@@ -2531,7 +2531,7 @@ check_message (const struct GNUNET_MessageHeader *message, | |||
2531 | 2531 | ||
2532 | /* Check PID for payload messages */ | 2532 | /* Check PID for payload messages */ |
2533 | type = ntohs (message->type); | 2533 | type = ntohs (message->type); |
2534 | if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == type) | 2534 | if (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED == type) |
2535 | { | 2535 | { |
2536 | fc = fwd ? &c->bck_fc : &c->fwd_fc; | 2536 | fc = fwd ? &c->bck_fc : &c->fwd_fc; |
2537 | LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u (expected in interval [%u,%u])\n", | 2537 | LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u (expected in interval [%u,%u])\n", |
@@ -2665,7 +2665,7 @@ GCC_handle_kx (struct CadetPeer *peer, | |||
2665 | */ | 2665 | */ |
2666 | void | 2666 | void |
2667 | GCC_handle_encrypted (struct CadetPeer *peer, | 2667 | GCC_handle_encrypted (struct CadetPeer *peer, |
2668 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 2668 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
2669 | { | 2669 | { |
2670 | static struct CadetEncryptedMessageIdentifier zero; | 2670 | static struct CadetEncryptedMessageIdentifier zero; |
2671 | const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid; | 2671 | const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid; |
@@ -3302,7 +3302,7 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
3302 | GC_f2s(fwd), size); | 3302 | GC_f2s(fwd), size); |
3303 | switch (type) | 3303 | switch (type) |
3304 | { | 3304 | { |
3305 | case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED: | 3305 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED: |
3306 | LOG (GNUNET_ERROR_TYPE_DEBUG, " Q_N+ %p %u, PIDsnt: %u, ACKrcv: %u\n", | 3306 | LOG (GNUNET_ERROR_TYPE_DEBUG, " Q_N+ %p %u, PIDsnt: %u, ACKrcv: %u\n", |
3307 | fc, | 3307 | fc, |
3308 | fc->queue_n, | 3308 | fc->queue_n, |
@@ -3324,8 +3324,8 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
3324 | GNUNET_break (0 == payload_type); | 3324 | GNUNET_break (0 == payload_type); |
3325 | break; | 3325 | break; |
3326 | 3326 | ||
3327 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK: | 3327 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK: |
3328 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL: | 3328 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL: |
3329 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY: | 3329 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY: |
3330 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN: | 3330 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN: |
3331 | GNUNET_assert (GNUNET_YES == force); | 3331 | GNUNET_assert (GNUNET_YES == force); |
@@ -3343,7 +3343,7 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
3343 | GNUNET_break (0); | 3343 | GNUNET_break (0); |
3344 | LOG (GNUNET_ERROR_TYPE_DEBUG, "queue full: %u/%u\n", | 3344 | LOG (GNUNET_ERROR_TYPE_DEBUG, "queue full: %u/%u\n", |
3345 | fc->queue_n, fc->queue_max); | 3345 | fc->queue_n, fc->queue_max); |
3346 | if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == type) | 3346 | if (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED == type) |
3347 | { | 3347 | { |
3348 | fc->queue_n--; | 3348 | fc->queue_n--; |
3349 | } | 3349 | } |
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h index ab2920ba3..1c3160dfd 100644 --- a/src/cadet/gnunet-service-cadet_connection.h +++ b/src/cadet/gnunet-service-cadet_connection.h | |||
@@ -197,7 +197,7 @@ GCC_handle_kx (struct CadetPeer *peer, | |||
197 | */ | 197 | */ |
198 | void | 198 | void |
199 | GCC_handle_encrypted (struct CadetPeer *peer, | 199 | GCC_handle_encrypted (struct CadetPeer *peer, |
200 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg); | 200 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg); |
201 | 201 | ||
202 | /** | 202 | /** |
203 | * Core handler for axolotl key exchange traffic. | 203 | * Core handler for axolotl key exchange traffic. |
diff --git a/src/cadet/gnunet-service-cadet_local.c b/src/cadet/gnunet-service-cadet_local.c index 40d7e26dc..7ba7077aa 100644 --- a/src/cadet/gnunet-service-cadet_local.c +++ b/src/cadet/gnunet-service-cadet_local.c | |||
@@ -440,7 +440,7 @@ handle_channel_create (void *cls, struct GNUNET_SERVER_Client *client, | |||
440 | LOG (GNUNET_ERROR_TYPE_DEBUG, " by client %u\n", c->id); | 440 | LOG (GNUNET_ERROR_TYPE_DEBUG, " by client %u\n", c->id); |
441 | 441 | ||
442 | /* Message size sanity check */ | 442 | /* Message size sanity check */ |
443 | if (sizeof (struct GNUNET_CADET_ChannelCreateMessageMessage) | 443 | if (sizeof (struct GNUNET_CADET_ChannelOpenMessageMessage) |
444 | != ntohs (message->size)) | 444 | != ntohs (message->size)) |
445 | { | 445 | { |
446 | GNUNET_break (0); | 446 | GNUNET_break (0); |
@@ -450,7 +450,7 @@ handle_channel_create (void *cls, struct GNUNET_SERVER_Client *client, | |||
450 | 450 | ||
451 | if (GNUNET_OK != | 451 | if (GNUNET_OK != |
452 | GCCH_handle_local_create (c, | 452 | GCCH_handle_local_create (c, |
453 | (struct GNUNET_CADET_ChannelCreateMessageMessage *) | 453 | (struct GNUNET_CADET_ChannelOpenMessageMessage *) |
454 | message)) | 454 | message)) |
455 | { | 455 | { |
456 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 456 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
@@ -1128,8 +1128,8 @@ static struct GNUNET_SERVER_MessageHandler client_handlers[] = { | |||
1128 | sizeof (struct GNUNET_CADET_PortMessage)}, | 1128 | sizeof (struct GNUNET_CADET_PortMessage)}, |
1129 | {&handle_port_close, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, | 1129 | {&handle_port_close, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, |
1130 | sizeof (struct GNUNET_CADET_PortMessage)}, | 1130 | sizeof (struct GNUNET_CADET_PortMessage)}, |
1131 | {&handle_channel_create, NULL, GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE, | 1131 | {&handle_channel_create, NULL, GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN, |
1132 | sizeof (struct GNUNET_CADET_ChannelCreateMessageMessage)}, | 1132 | sizeof (struct GNUNET_CADET_ChannelOpenMessageMessage)}, |
1133 | {&handle_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, | 1133 | {&handle_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, |
1134 | sizeof (struct GNUNET_CADET_ChannelDestroyMessage)}, | 1134 | sizeof (struct GNUNET_CADET_ChannelDestroyMessage)}, |
1135 | {&handle_data, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, 0}, | 1135 | {&handle_data, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, 0}, |
@@ -1434,10 +1434,10 @@ GML_send_channel_create (struct CadetClient *c, | |||
1434 | uint32_t opt, | 1434 | uint32_t opt, |
1435 | const struct GNUNET_PeerIdentity *peer) | 1435 | const struct GNUNET_PeerIdentity *peer) |
1436 | { | 1436 | { |
1437 | struct GNUNET_CADET_ChannelCreateMessageMessage msg; | 1437 | struct GNUNET_CADET_ChannelOpenMessageMessage msg; |
1438 | 1438 | ||
1439 | msg.header.size = htons (sizeof (msg)); | 1439 | msg.header.size = htons (sizeof (msg)); |
1440 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE); | 1440 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); |
1441 | msg.channel_id = id; | 1441 | msg.channel_id = id; |
1442 | msg.port = *port; | 1442 | msg.port = *port; |
1443 | msg.opt = htonl (opt); | 1443 | msg.opt = htonl (opt); |
@@ -1465,7 +1465,7 @@ GML_send_channel_nack (struct CadetClient *c, | |||
1465 | c); | 1465 | c); |
1466 | 1466 | ||
1467 | msg.header.size = htons (sizeof (msg)); | 1467 | msg.header.size = htons (sizeof (msg)); |
1468 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED); | 1468 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED); |
1469 | msg.channel_id = id; | 1469 | msg.channel_id = id; |
1470 | GNUNET_SERVER_notification_context_unicast (nc, | 1470 | GNUNET_SERVER_notification_context_unicast (nc, |
1471 | c->handle, | 1471 | c->handle, |
@@ -1510,11 +1510,11 @@ GML_send_channel_destroy (struct CadetClient *c, | |||
1510 | */ | 1510 | */ |
1511 | void | 1511 | void |
1512 | GML_send_data (struct CadetClient *c, | 1512 | GML_send_data (struct CadetClient *c, |
1513 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 1513 | const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
1514 | struct GNUNET_CADET_ClientChannelNumber id) | 1514 | struct GNUNET_CADET_ClientChannelNumber id) |
1515 | { | 1515 | { |
1516 | struct GNUNET_CADET_LocalData *copy; | 1516 | struct GNUNET_CADET_LocalData *copy; |
1517 | uint16_t size = ntohs (msg->header.size) - sizeof (struct GNUNET_CADET_ChannelDataMessage); | 1517 | uint16_t size = ntohs (msg->header.size) - sizeof (struct GNUNET_CADET_ChannelAppDataMessage); |
1518 | char cbuf[size + sizeof (struct GNUNET_CADET_LocalData)]; | 1518 | char cbuf[size + sizeof (struct GNUNET_CADET_LocalData)]; |
1519 | 1519 | ||
1520 | if (size < sizeof (struct GNUNET_MessageHeader)) | 1520 | if (size < sizeof (struct GNUNET_MessageHeader)) |
diff --git a/src/cadet/gnunet-service-cadet_local.h b/src/cadet/gnunet-service-cadet_local.h index 9428cd4b9..bf691f9c3 100644 --- a/src/cadet/gnunet-service-cadet_local.h +++ b/src/cadet/gnunet-service-cadet_local.h | |||
@@ -208,7 +208,7 @@ GML_send_channel_destroy (struct CadetClient *c, | |||
208 | */ | 208 | */ |
209 | void | 209 | void |
210 | GML_send_data (struct CadetClient *c, | 210 | GML_send_data (struct CadetClient *c, |
211 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 211 | const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
212 | struct GNUNET_CADET_ClientChannelNumber id); | 212 | struct GNUNET_CADET_ClientChannelNumber id); |
213 | 213 | ||
214 | /** | 214 | /** |
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 2b11040a5..3f8b7bbb8 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -526,7 +526,7 @@ handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroyMessage *m | |||
526 | 526 | ||
527 | 527 | ||
528 | /** | 528 | /** |
529 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK | 529 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK |
530 | * | 530 | * |
531 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 531 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
532 | * @param msg Message itself. | 532 | * @param msg Message itself. |
@@ -540,7 +540,7 @@ handle_ack (void *cls, const struct GNUNET_CADET_ConnectionEncryptedAckMessage * | |||
540 | 540 | ||
541 | 541 | ||
542 | /** | 542 | /** |
543 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL | 543 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL |
544 | * | 544 | * |
545 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 545 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
546 | * @param msg Message itself. | 546 | * @param msg Message itself. |
@@ -576,13 +576,13 @@ handle_kx (void *cls, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) | |||
576 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. | 576 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. |
577 | */ | 577 | */ |
578 | static int | 578 | static int |
579 | check_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 579 | check_encrypted (void *cls, const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
580 | { | 580 | { |
581 | uint16_t size; | 581 | uint16_t size; |
582 | uint16_t minimum_size; | 582 | uint16_t minimum_size; |
583 | 583 | ||
584 | size = ntohs (msg->header.size); | 584 | size = ntohs (msg->header.size); |
585 | minimum_size = sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) | 585 | minimum_size = sizeof (struct GNUNET_CADET_TunnelEncryptedMessage) |
586 | + sizeof (struct GNUNET_MessageHeader); | 586 | + sizeof (struct GNUNET_MessageHeader); |
587 | 587 | ||
588 | if (size < minimum_size) | 588 | if (size < minimum_size) |
@@ -594,13 +594,13 @@ check_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /** | 596 | /** |
597 | * Handle for #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED. | 597 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED. |
598 | * | 598 | * |
599 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 599 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
600 | * @param msg Message itself. | 600 | * @param msg Message itself. |
601 | */ | 601 | */ |
602 | static void | 602 | static void |
603 | handle_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 603 | handle_encrypted (void *cls, const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
604 | { | 604 | { |
605 | struct CadetPeer *peer = cls; | 605 | struct CadetPeer *peer = cls; |
606 | GCC_handle_encrypted (peer, msg); | 606 | GCC_handle_encrypted (peer, msg); |
@@ -639,11 +639,11 @@ connect_to_core (const struct GNUNET_CONFIGURATION_Handle *c) | |||
639 | struct GNUNET_CADET_ConnectionDestroyMessage, | 639 | struct GNUNET_CADET_ConnectionDestroyMessage, |
640 | NULL), | 640 | NULL), |
641 | GNUNET_MQ_hd_fixed_size (ack, | 641 | GNUNET_MQ_hd_fixed_size (ack, |
642 | GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK, | 642 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK, |
643 | struct GNUNET_CADET_ConnectionEncryptedAckMessage, | 643 | struct GNUNET_CADET_ConnectionEncryptedAckMessage, |
644 | NULL), | 644 | NULL), |
645 | GNUNET_MQ_hd_fixed_size (poll, | 645 | GNUNET_MQ_hd_fixed_size (poll, |
646 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL, | 646 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL, |
647 | struct GNUNET_CADET_ConnectionHopByHopPollMessage, | 647 | struct GNUNET_CADET_ConnectionHopByHopPollMessage, |
648 | NULL), | 648 | NULL), |
649 | GNUNET_MQ_hd_fixed_size (kx, | 649 | GNUNET_MQ_hd_fixed_size (kx, |
@@ -651,8 +651,8 @@ connect_to_core (const struct GNUNET_CONFIGURATION_Handle *c) | |||
651 | struct GNUNET_CADET_TunnelKeyExchangeMessage, | 651 | struct GNUNET_CADET_TunnelKeyExchangeMessage, |
652 | NULL), | 652 | NULL), |
653 | GNUNET_MQ_hd_var_size (encrypted, | 653 | GNUNET_MQ_hd_var_size (encrypted, |
654 | GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED, | 654 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED, |
655 | struct GNUNET_CADET_ConnectionEncryptedMessage, | 655 | struct GNUNET_CADET_TunnelEncryptedMessage, |
656 | NULL), | 656 | NULL), |
657 | GNUNET_MQ_handler_end () | 657 | GNUNET_MQ_handler_end () |
658 | }; | 658 | }; |
@@ -735,7 +735,7 @@ get_priority (struct CadetPeerQueue *q) | |||
735 | } | 735 | } |
736 | 736 | ||
737 | /* Bulky payload has lower priority, control traffic has higher. */ | 737 | /* Bulky payload has lower priority, control traffic has higher. */ |
738 | if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == q->type) | 738 | if (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED == q->type) |
739 | return low; | 739 | return low; |
740 | return high; | 740 | return high; |
741 | } | 741 | } |
@@ -1059,8 +1059,8 @@ search_handler (void *cls, const struct CadetPeerPath *path) | |||
1059 | static int | 1059 | static int |
1060 | is_connection_management (uint16_t type) | 1060 | is_connection_management (uint16_t type) |
1061 | { | 1061 | { |
1062 | return type == GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK || | 1062 | return type == GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK || |
1063 | type == GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL; | 1063 | type == GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL; |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | 1066 | ||
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 5e0f5bf4f..b2d91c995 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -843,7 +843,7 @@ t_ax_decrypt (struct CadetTunnel *t, void *dst, const void *src, size_t size) | |||
843 | * @param msg Message whose header to encrypt. | 843 | * @param msg Message whose header to encrypt. |
844 | */ | 844 | */ |
845 | static void | 845 | static void |
846 | t_h_encrypt (struct CadetTunnel *t, struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 846 | t_h_encrypt (struct CadetTunnel *t, struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
847 | { | 847 | { |
848 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 848 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
849 | struct CadetTunnelAxolotl *ax; | 849 | struct CadetTunnelAxolotl *ax; |
@@ -874,8 +874,8 @@ t_h_encrypt (struct CadetTunnel *t, struct GNUNET_CADET_ConnectionEncryptedMessa | |||
874 | * @param dst Where to decrypt header to. | 874 | * @param dst Where to decrypt header to. |
875 | */ | 875 | */ |
876 | static void | 876 | static void |
877 | t_h_decrypt (struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionEncryptedMessage *src, | 877 | t_h_decrypt (struct CadetTunnel *t, const struct GNUNET_CADET_TunnelEncryptedMessage *src, |
878 | struct GNUNET_CADET_ConnectionEncryptedMessage *dst) | 878 | struct GNUNET_CADET_TunnelEncryptedMessage *dst) |
879 | { | 879 | { |
880 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 880 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
881 | struct CadetTunnelAxolotl *ax; | 881 | struct CadetTunnelAxolotl *ax; |
@@ -913,12 +913,12 @@ t_h_decrypt (struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionEncrypte | |||
913 | */ | 913 | */ |
914 | static int | 914 | static int |
915 | try_old_ax_keys (struct CadetTunnel *t, void *dst, | 915 | try_old_ax_keys (struct CadetTunnel *t, void *dst, |
916 | const struct GNUNET_CADET_ConnectionEncryptedMessage *src, size_t size) | 916 | const struct GNUNET_CADET_TunnelEncryptedMessage *src, size_t size) |
917 | { | 917 | { |
918 | struct CadetTunnelSkippedKey *key; | 918 | struct CadetTunnelSkippedKey *key; |
919 | struct GNUNET_ShortHashCode *hmac; | 919 | struct GNUNET_ShortHashCode *hmac; |
920 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; | 920 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
921 | struct GNUNET_CADET_ConnectionEncryptedMessage plaintext_header; | 921 | struct GNUNET_CADET_TunnelEncryptedMessage plaintext_header; |
922 | struct GNUNET_CRYPTO_SymmetricSessionKey *valid_HK; | 922 | struct GNUNET_CRYPTO_SymmetricSessionKey *valid_HK; |
923 | size_t esize; | 923 | size_t esize; |
924 | size_t res; | 924 | size_t res; |
@@ -927,7 +927,7 @@ try_old_ax_keys (struct CadetTunnel *t, void *dst, | |||
927 | 927 | ||
928 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying old keys\n"); | 928 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying old keys\n"); |
929 | hmac = &plaintext_header.hmac; | 929 | hmac = &plaintext_header.hmac; |
930 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 930 | esize = size - sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
931 | 931 | ||
932 | /* Find a correct Header Key */ | 932 | /* Find a correct Header Key */ |
933 | for (key = t->ax->skipped_head; NULL != key; key = key->next) | 933 | for (key = t->ax->skipped_head; NULL != key; key = key->next) |
@@ -948,8 +948,8 @@ try_old_ax_keys (struct CadetTunnel *t, void *dst, | |||
948 | return -1; | 948 | return -1; |
949 | 949 | ||
950 | /* Should've been checked in -cadet_connection.c handle_cadet_encrypted. */ | 950 | /* Should've been checked in -cadet_connection.c handle_cadet_encrypted. */ |
951 | GNUNET_assert (size > sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage)); | 951 | GNUNET_assert (size > sizeof (struct GNUNET_CADET_TunnelEncryptedMessage)); |
952 | len = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 952 | len = size - sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
953 | GNUNET_assert (len >= sizeof (struct GNUNET_MessageHeader)); | 953 | GNUNET_assert (len >= sizeof (struct GNUNET_MessageHeader)); |
954 | 954 | ||
955 | /* Decrypt header */ | 955 | /* Decrypt header */ |
@@ -1092,19 +1092,19 @@ store_ax_keys (struct CadetTunnel *t, | |||
1092 | */ | 1092 | */ |
1093 | static int | 1093 | static int |
1094 | t_ax_decrypt_and_validate (struct CadetTunnel *t, void *dst, | 1094 | t_ax_decrypt_and_validate (struct CadetTunnel *t, void *dst, |
1095 | const struct GNUNET_CADET_ConnectionEncryptedMessage *src, | 1095 | const struct GNUNET_CADET_TunnelEncryptedMessage *src, |
1096 | size_t size) | 1096 | size_t size) |
1097 | { | 1097 | { |
1098 | struct CadetTunnelAxolotl *ax; | 1098 | struct CadetTunnelAxolotl *ax; |
1099 | struct GNUNET_ShortHashCode msg_hmac; | 1099 | struct GNUNET_ShortHashCode msg_hmac; |
1100 | struct GNUNET_HashCode hmac; | 1100 | struct GNUNET_HashCode hmac; |
1101 | struct GNUNET_CADET_ConnectionEncryptedMessage plaintext_header; | 1101 | struct GNUNET_CADET_TunnelEncryptedMessage plaintext_header; |
1102 | uint32_t Np; | 1102 | uint32_t Np; |
1103 | uint32_t PNp; | 1103 | uint32_t PNp; |
1104 | size_t esize; /* Size of encryped payload */ | 1104 | size_t esize; /* Size of encryped payload */ |
1105 | size_t osize; /* Size of output (decrypted payload) */ | 1105 | size_t osize; /* Size of output (decrypted payload) */ |
1106 | 1106 | ||
1107 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 1107 | esize = size - sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
1108 | ax = t->ax; | 1108 | ax = t->ax; |
1109 | if (NULL == ax) | 1109 | if (NULL == ax) |
1110 | return -1; | 1110 | return -1; |
@@ -1322,10 +1322,10 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
1322 | struct CadetTunnelQueue *existing_q) | 1322 | struct CadetTunnelQueue *existing_q) |
1323 | { | 1323 | { |
1324 | struct GNUNET_MessageHeader *msg; | 1324 | struct GNUNET_MessageHeader *msg; |
1325 | struct GNUNET_CADET_ConnectionEncryptedMessage *ax_msg; | 1325 | struct GNUNET_CADET_TunnelEncryptedMessage *ax_msg; |
1326 | struct CadetTunnelQueue *tq; | 1326 | struct CadetTunnelQueue *tq; |
1327 | size_t size = ntohs (message->size); | 1327 | size_t size = ntohs (message->size); |
1328 | char cbuf[sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) + size] GNUNET_ALIGN; | 1328 | char cbuf[sizeof (struct GNUNET_CADET_TunnelEncryptedMessage) + size] GNUNET_ALIGN; |
1329 | size_t esize; | 1329 | size_t esize; |
1330 | uint16_t type; | 1330 | uint16_t type; |
1331 | int fwd; | 1331 | int fwd; |
@@ -1352,10 +1352,10 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
1352 | 1352 | ||
1353 | GNUNET_assert (GNUNET_NO == GCT_is_loopback (t)); | 1353 | GNUNET_assert (GNUNET_NO == GCT_is_loopback (t)); |
1354 | 1354 | ||
1355 | ax_msg = (struct GNUNET_CADET_ConnectionEncryptedMessage *) cbuf; | 1355 | ax_msg = (struct GNUNET_CADET_TunnelEncryptedMessage *) cbuf; |
1356 | msg = &ax_msg->header; | 1356 | msg = &ax_msg->header; |
1357 | msg->size = htons (sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) + size); | 1357 | msg->size = htons (sizeof (struct GNUNET_CADET_TunnelEncryptedMessage) + size); |
1358 | msg->type = htons (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED); | 1358 | msg->type = htons (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED); |
1359 | esize = t_ax_encrypt (t, &ax_msg[1], message, size); | 1359 | esize = t_ax_encrypt (t, &ax_msg[1], message, size); |
1360 | ax_msg->Ns = htonl (t->ax->Ns++); | 1360 | ax_msg->Ns = htonl (t->ax->Ns++); |
1361 | ax_msg->PNs = htonl (t->ax->PNs); | 1361 | ax_msg->PNs = htonl (t->ax->PNs); |
@@ -1584,7 +1584,7 @@ send_channel_destroy (struct CadetTunnel *t, | |||
1584 | */ | 1584 | */ |
1585 | static void | 1585 | static void |
1586 | handle_data (struct CadetTunnel *t, | 1586 | handle_data (struct CadetTunnel *t, |
1587 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 1587 | const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
1588 | int fwd) | 1588 | int fwd) |
1589 | { | 1589 | { |
1590 | struct CadetChannel *ch; | 1590 | struct CadetChannel *ch; |
@@ -1595,7 +1595,7 @@ handle_data (struct CadetTunnel *t, | |||
1595 | /* Check size */ | 1595 | /* Check size */ |
1596 | size = ntohs (msg->header.size); | 1596 | size = ntohs (msg->header.size); |
1597 | if (size < | 1597 | if (size < |
1598 | sizeof (struct GNUNET_CADET_ChannelDataMessage) + | 1598 | sizeof (struct GNUNET_CADET_ChannelAppDataMessage) + |
1599 | sizeof (struct GNUNET_MessageHeader)) | 1599 | sizeof (struct GNUNET_MessageHeader)) |
1600 | { | 1600 | { |
1601 | GNUNET_break (0); | 1601 | GNUNET_break (0); |
@@ -1675,14 +1675,14 @@ handle_data_ack (struct CadetTunnel *t, | |||
1675 | */ | 1675 | */ |
1676 | static void | 1676 | static void |
1677 | handle_ch_create (struct CadetTunnel *t, | 1677 | handle_ch_create (struct CadetTunnel *t, |
1678 | const struct GNUNET_CADET_ChannelCreateMessage *msg) | 1678 | const struct GNUNET_CADET_ChannelOpenMessage *msg) |
1679 | { | 1679 | { |
1680 | struct CadetChannel *ch; | 1680 | struct CadetChannel *ch; |
1681 | size_t size; | 1681 | size_t size; |
1682 | 1682 | ||
1683 | /* Check size */ | 1683 | /* Check size */ |
1684 | size = ntohs (msg->header.size); | 1684 | size = ntohs (msg->header.size); |
1685 | if (size != sizeof (struct GNUNET_CADET_ChannelCreateMessage)) | 1685 | if (size != sizeof (struct GNUNET_CADET_ChannelOpenMessage)) |
1686 | { | 1686 | { |
1687 | GNUNET_break_op (0); | 1687 | GNUNET_break_op (0); |
1688 | return; | 1688 | return; |
@@ -1885,24 +1885,24 @@ handle_decrypted (struct CadetTunnel *t, | |||
1885 | GNUNET_STATISTICS_update (stats, "# keepalives received", 1, GNUNET_NO); | 1885 | GNUNET_STATISTICS_update (stats, "# keepalives received", 1, GNUNET_NO); |
1886 | break; | 1886 | break; |
1887 | 1887 | ||
1888 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 1888 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
1889 | /* Don't send hop ACK, wait for client to ACK */ | 1889 | /* Don't send hop ACK, wait for client to ACK */ |
1890 | handle_data (t, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd); | 1890 | handle_data (t, (struct GNUNET_CADET_ChannelAppDataMessage *) msgh, fwd); |
1891 | break; | 1891 | break; |
1892 | 1892 | ||
1893 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 1893 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
1894 | handle_data_ack (t, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd); | 1894 | handle_data_ack (t, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd); |
1895 | break; | 1895 | break; |
1896 | 1896 | ||
1897 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 1897 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
1898 | handle_ch_create (t, (struct GNUNET_CADET_ChannelCreateMessage *) msgh); | 1898 | handle_ch_create (t, (struct GNUNET_CADET_ChannelOpenMessage *) msgh); |
1899 | break; | 1899 | break; |
1900 | 1900 | ||
1901 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 1901 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
1902 | handle_ch_nack (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh); | 1902 | handle_ch_nack (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh); |
1903 | break; | 1903 | break; |
1904 | 1904 | ||
1905 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 1905 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
1906 | handle_ch_ack (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh, fwd); | 1906 | handle_ch_ack (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh, fwd); |
1907 | break; | 1907 | break; |
1908 | 1908 | ||
@@ -1934,7 +1934,7 @@ handle_decrypted (struct CadetTunnel *t, | |||
1934 | */ | 1934 | */ |
1935 | void | 1935 | void |
1936 | GCT_handle_encrypted (struct CadetTunnel *t, | 1936 | GCT_handle_encrypted (struct CadetTunnel *t, |
1937 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) | 1937 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
1938 | { | 1938 | { |
1939 | uint16_t size = ntohs (msg->header.size); | 1939 | uint16_t size = ntohs (msg->header.size); |
1940 | char cbuf [size]; | 1940 | char cbuf [size]; |
@@ -2146,8 +2146,8 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c, | |||
2146 | LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); | 2146 | LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); |
2147 | 2147 | ||
2148 | expected_overhead = 0; | 2148 | expected_overhead = 0; |
2149 | expected_overhead += sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); | 2149 | expected_overhead += sizeof (struct GNUNET_CADET_TunnelEncryptedMessage); |
2150 | expected_overhead += sizeof (struct GNUNET_CADET_ChannelDataMessage); | 2150 | expected_overhead += sizeof (struct GNUNET_CADET_ChannelAppDataMessage); |
2151 | expected_overhead += sizeof (struct GNUNET_CADET_ConnectionEncryptedAckMessage); | 2151 | expected_overhead += sizeof (struct GNUNET_CADET_ConnectionEncryptedAckMessage); |
2152 | GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead); | 2152 | GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead); |
2153 | 2153 | ||
diff --git a/src/cadet/gnunet-service-cadet_tunnel.h b/src/cadet/gnunet-service-cadet_tunnel.h index 8d3d28f8d..65f54e373 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.h +++ b/src/cadet/gnunet-service-cadet_tunnel.h | |||
@@ -304,7 +304,7 @@ GCT_get_channel (struct CadetTunnel *t, struct GNUNET_CADET_ChannelNumber chid); | |||
304 | */ | 304 | */ |
305 | void | 305 | void |
306 | GCT_handle_encrypted (struct CadetTunnel *t, | 306 | GCT_handle_encrypted (struct CadetTunnel *t, |
307 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg); | 307 | const struct GNUNET_CADET_TunnelEncryptedMessage *msg); |
308 | 308 | ||
309 | 309 | ||
310 | /** | 310 | /** |
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index 336184589..1d0232cea 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h | |||
@@ -127,8 +127,8 @@ extern "C" | |||
127 | 127 | ||
128 | /** | 128 | /** |
129 | * Size of the CADET message overhead: | 129 | * Size of the CADET message overhead: |
130 | * = sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) | 130 | * = sizeof (struct GNUNET_CADET_TunnelEncryptedMessage) |
131 | * + sizeof (struct GNUNET_CADET_ChannelDataMessage) | 131 | * + sizeof (struct GNUNET_CADET_ChannelAppDataMessage) |
132 | * + sizeof (struct GNUNET_CADET_ConnectionEncryptedAckMessage)) | 132 | * + sizeof (struct GNUNET_CADET_ConnectionEncryptedAckMessage)) |
133 | * | 133 | * |
134 | * Checked for correcteness in gnunet-service-cadet_tunnel.c: GCT_init(). | 134 | * Checked for correcteness in gnunet-service-cadet_tunnel.c: GCT_init(). |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 4962a944a..e8f5ead37 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2652,34 +2652,38 @@ extern "C" | |||
2652 | /** | 2652 | /** |
2653 | * Hop-by-hop, connection dependent ACK. | 2653 | * Hop-by-hop, connection dependent ACK. |
2654 | */ | 2654 | */ |
2655 | #define GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK 1005 | 2655 | #define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK 1005 |
2656 | 2656 | ||
2657 | /** | 2657 | /** |
2658 | * Poll for a hop-by-hop ACK. | 2658 | * Axolotl key exchange. |
2659 | */ | 2659 | */ |
2660 | #define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL 1006 | 2660 | #define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX 1007 |
2661 | 2661 | ||
2662 | /** | 2662 | /** |
2663 | * Key exchange encapsulation. | 2663 | * Axolotl encrypted data. |
2664 | */ | 2664 | */ |
2665 | #define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX 1007 | 2665 | #define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED 1008 |
2666 | 2666 | ||
2667 | /** | 2667 | /** |
2668 | * Axolotl encrypted data. | 2668 | * We do not bother with ACKs for |
2669 | * #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED messages, but we instead | ||
2670 | * poll for one if we got nothing for a while and start to be worried. | ||
2669 | */ | 2671 | */ |
2670 | #define GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED 1008 | 2672 | #define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL 1006 |
2673 | |||
2674 | |||
2671 | 2675 | ||
2672 | /********************************** Channel *********************************/ | 2676 | /********************************** Channel *********************************/ |
2673 | 2677 | ||
2674 | /** | 2678 | /** |
2675 | * Payload data (inside an encrypted tunnel). | 2679 | * Payload data (inside an encrypted tunnel). |
2676 | */ | 2680 | */ |
2677 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA 1010 | 2681 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA 1010 |
2678 | 2682 | ||
2679 | /** | 2683 | /** |
2680 | * Confirm payload data end-to-end. | 2684 | * Confirm payload data end-to-end. |
2681 | */ | 2685 | */ |
2682 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK 1011 | 2686 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK 1011 |
2683 | 2687 | ||
2684 | /** | 2688 | /** |
2685 | * Announce connection is still alive (direction sensitive). | 2689 | * Announce connection is still alive (direction sensitive). |
@@ -2689,7 +2693,7 @@ extern "C" | |||
2689 | /** | 2693 | /** |
2690 | * Ask the cadet service to create a new channel. | 2694 | * Ask the cadet service to create a new channel. |
2691 | */ | 2695 | */ |
2692 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE 1013 | 2696 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN 1013 |
2693 | 2697 | ||
2694 | /** | 2698 | /** |
2695 | * Ask the cadet service to destroy a channel. | 2699 | * Ask the cadet service to destroy a channel. |
@@ -2699,12 +2703,12 @@ extern "C" | |||
2699 | /** | 2703 | /** |
2700 | * Confirm the creation of a channel | 2704 | * Confirm the creation of a channel |
2701 | */ | 2705 | */ |
2702 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK 1015 | 2706 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK 1015 |
2703 | 2707 | ||
2704 | /** | 2708 | /** |
2705 | * Reject the creation of a channel | 2709 | * Reject the creation of a channel |
2706 | */ | 2710 | */ |
2707 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED 1016 | 2711 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED 1016 |
2708 | 2712 | ||
2709 | /*********************************** Local **********************************/ | 2713 | /*********************************** Local **********************************/ |
2710 | 2714 | ||
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h index 1e372bbea..c1e0d005c 100644 --- a/src/include/gnunet_signatures.h +++ b/src/include/gnunet_signatures.h | |||
@@ -151,11 +151,6 @@ extern "C" | |||
151 | #define GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING 20 | 151 | #define GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING 20 |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * Key exchange in CADET | ||
155 | */ | ||
156 | #define GNUNET_SIGNATURE_PURPOSE_CADET_KX 21 | ||
157 | |||
158 | /** | ||
159 | * Signature for the first round of distributed key generation. | 154 | * Signature for the first round of distributed key generation. |
160 | */ | 155 | */ |
161 | #define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1 22 | 156 | #define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1 22 |