diff options
Diffstat (limited to 'src/psycstore/psycstore.h')
-rw-r--r-- | src/psycstore/psycstore.h | 160 |
1 files changed, 99 insertions, 61 deletions
diff --git a/src/psycstore/psycstore.h b/src/psycstore/psycstore.h index 17905f422..e6a82848a 100644 --- a/src/psycstore/psycstore.h +++ b/src/psycstore/psycstore.h | |||
@@ -42,15 +42,17 @@ struct OperationResult | |||
42 | */ | 42 | */ |
43 | struct GNUNET_MessageHeader header; | 43 | struct GNUNET_MessageHeader header; |
44 | 44 | ||
45 | uint32_t reserved GNUNET_PACKED; | ||
46 | |||
45 | /** | 47 | /** |
46 | * Operation ID. | 48 | * Operation ID. |
47 | */ | 49 | */ |
48 | uint32_t op_id GNUNET_PACKED; | 50 | uint64_t op_id GNUNET_PACKED; |
49 | 51 | ||
50 | /** | 52 | /** |
51 | * Status code for the operation. | 53 | * Status code for the operation. |
52 | */ | 54 | */ |
53 | int64_t result_code GNUNET_PACKED; | 55 | uint64_t result_code GNUNET_PACKED; |
54 | 56 | ||
55 | /* followed by 0-terminated error message (on error) */ | 57 | /* followed by 0-terminated error message (on error) */ |
56 | 58 | ||
@@ -70,9 +72,17 @@ struct CountersResult | |||
70 | struct GNUNET_MessageHeader header; | 72 | struct GNUNET_MessageHeader header; |
71 | 73 | ||
72 | /** | 74 | /** |
75 | * Status code for the operation: | ||
76 | * #GNUNET_OK: success, counter values are returned. | ||
77 | * #GNUNET_NO: no message has been sent to the channel yet. | ||
78 | * #GNUNET_SYSERR: an error occurred. | ||
79 | */ | ||
80 | uint32_t result_code GNUNET_PACKED; | ||
81 | |||
82 | /** | ||
73 | * Operation ID. | 83 | * Operation ID. |
74 | */ | 84 | */ |
75 | uint32_t op_id GNUNET_PACKED; | 85 | uint64_t op_id GNUNET_PACKED; |
76 | 86 | ||
77 | uint64_t max_fragment_id GNUNET_PACKED; | 87 | uint64_t max_fragment_id GNUNET_PACKED; |
78 | 88 | ||
@@ -81,14 +91,6 @@ struct CountersResult | |||
81 | uint64_t max_group_generation GNUNET_PACKED; | 91 | uint64_t max_group_generation GNUNET_PACKED; |
82 | 92 | ||
83 | uint64_t max_state_message_id GNUNET_PACKED; | 93 | uint64_t max_state_message_id GNUNET_PACKED; |
84 | |||
85 | /** | ||
86 | * Status code for the operation: | ||
87 | * #GNUNET_OK: success, counter values are returned. | ||
88 | * #GNUNET_NO: no message has been sent to the channel yet. | ||
89 | * #GNUNET_SYSERR: an error occurred. | ||
90 | */ | ||
91 | int32_t result_code GNUNET_PACKED; | ||
92 | }; | 94 | }; |
93 | 95 | ||
94 | 96 | ||
@@ -102,15 +104,14 @@ struct FragmentResult | |||
102 | */ | 104 | */ |
103 | struct GNUNET_MessageHeader header; | 105 | struct GNUNET_MessageHeader header; |
104 | 106 | ||
107 | uint32_t psycstore_flags GNUNET_PACKED; | ||
108 | |||
105 | /** | 109 | /** |
106 | * Operation ID. | 110 | * Operation ID. |
107 | */ | 111 | */ |
108 | uint32_t op_id GNUNET_PACKED; | 112 | uint64_t op_id GNUNET_PACKED; |
109 | |||
110 | uint32_t psycstore_flags GNUNET_PACKED; | ||
111 | |||
112 | /* followed by GNUNET_MULTICAST_MessageHeader */ | ||
113 | 113 | ||
114 | /* Followed by GNUNET_MULTICAST_MessageHeader */ | ||
114 | }; | 115 | }; |
115 | 116 | ||
116 | 117 | ||
@@ -124,14 +125,16 @@ struct StateResult | |||
124 | */ | 125 | */ |
125 | struct GNUNET_MessageHeader header; | 126 | struct GNUNET_MessageHeader header; |
126 | 127 | ||
128 | uint16_t name_size GNUNET_PACKED; | ||
129 | |||
130 | uint16_t reserved GNUNET_PACKED; | ||
131 | |||
127 | /** | 132 | /** |
128 | * Operation ID. | 133 | * Operation ID. |
129 | */ | 134 | */ |
130 | uint32_t op_id GNUNET_PACKED; | 135 | uint64_t op_id GNUNET_PACKED; |
131 | |||
132 | uint16_t name_size GNUNET_PACKED; | ||
133 | 136 | ||
134 | /* followed by name and value */ | 137 | /* Followed by name and value */ |
135 | }; | 138 | }; |
136 | 139 | ||
137 | 140 | ||
@@ -142,13 +145,14 @@ struct OperationRequest | |||
142 | { | 145 | { |
143 | struct GNUNET_MessageHeader header; | 146 | struct GNUNET_MessageHeader header; |
144 | 147 | ||
148 | uint32_t reserved GNUNET_PACKED; | ||
149 | |||
145 | /** | 150 | /** |
146 | * Operation ID. | 151 | * Operation ID. |
147 | */ | 152 | */ |
148 | uint32_t op_id GNUNET_PACKED; | 153 | uint64_t op_id GNUNET_PACKED; |
149 | 154 | ||
150 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; | 155 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; |
151 | |||
152 | }; | 156 | }; |
153 | 157 | ||
154 | 158 | ||
@@ -162,10 +166,12 @@ struct MembershipStoreRequest | |||
162 | */ | 166 | */ |
163 | struct GNUNET_MessageHeader header; | 167 | struct GNUNET_MessageHeader header; |
164 | 168 | ||
169 | uint32_t reserved GNUNET_PACKED; | ||
170 | |||
165 | /** | 171 | /** |
166 | * Operation ID. | 172 | * Operation ID. |
167 | */ | 173 | */ |
168 | uint32_t op_id GNUNET_PACKED; | 174 | uint64_t op_id GNUNET_PACKED; |
169 | 175 | ||
170 | /** | 176 | /** |
171 | * Channel's public key. | 177 | * Channel's public key. |
@@ -177,9 +183,9 @@ struct MembershipStoreRequest | |||
177 | */ | 183 | */ |
178 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; | 184 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; |
179 | 185 | ||
180 | uint64_t announced_at; | 186 | uint64_t announced_at GNUNET_PACKED; |
181 | uint64_t effective_since; | 187 | uint64_t effective_since GNUNET_PACKED; |
182 | uint64_t group_generation; | 188 | uint64_t group_generation GNUNET_PACKED; |
183 | uint8_t did_join; | 189 | uint8_t did_join; |
184 | }; | 190 | }; |
185 | 191 | ||
@@ -194,10 +200,12 @@ struct MembershipTestRequest | |||
194 | */ | 200 | */ |
195 | struct GNUNET_MessageHeader header; | 201 | struct GNUNET_MessageHeader header; |
196 | 202 | ||
203 | uint32_t reserved GNUNET_PACKED; | ||
204 | |||
197 | /** | 205 | /** |
198 | * Operation ID. | 206 | * Operation ID. |
199 | */ | 207 | */ |
200 | uint32_t op_id GNUNET_PACKED; | 208 | uint64_t op_id GNUNET_PACKED; |
201 | 209 | ||
202 | /** | 210 | /** |
203 | * Channel's public key. | 211 | * Channel's public key. |
@@ -226,9 +234,9 @@ struct FragmentStoreRequest | |||
226 | struct GNUNET_MessageHeader header; | 234 | struct GNUNET_MessageHeader header; |
227 | 235 | ||
228 | /** | 236 | /** |
229 | * Operation ID. | 237 | * enum GNUNET_PSYCSTORE_MessageFlags |
230 | */ | 238 | */ |
231 | uint32_t op_id GNUNET_PACKED; | 239 | uint32_t psycstore_flags GNUNET_PACKED; |
232 | 240 | ||
233 | /** | 241 | /** |
234 | * Channel's public key. | 242 | * Channel's public key. |
@@ -236,9 +244,9 @@ struct FragmentStoreRequest | |||
236 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; | 244 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; |
237 | 245 | ||
238 | /** | 246 | /** |
239 | * enum GNUNET_PSYCSTORE_MessageFlags | 247 | * Operation ID. |
240 | */ | 248 | */ |
241 | uint32_t psycstore_flags GNUNET_PACKED; | 249 | uint64_t op_id; |
242 | 250 | ||
243 | /* Followed by fragment */ | 251 | /* Followed by fragment */ |
244 | }; | 252 | }; |
@@ -254,10 +262,12 @@ struct FragmentGetRequest | |||
254 | */ | 262 | */ |
255 | struct GNUNET_MessageHeader header; | 263 | struct GNUNET_MessageHeader header; |
256 | 264 | ||
265 | uint32_t reserved GNUNET_PACKED; | ||
266 | |||
257 | /** | 267 | /** |
258 | * Operation ID. | 268 | * Operation ID. |
259 | */ | 269 | */ |
260 | uint32_t op_id GNUNET_PACKED; | 270 | uint64_t op_id GNUNET_PACKED; |
261 | 271 | ||
262 | /** | 272 | /** |
263 | * Channel's public key. | 273 | * Channel's public key. |
@@ -270,9 +280,19 @@ struct FragmentGetRequest | |||
270 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; | 280 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; |
271 | 281 | ||
272 | /** | 282 | /** |
273 | * Fragment ID to request. | 283 | * First fragment ID to request. |
274 | */ | 284 | */ |
275 | uint64_t fragment_id GNUNET_PACKED; | 285 | uint64_t first_fragment_id GNUNET_PACKED; |
286 | |||
287 | /** | ||
288 | * Last fragment ID to request. | ||
289 | */ | ||
290 | uint64_t last_fragment_id GNUNET_PACKED; | ||
291 | |||
292 | /** | ||
293 | * Maximum number of fragments to retrieve. | ||
294 | */ | ||
295 | uint64_t fragment_limit GNUNET_PACKED; | ||
276 | 296 | ||
277 | /** | 297 | /** |
278 | * Do membership test with @a slave_key before returning fragment? | 298 | * Do membership test with @a slave_key before returning fragment? |
@@ -292,10 +312,12 @@ struct MessageGetRequest | |||
292 | */ | 312 | */ |
293 | struct GNUNET_MessageHeader header; | 313 | struct GNUNET_MessageHeader header; |
294 | 314 | ||
315 | uint32_t reserved GNUNET_PACKED; | ||
316 | |||
295 | /** | 317 | /** |
296 | * Operation ID. | 318 | * Operation ID. |
297 | */ | 319 | */ |
298 | uint32_t op_id GNUNET_PACKED; | 320 | uint64_t op_id GNUNET_PACKED; |
299 | 321 | ||
300 | /** | 322 | /** |
301 | * Channel's public key. | 323 | * Channel's public key. |
@@ -308,9 +330,19 @@ struct MessageGetRequest | |||
308 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; | 330 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; |
309 | 331 | ||
310 | /** | 332 | /** |
311 | * Message ID to request. | 333 | * First message ID to request. |
312 | */ | 334 | */ |
313 | uint64_t message_id GNUNET_PACKED; | 335 | uint64_t first_message_id GNUNET_PACKED; |
336 | |||
337 | /** | ||
338 | * Last message ID to request. | ||
339 | */ | ||
340 | uint64_t last_message_id GNUNET_PACKED; | ||
341 | |||
342 | /** | ||
343 | * Maximum number of messages to retrieve. | ||
344 | */ | ||
345 | uint64_t message_limit GNUNET_PACKED; | ||
314 | 346 | ||
315 | /** | 347 | /** |
316 | * Do membership test with @a slave_key before returning fragment? | 348 | * Do membership test with @a slave_key before returning fragment? |
@@ -330,10 +362,12 @@ struct MessageGetFragmentRequest | |||
330 | */ | 362 | */ |
331 | struct GNUNET_MessageHeader header; | 363 | struct GNUNET_MessageHeader header; |
332 | 364 | ||
365 | uint32_t reserved GNUNET_PACKED; | ||
366 | |||
333 | /** | 367 | /** |
334 | * Operation ID. | 368 | * Operation ID. |
335 | */ | 369 | */ |
336 | uint32_t op_id GNUNET_PACKED; | 370 | uint64_t op_id GNUNET_PACKED; |
337 | 371 | ||
338 | /** | 372 | /** |
339 | * Channel's public key. | 373 | * Channel's public key. |
@@ -373,10 +407,12 @@ struct StateHashUpdateRequest | |||
373 | */ | 407 | */ |
374 | struct GNUNET_MessageHeader header; | 408 | struct GNUNET_MessageHeader header; |
375 | 409 | ||
410 | uint32_t reserved GNUNET_PACKED; | ||
411 | |||
376 | /** | 412 | /** |
377 | * Operation ID. | 413 | * Operation ID. |
378 | */ | 414 | */ |
379 | uint32_t op_id GNUNET_PACKED; | 415 | uint64_t op_id GNUNET_PACKED; |
380 | 416 | ||
381 | /** | 417 | /** |
382 | * Channel's public key. | 418 | * Channel's public key. |
@@ -405,20 +441,6 @@ struct StateModifyRequest | |||
405 | struct GNUNET_MessageHeader header; | 441 | struct GNUNET_MessageHeader header; |
406 | 442 | ||
407 | /** | 443 | /** |
408 | * Operation ID. | ||
409 | */ | ||
410 | uint32_t op_id GNUNET_PACKED; | ||
411 | |||
412 | /** | ||
413 | * Channel's public key. | ||
414 | */ | ||
415 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; | ||
416 | |||
417 | uint64_t message_id GNUNET_PACKED; | ||
418 | |||
419 | uint64_t state_delta GNUNET_PACKED; | ||
420 | |||
421 | /** | ||
422 | * Size of name, including NUL terminator. | 444 | * Size of name, including NUL terminator. |
423 | */ | 445 | */ |
424 | uint16_t name_size GNUNET_PACKED; | 446 | uint16_t name_size GNUNET_PACKED; |
@@ -433,6 +455,20 @@ struct StateModifyRequest | |||
433 | */ | 455 | */ |
434 | uint8_t oper; | 456 | uint8_t oper; |
435 | 457 | ||
458 | /** | ||
459 | * Operation ID. | ||
460 | */ | ||
461 | uint64_t op_id GNUNET_PACKED; | ||
462 | |||
463 | /** | ||
464 | * Channel's public key. | ||
465 | */ | ||
466 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; | ||
467 | |||
468 | uint64_t message_id GNUNET_PACKED; | ||
469 | |||
470 | uint64_t state_delta GNUNET_PACKED; | ||
471 | |||
436 | /* Followed by NUL-terminated name, then the value. */ | 472 | /* Followed by NUL-terminated name, then the value. */ |
437 | }; | 473 | }; |
438 | 474 | ||
@@ -448,26 +484,28 @@ struct StateSyncRequest | |||
448 | struct GNUNET_MessageHeader header; | 484 | struct GNUNET_MessageHeader header; |
449 | 485 | ||
450 | /** | 486 | /** |
451 | * Operation ID. | 487 | * Size of name, including NUL terminator. |
452 | */ | 488 | */ |
453 | uint32_t op_id GNUNET_PACKED; | 489 | uint16_t name_size GNUNET_PACKED; |
454 | 490 | ||
455 | /** | 491 | /** |
456 | * Channel's public key. | 492 | * OR'd StateOpFlags |
457 | */ | 493 | */ |
458 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; | 494 | uint8_t flags; |
495 | |||
496 | uint8_t reserved; | ||
459 | 497 | ||
460 | uint64_t message_id GNUNET_PACKED; | 498 | uint64_t message_id GNUNET_PACKED; |
461 | 499 | ||
462 | /** | 500 | /** |
463 | * Size of name, including NUL terminator. | 501 | * Operation ID. |
464 | */ | 502 | */ |
465 | uint16_t name_size GNUNET_PACKED; | 503 | uint64_t op_id GNUNET_PACKED; |
466 | 504 | ||
467 | /** | 505 | /** |
468 | * OR'd StateOpFlags | 506 | * Channel's public key. |
469 | */ | 507 | */ |
470 | uint8_t flags; | 508 | struct GNUNET_CRYPTO_EddsaPublicKey channel_key; |
471 | 509 | ||
472 | /* Followed by NUL-terminated name, then the value. */ | 510 | /* Followed by NUL-terminated name, then the value. */ |
473 | }; | 511 | }; |