diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-12 11:31:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-12 11:31:50 +0000 |
commit | 02ccdcf0ef5c039224a397f057b2a76f54364d92 (patch) | |
tree | db9e4faee6831b965fedb5648915a556be5ff091 /src/cadet/gnunet-service-cadet_channel.c | |
parent | 17987cc9db00b169dd8bff5a620e5d5ab51ff044 (diff) | |
download | gnunet-02ccdcf0ef5c039224a397f057b2a76f54364d92.tar.gz gnunet-02ccdcf0ef5c039224a397f057b2a76f54364d92.zip |
realigning CADET messages and bumping message types to avoid interactions with incompatible old versions complicating diagnostics
Diffstat (limited to 'src/cadet/gnunet-service-cadet_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.c | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index d1dcfdd2d..0e9b7a3af 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c | |||
@@ -94,25 +94,25 @@ struct CadetChannelQueue | |||
94 | */ | 94 | */ |
95 | struct CadetReliableMessage | 95 | struct CadetReliableMessage |
96 | { | 96 | { |
97 | /** | 97 | /** |
98 | * Double linked list, FIFO style | 98 | * Double linked list, FIFO style |
99 | */ | 99 | */ |
100 | struct CadetReliableMessage *next; | 100 | struct CadetReliableMessage *next; |
101 | struct CadetReliableMessage *prev; | 101 | struct CadetReliableMessage *prev; |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Type of message (payload, channel management). | 104 | * Type of message (payload, channel management). |
105 | */ | 105 | */ |
106 | int16_t type; | 106 | int16_t type; |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Tunnel Reliability queue this message is in. | 109 | * Tunnel Reliability queue this message is in. |
110 | */ | 110 | */ |
111 | struct CadetChannelReliability *rel; | 111 | struct CadetChannelReliability *rel; |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * ID of the message (ACK needed to free) | 114 | * ID of the message (ACK needed to free) |
115 | */ | 115 | */ |
116 | uint32_t mid; | 116 | uint32_t mid; |
117 | 117 | ||
118 | /** | 118 | /** |
@@ -120,9 +120,9 @@ struct CadetReliableMessage | |||
120 | */ | 120 | */ |
121 | struct CadetChannelQueue *chq; | 121 | struct CadetChannelQueue *chq; |
122 | 122 | ||
123 | /** | 123 | /** |
124 | * When was this message issued (to calculate ACK delay) | 124 | * When was this message issued (to calculate ACK delay) |
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_Data with payload */ |
@@ -134,46 +134,46 @@ struct CadetReliableMessage | |||
134 | */ | 134 | */ |
135 | struct CadetChannelReliability | 135 | struct CadetChannelReliability |
136 | { | 136 | { |
137 | /** | 137 | /** |
138 | * Channel this is about. | 138 | * Channel this is about. |
139 | */ | 139 | */ |
140 | struct CadetChannel *ch; | 140 | struct CadetChannel *ch; |
141 | 141 | ||
142 | /** | 142 | /** |
143 | * DLL of messages sent and not yet ACK'd. | 143 | * DLL of messages sent and not yet ACK'd. |
144 | */ | 144 | */ |
145 | struct CadetReliableMessage *head_sent; | 145 | struct CadetReliableMessage *head_sent; |
146 | struct CadetReliableMessage *tail_sent; | 146 | struct CadetReliableMessage *tail_sent; |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * DLL of messages received out of order. | 149 | * DLL of messages received out of order. |
150 | */ | 150 | */ |
151 | struct CadetReliableMessage *head_recv; | 151 | struct CadetReliableMessage *head_recv; |
152 | struct CadetReliableMessage *tail_recv; | 152 | struct CadetReliableMessage *tail_recv; |
153 | 153 | ||
154 | /** | 154 | /** |
155 | * Messages received. | 155 | * Messages received. |
156 | */ | 156 | */ |
157 | unsigned int n_recv; | 157 | unsigned int n_recv; |
158 | 158 | ||
159 | /** | 159 | /** |
160 | * Next MID to use for outgoing traffic. | 160 | * Next MID to use for outgoing traffic. |
161 | */ | 161 | */ |
162 | uint32_t mid_send; | 162 | uint32_t mid_send; |
163 | 163 | ||
164 | /** | 164 | /** |
165 | * Next MID expected for incoming traffic. | 165 | * Next MID expected for incoming traffic. |
166 | */ | 166 | */ |
167 | uint32_t mid_recv; | 167 | uint32_t mid_recv; |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * Handle for queued unique data CREATE, DATA_ACK. | 170 | * Handle for queued unique data CREATE, DATA_ACK. |
171 | */ | 171 | */ |
172 | struct CadetChannelQueue *uniq; | 172 | struct CadetChannelQueue *uniq; |
173 | 173 | ||
174 | /** | 174 | /** |
175 | * Can we send data to the client? | 175 | * Can we send data to the client? |
176 | */ | 176 | */ |
177 | int client_ready; | 177 | int client_ready; |
178 | 178 | ||
179 | /** | 179 | /** |
@@ -181,19 +181,19 @@ struct CadetChannelReliability | |||
181 | */ | 181 | */ |
182 | int client_allowed; | 182 | int client_allowed; |
183 | 183 | ||
184 | /** | 184 | /** |
185 | * Task to resend/poll in case no ACK is received. | 185 | * Task to resend/poll in case no ACK is received. |
186 | */ | 186 | */ |
187 | struct GNUNET_SCHEDULER_Task * retry_task; | 187 | struct GNUNET_SCHEDULER_Task * retry_task; |
188 | 188 | ||
189 | /** | 189 | /** |
190 | * Counter for exponential backoff. | 190 | * Counter for exponential backoff. |
191 | */ | 191 | */ |
192 | struct GNUNET_TIME_Relative retry_timer; | 192 | struct GNUNET_TIME_Relative retry_timer; |
193 | 193 | ||
194 | /** | 194 | /** |
195 | * How long does it usually take to get an ACK. | 195 | * How long does it usually take to get an ACK. |
196 | */ | 196 | */ |
197 | struct GNUNET_TIME_Relative expected_delay; | 197 | struct GNUNET_TIME_Relative expected_delay; |
198 | }; | 198 | }; |
199 | 199 | ||
@@ -203,85 +203,85 @@ struct CadetChannelReliability | |||
203 | */ | 203 | */ |
204 | struct CadetChannel | 204 | struct CadetChannel |
205 | { | 205 | { |
206 | /** | 206 | /** |
207 | * Tunnel this channel is in. | 207 | * Tunnel this channel is in. |
208 | */ | 208 | */ |
209 | struct CadetTunnel *t; | 209 | struct CadetTunnel *t; |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * Destination port of the channel. | 212 | * Destination port of the channel. |
213 | */ | 213 | */ |
214 | struct GNUNET_HashCode port; | 214 | struct GNUNET_HashCode port; |
215 | 215 | ||
216 | /** | 216 | /** |
217 | * Global channel number ( < GNUNET_CADET_LOCAL_CHANNEL_ID_CLI) | 217 | * Global channel number ( < GNUNET_CADET_LOCAL_CHANNEL_ID_CLI) |
218 | */ | 218 | */ |
219 | CADET_ChannelNumber gid; | 219 | CADET_ChannelNumber gid; |
220 | 220 | ||
221 | /** | 221 | /** |
222 | * Local tunnel number for root (owner) client. | 222 | * Local tunnel number for root (owner) client. |
223 | * ( >= GNUNET_CADET_LOCAL_CHANNEL_ID_CLI or 0 ) | 223 | * ( >= GNUNET_CADET_LOCAL_CHANNEL_ID_CLI or 0 ) |
224 | */ | 224 | */ |
225 | CADET_ChannelNumber lid_root; | 225 | CADET_ChannelNumber lid_root; |
226 | 226 | ||
227 | /** | 227 | /** |
228 | * Local tunnel number for local destination clients (incoming number) | 228 | * Local tunnel number for local destination clients (incoming number) |
229 | * ( >= GNUNET_CADET_LOCAL_CHANNEL_ID_SERV or 0). | 229 | * ( >= GNUNET_CADET_LOCAL_CHANNEL_ID_SERV or 0). |
230 | */ | 230 | */ |
231 | CADET_ChannelNumber lid_dest; | 231 | CADET_ChannelNumber lid_dest; |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * Channel state. | 234 | * Channel state. |
235 | */ | 235 | */ |
236 | enum CadetChannelState state; | 236 | enum CadetChannelState state; |
237 | 237 | ||
238 | /** | 238 | /** |
239 | * Is the tunnel bufferless (minimum latency)? | 239 | * Is the tunnel bufferless (minimum latency)? |
240 | */ | 240 | */ |
241 | int nobuffer; | 241 | int nobuffer; |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * Is the tunnel reliable? | 244 | * Is the tunnel reliable? |
245 | */ | 245 | */ |
246 | int reliable; | 246 | int reliable; |
247 | 247 | ||
248 | /** | 248 | /** |
249 | * Last time the channel was used | 249 | * Last time the channel was used |
250 | */ | 250 | */ |
251 | struct GNUNET_TIME_Absolute timestamp; | 251 | struct GNUNET_TIME_Absolute timestamp; |
252 | 252 | ||
253 | /** | 253 | /** |
254 | * Client owner of the tunnel, if any | 254 | * Client owner of the tunnel, if any |
255 | */ | 255 | */ |
256 | struct CadetClient *root; | 256 | struct CadetClient *root; |
257 | 257 | ||
258 | /** | 258 | /** |
259 | * Client destination of the tunnel, if any. | 259 | * Client destination of the tunnel, if any. |
260 | */ | 260 | */ |
261 | struct CadetClient *dest; | 261 | struct CadetClient *dest; |
262 | 262 | ||
263 | /** | 263 | /** |
264 | * Flag to signal the destruction of the channel. | 264 | * Flag to signal the destruction of the channel. |
265 | * If this is set GNUNET_YES the channel will be destroyed | 265 | * If this is set to #GNUNET_YES the channel will be destroyed |
266 | * when the queue is empty. | 266 | * when the queue is empty. |
267 | */ | 267 | */ |
268 | int destroy; | 268 | int destroy; |
269 | 269 | ||
270 | /** | 270 | /** |
271 | * Total (reliable) messages pending ACK for this channel. | 271 | * Total (reliable) messages pending ACK for this channel. |
272 | */ | 272 | */ |
273 | unsigned int pending_messages; | 273 | unsigned int pending_messages; |
274 | 274 | ||
275 | /** | 275 | /** |
276 | * Reliability data. | 276 | * Reliability data. |
277 | * Only present (non-NULL) at the owner of a tunnel. | 277 | * Only present (non-NULL) at the owner of a tunnel. |
278 | */ | 278 | */ |
279 | struct CadetChannelReliability *root_rel; | 279 | struct CadetChannelReliability *root_rel; |
280 | 280 | ||
281 | /** | 281 | /** |
282 | * Reliability data. | 282 | * Reliability data. |
283 | * Only present (non-NULL) at the destination of a tunnel. | 283 | * Only present (non-NULL) at the destination of a tunnel. |
284 | */ | 284 | */ |
285 | struct CadetChannelReliability *dest_rel; | 285 | struct CadetChannelReliability *dest_rel; |
286 | 286 | ||
287 | }; | 287 | }; |