aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2021-12-28 23:57:33 +0100
committerChristian Grothoff <grothoff@gnunet.org>2021-12-28 23:57:33 +0100
commitae843638aa1bfd4b35f42549655ce1a5e6ce2c39 (patch)
tree4febd205ba6f0188e032752144c059f50fde4888
parent8d8976f00329ec326c4642a113e3767d011c396d (diff)
downloadgnunet-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.h43
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 */
421enum GNUNET_BLOCK_RequestEvaluationResult 425enum GNUNET_GenericReturnValue
422GNUNET_BLOCK_evaluate_get_request (struct GNUNET_BLOCK_Context *ctx, 426GNUNET_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 */
438enum GNUNET_BLOCK_RequestEvaluationResult 444enum GNUNET_BLOCK_RequestEvaluationResult
439GNUNET_BLOCK_evaluate_put_request (struct GNUNET_BLOCK_Context *ctx, 445GNUNET_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 */
484int 491enum GNUNET_GenericReturnValue
485GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, 492GNUNET_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 */
503int 510enum GNUNET_GenericReturnValue
504GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, 511GNUNET_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 */
521int 528enum GNUNET_GenericReturnValue
522GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1, 529GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1,
523 struct GNUNET_BLOCK_Group *bg2); 530 struct GNUNET_BLOCK_Group *bg2);
524 531