diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-06 09:50:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-06 09:50:48 +0000 |
commit | 2bcbb0d6b305eaf3419314a4ea8e23c8ad89902f (patch) | |
tree | c53f3c4d86b6f35bdcc3e24d11c449e589b8d21d /src | |
parent | 90eb61b35b4643f53e411e16a16c5a3cb9e53e80 (diff) | |
download | gnunet-2bcbb0d6b305eaf3419314a4ea8e23c8ad89902f.tar.gz gnunet-2bcbb0d6b305eaf3419314a4ea8e23c8ad89902f.zip |
breaking stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/namestore.h | 177 |
1 files changed, 124 insertions, 53 deletions
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index c34422e13..17229ab24 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h | |||
@@ -158,21 +158,29 @@ struct LookupNameMessage | |||
158 | { | 158 | { |
159 | struct GNUNET_NAMESTORE_Header gns_header; | 159 | struct GNUNET_NAMESTORE_Header gns_header; |
160 | 160 | ||
161 | /* The zone */ | 161 | /** |
162 | * The zone | ||
163 | */ | ||
162 | GNUNET_HashCode zone; | 164 | GNUNET_HashCode zone; |
163 | 165 | ||
164 | /* Requested record type */ | 166 | /** |
167 | * Requested record type | ||
168 | */ | ||
165 | uint32_t record_type; | 169 | uint32_t record_type; |
166 | 170 | ||
167 | /* Requested record type */ | 171 | /** |
172 | * Length of the name | ||
173 | */ | ||
168 | uint32_t name_len; | 174 | uint32_t name_len; |
175 | |||
176 | /* 0-terminated name here */ | ||
169 | }; | 177 | }; |
170 | 178 | ||
171 | 179 | ||
172 | /** | 180 | /** |
173 | * Lookup response | 181 | * Lookup response |
174 | * Memory layout: | 182 | * Memory layout: |
175 | * [struct LookupNameResponseMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData][struct GNUNET_CRYPTO_RsaSignature] | 183 | * [struct LookupNameResponseMessage][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData] |
176 | */ | 184 | */ |
177 | struct LookupNameResponseMessage | 185 | struct LookupNameResponseMessage |
178 | { | 186 | { |
@@ -189,16 +197,26 @@ struct LookupNameResponseMessage | |||
189 | 197 | ||
190 | uint16_t rd_count; | 198 | uint16_t rd_count; |
191 | 199 | ||
192 | int32_t contains_sig; | 200 | int16_t contains_sig; |
201 | |||
202 | /** | ||
203 | * All zeros if 'contains_sig' is GNUNET_NO. | ||
204 | */ | ||
205 | struct GNUNET_CRYPTO_RsaSignature signature; | ||
193 | 206 | ||
194 | /* Requested record type */ | 207 | /** |
208 | * | ||
209 | */ | ||
210 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | ||
211 | |||
212 | /* 0-terminated name and serialized record data */ | ||
195 | }; | 213 | }; |
196 | 214 | ||
197 | 215 | ||
198 | /** | 216 | /** |
199 | * Put a record to the namestore | 217 | * Put a record to the namestore |
200 | * Memory layout: | 218 | * Memory layout: |
201 | * [struct RecordPutMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData] | 219 | * [struct RecordPutMessage][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData] |
202 | */ | 220 | */ |
203 | struct RecordPutMessage | 221 | struct RecordPutMessage |
204 | { | 222 | { |
@@ -207,23 +225,43 @@ struct RecordPutMessage | |||
207 | */ | 225 | */ |
208 | struct GNUNET_NAMESTORE_Header gns_header; | 226 | struct GNUNET_NAMESTORE_Header gns_header; |
209 | 227 | ||
210 | /* Contenct starts here */ | 228 | /** |
229 | * | ||
230 | */ | ||
231 | struct GNUNET_TIME_AbsoluteNBO expire; | ||
211 | 232 | ||
212 | /* name length */ | 233 | /** |
234 | * name length | ||
235 | */ | ||
213 | uint16_t name_len; | 236 | uint16_t name_len; |
214 | 237 | ||
215 | /* Length of serialized rd data */ | 238 | /** |
239 | * Length of serialized rd data | ||
240 | */ | ||
216 | uint16_t rd_len; | 241 | uint16_t rd_len; |
217 | 242 | ||
218 | /* Number of records contained */ | 243 | /** |
244 | * Number of records contained | ||
245 | */ | ||
219 | uint16_t rd_count; | 246 | uint16_t rd_count; |
220 | 247 | ||
221 | /* Length of pubkey */ | 248 | /** |
222 | uint16_t key_len; | 249 | * always zero (for alignment) |
223 | 250 | */ | |
224 | struct GNUNET_TIME_AbsoluteNBO expire; | 251 | uint16_t reserved; |
225 | 252 | ||
253 | /** | ||
254 | * | ||
255 | */ | ||
226 | struct GNUNET_CRYPTO_RsaSignature signature; | 256 | struct GNUNET_CRYPTO_RsaSignature signature; |
257 | |||
258 | /** | ||
259 | * | ||
260 | */ | ||
261 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | ||
262 | |||
263 | /* name (0-terminated) followed by "rd_count" serialized records */ | ||
264 | |||
227 | }; | 265 | }; |
228 | 266 | ||
229 | 267 | ||
@@ -235,19 +273,12 @@ struct RecordPutResponseMessage | |||
235 | /** | 273 | /** |
236 | * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE | 274 | * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE |
237 | */ | 275 | */ |
238 | struct GNUNET_MessageHeader header; | 276 | struct GNUNET_NAMESTORE_Header gns_header; |
239 | |||
240 | /** | ||
241 | * Operation ID in NBO | ||
242 | */ | ||
243 | uint32_t op_id; | ||
244 | |||
245 | /* Contenct starts here */ | ||
246 | 277 | ||
247 | /** | 278 | /** |
248 | * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success | 279 | * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success |
249 | */ | 280 | */ |
250 | uint16_t op_result; | 281 | int32_t op_result; |
251 | }; | 282 | }; |
252 | 283 | ||
253 | 284 | ||
@@ -263,19 +294,29 @@ struct RecordCreateMessage | |||
263 | */ | 294 | */ |
264 | struct GNUNET_NAMESTORE_Header gns_header; | 295 | struct GNUNET_NAMESTORE_Header gns_header; |
265 | 296 | ||
266 | /* Contenct starts here */ | 297 | struct GNUNET_TIME_AbsoluteNBO expire; |
267 | 298 | ||
268 | /* name length */ | 299 | /** |
300 | * name length | ||
301 | */ | ||
269 | uint16_t name_len; | 302 | uint16_t name_len; |
270 | 303 | ||
271 | /* Record data length */ | 304 | /** |
305 | * Record data length | ||
306 | */ | ||
272 | uint16_t rd_len; | 307 | uint16_t rd_len; |
273 | 308 | ||
274 | /* Record count */ | 309 | /** |
310 | * Record count | ||
311 | */ | ||
275 | uint16_t rd_count; | 312 | uint16_t rd_count; |
276 | 313 | ||
277 | /* private key length */ | 314 | /** |
315 | * private key length | ||
316 | */ | ||
278 | uint16_t pkey_len; | 317 | uint16_t pkey_len; |
318 | |||
319 | /* followed by: name and serialized record data --- PK??? */ | ||
279 | }; | 320 | }; |
280 | 321 | ||
281 | 322 | ||
@@ -290,13 +331,10 @@ struct RecordCreateResponseMessage | |||
290 | */ | 331 | */ |
291 | struct GNUNET_NAMESTORE_Header gns_header; | 332 | struct GNUNET_NAMESTORE_Header gns_header; |
292 | 333 | ||
293 | /* Contenct starts here */ | ||
294 | |||
295 | /** | 334 | /** |
296 | * name length: GNUNET_NO already existsw, GNUNET_YES on success, GNUNET_SYSERR error | 335 | * name length: GNUNET_NO already exists, GNUNET_YES on success, GNUNET_SYSERR error |
297 | */ | 336 | */ |
298 | int16_t op_result; | 337 | int32_t op_result; |
299 | |||
300 | 338 | ||
301 | }; | 339 | }; |
302 | 340 | ||
@@ -313,18 +351,24 @@ struct RecordRemoveMessage | |||
313 | */ | 351 | */ |
314 | struct GNUNET_NAMESTORE_Header gns_header; | 352 | struct GNUNET_NAMESTORE_Header gns_header; |
315 | 353 | ||
316 | /* Contenct starts here */ | 354 | /** |
317 | 355 | * Name length | |
318 | /* Name length */ | 356 | */ |
319 | uint16_t name_len; | 357 | uint16_t name_len; |
320 | 358 | ||
321 | /* Length of serialized rd data */ | 359 | /** |
360 | * Length of serialized rd data | ||
361 | */ | ||
322 | uint16_t rd_len; | 362 | uint16_t rd_len; |
323 | 363 | ||
324 | /* Number of records contained */ | 364 | /** |
365 | * Number of records contained | ||
366 | */ | ||
325 | uint16_t rd_count; | 367 | uint16_t rd_count; |
326 | 368 | ||
327 | /* Length of pubkey */ | 369 | /** |
370 | * Length of pubkey | ||
371 | */ | ||
328 | uint16_t key_len; | 372 | uint16_t key_len; |
329 | }; | 373 | }; |
330 | 374 | ||
@@ -339,8 +383,6 @@ struct RecordRemoveResponseMessage | |||
339 | */ | 383 | */ |
340 | struct GNUNET_NAMESTORE_Header gns_header; | 384 | struct GNUNET_NAMESTORE_Header gns_header; |
341 | 385 | ||
342 | /* Contenct starts here */ | ||
343 | |||
344 | /** | 386 | /** |
345 | * result: | 387 | * result: |
346 | * 0 : successful | 388 | * 0 : successful |
@@ -349,7 +391,7 @@ struct RecordRemoveResponseMessage | |||
349 | * 3 : Failed to create new signature | 391 | * 3 : Failed to create new signature |
350 | * 4 : Failed to put new set of records in database | 392 | * 4 : Failed to put new set of records in database |
351 | */ | 393 | */ |
352 | uint16_t op_result; | 394 | int32_t op_result; |
353 | }; | 395 | }; |
354 | 396 | ||
355 | 397 | ||
@@ -360,10 +402,14 @@ struct ZoneToNameMessage | |||
360 | { | 402 | { |
361 | struct GNUNET_NAMESTORE_Header gns_header; | 403 | struct GNUNET_NAMESTORE_Header gns_header; |
362 | 404 | ||
363 | /* The hash of public key of the zone to look up in */ | 405 | /** |
406 | * The hash of public key of the zone to look up in | ||
407 | */ | ||
364 | GNUNET_HashCode zone; | 408 | GNUNET_HashCode zone; |
365 | 409 | ||
366 | /* The hash of the public key of the target zone */ | 410 | /** |
411 | * The hash of the public key of the target zone | ||
412 | */ | ||
367 | GNUNET_HashCode value_zone; | 413 | GNUNET_HashCode value_zone; |
368 | }; | 414 | }; |
369 | 415 | ||
@@ -382,11 +428,14 @@ struct ZoneToNameResponseMessage | |||
382 | 428 | ||
383 | uint16_t rd_count; | 429 | uint16_t rd_count; |
384 | 430 | ||
385 | int32_t contains_sig; | ||
386 | |||
387 | /* result in NBO: GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error */ | 431 | /* result in NBO: GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error */ |
388 | int16_t res; | 432 | int16_t res; |
389 | 433 | ||
434 | /** | ||
435 | * | ||
436 | */ | ||
437 | struct GNUNET_CRYPTO_RsaSignature signature; | ||
438 | |||
390 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; | 439 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; |
391 | 440 | ||
392 | }; | 441 | }; |
@@ -403,12 +452,12 @@ struct ZoneIterationStartMessage | |||
403 | */ | 452 | */ |
404 | struct GNUNET_NAMESTORE_Header gns_header; | 453 | struct GNUNET_NAMESTORE_Header gns_header; |
405 | 454 | ||
406 | /* Contenct starts here */ | 455 | GNUNET_HashCode zone; |
407 | 456 | ||
408 | uint16_t must_have_flags; | 457 | uint16_t must_have_flags; |
458 | |||
409 | uint16_t must_not_have_flags; | 459 | uint16_t must_not_have_flags; |
410 | 460 | ||
411 | GNUNET_HashCode zone; | ||
412 | }; | 461 | }; |
413 | 462 | ||
414 | 463 | ||
@@ -436,7 +485,9 @@ struct ZoneIterationStopMessage | |||
436 | }; | 485 | }; |
437 | 486 | ||
438 | /** | 487 | /** |
439 | * Ask for next result of zone iteration for the given operation | 488 | * Next result of zone iteration for the given operation |
489 | * // FIXME: use 'struct LookupResponseMessage' instead? (identical except | ||
490 | * for having 'contains_sig' instead of 'reserved', but fully compatible otherwise). | ||
440 | */ | 491 | */ |
441 | struct ZoneIterationResponseMessage | 492 | struct ZoneIterationResponseMessage |
442 | { | 493 | { |
@@ -449,11 +500,31 @@ struct ZoneIterationResponseMessage | |||
449 | 500 | ||
450 | uint16_t name_len; | 501 | uint16_t name_len; |
451 | 502 | ||
452 | uint16_t contains_sig; | ||
453 | |||
454 | /* Record data length */ | 503 | /* Record data length */ |
455 | uint16_t rd_len; | 504 | uint16_t rd_len; |
456 | 505 | ||
506 | /** | ||
507 | * Number of records contained | ||
508 | */ | ||
509 | uint16_t rd_count; | ||
510 | |||
511 | /** | ||
512 | * always zero (for alignment) | ||
513 | */ | ||
514 | uint16_t reserved; | ||
515 | |||
516 | /** | ||
517 | * All zeros if 'contains_sig' is GNUNET_NO. | ||
518 | */ | ||
519 | struct GNUNET_CRYPTO_RsaSignature signature; | ||
520 | |||
521 | /** | ||
522 | * | ||
523 | */ | ||
524 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | ||
525 | |||
526 | |||
527 | |||
457 | }; | 528 | }; |
458 | GNUNET_NETWORK_STRUCT_END | 529 | GNUNET_NETWORK_STRUCT_END |
459 | 530 | ||