diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-18 10:51:16 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-18 10:51:16 +0100 |
commit | a1bd2dcc29c126023dbd1ddf83d7514859d1775b (patch) | |
tree | 9e23f546f72f800c6451a9ab717bed6fa87e2ead | |
parent | 4ed4bcba53601d97793663017efcda877c3c490a (diff) | |
download | gnunet-a1bd2dcc29c126023dbd1ddf83d7514859d1775b.tar.gz gnunet-a1bd2dcc29c126023dbd1ddf83d7514859d1775b.zip |
cadet message struct and type rename-fest
22 files changed, 348 insertions, 348 deletions
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h index df8803662..8218fd1ed 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_ChannelCreateMessage | 138 | struct GNUNET_CADET_ChannelCreateMessageMessage |
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_ChannelCreateMessage) | 143 | * Size: sizeof(struct GNUNET_CADET_ChannelCreateMessageMessage) |
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 57a14639d..281d8c5f3 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_ChannelCreateMessage *msg) | 591 | const struct GNUNET_CADET_ChannelCreateMessageMessage *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; |
@@ -1282,7 +1282,7 @@ do_reconnect (struct GNUNET_CADET_Handle *h) | |||
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_CREATE, |
1285 | struct GNUNET_CADET_ChannelCreateMessage, | 1285 | struct GNUNET_CADET_ChannelCreateMessageMessage, |
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_NACK, | 1317 | // GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED, |
1318 | // struct GNUNET_CADET_ChannelDestroyMessage); | 1318 | // struct GNUNET_CADET_ChannelDestroyMessage); |
1319 | GNUNET_MQ_handler_end () | 1319 | GNUNET_MQ_handler_end () |
1320 | }; | 1320 | }; |
@@ -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_ChannelCreateMessage *msg; | 1578 | struct GNUNET_CADET_ChannelCreateMessageMessage *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; |
diff --git a/src/cadet/cadet_common.c b/src/cadet/cadet_common.c index 9a0c58d48..0606aac50 100644 --- a/src/cadet/cadet_common.c +++ b/src/cadet/cadet_common.c | |||
@@ -146,7 +146,7 @@ GC_m2s (uint16_t m) | |||
146 | /** | 146 | /** |
147 | * Request the modification of an existing path | 147 | * Request the modification of an existing path |
148 | */ | 148 | */ |
149 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK: | 149 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK: |
150 | s = "CONN_ACK"; | 150 | s = "CONN_ACK"; |
151 | break; | 151 | break; |
152 | 152 | ||
@@ -160,35 +160,35 @@ GC_m2s (uint16_t m) | |||
160 | /** | 160 | /** |
161 | * At some point, the route will spontaneously change | 161 | * At some point, the route will spontaneously change |
162 | */ | 162 | */ |
163 | case GNUNET_MESSAGE_TYPE_CADET_PATH_CHANGED: | 163 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_PATH_CHANGED_UNIMPLEMENTED: |
164 | s = "PATH_CHNGD"; | 164 | s = "PATH_CHNGD"; |
165 | break; | 165 | break; |
166 | 166 | ||
167 | /** | 167 | /** |
168 | * Transport payload data. | 168 | * Transport payload data. |
169 | */ | 169 | */ |
170 | case GNUNET_MESSAGE_TYPE_CADET_DATA: | 170 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_DATA_ACK: | 177 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
178 | s = "DATA_ACK"; | 178 | s = "DATA_ACK"; |
179 | break; | 179 | break; |
180 | 180 | ||
181 | /** | 181 | /** |
182 | * Key exchange message. | 182 | * Key exchange message. |
183 | */ | 183 | */ |
184 | case GNUNET_MESSAGE_TYPE_CADET_KX: | 184 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX: |
185 | s = "KX"; | 185 | s = "KX"; |
186 | break; | 186 | break; |
187 | 187 | ||
188 | /** | 188 | /** |
189 | * Encrypted. | 189 | * Encrypted. |
190 | */ | 190 | */ |
191 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED: | 191 | case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED: |
192 | s = "ENCRYPTED"; | 192 | s = "ENCRYPTED"; |
193 | break; | 193 | break; |
194 | 194 | ||
@@ -202,21 +202,21 @@ 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_ACK: | 205 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_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_POLL: | 212 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL: |
213 | s = "POLL"; | 213 | s = "POLL"; |
214 | break; | 214 | break; |
215 | 215 | ||
216 | /** | 216 | /** |
217 | * Announce origin is still alive. | 217 | * Announce origin is still alive. |
218 | */ | 218 | */ |
219 | case GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE: | 219 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE: |
220 | s = "KEEPALIVE"; | 220 | s = "KEEPALIVE"; |
221 | break; | 221 | break; |
222 | 222 | ||
@@ -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_ACK: | 254 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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_NACK: | 261 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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 c63337c95..c45c4c684 100644 --- a/src/cadet/cadet_protocol.h +++ b/src/cadet/cadet_protocol.h | |||
@@ -56,12 +56,12 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
56 | /** | 56 | /** |
57 | * Message for cadet connection creation. | 57 | * Message for cadet connection creation. |
58 | */ | 58 | */ |
59 | struct GNUNET_CADET_ConnectionCreate | 59 | struct GNUNET_CADET_ConnectionCreateMessage |
60 | { | 60 | { |
61 | /** | 61 | /** |
62 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE | 62 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE |
63 | * | 63 | * |
64 | * Size: sizeof (struct GNUNET_CADET_ConnectionCreate) + | 64 | * Size: sizeof (struct GNUNET_CADET_ConnectionCreateMessage) + |
65 | * path_length * sizeof (struct GNUNET_PeerIdentity) | 65 | * path_length * sizeof (struct GNUNET_PeerIdentity) |
66 | */ | 66 | */ |
67 | struct GNUNET_MessageHeader header; | 67 | struct GNUNET_MessageHeader header; |
@@ -87,10 +87,10 @@ struct GNUNET_CADET_ConnectionCreate | |||
87 | /** | 87 | /** |
88 | * Message for ack'ing a connection | 88 | * Message for ack'ing a connection |
89 | */ | 89 | */ |
90 | struct GNUNET_CADET_ConnectionACK | 90 | struct GNUNET_CADET_ConnectionCreateMessageAckMessage |
91 | { | 91 | { |
92 | /** | 92 | /** |
93 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK | 93 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK |
94 | */ | 94 | */ |
95 | struct GNUNET_MessageHeader header; | 95 | struct GNUNET_MessageHeader header; |
96 | 96 | ||
@@ -110,7 +110,7 @@ struct GNUNET_CADET_ConnectionACK | |||
110 | /** | 110 | /** |
111 | * Message for notifying a disconnection in a path | 111 | * Message for notifying a disconnection in a path |
112 | */ | 112 | */ |
113 | struct GNUNET_CADET_ConnectionBroken | 113 | struct GNUNET_CADET_ConnectionBrokenMessage |
114 | { | 114 | { |
115 | /** | 115 | /** |
116 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN | 116 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN |
@@ -142,7 +142,7 @@ struct GNUNET_CADET_ConnectionBroken | |||
142 | /** | 142 | /** |
143 | * Message to destroy a connection. | 143 | * Message to destroy a connection. |
144 | */ | 144 | */ |
145 | struct GNUNET_CADET_ConnectionDestroy | 145 | struct GNUNET_CADET_ConnectionDestroyMessage |
146 | { | 146 | { |
147 | /** | 147 | /** |
148 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY | 148 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY |
@@ -164,10 +164,10 @@ struct GNUNET_CADET_ConnectionDestroy | |||
164 | /** | 164 | /** |
165 | * Message to acknowledge cadet encrypted traffic. | 165 | * Message to acknowledge cadet encrypted traffic. |
166 | */ | 166 | */ |
167 | struct GNUNET_CADET_ACK | 167 | struct GNUNET_CADET_ConnectionEncryptedAckMessage |
168 | { | 168 | { |
169 | /** | 169 | /** |
170 | * Type: #GNUNET_MESSAGE_TYPE_CADET_ACK | 170 | * Type: #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK |
171 | */ | 171 | */ |
172 | struct GNUNET_MessageHeader header; | 172 | struct GNUNET_MessageHeader header; |
173 | 173 | ||
@@ -186,10 +186,10 @@ struct GNUNET_CADET_ACK | |||
186 | /** | 186 | /** |
187 | * Message to query a peer about its Flow Control status regarding a tunnel. | 187 | * Message to query a peer about its Flow Control status regarding a tunnel. |
188 | */ | 188 | */ |
189 | struct GNUNET_CADET_Poll | 189 | struct GNUNET_CADET_ConnectionHopByHopPollMessage |
190 | { | 190 | { |
191 | /** | 191 | /** |
192 | * Type: #GNUNET_MESSAGE_TYPE_CADET_POLL | 192 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL |
193 | */ | 193 | */ |
194 | struct GNUNET_MessageHeader header; | 194 | struct GNUNET_MessageHeader header; |
195 | 195 | ||
@@ -231,10 +231,10 @@ enum GNUNET_CADET_KX_Flags { | |||
231 | /** | 231 | /** |
232 | * Message for a Key eXchange for a tunnel. | 232 | * Message for a Key eXchange for a tunnel. |
233 | */ | 233 | */ |
234 | struct GNUNET_CADET_KX | 234 | struct GNUNET_CADET_TunnelKeyExchangeMessage |
235 | { | 235 | { |
236 | /** | 236 | /** |
237 | * Type: #GNUNET_MESSAGE_TYPE_CADET_KX. | 237 | * Type: #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX. |
238 | */ | 238 | */ |
239 | struct GNUNET_MessageHeader header; | 239 | struct GNUNET_MessageHeader header; |
240 | 240 | ||
@@ -268,10 +268,10 @@ struct GNUNET_CADET_KX | |||
268 | /** | 268 | /** |
269 | * Axolotl tunnel message. | 269 | * Axolotl tunnel message. |
270 | */ | 270 | */ |
271 | struct GNUNET_CADET_Encrypted | 271 | struct GNUNET_CADET_ConnectionEncryptedMessage |
272 | { | 272 | { |
273 | /** | 273 | /** |
274 | * Type: #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED | 274 | * Type: #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED |
275 | */ | 275 | */ |
276 | struct GNUNET_MessageHeader header; | 276 | struct GNUNET_MessageHeader header; |
277 | 277 | ||
@@ -327,7 +327,7 @@ struct GNUNET_CADET_Encrypted | |||
327 | /** | 327 | /** |
328 | * Message to create a Channel. | 328 | * Message to create a Channel. |
329 | */ | 329 | */ |
330 | struct GNUNET_CADET_ChannelCreate | 330 | struct GNUNET_CADET_ChannelCreateMessage |
331 | { | 331 | { |
332 | /** | 332 | /** |
333 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE | 333 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE |
@@ -355,7 +355,7 @@ struct GNUNET_CADET_ChannelCreate | |||
355 | /** | 355 | /** |
356 | * Message to manage a Channel (ACK, NACK, Destroy). | 356 | * Message to manage a Channel (ACK, NACK, Destroy). |
357 | */ | 357 | */ |
358 | struct GNUNET_CADET_ChannelManage | 358 | struct GNUNET_CADET_ChannelManageMessage |
359 | { | 359 | { |
360 | /** | 360 | /** |
361 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_{ACK|NACK|DESTROY} | 361 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_{ACK|NACK|DESTROY} |
@@ -374,7 +374,7 @@ struct GNUNET_CADET_ChannelManage | |||
374 | /** | 374 | /** |
375 | * Message for cadet data traffic. | 375 | * Message for cadet data traffic. |
376 | */ | 376 | */ |
377 | struct GNUNET_CADET_Data | 377 | struct GNUNET_CADET_ChannelDataMessage |
378 | { | 378 | { |
379 | /** | 379 | /** |
380 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, | 380 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, |
@@ -401,10 +401,10 @@ struct GNUNET_CADET_Data | |||
401 | /** | 401 | /** |
402 | * Message to acknowledge end-to-end data. | 402 | * Message to acknowledge end-to-end data. |
403 | */ | 403 | */ |
404 | struct GNUNET_CADET_DataACK | 404 | struct GNUNET_CADET_ChannelDataAckMessage |
405 | { | 405 | { |
406 | /** | 406 | /** |
407 | * Type: GNUNET_MESSAGE_TYPE_CADET_DATA_ACK | 407 | * Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK |
408 | */ | 408 | */ |
409 | struct GNUNET_MessageHeader header; | 409 | struct GNUNET_MessageHeader header; |
410 | 410 | ||
diff --git a/src/cadet/gnunet-service-cadet-new.c b/src/cadet/gnunet-service-cadet-new.c index c8cd2fc63..64bb25403 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_ChannelCreateMessage *msg; | 275 | struct GNUNET_CADET_ChannelCreateMessageMessage *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); |
@@ -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_ChannelCreateMessage *ccm) | 467 | const struct GNUNET_CADET_ChannelCreateMessageMessage *ccm) |
468 | { | 468 | { |
469 | struct CadetClient *c = cls; | 469 | struct CadetClient *c = cls; |
470 | struct CadetChannel *ch; | 470 | struct CadetChannel *ch; |
@@ -1311,7 +1311,7 @@ GNUNET_SERVICE_MAIN | |||
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_CREATE, |
1314 | struct GNUNET_CADET_ChannelCreateMessage, | 1314 | struct GNUNET_CADET_ChannelCreateMessageMessage, |
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 00bdf569e..fb6379de5 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -68,7 +68,7 @@ struct ChannelMessageIdentifier | |||
68 | /** | 68 | /** |
69 | * Message to create a Channel. | 69 | * Message to create a Channel. |
70 | */ | 70 | */ |
71 | struct GNUNET_CADET_ChannelCreate | 71 | struct GNUNET_CADET_ChannelCreateMessage |
72 | { | 72 | { |
73 | /** | 73 | /** |
74 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE | 74 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE |
@@ -96,7 +96,7 @@ struct GNUNET_CADET_ChannelCreate | |||
96 | /** | 96 | /** |
97 | * Message for cadet data traffic. | 97 | * Message for cadet data traffic. |
98 | */ | 98 | */ |
99 | struct GNUNET_CADET_Data | 99 | struct GNUNET_CADET_ChannelDataMessage |
100 | { | 100 | { |
101 | /** | 101 | /** |
102 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, | 102 | * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST, |
@@ -123,10 +123,10 @@ struct GNUNET_CADET_Data | |||
123 | /** | 123 | /** |
124 | * Message to acknowledge end-to-end data. | 124 | * Message to acknowledge end-to-end data. |
125 | */ | 125 | */ |
126 | struct GNUNET_CADET_DataACK | 126 | struct GNUNET_CADET_ChannelDataAckMessage |
127 | { | 127 | { |
128 | /** | 128 | /** |
129 | * Type: #GNUNET_MESSAGE_TYPE_CADET_DATA_ACK | 129 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_Data data_message; | 222 | struct GNUNET_CADET_ChannelDataMessage data_message; |
223 | 223 | ||
224 | /* followed by variable-size payload */ | 224 | /* followed by variable-size payload */ |
225 | }; | 225 | }; |
@@ -266,7 +266,7 @@ struct CadetChannel | |||
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_CREATE or |
269 | * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK). Used to cancel | 269 | * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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_ChannelCreate msgcc; | 534 | struct GNUNET_CADET_ChannelCreateMessage msgcc; |
535 | uint32_t options; | 535 | uint32_t options; |
536 | 536 | ||
537 | options = 0; | 537 | options = 0; |
@@ -696,9 +696,9 @@ send_ack_cb (void *cls) | |||
696 | static void | 696 | static void |
697 | send_channel_ack (struct CadetChannel *ch) | 697 | send_channel_ack (struct CadetChannel *ch) |
698 | { | 698 | { |
699 | struct GNUNET_CADET_DataACK msg; | 699 | struct GNUNET_CADET_ChannelDataAckMessage msg; |
700 | 700 | ||
701 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA_ACK); | 701 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_Data) + payload_size); | 1006 | crm->data_message.header.size = htons (sizeof (struct GNUNET_CADET_ChannelDataMessage) + payload_size); |
1007 | crm->data_message.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA); | 1007 | crm->data_message.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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 ff0579dc2..95342d631 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.c +++ b/src/cadet/gnunet-service-cadet-new_connection.c | |||
@@ -190,7 +190,7 @@ GCC_destroy (struct CadetConnection *cc) | |||
190 | { | 190 | { |
191 | /* Need to notify next hop that we are down. */ | 191 | /* Need to notify next hop that we are down. */ |
192 | struct GNUNET_MQ_Envelope *env; | 192 | struct GNUNET_MQ_Envelope *env; |
193 | struct GNUNET_CADET_ConnectionDestroy *destroy_msg; | 193 | struct GNUNET_CADET_ConnectionDestroyMessage *destroy_msg; |
194 | 194 | ||
195 | env = GNUNET_MQ_msg (destroy_msg, | 195 | env = GNUNET_MQ_msg (destroy_msg, |
196 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY); | 196 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY); |
@@ -253,7 +253,7 @@ GCC_handle_connection_ack (struct CadetConnection *cc) | |||
253 | */ | 253 | */ |
254 | void | 254 | void |
255 | GCC_handle_kx (struct CadetConnection *cc, | 255 | GCC_handle_kx (struct CadetConnection *cc, |
256 | const struct GNUNET_CADET_KX *msg) | 256 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
257 | { | 257 | { |
258 | GCT_handle_kx (cc->ct, | 258 | GCT_handle_kx (cc->ct, |
259 | msg); | 259 | msg); |
@@ -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_Encrypted *msg) | 271 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) |
272 | { | 272 | { |
273 | GCT_handle_encrypted (cc->ct, | 273 | GCT_handle_encrypted (cc->ct, |
274 | msg); | 274 | msg); |
@@ -314,7 +314,7 @@ static void | |||
314 | send_create (void *cls) | 314 | send_create (void *cls) |
315 | { | 315 | { |
316 | struct CadetConnection *cc = cls; | 316 | struct CadetConnection *cc = cls; |
317 | struct GNUNET_CADET_ConnectionCreate *create_msg; | 317 | struct GNUNET_CADET_ConnectionCreateMessage *create_msg; |
318 | struct GNUNET_PeerIdentity *pids; | 318 | struct GNUNET_PeerIdentity *pids; |
319 | struct GNUNET_MQ_Envelope *env; | 319 | struct GNUNET_MQ_Envelope *env; |
320 | unsigned int path_length; | 320 | unsigned int path_length; |
diff --git a/src/cadet/gnunet-service-cadet-new_connection.h b/src/cadet/gnunet-service-cadet-new_connection.h index 515863aad..440fb9019 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.h +++ b/src/cadet/gnunet-service-cadet-new_connection.h | |||
@@ -107,7 +107,7 @@ GCC_handle_connection_ack (struct CadetConnection *cc); | |||
107 | */ | 107 | */ |
108 | void | 108 | void |
109 | GCC_handle_kx (struct CadetConnection *cc, | 109 | GCC_handle_kx (struct CadetConnection *cc, |
110 | const struct GNUNET_CADET_KX *msg); | 110 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); |
111 | 111 | ||
112 | 112 | ||
113 | /** | 113 | /** |
@@ -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_Encrypted *msg); | 121 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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 943191a0b..b925200a6 100644 --- a/src/cadet/gnunet-service-cadet-new_core.c +++ b/src/cadet/gnunet-service-cadet-new_core.c | |||
@@ -113,7 +113,7 @@ route_message (struct CadetPeer *prev, | |||
113 | if (NULL == route) | 113 | if (NULL == route) |
114 | { | 114 | { |
115 | struct GNUNET_MQ_Envelope *env; | 115 | struct GNUNET_MQ_Envelope *env; |
116 | struct GNUNET_CADET_ConnectionBroken *bm; | 116 | struct GNUNET_CADET_ConnectionBrokenMessage *bm; |
117 | 117 | ||
118 | env = GNUNET_MQ_msg (bm, | 118 | env = GNUNET_MQ_msg (bm, |
119 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN); | 119 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN); |
@@ -138,7 +138,7 @@ route_message (struct CadetPeer *prev, | |||
138 | */ | 138 | */ |
139 | static int | 139 | static int |
140 | check_create (void *cls, | 140 | check_create (void *cls, |
141 | const struct GNUNET_CADET_ConnectionCreate *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 | ||
@@ -171,7 +171,7 @@ destroy_route (struct CadetRoute *route) | |||
171 | */ | 171 | */ |
172 | static void | 172 | static void |
173 | handle_create (void *cls, | 173 | handle_create (void *cls, |
174 | const struct GNUNET_CADET_ConnectionCreate *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); |
@@ -188,14 +188,14 @@ handle_create (void *cls, | |||
188 | 188 | ||
189 | 189 | ||
190 | /** | 190 | /** |
191 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK | 191 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK |
192 | * | 192 | * |
193 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 193 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
194 | * @param msg Message itself. | 194 | * @param msg Message itself. |
195 | */ | 195 | */ |
196 | static void | 196 | static void |
197 | handle_connection_ack (void *cls, | 197 | handle_connection_ack (void *cls, |
198 | const struct GNUNET_CADET_ConnectionACK *msg) | 198 | const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg) |
199 | { | 199 | { |
200 | struct CadetPeer *peer = cls; | 200 | struct CadetPeer *peer = cls; |
201 | struct CadetConnection *cc; | 201 | struct CadetConnection *cc; |
@@ -236,7 +236,7 @@ handle_connection_ack (void *cls, | |||
236 | */ | 236 | */ |
237 | static void | 237 | static void |
238 | handle_broken (void *cls, | 238 | handle_broken (void *cls, |
239 | const struct GNUNET_CADET_ConnectionBroken *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; |
@@ -282,7 +282,7 @@ handle_broken (void *cls, | |||
282 | */ | 282 | */ |
283 | static void | 283 | static void |
284 | handle_destroy (void *cls, | 284 | handle_destroy (void *cls, |
285 | const struct GNUNET_CADET_ConnectionDestroy *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,14 +318,14 @@ handle_destroy (void *cls, | |||
318 | 318 | ||
319 | 319 | ||
320 | /** | 320 | /** |
321 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ACK | 321 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_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_ack (void *cls, |
328 | const struct GNUNET_CADET_ACK *msg) | 328 | const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg) |
329 | { | 329 | { |
330 | struct CadetPeer *peer = cls; | 330 | struct CadetPeer *peer = cls; |
331 | 331 | ||
@@ -337,14 +337,14 @@ handle_ack (void *cls, | |||
337 | 337 | ||
338 | 338 | ||
339 | /** | 339 | /** |
340 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_POLL | 340 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_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. |
344 | */ | 344 | */ |
345 | static void | 345 | static void |
346 | handle_poll (void *cls, | 346 | handle_poll (void *cls, |
347 | const struct GNUNET_CADET_Poll *msg) | 347 | const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg) |
348 | { | 348 | { |
349 | struct CadetPeer *peer = cls; | 349 | struct CadetPeer *peer = cls; |
350 | 350 | ||
@@ -356,14 +356,14 @@ handle_poll (void *cls, | |||
356 | 356 | ||
357 | 357 | ||
358 | /** | 358 | /** |
359 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_KX | 359 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX |
360 | * | 360 | * |
361 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 361 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
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_kx (void *cls, |
366 | const struct GNUNET_CADET_KX *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; |
@@ -406,21 +406,21 @@ handle_kx (void *cls, | |||
406 | */ | 406 | */ |
407 | static int | 407 | static int |
408 | check_encrypted (void *cls, | 408 | check_encrypted (void *cls, |
409 | const struct GNUNET_CADET_Encrypted *msg) | 409 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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_CADET_ENCRYPTED. | 416 | * Handle for #GNUNET_MESSAGE_TYPE_CONNECTION_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_encrypted (void *cls, |
423 | const struct GNUNET_CADET_Encrypted *msg) | 423 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) |
424 | { | 424 | { |
425 | struct CadetPeer *peer = cls; | 425 | struct CadetPeer *peer = cls; |
426 | struct CadetConnection *cc; | 426 | struct CadetConnection *cc; |
@@ -534,35 +534,35 @@ GCO_init (const struct GNUNET_CONFIGURATION_Handle *c) | |||
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 (create, |
536 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, | 536 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, |
537 | struct GNUNET_CADET_ConnectionCreate, | 537 | struct GNUNET_CADET_ConnectionCreateMessage, |
538 | NULL), | 538 | NULL), |
539 | GNUNET_MQ_hd_fixed_size (connection_ack, | 539 | GNUNET_MQ_hd_fixed_size (connection_ack, |
540 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK, | 540 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, |
541 | struct GNUNET_CADET_ConnectionACK, | 541 | struct GNUNET_CADET_ConnectionCreateMessageAckMessage, |
542 | NULL), | 542 | NULL), |
543 | GNUNET_MQ_hd_fixed_size (broken, | 543 | GNUNET_MQ_hd_fixed_size (broken, |
544 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, | 544 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, |
545 | struct GNUNET_CADET_ConnectionBroken, | 545 | struct GNUNET_CADET_ConnectionBrokenMessage, |
546 | NULL), | 546 | NULL), |
547 | GNUNET_MQ_hd_fixed_size (destroy, | 547 | GNUNET_MQ_hd_fixed_size (destroy, |
548 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, | 548 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, |
549 | struct GNUNET_CADET_ConnectionDestroy, | 549 | struct GNUNET_CADET_ConnectionDestroyMessage, |
550 | NULL), | 550 | NULL), |
551 | GNUNET_MQ_hd_fixed_size (ack, | 551 | GNUNET_MQ_hd_fixed_size (ack, |
552 | GNUNET_MESSAGE_TYPE_CADET_ACK, | 552 | GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK, |
553 | struct GNUNET_CADET_ACK, | 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_POLL, | 556 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL, |
557 | struct GNUNET_CADET_Poll, | 557 | struct GNUNET_CADET_ConnectionHopByHopPollMessage, |
558 | NULL), | 558 | NULL), |
559 | GNUNET_MQ_hd_fixed_size (kx, | 559 | GNUNET_MQ_hd_fixed_size (kx, |
560 | GNUNET_MESSAGE_TYPE_CADET_KX, | 560 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX, |
561 | struct GNUNET_CADET_KX, | 561 | struct GNUNET_CADET_TunnelKeyExchangeMessage, |
562 | NULL), | 562 | NULL), |
563 | GNUNET_MQ_hd_var_size (encrypted, | 563 | GNUNET_MQ_hd_var_size (encrypted, |
564 | GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED, | 564 | GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED, |
565 | struct GNUNET_CADET_Encrypted, | 565 | struct GNUNET_CADET_ConnectionEncryptedMessage, |
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 74e56aa35..2425a4503 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_Encrypted *msg) | 765 | struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted *src, | 794 | const struct GNUNET_CADET_ConnectionEncryptedMessage *src, |
795 | struct GNUNET_CADET_Encrypted *dst) | 795 | struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted *src, | 846 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted plaintext_header; | 852 | struct GNUNET_CADET_ConnectionEncryptedMessage 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_Encrypted); | 862 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
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_Encrypted)); | 885 | GNUNET_assert (size > sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage)); |
886 | len = size - sizeof (struct GNUNET_CADET_Encrypted); | 886 | len = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
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_Encrypted *src, | 1024 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted plaintext_header; | 1030 | struct GNUNET_CADET_ConnectionEncryptedMessage 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_Encrypted); | 1035 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
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_Data *msg) | 1414 | const struct GNUNET_CADET_ChannelDataMessage *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_Data *msg) | 1428 | const struct GNUNET_CADET_ChannelDataMessage *msg) |
1429 | { | 1429 | { |
1430 | struct CadetTunnel *t = cls; | 1430 | struct CadetTunnel *t = cls; |
1431 | GNUNET_break (0); // FIXME! | 1431 | GNUNET_break (0); // FIXME! |
@@ -1440,7 +1440,7 @@ handle_plaintext_data (void *cls, | |||
1440 | */ | 1440 | */ |
1441 | static void | 1441 | static void |
1442 | handle_plaintext_data_ack (void *cls, | 1442 | handle_plaintext_data_ack (void *cls, |
1443 | const struct GNUNET_CADET_DataACK *ack) | 1443 | const struct GNUNET_CADET_ChannelDataAckMessage *ack) |
1444 | { | 1444 | { |
1445 | struct CadetTunnel *t = cls; | 1445 | struct CadetTunnel *t = cls; |
1446 | GNUNET_break (0); // FIXME! | 1446 | 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_ChannelCreate *cc) | 1458 | const struct GNUNET_CADET_ChannelCreateMessage *cc) |
1459 | { | 1459 | { |
1460 | struct CadetTunnel *t = cls; | 1460 | struct CadetTunnel *t = cls; |
1461 | GNUNET_break (0); // FIXME! | 1461 | GNUNET_break (0); // FIXME! |
@@ -1470,7 +1470,7 @@ handle_plaintext_channel_create (void *cls, | |||
1470 | */ | 1470 | */ |
1471 | static void | 1471 | static void |
1472 | handle_plaintext_channel_nack (void *cls, | 1472 | handle_plaintext_channel_nack (void *cls, |
1473 | const struct GNUNET_CADET_ChannelManage *cm) | 1473 | const struct GNUNET_CADET_ChannelManageMessage *cm) |
1474 | { | 1474 | { |
1475 | struct CadetTunnel *t = cls; | 1475 | struct CadetTunnel *t = cls; |
1476 | GNUNET_break (0); // FIXME! | 1476 | GNUNET_break (0); // FIXME! |
@@ -1485,7 +1485,7 @@ handle_plaintext_channel_nack (void *cls, | |||
1485 | */ | 1485 | */ |
1486 | static void | 1486 | static void |
1487 | handle_plaintext_channel_ack (void *cls, | 1487 | handle_plaintext_channel_ack (void *cls, |
1488 | const struct GNUNET_CADET_ChannelManage *cm) | 1488 | const struct GNUNET_CADET_ChannelManageMessage *cm) |
1489 | { | 1489 | { |
1490 | struct CadetTunnel *t = cls; | 1490 | struct CadetTunnel *t = cls; |
1491 | GNUNET_break (0); // FIXME! | 1491 | GNUNET_break (0); // FIXME! |
@@ -1500,7 +1500,7 @@ handle_plaintext_channel_ack (void *cls, | |||
1500 | */ | 1500 | */ |
1501 | static void | 1501 | static void |
1502 | handle_plaintext_channel_destroy (void *cls, | 1502 | handle_plaintext_channel_destroy (void *cls, |
1503 | const struct GNUNET_CADET_ChannelManage *cm) | 1503 | const struct GNUNET_CADET_ChannelManageMessage *cm) |
1504 | { | 1504 | { |
1505 | struct CadetTunnel *t = cls; | 1505 | struct CadetTunnel *t = cls; |
1506 | GNUNET_break (0); // FIXME! | 1506 | GNUNET_break (0); // FIXME! |
@@ -1554,32 +1554,32 @@ GCT_create_tunnel (struct CadetPeer *destination) | |||
1554 | { | 1554 | { |
1555 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1555 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1556 | GNUNET_MQ_hd_fixed_size (plaintext_keepalive, | 1556 | GNUNET_MQ_hd_fixed_size (plaintext_keepalive, |
1557 | GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE, | 1557 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE, |
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_DATA, | 1561 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA, |
1562 | struct GNUNET_CADET_Data, | 1562 | struct GNUNET_CADET_ChannelDataMessage, |
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_DATA_ACK, | 1565 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK, |
1566 | struct GNUNET_CADET_DataACK, | 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_CREATE, |
1570 | struct GNUNET_CADET_ChannelCreate, | 1570 | struct GNUNET_CADET_ChannelCreateMessage, |
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_NACK, | 1573 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED, |
1574 | struct GNUNET_CADET_ChannelManage, | 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_ACK, | 1577 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK, |
1578 | struct GNUNET_CADET_ChannelManage, | 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, |
1581 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, | 1581 | GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, |
1582 | struct GNUNET_CADET_ChannelManage, | 1582 | struct GNUNET_CADET_ChannelManageMessage, |
1583 | NULL), | 1583 | NULL), |
1584 | GNUNET_MQ_handler_end () | 1584 | GNUNET_MQ_handler_end () |
1585 | }; | 1585 | }; |
@@ -1678,7 +1678,7 @@ GCT_change_estate (struct CadetTunnel *t, | |||
1678 | */ | 1678 | */ |
1679 | void | 1679 | void |
1680 | GCT_handle_kx (struct CadetTConnection *ct, | 1680 | GCT_handle_kx (struct CadetTConnection *ct, |
1681 | const struct GNUNET_CADET_KX *msg) | 1681 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
1682 | { | 1682 | { |
1683 | GNUNET_break (0); // not implemented | 1683 | GNUNET_break (0); // not implemented |
1684 | } | 1684 | } |
@@ -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_Encrypted *msg) | 1695 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted *ax_msg; | 1761 | struct GNUNET_CADET_ConnectionEncryptedMessage *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_CADET_ENCRYPTED); | 1768 | GNUNET_MESSAGE_TYPE_CONNECTION_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 c0e179771..d565077b0 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.h +++ b/src/cadet/gnunet-service-cadet-new_tunnels.h | |||
@@ -325,7 +325,7 @@ GCT_get_estate (struct CadetTunnel *t); | |||
325 | */ | 325 | */ |
326 | void | 326 | void |
327 | GCT_handle_kx (struct CadetTConnection *ct, | 327 | GCT_handle_kx (struct CadetTConnection *ct, |
328 | const struct GNUNET_CADET_KX *msg); | 328 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); |
329 | 329 | ||
330 | 330 | ||
331 | /** | 331 | /** |
@@ -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_Encrypted *msg); | 339 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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 6bc3dc590..eff6af40b 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_Data with payload */ | 128 | /* struct GNUNET_CADET_ChannelDataMessage 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_Data *msg, uint32_t mid, | 371 | copy_message (const struct GNUNET_CADET_ChannelDataMessage *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_Data *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_DATA; | 381 | copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_Data *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_Data *msg, | 396 | add_buffered_data (const struct GNUNET_CADET_ChannelDataMessage *msg, |
397 | struct CadetChannelReliability *rel) | 397 | struct CadetChannelReliability *rel) |
398 | { | 398 | { |
399 | struct CadetReliableMessage *copy; | 399 | struct CadetReliableMessage *copy; |
@@ -513,7 +513,7 @@ channel_get_options (struct CadetChannel *ch) | |||
513 | static void | 513 | static void |
514 | send_destroy (struct CadetChannel *ch, int local_only) | 514 | send_destroy (struct CadetChannel *ch, int local_only) |
515 | { | 515 | { |
516 | struct GNUNET_CADET_ChannelManage msg; | 516 | struct GNUNET_CADET_ChannelManageMessage msg; |
517 | 517 | ||
518 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY); | 518 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY); |
519 | msg.header.size = htons (sizeof (msg)); | 519 | msg.header.size = htons (sizeof (msg)); |
@@ -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_Data *msg, | 576 | const struct GNUNET_CADET_ChannelDataMessage *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_Data *msg = (struct GNUNET_CADET_Data *) ©[1]; | 634 | struct GNUNET_CADET_ChannelDataMessage *msg = (struct GNUNET_CADET_ChannelDataMessage *) ©[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_Data *payload; | 734 | struct GNUNET_CADET_ChannelDataMessage *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_Data *) ©[1]; | 746 | payload = (struct GNUNET_CADET_ChannelDataMessage *) ©[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_DATA: | 811 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_DATA_ACK: | 847 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
848 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 848 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: |
849 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: | 849 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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_DATA_ACK != type | 856 | && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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,7 +882,7 @@ 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_ChannelCreate msgcc; | 885 | struct GNUNET_CADET_ChannelCreateMessage 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_CREATE); |
@@ -903,10 +903,10 @@ send_create (struct CadetChannel *ch) | |||
903 | static void | 903 | static void |
904 | send_ack (struct CadetChannel *ch, int fwd) | 904 | send_ack (struct CadetChannel *ch, int fwd) |
905 | { | 905 | { |
906 | struct GNUNET_CADET_ChannelManage 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_ACK); | 909 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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)); |
@@ -943,10 +943,10 @@ fire_and_forget (const struct GNUNET_MessageHeader *msg, | |||
943 | static void | 943 | static void |
944 | send_nack (struct CadetChannel *ch) | 944 | send_nack (struct CadetChannel *ch) |
945 | { | 945 | { |
946 | struct GNUNET_CADET_ChannelManage 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_NACK); | 949 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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)); |
@@ -1024,7 +1024,7 @@ channel_rel_free_all (struct CadetChannelReliability *rel) | |||
1024 | */ | 1024 | */ |
1025 | static unsigned int | 1025 | static unsigned int |
1026 | channel_rel_free_sent (struct CadetChannelReliability *rel, | 1026 | channel_rel_free_sent (struct CadetChannelReliability *rel, |
1027 | const struct GNUNET_CADET_DataACK *msg) | 1027 | const struct GNUNET_CADET_ChannelDataAckMessage *msg) |
1028 | { | 1028 | { |
1029 | struct CadetReliableMessage *copy; | 1029 | struct CadetReliableMessage *copy; |
1030 | struct CadetReliableMessage *next; | 1030 | struct CadetReliableMessage *next; |
@@ -1300,35 +1300,35 @@ handle_loopback (struct CadetChannel *ch, | |||
1300 | 1300 | ||
1301 | switch (type) | 1301 | switch (type) |
1302 | { | 1302 | { |
1303 | case GNUNET_MESSAGE_TYPE_CADET_DATA: | 1303 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_Data *) msgh)->mid), ntohs (msgh->size)); | 1306 | ntohl (((struct GNUNET_CADET_ChannelDataMessage *) msgh)->mid), ntohs (msgh->size)); |
1307 | GCCH_handle_data (ch, (struct GNUNET_CADET_Data *) msgh, fwd); | 1307 | GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd); |
1308 | break; | 1308 | break; |
1309 | 1309 | ||
1310 | case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: | 1310 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
1311 | GCCH_handle_data_ack (ch, (struct GNUNET_CADET_DataACK *) 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_CREATE: |
1315 | GCCH_handle_create (ch->t, | 1315 | GCCH_handle_create (ch->t, |
1316 | (struct GNUNET_CADET_ChannelCreate *) msgh); | 1316 | (struct GNUNET_CADET_ChannelCreateMessage *) msgh); |
1317 | break; | 1317 | break; |
1318 | 1318 | ||
1319 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: | 1319 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: |
1320 | GCCH_handle_ack (ch, | 1320 | GCCH_handle_ack (ch, |
1321 | (struct GNUNET_CADET_ChannelManage *) msgh, | 1321 | (struct GNUNET_CADET_ChannelManageMessage *) msgh, |
1322 | fwd); | 1322 | fwd); |
1323 | break; | 1323 | break; |
1324 | 1324 | ||
1325 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: | 1325 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: |
1326 | GCCH_handle_nack (ch); | 1326 | GCCH_handle_nack (ch); |
1327 | break; | 1327 | break; |
1328 | 1328 | ||
1329 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 1329 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
1330 | GCCH_handle_destroy (ch, | 1330 | GCCH_handle_destroy (ch, |
1331 | (struct GNUNET_CADET_ChannelManage *) msgh, | 1331 | (struct GNUNET_CADET_ChannelManageMessage *) msgh, |
1332 | fwd); | 1332 | fwd); |
1333 | break; | 1333 | break; |
1334 | 1334 | ||
@@ -1523,7 +1523,7 @@ GCCH_is_terminal (struct CadetChannel *ch, int fwd) | |||
1523 | void | 1523 | void |
1524 | GCCH_send_data_ack (struct CadetChannel *ch, int fwd) | 1524 | GCCH_send_data_ack (struct CadetChannel *ch, int fwd) |
1525 | { | 1525 | { |
1526 | struct GNUNET_CADET_DataACK msg; | 1526 | struct GNUNET_CADET_ChannelDataAckMessage msg; |
1527 | struct CadetChannelReliability *rel; | 1527 | struct CadetChannelReliability *rel; |
1528 | struct CadetReliableMessage *copy; | 1528 | struct CadetReliableMessage *copy; |
1529 | unsigned int delta; | 1529 | unsigned int delta; |
@@ -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_DATA_ACK); | 1539 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_DATA) | 1547 | if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_Data *payload; | 1751 | struct GNUNET_CADET_ChannelDataMessage *payload; |
1752 | uint16_t p2p_size = sizeof(struct GNUNET_CADET_Data) + size; | 1752 | uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelDataMessage) + 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_Data *) cbuf; | 1778 | payload = (struct GNUNET_CADET_ChannelDataMessage *) 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_DATA); | 1783 | payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_ChannelCreateMessage *msg) | 1849 | struct GNUNET_CADET_ChannelCreateMessageMessage *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_Data *msg, | 1917 | const struct GNUNET_CADET_ChannelDataMessage *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_DATA), GC_m2s (payload_type), mid, | 1975 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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) || |
@@ -2044,7 +2044,7 @@ GCCH_handle_data (struct CadetChannel *ch, | |||
2044 | */ | 2044 | */ |
2045 | void | 2045 | void |
2046 | GCCH_handle_data_ack (struct CadetChannel *ch, | 2046 | GCCH_handle_data_ack (struct CadetChannel *ch, |
2047 | const struct GNUNET_CADET_DataACK *msg, | 2047 | const struct GNUNET_CADET_ChannelDataAckMessage *msg, |
2048 | int fwd) | 2048 | int fwd) |
2049 | { | 2049 | { |
2050 | struct CadetChannelReliability *rel; | 2050 | struct CadetChannelReliability *rel; |
@@ -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_DATA_ACK), msg->futures, ack, | 2072 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_ChannelCreate *msg) | 2154 | const struct GNUNET_CADET_ChannelCreateMessage *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; |
@@ -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_NACK), ch->gid, 0, | 2255 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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); |
@@ -2272,12 +2272,12 @@ GCCH_handle_nack (struct CadetChannel *ch) | |||
2272 | */ | 2272 | */ |
2273 | void | 2273 | void |
2274 | GCCH_handle_ack (struct CadetChannel *ch, | 2274 | GCCH_handle_ack (struct CadetChannel *ch, |
2275 | const struct GNUNET_CADET_ChannelManage *msg, | 2275 | const struct GNUNET_CADET_ChannelManageMessage *msg, |
2276 | int fwd) | 2276 | int fwd) |
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_ACK), ch->gid, 0, | 2280 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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'. */ |
@@ -2308,7 +2308,7 @@ GCCH_handle_ack (struct CadetChannel *ch, | |||
2308 | */ | 2308 | */ |
2309 | void | 2309 | void |
2310 | GCCH_handle_destroy (struct CadetChannel *ch, | 2310 | GCCH_handle_destroy (struct CadetChannel *ch, |
2311 | const struct GNUNET_CADET_ChannelManage *msg, | 2311 | const struct GNUNET_CADET_ChannelManageMessage *msg, |
2312 | int fwd) | 2312 | int fwd) |
2313 | { | 2313 | { |
2314 | struct CadetChannelReliability *rel; | 2314 | struct CadetChannelReliability *rel; |
@@ -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_DATA: | 2386 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: |
2387 | { | 2387 | { |
2388 | struct GNUNET_CADET_Data *data_msg; | 2388 | struct GNUNET_CADET_ChannelDataMessage *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_Data *) message; | 2392 | data_msg = (struct GNUNET_CADET_ChannelDataMessage *) 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,10 +2397,10 @@ 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_DATA_ACK: | 2400 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
2401 | { | 2401 | { |
2402 | struct GNUNET_CADET_DataACK *ack_msg; | 2402 | struct GNUNET_CADET_ChannelDataAckMessage *ack_msg; |
2403 | ack_msg = (struct GNUNET_CADET_DataACK *) message; | 2403 | ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message; |
2404 | data_id = ntohl (ack_msg->mid); | 2404 | data_id = ntohl (ack_msg->mid); |
2405 | SPRINTF (info, "0x%010lX", | 2405 | SPRINTF (info, "0x%010lX", |
2406 | (unsigned long int) ack_msg->futures); | 2406 | (unsigned long int) ack_msg->futures); |
@@ -2408,17 +2408,17 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2408 | } | 2408 | } |
2409 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 2409 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: |
2410 | { | 2410 | { |
2411 | struct GNUNET_CADET_ChannelCreate *cc_msg; | 2411 | struct GNUNET_CADET_ChannelCreateMessage *cc_msg; |
2412 | cc_msg = (struct GNUNET_CADET_ChannelCreate *) message; | 2412 | cc_msg = (struct GNUNET_CADET_ChannelCreateMessage *) 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_ACK: | 2416 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: |
2417 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: | 2417 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: |
2418 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 2418 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
2419 | { | 2419 | { |
2420 | struct GNUNET_CADET_ChannelManage *m_msg; | 2420 | struct GNUNET_CADET_ChannelManageMessage *m_msg; |
2421 | m_msg = (struct GNUNET_CADET_ChannelManage *) message; | 2421 | m_msg = (struct GNUNET_CADET_ChannelManageMessage *) message; |
2422 | SPRINTF (info, " 0x%08X", ntohl (m_msg->chid.cn)); | 2422 | SPRINTF (info, " 0x%08X", ntohl (m_msg->chid.cn)); |
2423 | break; | 2423 | break; |
2424 | } | 2424 | } |
@@ -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_DATA: | 2441 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_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_DATA_ACK: | 2487 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
2488 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 2488 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: |
2489 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: | 2489 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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_NACK: | 2524 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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 8faad2e86..c6a1df9ff 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_ChannelCreateMessage *msg); | 227 | struct GNUNET_CADET_ChannelCreateMessageMessage *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_Data *msg, | 241 | const struct GNUNET_CADET_ChannelDataMessage *msg, |
242 | int fwd); | 242 | int fwd); |
243 | 243 | ||
244 | 244 | ||
@@ -254,7 +254,7 @@ GCCH_handle_data (struct CadetChannel *ch, | |||
254 | */ | 254 | */ |
255 | void | 255 | void |
256 | GCCH_handle_data_ack (struct CadetChannel *ch, | 256 | GCCH_handle_data_ack (struct CadetChannel *ch, |
257 | const struct GNUNET_CADET_DataACK *msg, | 257 | const struct GNUNET_CADET_ChannelDataAckMessage *msg, |
258 | int fwd); | 258 | int fwd); |
259 | 259 | ||
260 | 260 | ||
@@ -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_ChannelCreate *msg); | 271 | const struct GNUNET_CADET_ChannelCreateMessage *msg); |
272 | 272 | ||
273 | 273 | ||
274 | /** | 274 | /** |
@@ -294,7 +294,7 @@ GCCH_handle_nack (struct CadetChannel *ch); | |||
294 | */ | 294 | */ |
295 | void | 295 | void |
296 | GCCH_handle_ack (struct CadetChannel *ch, | 296 | GCCH_handle_ack (struct CadetChannel *ch, |
297 | const struct GNUNET_CADET_ChannelManage *msg, | 297 | const struct GNUNET_CADET_ChannelManageMessage *msg, |
298 | int fwd); | 298 | int fwd); |
299 | 299 | ||
300 | 300 | ||
@@ -310,7 +310,7 @@ GCCH_handle_ack (struct CadetChannel *ch, | |||
310 | */ | 310 | */ |
311 | void | 311 | void |
312 | GCCH_handle_destroy (struct CadetChannel *ch, | 312 | GCCH_handle_destroy (struct CadetChannel *ch, |
313 | const struct GNUNET_CADET_ChannelManage *msg, | 313 | const struct GNUNET_CADET_ChannelManageMessage *msg, |
314 | int fwd); | 314 | int fwd); |
315 | 315 | ||
316 | 316 | ||
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 500511ce4..351bf2d3c 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -549,7 +549,7 @@ send_ack (struct CadetConnection *c, | |||
549 | { | 549 | { |
550 | struct CadetFlowControl *next_fc; | 550 | struct CadetFlowControl *next_fc; |
551 | struct CadetFlowControl *prev_fc; | 551 | struct CadetFlowControl *prev_fc; |
552 | struct GNUNET_CADET_ACK msg; | 552 | struct GNUNET_CADET_ConnectionEncryptedAckMessage msg; |
553 | uint32_t ack; | 553 | uint32_t ack; |
554 | int delta; | 554 | int delta; |
555 | 555 | ||
@@ -609,7 +609,7 @@ send_ack (struct CadetConnection *c, | |||
609 | 609 | ||
610 | /* Build ACK message and send on conn */ | 610 | /* Build ACK message and send on conn */ |
611 | msg.header.size = htons (sizeof (msg)); | 611 | msg.header.size = htons (sizeof (msg)); |
612 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_ACK); | 612 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK); |
613 | msg.ack = htonl (ack); | 613 | msg.ack = htonl (ack); |
614 | msg.cid = c->id; | 614 | msg.cid = c->id; |
615 | 615 | ||
@@ -730,7 +730,7 @@ conn_message_sent (void *cls, | |||
730 | } | 730 | } |
731 | else /* CONN_CREATE or CONN_ACK */ | 731 | else /* CONN_CREATE or CONN_ACK */ |
732 | { | 732 | { |
733 | GNUNET_assert (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED != type); | 733 | GNUNET_assert (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED != type); |
734 | forced = GNUNET_YES; | 734 | forced = GNUNET_YES; |
735 | } | 735 | } |
736 | 736 | ||
@@ -750,14 +750,14 @@ conn_message_sent (void *cls, | |||
750 | switch (type) | 750 | switch (type) |
751 | { | 751 | { |
752 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE: | 752 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE: |
753 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK: | 753 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK: |
754 | c->maintenance_q = NULL; | 754 | c->maintenance_q = NULL; |
755 | /* Don't trigger a keepalive for sent ACKs, only SYN and SYNACKs */ | 755 | /* Don't trigger a keepalive for sent ACKs, only SYN and SYNACKs */ |
756 | if (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE == type || !fwd) | 756 | if (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE == type || !fwd) |
757 | schedule_next_keepalive (c, fwd); | 757 | schedule_next_keepalive (c, fwd); |
758 | break; | 758 | break; |
759 | 759 | ||
760 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED: | 760 | case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED: |
761 | if (GNUNET_YES == sent) | 761 | if (GNUNET_YES == sent) |
762 | { | 762 | { |
763 | fc->last_pid_sent = pid; | 763 | fc->last_pid_sent = pid; |
@@ -783,12 +783,12 @@ conn_message_sent (void *cls, | |||
783 | } | 783 | } |
784 | break; | 784 | break; |
785 | 785 | ||
786 | case GNUNET_MESSAGE_TYPE_CADET_KX: | 786 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX: |
787 | if (GNUNET_YES == sent) | 787 | if (GNUNET_YES == sent) |
788 | connection_reset_timeout (c, fwd); | 788 | connection_reset_timeout (c, fwd); |
789 | break; | 789 | break; |
790 | 790 | ||
791 | case GNUNET_MESSAGE_TYPE_CADET_POLL: | 791 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL: |
792 | fc->poll_msg = NULL; | 792 | fc->poll_msg = NULL; |
793 | if (2 == c->destroy) | 793 | if (2 == c->destroy) |
794 | { | 794 | { |
@@ -809,7 +809,7 @@ conn_message_sent (void *cls, | |||
809 | LOG (GNUNET_ERROR_TYPE_DEBUG, " task %u\n", fc->poll_task); | 809 | LOG (GNUNET_ERROR_TYPE_DEBUG, " task %u\n", fc->poll_task); |
810 | break; | 810 | break; |
811 | 811 | ||
812 | case GNUNET_MESSAGE_TYPE_CADET_ACK: | 812 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK: |
813 | fc->ack_msg = NULL; | 813 | fc->ack_msg = NULL; |
814 | break; | 814 | break; |
815 | 815 | ||
@@ -1029,10 +1029,10 @@ is_fwd (const struct CadetConnection *c, | |||
1029 | static void | 1029 | static void |
1030 | send_connection_ack (struct CadetConnection *c, int fwd) | 1030 | send_connection_ack (struct CadetConnection *c, int fwd) |
1031 | { | 1031 | { |
1032 | struct GNUNET_CADET_ConnectionACK msg; | 1032 | struct GNUNET_CADET_ConnectionCreateMessageAckMessage msg; |
1033 | struct CadetTunnel *t; | 1033 | struct CadetTunnel *t; |
1034 | const uint16_t size = sizeof (struct GNUNET_CADET_ConnectionACK); | 1034 | const uint16_t size = sizeof (struct GNUNET_CADET_ConnectionCreateMessageAckMessage); |
1035 | const uint16_t type = GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK; | 1035 | const uint16_t type = GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK; |
1036 | 1036 | ||
1037 | GCC_check_connections (); | 1037 | GCC_check_connections (); |
1038 | t = c->t; | 1038 | t = c->t; |
@@ -1047,7 +1047,7 @@ send_connection_ack (struct CadetConnection *c, int fwd) | |||
1047 | 1047 | ||
1048 | GNUNET_assert (NULL == c->maintenance_q); | 1048 | GNUNET_assert (NULL == c->maintenance_q); |
1049 | c->maintenance_q = GCP_send (get_hop (c, fwd), &msg.header, | 1049 | c->maintenance_q = GCP_send (get_hop (c, fwd), &msg.header, |
1050 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK, 0, | 1050 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, 0, |
1051 | c, fwd, | 1051 | c, fwd, |
1052 | &conn_message_sent, NULL); | 1052 | &conn_message_sent, NULL); |
1053 | LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P+ %p %u (conn`ACK)\n", | 1053 | LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P+ %p %u (conn`ACK)\n", |
@@ -1076,10 +1076,10 @@ send_broken (struct CadetConnection *c, | |||
1076 | const struct GNUNET_PeerIdentity *id2, | 1076 | const struct GNUNET_PeerIdentity *id2, |
1077 | int fwd) | 1077 | int fwd) |
1078 | { | 1078 | { |
1079 | struct GNUNET_CADET_ConnectionBroken msg; | 1079 | struct GNUNET_CADET_ConnectionBrokenMessage msg; |
1080 | 1080 | ||
1081 | GCC_check_connections (); | 1081 | GCC_check_connections (); |
1082 | msg.header.size = htons (sizeof (struct GNUNET_CADET_ConnectionBroken)); | 1082 | msg.header.size = htons (sizeof (struct GNUNET_CADET_ConnectionBrokenMessage)); |
1083 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN); | 1083 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN); |
1084 | msg.cid = c->id; | 1084 | msg.cid = c->id; |
1085 | msg.reserved = htonl (0); | 1085 | msg.reserved = htonl (0); |
@@ -1106,13 +1106,13 @@ send_broken_unknown (const struct GNUNET_CADET_ConnectionTunnelIdentifier *conne | |||
1106 | const struct GNUNET_PeerIdentity *id2, | 1106 | const struct GNUNET_PeerIdentity *id2, |
1107 | struct CadetPeer *neighbor) | 1107 | struct CadetPeer *neighbor) |
1108 | { | 1108 | { |
1109 | struct GNUNET_CADET_ConnectionBroken msg; | 1109 | struct GNUNET_CADET_ConnectionBrokenMessage msg; |
1110 | 1110 | ||
1111 | GCC_check_connections (); | 1111 | GCC_check_connections (); |
1112 | LOG (GNUNET_ERROR_TYPE_INFO, "--> BROKEN on unknown connection %s\n", | 1112 | LOG (GNUNET_ERROR_TYPE_INFO, "--> BROKEN on unknown connection %s\n", |
1113 | GNUNET_sh2s (&connection_id->connection_of_tunnel)); | 1113 | GNUNET_sh2s (&connection_id->connection_of_tunnel)); |
1114 | 1114 | ||
1115 | msg.header.size = htons (sizeof (struct GNUNET_CADET_ConnectionBroken)); | 1115 | msg.header.size = htons (sizeof (struct GNUNET_CADET_ConnectionBrokenMessage)); |
1116 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN); | 1116 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN); |
1117 | msg.cid = *connection_id; | 1117 | msg.cid = *connection_id; |
1118 | msg.reserved = htonl (0); | 1118 | msg.reserved = htonl (0); |
@@ -1161,7 +1161,7 @@ send_connection_keepalive (struct CadetConnection *c, int fwd) | |||
1161 | 1161 | ||
1162 | GNUNET_assert (NULL != c->t); | 1162 | GNUNET_assert (NULL != c->t); |
1163 | msg.size = htons (sizeof (msg)); | 1163 | msg.size = htons (sizeof (msg)); |
1164 | msg.type = htons (GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE); | 1164 | msg.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE); |
1165 | 1165 | ||
1166 | GNUNET_assert (NULL == | 1166 | GNUNET_assert (NULL == |
1167 | GCT_send_prebuilt_message (&msg, c->t, c, | 1167 | GCT_send_prebuilt_message (&msg, c->t, c, |
@@ -1419,7 +1419,7 @@ static void | |||
1419 | send_poll (void *cls) | 1419 | send_poll (void *cls) |
1420 | { | 1420 | { |
1421 | struct CadetFlowControl *fc = cls; | 1421 | struct CadetFlowControl *fc = cls; |
1422 | struct GNUNET_CADET_Poll msg; | 1422 | struct GNUNET_CADET_ConnectionHopByHopPollMessage msg; |
1423 | struct CadetConnection *c; | 1423 | struct CadetConnection *c; |
1424 | int fwd; | 1424 | int fwd; |
1425 | 1425 | ||
@@ -1430,7 +1430,7 @@ send_poll (void *cls) | |||
1430 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Polling connection %s %s\n", | 1430 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Polling connection %s %s\n", |
1431 | GCC_2s (c), GC_f2s (fwd)); | 1431 | GCC_2s (c), GC_f2s (fwd)); |
1432 | 1432 | ||
1433 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_POLL); | 1433 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL); |
1434 | msg.header.size = htons (sizeof (msg)); | 1434 | msg.header.size = htons (sizeof (msg)); |
1435 | msg.cid = c->id; | 1435 | msg.cid = c->id; |
1436 | msg.pid = htonl (fc->last_pid_sent); | 1436 | msg.pid = htonl (fc->last_pid_sent); |
@@ -1848,7 +1848,7 @@ log_message (const struct GNUNET_MessageHeader *message, | |||
1848 | switch (type) | 1848 | switch (type) |
1849 | { | 1849 | { |
1850 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE: | 1850 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE: |
1851 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK: | 1851 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK: |
1852 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN: | 1852 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN: |
1853 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY: | 1853 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY: |
1854 | arrow = "=="; | 1854 | arrow = "=="; |
@@ -1877,7 +1877,7 @@ log_message (const struct GNUNET_MessageHeader *message, | |||
1877 | */ | 1877 | */ |
1878 | void | 1878 | void |
1879 | GCC_handle_create (struct CadetPeer *peer, | 1879 | GCC_handle_create (struct CadetPeer *peer, |
1880 | const struct GNUNET_CADET_ConnectionCreate *msg) | 1880 | const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
1881 | { | 1881 | { |
1882 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid; | 1882 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid; |
1883 | struct GNUNET_PeerIdentity *id; | 1883 | struct GNUNET_PeerIdentity *id; |
@@ -1892,7 +1892,7 @@ GCC_handle_create (struct CadetPeer *peer, | |||
1892 | size = ntohs (msg->header.size); | 1892 | size = ntohs (msg->header.size); |
1893 | 1893 | ||
1894 | /* Calculate hops */ | 1894 | /* Calculate hops */ |
1895 | size -= sizeof (struct GNUNET_CADET_ConnectionCreate); | 1895 | size -= sizeof (struct GNUNET_CADET_ConnectionCreateMessage); |
1896 | if (0 != size % sizeof (struct GNUNET_PeerIdentity)) | 1896 | if (0 != size % sizeof (struct GNUNET_PeerIdentity)) |
1897 | { | 1897 | { |
1898 | GNUNET_break_op (0); | 1898 | GNUNET_break_op (0); |
@@ -2017,7 +2017,7 @@ GCC_handle_create (struct CadetPeer *peer, | |||
2017 | */ | 2017 | */ |
2018 | void | 2018 | void |
2019 | GCC_handle_confirm (struct CadetPeer *peer, | 2019 | GCC_handle_confirm (struct CadetPeer *peer, |
2020 | const struct GNUNET_CADET_ConnectionACK *msg) | 2020 | const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg) |
2021 | { | 2021 | { |
2022 | struct CadetConnection *c; | 2022 | struct CadetConnection *c; |
2023 | enum CadetConnectionState oldstate; | 2023 | enum CadetConnectionState oldstate; |
@@ -2141,7 +2141,7 @@ GCC_handle_confirm (struct CadetPeer *peer, | |||
2141 | */ | 2141 | */ |
2142 | void | 2142 | void |
2143 | GCC_handle_broken (struct CadetPeer *peer, | 2143 | GCC_handle_broken (struct CadetPeer *peer, |
2144 | const struct GNUNET_CADET_ConnectionBroken *msg) | 2144 | const struct GNUNET_CADET_ConnectionBrokenMessage *msg) |
2145 | { | 2145 | { |
2146 | struct CadetConnection *c; | 2146 | struct CadetConnection *c; |
2147 | struct CadetTunnel *t; | 2147 | struct CadetTunnel *t; |
@@ -2212,7 +2212,7 @@ GCC_handle_broken (struct CadetPeer *peer, | |||
2212 | */ | 2212 | */ |
2213 | void | 2213 | void |
2214 | GCC_handle_destroy (struct CadetPeer *peer, | 2214 | GCC_handle_destroy (struct CadetPeer *peer, |
2215 | const struct GNUNET_CADET_ConnectionDestroy *msg) | 2215 | const struct GNUNET_CADET_ConnectionDestroyMessage *msg) |
2216 | { | 2216 | { |
2217 | struct CadetConnection *c; | 2217 | struct CadetConnection *c; |
2218 | int fwd; | 2218 | int fwd; |
@@ -2274,7 +2274,7 @@ GCC_handle_destroy (struct CadetPeer *peer, | |||
2274 | */ | 2274 | */ |
2275 | void | 2275 | void |
2276 | GCC_handle_ack (struct CadetPeer *peer, | 2276 | GCC_handle_ack (struct CadetPeer *peer, |
2277 | const struct GNUNET_CADET_ACK *msg) | 2277 | const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg) |
2278 | { | 2278 | { |
2279 | struct CadetConnection *c; | 2279 | struct CadetConnection *c; |
2280 | struct CadetFlowControl *fc; | 2280 | struct CadetFlowControl *fc; |
@@ -2343,7 +2343,7 @@ GCC_handle_ack (struct CadetPeer *peer, | |||
2343 | */ | 2343 | */ |
2344 | void | 2344 | void |
2345 | GCC_handle_poll (struct CadetPeer *peer, | 2345 | GCC_handle_poll (struct CadetPeer *peer, |
2346 | const struct GNUNET_CADET_Poll *msg) | 2346 | const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg) |
2347 | { | 2347 | { |
2348 | struct CadetConnection *c; | 2348 | struct CadetConnection *c; |
2349 | struct CadetFlowControl *fc; | 2349 | struct CadetFlowControl *fc; |
@@ -2466,7 +2466,7 @@ check_message (const struct GNUNET_MessageHeader *message, | |||
2466 | 2466 | ||
2467 | /* Check PID for payload messages */ | 2467 | /* Check PID for payload messages */ |
2468 | type = ntohs (message->type); | 2468 | type = ntohs (message->type); |
2469 | if (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED == type) | 2469 | if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == type) |
2470 | { | 2470 | { |
2471 | fc = fwd ? &c->bck_fc : &c->fwd_fc; | 2471 | fc = fwd ? &c->bck_fc : &c->fwd_fc; |
2472 | LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u (expected in interval [%u,%u])\n", | 2472 | LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u (expected in interval [%u,%u])\n", |
@@ -2537,7 +2537,7 @@ check_message (const struct GNUNET_MessageHeader *message, | |||
2537 | */ | 2537 | */ |
2538 | void | 2538 | void |
2539 | GCC_handle_kx (struct CadetPeer *peer, | 2539 | GCC_handle_kx (struct CadetPeer *peer, |
2540 | const struct GNUNET_CADET_KX *msg) | 2540 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
2541 | { | 2541 | { |
2542 | const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid; | 2542 | const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid; |
2543 | struct CadetConnection *c; | 2543 | struct CadetConnection *c; |
@@ -2594,7 +2594,7 @@ GCC_handle_kx (struct CadetPeer *peer, | |||
2594 | */ | 2594 | */ |
2595 | void | 2595 | void |
2596 | GCC_handle_encrypted (struct CadetPeer *peer, | 2596 | GCC_handle_encrypted (struct CadetPeer *peer, |
2597 | const struct GNUNET_CADET_Encrypted *msg) | 2597 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) |
2598 | { | 2598 | { |
2599 | const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid; | 2599 | const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid; |
2600 | struct CadetConnection *c; | 2600 | struct CadetConnection *c; |
@@ -3227,7 +3227,7 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
3227 | GC_f2s(fwd), size); | 3227 | GC_f2s(fwd), size); |
3228 | switch (type) | 3228 | switch (type) |
3229 | { | 3229 | { |
3230 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED: | 3230 | case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED: |
3231 | LOG (GNUNET_ERROR_TYPE_DEBUG, " Q_N+ %p %u, PIDsnt: %u, ACKrcv: %u\n", | 3231 | LOG (GNUNET_ERROR_TYPE_DEBUG, " Q_N+ %p %u, PIDsnt: %u, ACKrcv: %u\n", |
3232 | fc, fc->queue_n, fc->last_pid_sent, fc->last_ack_recv); | 3232 | fc, fc->queue_n, fc->last_pid_sent, fc->last_ack_recv); |
3233 | if (GNUNET_NO == force) | 3233 | if (GNUNET_NO == force) |
@@ -3236,18 +3236,18 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
3236 | } | 3236 | } |
3237 | break; | 3237 | break; |
3238 | 3238 | ||
3239 | case GNUNET_MESSAGE_TYPE_CADET_KX: | 3239 | case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX: |
3240 | /* nothing to do here */ | 3240 | /* nothing to do here */ |
3241 | break; | 3241 | break; |
3242 | 3242 | ||
3243 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE: | 3243 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE: |
3244 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK: | 3244 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK: |
3245 | /* Should've only be used for restransmissions. */ | 3245 | /* Should've only be used for restransmissions. */ |
3246 | GNUNET_break (0 == payload_type); | 3246 | GNUNET_break (0 == payload_type); |
3247 | break; | 3247 | break; |
3248 | 3248 | ||
3249 | case GNUNET_MESSAGE_TYPE_CADET_ACK: | 3249 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK: |
3250 | case GNUNET_MESSAGE_TYPE_CADET_POLL: | 3250 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL: |
3251 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY: | 3251 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY: |
3252 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN: | 3252 | case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN: |
3253 | GNUNET_assert (GNUNET_YES == force); | 3253 | GNUNET_assert (GNUNET_YES == force); |
@@ -3265,7 +3265,7 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
3265 | GNUNET_break (0); | 3265 | GNUNET_break (0); |
3266 | LOG (GNUNET_ERROR_TYPE_DEBUG, "queue full: %u/%u\n", | 3266 | LOG (GNUNET_ERROR_TYPE_DEBUG, "queue full: %u/%u\n", |
3267 | fc->queue_n, fc->queue_max); | 3267 | fc->queue_n, fc->queue_max); |
3268 | if (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED == type) | 3268 | if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == type) |
3269 | { | 3269 | { |
3270 | fc->queue_n--; | 3270 | fc->queue_n--; |
3271 | } | 3271 | } |
@@ -3331,15 +3331,15 @@ GCC_send_create (struct CadetConnection *c) | |||
3331 | size_t size; | 3331 | size_t size; |
3332 | 3332 | ||
3333 | GCC_check_connections (); | 3333 | GCC_check_connections (); |
3334 | size = sizeof (struct GNUNET_CADET_ConnectionCreate); | 3334 | size = sizeof (struct GNUNET_CADET_ConnectionCreateMessage); |
3335 | size += c->path->length * sizeof (struct GNUNET_PeerIdentity); | 3335 | size += c->path->length * sizeof (struct GNUNET_PeerIdentity); |
3336 | { | 3336 | { |
3337 | /* Allocate message on the stack */ | 3337 | /* Allocate message on the stack */ |
3338 | unsigned char cbuf[size]; | 3338 | unsigned char cbuf[size]; |
3339 | struct GNUNET_CADET_ConnectionCreate *msg; | 3339 | struct GNUNET_CADET_ConnectionCreateMessage *msg; |
3340 | struct GNUNET_PeerIdentity *peers; | 3340 | struct GNUNET_PeerIdentity *peers; |
3341 | 3341 | ||
3342 | msg = (struct GNUNET_CADET_ConnectionCreate *) cbuf; | 3342 | msg = (struct GNUNET_CADET_ConnectionCreateMessage *) cbuf; |
3343 | msg->header.size = htons (size); | 3343 | msg->header.size = htons (size); |
3344 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE); | 3344 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE); |
3345 | msg->reserved = htonl (0); | 3345 | msg->reserved = htonl (0); |
@@ -3449,7 +3449,7 @@ GCC_send_ack (struct CadetConnection *c, int fwd, int force) | |||
3449 | void | 3449 | void |
3450 | GCC_send_destroy (struct CadetConnection *c) | 3450 | GCC_send_destroy (struct CadetConnection *c) |
3451 | { | 3451 | { |
3452 | struct GNUNET_CADET_ConnectionDestroy msg; | 3452 | struct GNUNET_CADET_ConnectionDestroyMessage msg; |
3453 | 3453 | ||
3454 | if (GNUNET_YES == c->destroy) | 3454 | if (GNUNET_YES == c->destroy) |
3455 | return; | 3455 | return; |
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h index 3d3e8adbe..6df307dd1 100644 --- a/src/cadet/gnunet-service-cadet_connection.h +++ b/src/cadet/gnunet-service-cadet_connection.h | |||
@@ -125,7 +125,7 @@ typedef void | |||
125 | */ | 125 | */ |
126 | void | 126 | void |
127 | GCC_handle_create (struct CadetPeer *peer, | 127 | GCC_handle_create (struct CadetPeer *peer, |
128 | const struct GNUNET_CADET_ConnectionCreate *msg); | 128 | const struct GNUNET_CADET_ConnectionCreateMessage *msg); |
129 | 129 | ||
130 | 130 | ||
131 | /** | 131 | /** |
@@ -136,7 +136,7 @@ GCC_handle_create (struct CadetPeer *peer, | |||
136 | */ | 136 | */ |
137 | void | 137 | void |
138 | GCC_handle_confirm (struct CadetPeer *peer, | 138 | GCC_handle_confirm (struct CadetPeer *peer, |
139 | const struct GNUNET_CADET_ConnectionACK *msg); | 139 | const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg); |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
@@ -147,7 +147,7 @@ GCC_handle_confirm (struct CadetPeer *peer, | |||
147 | */ | 147 | */ |
148 | void | 148 | void |
149 | GCC_handle_broken (struct CadetPeer *peer, | 149 | GCC_handle_broken (struct CadetPeer *peer, |
150 | const struct GNUNET_CADET_ConnectionBroken *msg); | 150 | const struct GNUNET_CADET_ConnectionBrokenMessage *msg); |
151 | 151 | ||
152 | /** | 152 | /** |
153 | * Handler for notifications of destroyed connections. | 153 | * Handler for notifications of destroyed connections. |
@@ -157,7 +157,7 @@ GCC_handle_broken (struct CadetPeer *peer, | |||
157 | */ | 157 | */ |
158 | void | 158 | void |
159 | GCC_handle_destroy (struct CadetPeer *peer, | 159 | GCC_handle_destroy (struct CadetPeer *peer, |
160 | const struct GNUNET_CADET_ConnectionDestroy *msg); | 160 | const struct GNUNET_CADET_ConnectionDestroyMessage *msg); |
161 | 161 | ||
162 | /** | 162 | /** |
163 | * Handler for cadet network traffic hop-by-hop acks. | 163 | * Handler for cadet network traffic hop-by-hop acks. |
@@ -167,7 +167,7 @@ GCC_handle_destroy (struct CadetPeer *peer, | |||
167 | */ | 167 | */ |
168 | void | 168 | void |
169 | GCC_handle_ack (struct CadetPeer *peer, | 169 | GCC_handle_ack (struct CadetPeer *peer, |
170 | const struct GNUNET_CADET_ACK *msg); | 170 | const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg); |
171 | 171 | ||
172 | /** | 172 | /** |
173 | * Handler for cadet network traffic hop-by-hop data counter polls. | 173 | * Handler for cadet network traffic hop-by-hop data counter polls. |
@@ -177,7 +177,7 @@ GCC_handle_ack (struct CadetPeer *peer, | |||
177 | */ | 177 | */ |
178 | void | 178 | void |
179 | GCC_handle_poll (struct CadetPeer *peer, | 179 | GCC_handle_poll (struct CadetPeer *peer, |
180 | const struct GNUNET_CADET_Poll *msg); | 180 | const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg); |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * Handler for key exchange traffic (Axolotl KX). | 183 | * Handler for key exchange traffic (Axolotl KX). |
@@ -187,7 +187,7 @@ GCC_handle_poll (struct CadetPeer *peer, | |||
187 | */ | 187 | */ |
188 | void | 188 | void |
189 | GCC_handle_kx (struct CadetPeer *peer, | 189 | GCC_handle_kx (struct CadetPeer *peer, |
190 | const struct GNUNET_CADET_KX *msg); | 190 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * Handler for encrypted cadet network traffic (channel mgmt, data). | 193 | * Handler for encrypted cadet network traffic (channel mgmt, data). |
@@ -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_Encrypted *msg); | 200 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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 cea28bcd2..40d7e26dc 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_ChannelCreateMessage) | 443 | if (sizeof (struct GNUNET_CADET_ChannelCreateMessageMessage) |
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_ChannelCreateMessage *) | 453 | (struct GNUNET_CADET_ChannelCreateMessageMessage *) |
454 | message)) | 454 | message)) |
455 | { | 455 | { |
456 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 456 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
@@ -1129,7 +1129,7 @@ static struct GNUNET_SERVER_MessageHandler client_handlers[] = { | |||
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_CREATE, |
1132 | sizeof (struct GNUNET_CADET_ChannelCreateMessage)}, | 1132 | sizeof (struct GNUNET_CADET_ChannelCreateMessageMessage)}, |
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,7 +1434,7 @@ 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_ChannelCreateMessage msg; | 1437 | struct GNUNET_CADET_ChannelCreateMessageMessage 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_CREATE); |
@@ -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_NACK); | 1468 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_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_Data *msg, | 1513 | const struct GNUNET_CADET_ChannelDataMessage *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_Data); | 1517 | uint16_t size = ntohs (msg->header.size) - sizeof (struct GNUNET_CADET_ChannelDataMessage); |
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 9b6e5bf05..9428cd4b9 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_Data *msg, | 211 | const struct GNUNET_CADET_ChannelDataMessage *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 a3defb87e..2c2c552c6 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -456,7 +456,7 @@ core_disconnect_handler (void *cls, | |||
456 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. | 456 | * @return #GNUNET_YES if size is correct, #GNUNET_NO otherwise. |
457 | */ | 457 | */ |
458 | static int | 458 | static int |
459 | check_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg) | 459 | check_create (void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
460 | { | 460 | { |
461 | uint16_t size; | 461 | uint16_t size; |
462 | 462 | ||
@@ -476,7 +476,7 @@ check_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg) | |||
476 | * @param msg Message itself. | 476 | * @param msg Message itself. |
477 | */ | 477 | */ |
478 | static void | 478 | static void |
479 | handle_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg) | 479 | handle_create (void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
480 | { | 480 | { |
481 | struct CadetPeer *peer = cls; | 481 | struct CadetPeer *peer = cls; |
482 | GCC_handle_create (peer, msg); | 482 | GCC_handle_create (peer, msg); |
@@ -484,13 +484,13 @@ handle_create (void *cls, const struct GNUNET_CADET_ConnectionCreate *msg) | |||
484 | 484 | ||
485 | 485 | ||
486 | /** | 486 | /** |
487 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK | 487 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK |
488 | * | 488 | * |
489 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 489 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
490 | * @param msg Message itself. | 490 | * @param msg Message itself. |
491 | */ | 491 | */ |
492 | static void | 492 | static void |
493 | handle_confirm (void *cls, const struct GNUNET_CADET_ConnectionACK *msg) | 493 | handle_confirm (void *cls, const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg) |
494 | { | 494 | { |
495 | struct CadetPeer *peer = cls; | 495 | struct CadetPeer *peer = cls; |
496 | GCC_handle_confirm (peer, msg); | 496 | GCC_handle_confirm (peer, msg); |
@@ -504,7 +504,7 @@ handle_confirm (void *cls, const struct GNUNET_CADET_ConnectionACK *msg) | |||
504 | * @param msg Message itself. | 504 | * @param msg Message itself. |
505 | */ | 505 | */ |
506 | static void | 506 | static void |
507 | handle_broken (void *cls, const struct GNUNET_CADET_ConnectionBroken *msg) | 507 | handle_broken (void *cls, const struct GNUNET_CADET_ConnectionBrokenMessage *msg) |
508 | { | 508 | { |
509 | struct CadetPeer *peer = cls; | 509 | struct CadetPeer *peer = cls; |
510 | GCC_handle_broken (peer, msg); | 510 | GCC_handle_broken (peer, msg); |
@@ -518,7 +518,7 @@ handle_broken (void *cls, const struct GNUNET_CADET_ConnectionBroken *msg) | |||
518 | * @param msg Message itself. | 518 | * @param msg Message itself. |
519 | */ | 519 | */ |
520 | static void | 520 | static void |
521 | handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroy *msg) | 521 | handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroyMessage *msg) |
522 | { | 522 | { |
523 | struct CadetPeer *peer = cls; | 523 | struct CadetPeer *peer = cls; |
524 | GCC_handle_destroy (peer, msg); | 524 | GCC_handle_destroy (peer, msg); |
@@ -526,13 +526,13 @@ handle_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroy *msg) | |||
526 | 526 | ||
527 | 527 | ||
528 | /** | 528 | /** |
529 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ACK | 529 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_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. |
533 | */ | 533 | */ |
534 | static void | 534 | static void |
535 | handle_ack (void *cls, const struct GNUNET_CADET_ACK *msg) | 535 | handle_ack (void *cls, const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg) |
536 | { | 536 | { |
537 | struct CadetPeer *peer = cls; | 537 | struct CadetPeer *peer = cls; |
538 | GCC_handle_ack (peer, msg); | 538 | GCC_handle_ack (peer, msg); |
@@ -540,13 +540,13 @@ handle_ack (void *cls, const struct GNUNET_CADET_ACK *msg) | |||
540 | 540 | ||
541 | 541 | ||
542 | /** | 542 | /** |
543 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_POLL | 543 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_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. |
547 | */ | 547 | */ |
548 | static void | 548 | static void |
549 | handle_poll (void *cls, const struct GNUNET_CADET_Poll *msg) | 549 | handle_poll (void *cls, const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg) |
550 | { | 550 | { |
551 | struct CadetPeer *peer = cls; | 551 | struct CadetPeer *peer = cls; |
552 | GCC_handle_poll (peer, msg); | 552 | GCC_handle_poll (peer, msg); |
@@ -554,13 +554,13 @@ handle_poll (void *cls, const struct GNUNET_CADET_Poll *msg) | |||
554 | 554 | ||
555 | 555 | ||
556 | /** | 556 | /** |
557 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_KX | 557 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX |
558 | * | 558 | * |
559 | * @param cls Closure (CadetPeer for neighbor that sent the message). | 559 | * @param cls Closure (CadetPeer for neighbor that sent the message). |
560 | * @param msg Message itself. | 560 | * @param msg Message itself. |
561 | */ | 561 | */ |
562 | static void | 562 | static void |
563 | handle_kx (void *cls, const struct GNUNET_CADET_KX *msg) | 563 | handle_kx (void *cls, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
564 | { | 564 | { |
565 | struct CadetPeer *peer = cls; | 565 | struct CadetPeer *peer = cls; |
566 | GCC_handle_kx (peer, msg); | 566 | GCC_handle_kx (peer, msg); |
@@ -576,13 +576,13 @@ handle_kx (void *cls, const struct GNUNET_CADET_KX *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_Encrypted *msg) | 579 | check_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted) | 585 | minimum_size = sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) |
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_Encrypted *msg) | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /** | 596 | /** |
597 | * Handle for #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED. | 597 | * Handle for #GNUNET_MESSAGE_TYPE_CONNECTION_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_Encrypted *msg) | 603 | handle_encrypted (void *cls, const struct GNUNET_CADET_ConnectionEncryptedMessage *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); |
@@ -624,35 +624,35 @@ connect_to_core (const struct GNUNET_CONFIGURATION_Handle *c) | |||
624 | struct GNUNET_MQ_MessageHandler core_handlers[] = { | 624 | struct GNUNET_MQ_MessageHandler core_handlers[] = { |
625 | GNUNET_MQ_hd_var_size (create, | 625 | GNUNET_MQ_hd_var_size (create, |
626 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, | 626 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, |
627 | struct GNUNET_CADET_ConnectionCreate, | 627 | struct GNUNET_CADET_ConnectionCreateMessage, |
628 | NULL), | 628 | NULL), |
629 | GNUNET_MQ_hd_fixed_size (confirm, | 629 | GNUNET_MQ_hd_fixed_size (confirm, |
630 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK, | 630 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, |
631 | struct GNUNET_CADET_ConnectionACK, | 631 | struct GNUNET_CADET_ConnectionCreateMessageAckMessage, |
632 | NULL), | 632 | NULL), |
633 | GNUNET_MQ_hd_fixed_size (broken, | 633 | GNUNET_MQ_hd_fixed_size (broken, |
634 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, | 634 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, |
635 | struct GNUNET_CADET_ConnectionBroken, | 635 | struct GNUNET_CADET_ConnectionBrokenMessage, |
636 | NULL), | 636 | NULL), |
637 | GNUNET_MQ_hd_fixed_size (destroy, | 637 | GNUNET_MQ_hd_fixed_size (destroy, |
638 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, | 638 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, |
639 | struct GNUNET_CADET_ConnectionDestroy, | 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_ACK, | 642 | GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK, |
643 | struct GNUNET_CADET_ACK, | 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_POLL, | 646 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL, |
647 | struct GNUNET_CADET_Poll, | 647 | struct GNUNET_CADET_ConnectionHopByHopPollMessage, |
648 | NULL), | 648 | NULL), |
649 | GNUNET_MQ_hd_fixed_size (kx, | 649 | GNUNET_MQ_hd_fixed_size (kx, |
650 | GNUNET_MESSAGE_TYPE_CADET_KX, | 650 | GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX, |
651 | struct GNUNET_CADET_KX, | 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_CADET_ENCRYPTED, | 654 | GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED, |
655 | struct GNUNET_CADET_Encrypted, | 655 | struct GNUNET_CADET_ConnectionEncryptedMessage, |
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_CADET_ENCRYPTED == q->type) | 738 | if (GNUNET_MESSAGE_TYPE_CONNECTION_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_ACK || | 1062 | return type == GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK || |
1063 | type == GNUNET_MESSAGE_TYPE_CADET_POLL; | 1063 | type == GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_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 09e91386e..df1cfa16e 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_Encrypted *msg) | 846 | t_h_encrypt (struct CadetTunnel *t, struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted *msg) | |||
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_Encrypted *src, | 877 | t_h_decrypt (struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionEncryptedMessage *src, |
878 | struct GNUNET_CADET_Encrypted *dst) | 878 | struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted *src, | |||
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_Encrypted *src, size_t size) | 916 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted plaintext_header; | 921 | struct GNUNET_CADET_ConnectionEncryptedMessage 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_Encrypted); | 930 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
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_Encrypted)); | 951 | GNUNET_assert (size > sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage)); |
952 | len = size - sizeof (struct GNUNET_CADET_Encrypted); | 952 | len = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
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_Encrypted *src, | 1095 | const struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted plaintext_header; | 1101 | struct GNUNET_CADET_ConnectionEncryptedMessage 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_Encrypted); | 1107 | esize = size - sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
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_Encrypted *ax_msg; | 1325 | struct GNUNET_CADET_ConnectionEncryptedMessage *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_Encrypted) + size] GNUNET_ALIGN; | 1328 | char cbuf[sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) + size] GNUNET_ALIGN; |
1329 | size_t esize; | 1329 | size_t esize; |
1330 | uint32_t mid; | 1330 | uint32_t mid; |
1331 | uint16_t type; | 1331 | uint16_t type; |
@@ -1353,10 +1353,10 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
1353 | 1353 | ||
1354 | GNUNET_assert (GNUNET_NO == GCT_is_loopback (t)); | 1354 | GNUNET_assert (GNUNET_NO == GCT_is_loopback (t)); |
1355 | 1355 | ||
1356 | ax_msg = (struct GNUNET_CADET_Encrypted *) cbuf; | 1356 | ax_msg = (struct GNUNET_CADET_ConnectionEncryptedMessage *) cbuf; |
1357 | msg = &ax_msg->header; | 1357 | msg = &ax_msg->header; |
1358 | msg->size = htons (sizeof (struct GNUNET_CADET_Encrypted) + size); | 1358 | msg->size = htons (sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) + size); |
1359 | msg->type = htons (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED); | 1359 | msg->type = htons (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED); |
1360 | esize = t_ax_encrypt (t, &ax_msg[1], message, size); | 1360 | esize = t_ax_encrypt (t, &ax_msg[1], message, size); |
1361 | ax_msg->Ns = htonl (t->ax->Ns++); | 1361 | ax_msg->Ns = htonl (t->ax->Ns++); |
1362 | ax_msg->PNs = htonl (t->ax->PNs); | 1362 | ax_msg->PNs = htonl (t->ax->PNs); |
@@ -1385,18 +1385,18 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
1385 | type = ntohs (message->type); | 1385 | type = ntohs (message->type); |
1386 | switch (type) | 1386 | switch (type) |
1387 | { | 1387 | { |
1388 | case GNUNET_MESSAGE_TYPE_CADET_DATA: | 1388 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: |
1389 | case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: | 1389 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
1390 | if (GNUNET_MESSAGE_TYPE_CADET_DATA == type) | 1390 | if (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA == type) |
1391 | mid = ntohl (((struct GNUNET_CADET_Data *) message)->mid); | 1391 | mid = ntohl (((struct GNUNET_CADET_ChannelDataMessage *) message)->mid); |
1392 | else | 1392 | else |
1393 | mid = ntohl (((struct GNUNET_CADET_DataACK *) message)->mid); | 1393 | mid = ntohl (((struct GNUNET_CADET_ChannelDataAckMessage *) message)->mid); |
1394 | /* Fall thru */ | 1394 | /* Fall thru */ |
1395 | case GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE: | 1395 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE: |
1396 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 1396 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: |
1397 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 1397 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
1398 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: | 1398 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: |
1399 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: | 1399 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: |
1400 | break; | 1400 | break; |
1401 | default: | 1401 | default: |
1402 | GNUNET_break (0); | 1402 | GNUNET_break (0); |
@@ -1570,7 +1570,7 @@ static void | |||
1570 | send_channel_destroy (struct CadetTunnel *t, | 1570 | send_channel_destroy (struct CadetTunnel *t, |
1571 | struct GNUNET_CADET_ChannelNumber gid) | 1571 | struct GNUNET_CADET_ChannelNumber gid) |
1572 | { | 1572 | { |
1573 | struct GNUNET_CADET_ChannelManage msg; | 1573 | struct GNUNET_CADET_ChannelManageMessage msg; |
1574 | 1574 | ||
1575 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY); | 1575 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY); |
1576 | msg.header.size = htons (sizeof (msg)); | 1576 | msg.header.size = htons (sizeof (msg)); |
@@ -1596,7 +1596,7 @@ send_channel_destroy (struct CadetTunnel *t, | |||
1596 | */ | 1596 | */ |
1597 | static void | 1597 | static void |
1598 | handle_data (struct CadetTunnel *t, | 1598 | handle_data (struct CadetTunnel *t, |
1599 | const struct GNUNET_CADET_Data *msg, | 1599 | const struct GNUNET_CADET_ChannelDataMessage *msg, |
1600 | int fwd) | 1600 | int fwd) |
1601 | { | 1601 | { |
1602 | struct CadetChannel *ch; | 1602 | struct CadetChannel *ch; |
@@ -1607,7 +1607,7 @@ handle_data (struct CadetTunnel *t, | |||
1607 | /* Check size */ | 1607 | /* Check size */ |
1608 | size = ntohs (msg->header.size); | 1608 | size = ntohs (msg->header.size); |
1609 | if (size < | 1609 | if (size < |
1610 | sizeof (struct GNUNET_CADET_Data) + | 1610 | sizeof (struct GNUNET_CADET_ChannelDataMessage) + |
1611 | sizeof (struct GNUNET_MessageHeader)) | 1611 | sizeof (struct GNUNET_MessageHeader)) |
1612 | { | 1612 | { |
1613 | GNUNET_break (0); | 1613 | GNUNET_break (0); |
@@ -1650,7 +1650,7 @@ handle_data (struct CadetTunnel *t, | |||
1650 | */ | 1650 | */ |
1651 | static void | 1651 | static void |
1652 | handle_data_ack (struct CadetTunnel *t, | 1652 | handle_data_ack (struct CadetTunnel *t, |
1653 | const struct GNUNET_CADET_DataACK *msg, | 1653 | const struct GNUNET_CADET_ChannelDataAckMessage *msg, |
1654 | int fwd) | 1654 | int fwd) |
1655 | { | 1655 | { |
1656 | struct CadetChannel *ch; | 1656 | struct CadetChannel *ch; |
@@ -1658,7 +1658,7 @@ handle_data_ack (struct CadetTunnel *t, | |||
1658 | 1658 | ||
1659 | /* Check size */ | 1659 | /* Check size */ |
1660 | size = ntohs (msg->header.size); | 1660 | size = ntohs (msg->header.size); |
1661 | if (size != sizeof (struct GNUNET_CADET_DataACK)) | 1661 | if (size != sizeof (struct GNUNET_CADET_ChannelDataAckMessage)) |
1662 | { | 1662 | { |
1663 | GNUNET_break (0); | 1663 | GNUNET_break (0); |
1664 | return; | 1664 | return; |
@@ -1687,14 +1687,14 @@ handle_data_ack (struct CadetTunnel *t, | |||
1687 | */ | 1687 | */ |
1688 | static void | 1688 | static void |
1689 | handle_ch_create (struct CadetTunnel *t, | 1689 | handle_ch_create (struct CadetTunnel *t, |
1690 | const struct GNUNET_CADET_ChannelCreate *msg) | 1690 | const struct GNUNET_CADET_ChannelCreateMessage *msg) |
1691 | { | 1691 | { |
1692 | struct CadetChannel *ch; | 1692 | struct CadetChannel *ch; |
1693 | size_t size; | 1693 | size_t size; |
1694 | 1694 | ||
1695 | /* Check size */ | 1695 | /* Check size */ |
1696 | size = ntohs (msg->header.size); | 1696 | size = ntohs (msg->header.size); |
1697 | if (size != sizeof (struct GNUNET_CADET_ChannelCreate)) | 1697 | if (size != sizeof (struct GNUNET_CADET_ChannelCreateMessage)) |
1698 | { | 1698 | { |
1699 | GNUNET_break_op (0); | 1699 | GNUNET_break_op (0); |
1700 | return; | 1700 | return; |
@@ -1722,14 +1722,14 @@ handle_ch_create (struct CadetTunnel *t, | |||
1722 | */ | 1722 | */ |
1723 | static void | 1723 | static void |
1724 | handle_ch_nack (struct CadetTunnel *t, | 1724 | handle_ch_nack (struct CadetTunnel *t, |
1725 | const struct GNUNET_CADET_ChannelManage *msg) | 1725 | const struct GNUNET_CADET_ChannelManageMessage *msg) |
1726 | { | 1726 | { |
1727 | struct CadetChannel *ch; | 1727 | struct CadetChannel *ch; |
1728 | size_t size; | 1728 | size_t size; |
1729 | 1729 | ||
1730 | /* Check size */ | 1730 | /* Check size */ |
1731 | size = ntohs (msg->header.size); | 1731 | size = ntohs (msg->header.size); |
1732 | if (size != sizeof (struct GNUNET_CADET_ChannelManage)) | 1732 | if (size != sizeof (struct GNUNET_CADET_ChannelManageMessage)) |
1733 | { | 1733 | { |
1734 | GNUNET_break (0); | 1734 | GNUNET_break (0); |
1735 | return; | 1735 | return; |
@@ -1763,7 +1763,7 @@ handle_ch_nack (struct CadetTunnel *t, | |||
1763 | */ | 1763 | */ |
1764 | static void | 1764 | static void |
1765 | handle_ch_ack (struct CadetTunnel *t, | 1765 | handle_ch_ack (struct CadetTunnel *t, |
1766 | const struct GNUNET_CADET_ChannelManage *msg, | 1766 | const struct GNUNET_CADET_ChannelManageMessage *msg, |
1767 | int fwd) | 1767 | int fwd) |
1768 | { | 1768 | { |
1769 | struct CadetChannel *ch; | 1769 | struct CadetChannel *ch; |
@@ -1771,7 +1771,7 @@ handle_ch_ack (struct CadetTunnel *t, | |||
1771 | 1771 | ||
1772 | /* Check size */ | 1772 | /* Check size */ |
1773 | size = ntohs (msg->header.size); | 1773 | size = ntohs (msg->header.size); |
1774 | if (size != sizeof (struct GNUNET_CADET_ChannelManage)) | 1774 | if (size != sizeof (struct GNUNET_CADET_ChannelManageMessage)) |
1775 | { | 1775 | { |
1776 | GNUNET_break (0); | 1776 | GNUNET_break (0); |
1777 | return; | 1777 | return; |
@@ -1807,7 +1807,7 @@ handle_ch_ack (struct CadetTunnel *t, | |||
1807 | */ | 1807 | */ |
1808 | static void | 1808 | static void |
1809 | handle_ch_destroy (struct CadetTunnel *t, | 1809 | handle_ch_destroy (struct CadetTunnel *t, |
1810 | const struct GNUNET_CADET_ChannelManage *msg, | 1810 | const struct GNUNET_CADET_ChannelManageMessage *msg, |
1811 | int fwd) | 1811 | int fwd) |
1812 | { | 1812 | { |
1813 | struct CadetChannel *ch; | 1813 | struct CadetChannel *ch; |
@@ -1815,7 +1815,7 @@ handle_ch_destroy (struct CadetTunnel *t, | |||
1815 | 1815 | ||
1816 | /* Check size */ | 1816 | /* Check size */ |
1817 | size = ntohs (msg->header.size); | 1817 | size = ntohs (msg->header.size); |
1818 | if (size != sizeof (struct GNUNET_CADET_ChannelManage)) | 1818 | if (size != sizeof (struct GNUNET_CADET_ChannelManageMessage)) |
1819 | { | 1819 | { |
1820 | GNUNET_break (0); | 1820 | GNUNET_break (0); |
1821 | return; | 1821 | return; |
@@ -1892,34 +1892,34 @@ handle_decrypted (struct CadetTunnel *t, | |||
1892 | 1892 | ||
1893 | switch (type) | 1893 | switch (type) |
1894 | { | 1894 | { |
1895 | case GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE: | 1895 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE: |
1896 | /* Do nothing, connection aleady got updated. */ | 1896 | /* Do nothing, connection aleady got updated. */ |
1897 | GNUNET_STATISTICS_update (stats, "# keepalives received", 1, GNUNET_NO); | 1897 | GNUNET_STATISTICS_update (stats, "# keepalives received", 1, GNUNET_NO); |
1898 | break; | 1898 | break; |
1899 | 1899 | ||
1900 | case GNUNET_MESSAGE_TYPE_CADET_DATA: | 1900 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: |
1901 | /* Don't send hop ACK, wait for client to ACK */ | 1901 | /* Don't send hop ACK, wait for client to ACK */ |
1902 | handle_data (t, (struct GNUNET_CADET_Data *) msgh, fwd); | 1902 | handle_data (t, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd); |
1903 | break; | 1903 | break; |
1904 | 1904 | ||
1905 | case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: | 1905 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: |
1906 | handle_data_ack (t, (struct GNUNET_CADET_DataACK *) msgh, fwd); | 1906 | handle_data_ack (t, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd); |
1907 | break; | 1907 | break; |
1908 | 1908 | ||
1909 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 1909 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: |
1910 | handle_ch_create (t, (struct GNUNET_CADET_ChannelCreate *) msgh); | 1910 | handle_ch_create (t, (struct GNUNET_CADET_ChannelCreateMessage *) msgh); |
1911 | break; | 1911 | break; |
1912 | 1912 | ||
1913 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: | 1913 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: |
1914 | handle_ch_nack (t, (struct GNUNET_CADET_ChannelManage *) msgh); | 1914 | handle_ch_nack (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh); |
1915 | break; | 1915 | break; |
1916 | 1916 | ||
1917 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: | 1917 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: |
1918 | handle_ch_ack (t, (struct GNUNET_CADET_ChannelManage *) msgh, fwd); | 1918 | handle_ch_ack (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh, fwd); |
1919 | break; | 1919 | break; |
1920 | 1920 | ||
1921 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 1921 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
1922 | handle_ch_destroy (t, (struct GNUNET_CADET_ChannelManage *) msgh, fwd); | 1922 | handle_ch_destroy (t, (struct GNUNET_CADET_ChannelManageMessage *) msgh, fwd); |
1923 | break; | 1923 | break; |
1924 | 1924 | ||
1925 | default: | 1925 | default: |
@@ -1946,7 +1946,7 @@ handle_decrypted (struct CadetTunnel *t, | |||
1946 | */ | 1946 | */ |
1947 | void | 1947 | void |
1948 | GCT_handle_encrypted (struct CadetTunnel *t, | 1948 | GCT_handle_encrypted (struct CadetTunnel *t, |
1949 | const struct GNUNET_CADET_Encrypted *msg) | 1949 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg) |
1950 | { | 1950 | { |
1951 | uint16_t size = ntohs (msg->header.size); | 1951 | uint16_t size = ntohs (msg->header.size); |
1952 | char cbuf [size]; | 1952 | char cbuf [size]; |
@@ -2005,7 +2005,7 @@ GCT_handle_encrypted (struct CadetTunnel *t, | |||
2005 | */ | 2005 | */ |
2006 | void | 2006 | void |
2007 | GCT_handle_kx (struct CadetTunnel *t, | 2007 | GCT_handle_kx (struct CadetTunnel *t, |
2008 | const struct GNUNET_CADET_KX *msg) | 2008 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
2009 | { | 2009 | { |
2010 | struct CadetTunnelAxolotl *ax; | 2010 | struct CadetTunnelAxolotl *ax; |
2011 | struct GNUNET_HashCode key_material[3]; | 2011 | struct GNUNET_HashCode key_material[3]; |
@@ -2158,9 +2158,9 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c, | |||
2158 | LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); | 2158 | LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); |
2159 | 2159 | ||
2160 | expected_overhead = 0; | 2160 | expected_overhead = 0; |
2161 | expected_overhead += sizeof (struct GNUNET_CADET_Encrypted); | 2161 | expected_overhead += sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage); |
2162 | expected_overhead += sizeof (struct GNUNET_CADET_Data); | 2162 | expected_overhead += sizeof (struct GNUNET_CADET_ChannelDataMessage); |
2163 | expected_overhead += sizeof (struct GNUNET_CADET_ACK); | 2163 | expected_overhead += sizeof (struct GNUNET_CADET_ConnectionEncryptedAckMessage); |
2164 | GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead); | 2164 | GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead); |
2165 | 2165 | ||
2166 | if (GNUNET_OK != | 2166 | if (GNUNET_OK != |
@@ -2676,7 +2676,7 @@ GCT_destroy (struct CadetTunnel *t) | |||
2676 | 2676 | ||
2677 | mh = (struct GNUNET_MessageHeader *) &t->tq_head[1]; | 2677 | mh = (struct GNUNET_MessageHeader *) &t->tq_head[1]; |
2678 | type = ntohs (mh->type); | 2678 | type = ntohs (mh->type); |
2679 | if (0 == keepalives_queued && GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE == type) | 2679 | if (0 == keepalives_queued && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE == type) |
2680 | { | 2680 | { |
2681 | keepalives_queued = 1; | 2681 | keepalives_queued = 1; |
2682 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2682 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -3221,7 +3221,7 @@ void | |||
3221 | GCT_send_kx (struct CadetTunnel *t, int force_reply) | 3221 | GCT_send_kx (struct CadetTunnel *t, int force_reply) |
3222 | { | 3222 | { |
3223 | struct CadetConnection *c; | 3223 | struct CadetConnection *c; |
3224 | struct GNUNET_CADET_KX msg; | 3224 | struct GNUNET_CADET_TunnelKeyExchangeMessage msg; |
3225 | enum GNUNET_CADET_KX_Flags flags; | 3225 | enum GNUNET_CADET_KX_Flags flags; |
3226 | 3226 | ||
3227 | LOG (GNUNET_ERROR_TYPE_INFO, "==> { KX} on %s\n", GCT_2s (t)); | 3227 | LOG (GNUNET_ERROR_TYPE_INFO, "==> { KX} on %s\n", GCT_2s (t)); |
@@ -3244,7 +3244,7 @@ GCT_send_kx (struct CadetTunnel *t, int force_reply) | |||
3244 | } | 3244 | } |
3245 | 3245 | ||
3246 | msg.header.size = htons (sizeof (msg)); | 3246 | msg.header.size = htons (sizeof (msg)); |
3247 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_KX); | 3247 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX); |
3248 | flags = GNUNET_CADET_KX_FLAG_NONE; | 3248 | flags = GNUNET_CADET_KX_FLAG_NONE; |
3249 | if (GNUNET_YES == force_reply) | 3249 | if (GNUNET_YES == force_reply) |
3250 | flags |= GNUNET_CADET_KX_FLAG_FORCE_REPLY; | 3250 | flags |= GNUNET_CADET_KX_FLAG_FORCE_REPLY; |
diff --git a/src/cadet/gnunet-service-cadet_tunnel.h b/src/cadet/gnunet-service-cadet_tunnel.h index 2d9a2b528..8d3d28f8d 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_Encrypted *msg); | 307 | const struct GNUNET_CADET_ConnectionEncryptedMessage *msg); |
308 | 308 | ||
309 | 309 | ||
310 | /** | 310 | /** |
@@ -315,7 +315,7 @@ GCT_handle_encrypted (struct CadetTunnel *t, | |||
315 | */ | 315 | */ |
316 | void | 316 | void |
317 | GCT_handle_kx (struct CadetTunnel *t, | 317 | GCT_handle_kx (struct CadetTunnel *t, |
318 | const struct GNUNET_CADET_KX *msg); | 318 | const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg); |
319 | 319 | ||
320 | 320 | ||
321 | /** | 321 | /** |
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index ef9b27318..336184589 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h | |||
@@ -127,9 +127,9 @@ 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_Encrypted) | 130 | * = sizeof (struct GNUNET_CADET_ConnectionEncryptedMessage) |
131 | * + sizeof (struct GNUNET_CADET_Data) | 131 | * + sizeof (struct GNUNET_CADET_ChannelDataMessage) |
132 | * + sizeof (struct GNUNET_CADET_ACK)) | 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(). |
135 | */ | 135 | */ |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index cea774932..4962a944a 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2632,7 +2632,7 @@ extern "C" | |||
2632 | /** | 2632 | /** |
2633 | * Send origin an ACK that the connection is complete | 2633 | * Send origin an ACK that the connection is complete |
2634 | */ | 2634 | */ |
2635 | #define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK 1001 | 2635 | #define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK 1001 |
2636 | 2636 | ||
2637 | /** | 2637 | /** |
2638 | * Notify that a connection is no longer valid | 2638 | * Notify that a connection is no longer valid |
@@ -2647,44 +2647,44 @@ extern "C" | |||
2647 | /** | 2647 | /** |
2648 | * At some point, the route will spontaneously change TODO | 2648 | * At some point, the route will spontaneously change TODO |
2649 | */ | 2649 | */ |
2650 | #define GNUNET_MESSAGE_TYPE_CADET_PATH_CHANGED 1004 | 2650 | #define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_PATH_CHANGED_UNIMPLEMENTED 1004 |
2651 | 2651 | ||
2652 | /** | 2652 | /** |
2653 | * Hop-by-hop, connection dependent ACK. | 2653 | * Hop-by-hop, connection dependent ACK. |
2654 | */ | 2654 | */ |
2655 | #define GNUNET_MESSAGE_TYPE_CADET_ACK 1005 | 2655 | #define GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK 1005 |
2656 | 2656 | ||
2657 | /** | 2657 | /** |
2658 | * Poll for a hop-by-hop ACK. | 2658 | * Poll for a hop-by-hop ACK. |
2659 | */ | 2659 | */ |
2660 | #define GNUNET_MESSAGE_TYPE_CADET_POLL 1006 | 2660 | #define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL 1006 |
2661 | 2661 | ||
2662 | /** | 2662 | /** |
2663 | * Key exchange encapsulation. | 2663 | * Key exchange encapsulation. |
2664 | */ | 2664 | */ |
2665 | #define GNUNET_MESSAGE_TYPE_CADET_KX 1007 | 2665 | #define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX 1007 |
2666 | 2666 | ||
2667 | /** | 2667 | /** |
2668 | * Axolotl encrypted data. | 2668 | * Axolotl encrypted data. |
2669 | */ | 2669 | */ |
2670 | #define GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED 1008 | 2670 | #define GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED 1008 |
2671 | 2671 | ||
2672 | /********************************** Channel *********************************/ | 2672 | /********************************** Channel *********************************/ |
2673 | 2673 | ||
2674 | /** | 2674 | /** |
2675 | * Payload data (inside an encrypted tunnel). | 2675 | * Payload data (inside an encrypted tunnel). |
2676 | */ | 2676 | */ |
2677 | #define GNUNET_MESSAGE_TYPE_CADET_DATA 1010 | 2677 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA 1010 |
2678 | 2678 | ||
2679 | /** | 2679 | /** |
2680 | * Confirm payload data end-to-end. | 2680 | * Confirm payload data end-to-end. |
2681 | */ | 2681 | */ |
2682 | #define GNUNET_MESSAGE_TYPE_CADET_DATA_ACK 1011 | 2682 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK 1011 |
2683 | 2683 | ||
2684 | /** | 2684 | /** |
2685 | * Announce connection is still alive (direction sensitive). | 2685 | * Announce connection is still alive (direction sensitive). |
2686 | */ | 2686 | */ |
2687 | #define GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE 1012 | 2687 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_KEEPALIVE 1012 |
2688 | 2688 | ||
2689 | /** | 2689 | /** |
2690 | * Ask the cadet service to create a new channel. | 2690 | * Ask the cadet service to create a new channel. |
@@ -2699,12 +2699,12 @@ extern "C" | |||
2699 | /** | 2699 | /** |
2700 | * Confirm the creation of a channel | 2700 | * Confirm the creation of a channel |
2701 | */ | 2701 | */ |
2702 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK 1015 | 2702 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK 1015 |
2703 | 2703 | ||
2704 | /** | 2704 | /** |
2705 | * Reject the creation of a channel | 2705 | * Reject the creation of a channel |
2706 | */ | 2706 | */ |
2707 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK 1016 | 2707 | #define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED 1016 |
2708 | 2708 | ||
2709 | /*********************************** Local **********************************/ | 2709 | /*********************************** Local **********************************/ |
2710 | 2710 | ||