diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-12-28 23:57:33 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2021-12-28 23:57:33 +0100 |
commit | ae843638aa1bfd4b35f42549655ce1a5e6ce2c39 (patch) | |
tree | 4febd205ba6f0188e032752144c059f50fde4888 | |
parent | 8d8976f00329ec326c4642a113e3767d011c396d (diff) | |
download | gnunet-ae843638aa1bfd4b35f42549655ce1a5e6ce2c39.tar.gz gnunet-ae843638aa1bfd4b35f42549655ce1a5e6ce2c39.zip |
-minor adaptations to match up schanzen's block API and my block plugin API
-rw-r--r-- | src/include/gnunet_block_lib.h | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index 50306b003..78ade8218 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -393,6 +393,8 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, | |||
393 | * @param type block type | 393 | * @param type block type |
394 | * @param group block group to use for evaluation | 394 | * @param group block group to use for evaluation |
395 | * @param query original query (hash) | 395 | * @param query original query (hash) |
396 | * @param xquery extrended query data (can be NULL, depending on type) | ||
397 | * @param xquery_size number of bytes in @a xquery | ||
396 | * @param reply_block response to validate | 398 | * @param reply_block response to validate |
397 | * @param reply_block_size number of bytes in @a reply_block | 399 | * @param reply_block_size number of bytes in @a reply_block |
398 | * @return characterization of result | 400 | * @return characterization of result |
@@ -402,6 +404,8 @@ GNUNET_BLOCK_evaluate_reply (struct GNUNET_BLOCK_Context *ctx, | |||
402 | enum GNUNET_BLOCK_Type type, | 404 | enum GNUNET_BLOCK_Type type, |
403 | struct GNUNET_BLOCK_Group *group, | 405 | struct GNUNET_BLOCK_Group *group, |
404 | const struct GNUNET_HashCode *query, | 406 | const struct GNUNET_HashCode *query, |
407 | const void *xquery, | ||
408 | size_t xquery_size, | ||
405 | const void *reply_block, | 409 | const void *reply_block, |
406 | size_t reply_block_size); | 410 | size_t reply_block_size); |
407 | 411 | ||
@@ -412,35 +416,38 @@ GNUNET_BLOCK_evaluate_reply (struct GNUNET_BLOCK_Context *ctx, | |||
412 | * | 416 | * |
413 | * @param ctx block contxt | 417 | * @param ctx block contxt |
414 | * @param type block type | 418 | * @param type block type |
415 | * @param eo evaluation options to control evaluation | ||
416 | * @param query original query (hash) | 419 | * @param query original query (hash) |
417 | * @param xquery extrended query data (can be NULL, depending on type) | 420 | * @param xquery extrended query data (can be NULL, depending on type) |
418 | * @param xquery_size number of bytes in @a xquery | 421 | * @param xquery_size number of bytes in @a xquery |
419 | * @return characterization of result | 422 | * @return #GNUNET_OK if the block is fine, #GNUNET_NO if not, |
423 | * #GNUNET_SYSERR if @a type is not supported | ||
420 | */ | 424 | */ |
421 | enum GNUNET_BLOCK_RequestEvaluationResult | 425 | enum GNUNET_GenericReturnValue |
422 | GNUNET_BLOCK_evaluate_get_request (struct GNUNET_BLOCK_Context *ctx, | 426 | GNUNET_BLOCK_evaluate_request (struct GNUNET_BLOCK_Context *ctx, |
423 | enum GNUNET_BLOCK_Type type, | 427 | enum GNUNET_BLOCK_Type type, |
424 | const struct GNUNET_HashCode *query, | 428 | const struct GNUNET_HashCode *query, |
425 | const void *xquery, | 429 | const void *xquery, |
426 | size_t xquery_size); | 430 | size_t xquery_size); |
431 | |||
427 | 432 | ||
428 | /** | 433 | /** |
429 | * Function called to validate a request. | 434 | * Function called to validate a block. |
430 | * | 435 | * |
431 | * @param ctx block contxt | 436 | * @param ctx block contxt |
432 | * @param type block type | 437 | * @param type block type |
433 | * @param query query key (hash) | 438 | * @param query query key (hash) |
434 | * @param block payload to put | 439 | * @param block payload to put |
435 | * @param block_size number of bytes in @a block | 440 | * @param block_size number of bytes in @a block |
436 | * @return characterization of result | 441 | * @return #GNUNET_OK if the block is fine, #GNUNET_NO if not, |
442 | * #GNUNET_SYSERR if @a type is not supported | ||
437 | */ | 443 | */ |
438 | enum GNUNET_BLOCK_RequestEvaluationResult | 444 | enum GNUNET_BLOCK_RequestEvaluationResult |
439 | GNUNET_BLOCK_evaluate_put_request (struct GNUNET_BLOCK_Context *ctx, | 445 | GNUNET_BLOCK_evaluate_block (struct GNUNET_BLOCK_Context *ctx, |
440 | enum GNUNET_BLOCK_Type type, | 446 | enum GNUNET_BLOCK_Type type, |
441 | const struct GNUNET_HashCode *query, | 447 | const struct GNUNET_HashCode *query, |
442 | const void *block, | 448 | const void *block, |
443 | size_t block_size); | 449 | size_t block_size); |
450 | |||
444 | 451 | ||
445 | /** | 452 | /** |
446 | * Function called to obtain the key for a block. | 453 | * Function called to obtain the key for a block. |
@@ -481,7 +488,7 @@ GNUNET_BLOCK_validate_key (struct GNUNET_BLOCK_Context *ctx, | |||
481 | * #GNUNET_SYSERR if type not supported | 488 | * #GNUNET_SYSERR if type not supported |
482 | * (or if extracting a key from a block of this type does not work) | 489 | * (or if extracting a key from a block of this type does not work) |
483 | */ | 490 | */ |
484 | int | 491 | enum GNUNET_GenericReturnValue |
485 | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | 492 | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, |
486 | enum GNUNET_BLOCK_Type type, | 493 | enum GNUNET_BLOCK_Type type, |
487 | const void *block, | 494 | const void *block, |
@@ -500,7 +507,7 @@ GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | |||
500 | * @param seen_results_count number of entries in @a seen_results | 507 | * @param seen_results_count number of entries in @a seen_results |
501 | * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success | 508 | * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success |
502 | */ | 509 | */ |
503 | int | 510 | enum GNUNET_GenericReturnValue |
504 | GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, | 511 | GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, |
505 | const struct GNUNET_HashCode *seen_results, | 512 | const struct GNUNET_HashCode *seen_results, |
506 | unsigned int seen_results_count); | 513 | unsigned int seen_results_count); |
@@ -518,7 +525,7 @@ GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, | |||
518 | * #GNUNET_NO if merge failed due to different nonce | 525 | * #GNUNET_NO if merge failed due to different nonce |
519 | * #GNUNET_SYSERR if merging is not supported | 526 | * #GNUNET_SYSERR if merging is not supported |
520 | */ | 527 | */ |
521 | int | 528 | enum GNUNET_GenericReturnValue |
522 | GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1, | 529 | GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1, |
523 | struct GNUNET_BLOCK_Group *bg2); | 530 | struct GNUNET_BLOCK_Group *bg2); |
524 | 531 | ||