diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/include/gnunet_gnsrecord_lib.h | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/include/gnunet_gnsrecord_lib.h')
-rw-r--r-- | src/include/gnunet_gnsrecord_lib.h | 98 |
1 files changed, 47 insertions, 51 deletions
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index a92cdc2e7..5effa855f 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
@@ -145,7 +145,6 @@ extern "C" { | |||
145 | * Flags that can be set for a record. | 145 | * Flags that can be set for a record. |
146 | */ | 146 | */ |
147 | enum GNUNET_GNSRECORD_Flags { | 147 | enum GNUNET_GNSRECORD_Flags { |
148 | |||
149 | /** | 148 | /** |
150 | * No special options. | 149 | * No special options. |
151 | */ | 150 | */ |
@@ -194,7 +193,6 @@ enum GNUNET_GNSRECORD_Flags { | |||
194 | * A GNS record. | 193 | * A GNS record. |
195 | */ | 194 | */ |
196 | struct GNUNET_GNSRECORD_Data { | 195 | struct GNUNET_GNSRECORD_Data { |
197 | |||
198 | /** | 196 | /** |
199 | * Binary value stored in the DNS record. Note: "data" must never | 197 | * Binary value stored in the DNS record. Note: "data" must never |
200 | * be individually 'malloc'ed, but instead always points into some | 198 | * be individually 'malloc'ed, but instead always points into some |
@@ -255,7 +253,6 @@ struct GNUNET_GNSRECORD_PlaceData { | |||
255 | * Information we have in an encrypted block with record data (i.e. in the DHT). | 253 | * Information we have in an encrypted block with record data (i.e. in the DHT). |
256 | */ | 254 | */ |
257 | struct GNUNET_GNSRECORD_Block { | 255 | struct GNUNET_GNSRECORD_Block { |
258 | |||
259 | /** | 256 | /** |
260 | * Signature of the block. | 257 | * Signature of the block. |
261 | */ | 258 | */ |
@@ -292,7 +289,6 @@ struct GNUNET_GNSRECORD_Block { | |||
292 | * records inseparable from the "main" A/AAAA/VPN/etc. records. | 289 | * records inseparable from the "main" A/AAAA/VPN/etc. records. |
293 | */ | 290 | */ |
294 | struct GNUNET_GNSRECORD_BoxRecord { | 291 | struct GNUNET_GNSRECORD_BoxRecord { |
295 | |||
296 | /** | 292 | /** |
297 | * Protocol of the boxed record (6 = TCP, 17 = UDP, etc.). | 293 | * Protocol of the boxed record (6 = TCP, 17 = UDP, etc.). |
298 | * Yes, in IP protocols are usually limited to 8 bits. In NBO. | 294 | * Yes, in IP protocols are usually limited to 8 bits. In NBO. |
@@ -344,7 +340,7 @@ GNUNET_NETWORK_STRUCT_END | |||
344 | * @param rd array of records with data to store | 340 | * @param rd array of records with data to store |
345 | */ | 341 | */ |
346 | typedef void (*GNUNET_GNSRECORD_RecordCallback) ( | 342 | typedef void (*GNUNET_GNSRECORD_RecordCallback) ( |
347 | void *cls, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); | 343 | void *cls, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); |
348 | 344 | ||
349 | 345 | ||
350 | /* ***************** API related to GNSRECORD plugins ************** */ | 346 | /* ***************** API related to GNSRECORD plugins ************** */ |
@@ -359,8 +355,8 @@ typedef void (*GNUNET_GNSRECORD_RecordCallback) ( | |||
359 | * @return NULL on error, otherwise human-readable representation of the value | 355 | * @return NULL on error, otherwise human-readable representation of the value |
360 | */ | 356 | */ |
361 | char * | 357 | char * |
362 | GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data, | 358 | GNUNET_GNSRECORD_value_to_string(uint32_t type, const void *data, |
363 | size_t data_size); | 359 | size_t data_size); |
364 | 360 | ||
365 | 361 | ||
366 | /** | 362 | /** |
@@ -374,8 +370,8 @@ GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data, | |||
374 | * @return #GNUNET_OK on success | 370 | * @return #GNUNET_OK on success |
375 | */ | 371 | */ |
376 | int | 372 | int |
377 | GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data, | 373 | GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, |
378 | size_t *data_size); | 374 | size_t *data_size); |
379 | 375 | ||
380 | 376 | ||
381 | /** | 377 | /** |
@@ -385,7 +381,7 @@ GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data, | |||
385 | * @return corresponding number, UINT32_MAX on error | 381 | * @return corresponding number, UINT32_MAX on error |
386 | */ | 382 | */ |
387 | uint32_t | 383 | uint32_t |
388 | GNUNET_GNSRECORD_typename_to_number (const char *dns_typename); | 384 | GNUNET_GNSRECORD_typename_to_number(const char *dns_typename); |
389 | 385 | ||
390 | 386 | ||
391 | /** | 387 | /** |
@@ -395,7 +391,7 @@ GNUNET_GNSRECORD_typename_to_number (const char *dns_typename); | |||
395 | * @return corresponding typestring, NULL on error | 391 | * @return corresponding typestring, NULL on error |
396 | */ | 392 | */ |
397 | const char * | 393 | const char * |
398 | GNUNET_GNSRECORD_number_to_typename (uint32_t type); | 394 | GNUNET_GNSRECORD_number_to_typename(uint32_t type); |
399 | 395 | ||
400 | 396 | ||
401 | /* convenience APIs for serializing / deserializing GNS records */ | 397 | /* convenience APIs for serializing / deserializing GNS records */ |
@@ -409,8 +405,8 @@ GNUNET_GNSRECORD_number_to_typename (uint32_t type); | |||
409 | * @return the required size to serialize, -1 on error | 405 | * @return the required size to serialize, -1 on error |
410 | */ | 406 | */ |
411 | ssize_t | 407 | ssize_t |
412 | GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, | 408 | GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, |
413 | const struct GNUNET_GNSRECORD_Data *rd); | 409 | const struct GNUNET_GNSRECORD_Data *rd); |
414 | 410 | ||
415 | 411 | ||
416 | /** | 412 | /** |
@@ -423,9 +419,9 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, | |||
423 | * @return the size of serialized records, -1 if records do not fit | 419 | * @return the size of serialized records, -1 if records do not fit |
424 | */ | 420 | */ |
425 | ssize_t | 421 | ssize_t |
426 | GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | 422 | GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, |
427 | const struct GNUNET_GNSRECORD_Data *rd, | 423 | const struct GNUNET_GNSRECORD_Data *rd, |
428 | size_t dest_size, char *dest); | 424 | size_t dest_size, char *dest); |
429 | 425 | ||
430 | 426 | ||
431 | /** | 427 | /** |
@@ -438,9 +434,9 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | |||
438 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 434 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
439 | */ | 435 | */ |
440 | int | 436 | int |
441 | GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src, | 437 | GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, |
442 | unsigned int rd_count, | 438 | unsigned int rd_count, |
443 | struct GNUNET_GNSRECORD_Data *dest); | 439 | struct GNUNET_GNSRECORD_Data *dest); |
444 | 440 | ||
445 | 441 | ||
446 | /* ******* general APIs relating to blocks, records and labels ******** */ | 442 | /* ******* general APIs relating to blocks, records and labels ******** */ |
@@ -454,7 +450,7 @@ GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src, | |||
454 | * #GNUNET_NO if not | 450 | * #GNUNET_NO if not |
455 | */ | 451 | */ |
456 | int | 452 | int |
457 | GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd); | 453 | GNUNET_GNSRECORD_is_expired(const struct GNUNET_GNSRECORD_Data *rd); |
458 | 454 | ||
459 | 455 | ||
460 | /** | 456 | /** |
@@ -463,7 +459,7 @@ GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd); | |||
463 | * @return converted result | 459 | * @return converted result |
464 | */ | 460 | */ |
465 | char * | 461 | char * |
466 | GNUNET_GNSRECORD_string_to_lowercase (const char *src); | 462 | GNUNET_GNSRECORD_string_to_lowercase(const char *src); |
467 | 463 | ||
468 | 464 | ||
469 | /** | 465 | /** |
@@ -476,7 +472,7 @@ GNUNET_GNSRECORD_string_to_lowercase (const char *src); | |||
476 | * #GNUNET_GNSRECORD_z2s. | 472 | * #GNUNET_GNSRECORD_z2s. |
477 | */ | 473 | */ |
478 | const char * | 474 | const char * |
479 | GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z); | 475 | GNUNET_GNSRECORD_z2s(const struct GNUNET_CRYPTO_EcdsaPublicKey *z); |
480 | 476 | ||
481 | 477 | ||
482 | /** | 478 | /** |
@@ -490,7 +486,7 @@ GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z); | |||
490 | * key in an encoding suitable for DNS labels. | 486 | * key in an encoding suitable for DNS labels. |
491 | */ | 487 | */ |
492 | const char * | 488 | const char * |
493 | GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | 489 | GNUNET_GNSRECORD_pkey_to_zkey(const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); |
494 | 490 | ||
495 | 491 | ||
496 | /** | 492 | /** |
@@ -503,8 +499,8 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | |||
503 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax | 499 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax |
504 | */ | 500 | */ |
505 | int | 501 | int |
506 | GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, | 502 | GNUNET_GNSRECORD_zkey_to_pkey(const char *zkey, |
507 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | 503 | struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); |
508 | 504 | ||
509 | 505 | ||
510 | /** | 506 | /** |
@@ -515,9 +511,9 @@ GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey, | |||
515 | * @param query hash to use for the query | 511 | * @param query hash to use for the query |
516 | */ | 512 | */ |
517 | void | 513 | void |
518 | GNUNET_GNSRECORD_query_from_private_key ( | 514 | GNUNET_GNSRECORD_query_from_private_key( |
519 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, | 515 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, |
520 | struct GNUNET_HashCode *query); | 516 | struct GNUNET_HashCode *query); |
521 | 517 | ||
522 | 518 | ||
523 | /** | 519 | /** |
@@ -528,9 +524,9 @@ GNUNET_GNSRECORD_query_from_private_key ( | |||
528 | * @param query hash to use for the query | 524 | * @param query hash to use for the query |
529 | */ | 525 | */ |
530 | void | 526 | void |
531 | GNUNET_GNSRECORD_query_from_public_key ( | 527 | GNUNET_GNSRECORD_query_from_public_key( |
532 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, | 528 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, |
533 | struct GNUNET_HashCode *query); | 529 | struct GNUNET_HashCode *query); |
534 | 530 | ||
535 | 531 | ||
536 | /** | 532 | /** |
@@ -543,11 +539,11 @@ GNUNET_GNSRECORD_query_from_public_key ( | |||
543 | * @param rd_count number of records in @a rd | 539 | * @param rd_count number of records in @a rd |
544 | */ | 540 | */ |
545 | struct GNUNET_GNSRECORD_Block * | 541 | struct GNUNET_GNSRECORD_Block * |
546 | GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 542 | GNUNET_GNSRECORD_block_create(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
547 | struct GNUNET_TIME_Absolute expire, | 543 | struct GNUNET_TIME_Absolute expire, |
548 | const char *label, | 544 | const char *label, |
549 | const struct GNUNET_GNSRECORD_Data *rd, | 545 | const struct GNUNET_GNSRECORD_Data *rd, |
550 | unsigned int rd_count); | 546 | unsigned int rd_count); |
551 | 547 | ||
552 | 548 | ||
553 | /** | 549 | /** |
@@ -562,11 +558,11 @@ GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
562 | * @param rd_count number of records in @a rd | 558 | * @param rd_count number of records in @a rd |
563 | */ | 559 | */ |
564 | struct GNUNET_GNSRECORD_Block * | 560 | struct GNUNET_GNSRECORD_Block * |
565 | GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 561 | GNUNET_GNSRECORD_block_create2(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
566 | struct GNUNET_TIME_Absolute expire, | 562 | struct GNUNET_TIME_Absolute expire, |
567 | const char *label, | 563 | const char *label, |
568 | const struct GNUNET_GNSRECORD_Data *rd, | 564 | const struct GNUNET_GNSRECORD_Data *rd, |
569 | unsigned int rd_count); | 565 | unsigned int rd_count); |
570 | 566 | ||
571 | 567 | ||
572 | /** | 568 | /** |
@@ -577,7 +573,7 @@ GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
577 | * @return #GNUNET_OK if the signature is valid | 573 | * @return #GNUNET_OK if the signature is valid |
578 | */ | 574 | */ |
579 | int | 575 | int |
580 | GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); | 576 | GNUNET_GNSRECORD_block_verify(const struct GNUNET_GNSRECORD_Block *block); |
581 | 577 | ||
582 | 578 | ||
583 | /** | 579 | /** |
@@ -592,10 +588,10 @@ GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); | |||
592 | * not well-formed | 588 | * not well-formed |
593 | */ | 589 | */ |
594 | int | 590 | int |
595 | GNUNET_GNSRECORD_block_decrypt ( | 591 | GNUNET_GNSRECORD_block_decrypt( |
596 | const struct GNUNET_GNSRECORD_Block *block, | 592 | const struct GNUNET_GNSRECORD_Block *block, |
597 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, | 593 | const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, |
598 | GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); | 594 | GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); |
599 | 595 | ||
600 | 596 | ||
601 | /** | 597 | /** |
@@ -606,8 +602,8 @@ GNUNET_GNSRECORD_block_decrypt ( | |||
606 | * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not. | 602 | * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not. |
607 | */ | 603 | */ |
608 | int | 604 | int |
609 | GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, | 605 | GNUNET_GNSRECORD_records_cmp(const struct GNUNET_GNSRECORD_Data *a, |
610 | const struct GNUNET_GNSRECORD_Data *b); | 606 | const struct GNUNET_GNSRECORD_Data *b); |
611 | 607 | ||
612 | 608 | ||
613 | /** | 609 | /** |
@@ -620,8 +616,8 @@ GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, | |||
620 | * @return absolute expiration time | 616 | * @return absolute expiration time |
621 | */ | 617 | */ |
622 | struct GNUNET_TIME_Absolute | 618 | struct GNUNET_TIME_Absolute |
623 | GNUNET_GNSRECORD_record_get_expiration_time ( | 619 | GNUNET_GNSRECORD_record_get_expiration_time( |
624 | unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); | 620 | unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); |
625 | 621 | ||
626 | 622 | ||
627 | #if 0 /* keep Emacsens' auto-indent happy */ | 623 | #if 0 /* keep Emacsens' auto-indent happy */ |