aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testing_ng_lib.h
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-06-07 14:26:26 +0200
committert3sserakt <t3ss@posteo.de>2023-06-19 15:20:17 +0200
commit01cf7af535c57b4cdfabbba09b1af21d5d3aafb5 (patch)
tree804fe8edc1174cd389b8bc7e8cfc72a85d1f8295 /src/include/gnunet_testing_ng_lib.h
parentae7fcd30040c38650aa96286468dc9b0a2178d9e (diff)
downloadgnunet-01cf7af535c57b4cdfabbba09b1af21d5d3aafb5.tar.gz
gnunet-01cf7af535c57b4cdfabbba09b1af21d5d3aafb5.zip
NEWS: Added __attribute__((deprecated)) to the old transport API
Diffstat (limited to 'src/include/gnunet_testing_ng_lib.h')
-rw-r--r--src/include/gnunet_testing_ng_lib.h54
1 files changed, 35 insertions, 19 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h
index aae918ff3..0c8614eef 100644
--- a/src/include/gnunet_testing_ng_lib.h
+++ b/src/include/gnunet_testing_ng_lib.h
@@ -104,10 +104,10 @@ typedef void
104(*GNUNET_TESTING_CommandCleanupRoutine)(void *cls); 104(*GNUNET_TESTING_CommandCleanupRoutine)(void *cls);
105 105
106typedef enum GNUNET_GenericReturnValue 106typedef enum GNUNET_GenericReturnValue
107(*GNUNET_TESTING_CommandGetTraits) (void *cls, 107(*GNUNET_TESTING_CommandGetTraits)(void *cls,
108 const void **ret, 108 const void **ret,
109 const char *trait, 109 const char *trait,
110 unsigned int index); 110 unsigned int index);
111 111
112/** 112/**
113 * Create a new command 113 * Create a new command
@@ -529,7 +529,7 @@ struct GNUNET_TESTING_Timer
529 */ 529 */
530struct GNUNET_PeerIdentity * 530struct GNUNET_PeerIdentity *
531GNUNET_TESTING_get_peer (unsigned int num, 531GNUNET_TESTING_get_peer (unsigned int num,
532 const struct GNUNET_TESTING_System *tl_system); 532 const struct GNUNET_TESTING_System *tl_system);
533 533
534 534
535/** 535/**
@@ -542,15 +542,31 @@ struct GNUNET_TESTING_Command
542GNUNET_TESTING_cmd_stat (struct GNUNET_TESTING_Timer *timers); 542GNUNET_TESTING_cmd_stat (struct GNUNET_TESTING_Timer *timers);
543 543
544 544
545/**
546 * Command to execute a script. The cmd succeeds when the script exit with 0 and fails,
547 * when the script exits with an error code.
548 *
549 * @param label The label of the cmd.
550 * @param script The name of the script.
551 * @param script_argv Array with script args.
552 * @param script_argv_len Length of the array.
553 */
554const struct GNUNET_TESTING_Command
555GNUNET_TESTING_cmd_exec_bash_script (const char *label,
556 const char *script,
557 char **script_argv,
558 unsigned int script_argv_len);
559
560
545/* *** Generic trait logic for implementing traits ********* */ 561/* *** Generic trait logic for implementing traits ********* */
546 562
547/** 563/**
548 * A struct GNUNET_TESTING_Trait can be used to exchange data between cmds. 564 * A struct GNUNET_TESTING_Trait can be used to exchange data between cmds.
549 * 565 *
550 * Therefor the cmd which like to provide data to other cmds has to implement 566 * Therefor the cmd which like to provide data to other cmds has to implement
551 * the trait function, where an array of traits is defined with the help of the 567 * the trait function, where an array of traits is defined with the help of the
552 * GNUNET_TESTING_make_trait_ macro. The data can be retrieved with the help of the 568 * GNUNET_TESTING_make_trait_ macro. The data can be retrieved with the help of the
553 * GNUNET_TESTING_get_trait_ macro. Traits name and type must be defined to make 569 * GNUNET_TESTING_get_trait_ macro. Traits name and type must be defined to make
554 * use of the macros. 570 * use of the macros.
555 */ 571 */
556struct GNUNET_TESTING_Trait 572struct GNUNET_TESTING_Trait
@@ -609,11 +625,11 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits,
609 */ 625 */
610#define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(name,type) \ 626#define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(name,type) \
611 enum GNUNET_GenericReturnValue \ 627 enum GNUNET_GenericReturnValue \
612 GNUNET_TESTING_get_trait_ ## name ( \ 628 GNUNET_TESTING_get_trait_ ## name ( \
613 const struct GNUNET_TESTING_Command *cmd, \ 629 const struct GNUNET_TESTING_Command *cmd, \
614 type **ret); \ 630 type **ret); \
615 struct GNUNET_TESTING_Trait \ 631 struct GNUNET_TESTING_Trait \
616 GNUNET_TESTING_make_trait_ ## name ( \ 632 GNUNET_TESTING_make_trait_ ## name ( \
617 type * value); 633 type * value);
618 634
619 635
@@ -623,9 +639,9 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits,
623 */ 639 */
624#define GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT(name,type) \ 640#define GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT(name,type) \
625 enum GNUNET_GenericReturnValue \ 641 enum GNUNET_GenericReturnValue \
626 GNUNET_TESTING_get_trait_ ## name ( \ 642 GNUNET_TESTING_get_trait_ ## name ( \
627 const struct GNUNET_TESTING_Command *cmd, \ 643 const struct GNUNET_TESTING_Command *cmd, \
628 type * *ret) \ 644 type **ret) \
629 { \ 645 { \
630 if (NULL == cmd->traits) return GNUNET_SYSERR; \ 646 if (NULL == cmd->traits) return GNUNET_SYSERR; \
631 return cmd->traits (cmd->cls, \ 647 return cmd->traits (cmd->cls, \
@@ -634,7 +650,7 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits,
634 0); \ 650 0); \
635 } \ 651 } \
636 struct GNUNET_TESTING_Trait \ 652 struct GNUNET_TESTING_Trait \
637 GNUNET_TESTING_make_trait_ ## name ( \ 653 GNUNET_TESTING_make_trait_ ## name ( \
638 type * value) \ 654 type * value) \
639 { \ 655 { \
640 struct GNUNET_TESTING_Trait ret = { \ 656 struct GNUNET_TESTING_Trait ret = { \
@@ -651,14 +667,14 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits,
651 */ 667 */
652#define GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT(name,type) \ 668#define GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT(name,type) \
653 enum GNUNET_GenericReturnValue \ 669 enum GNUNET_GenericReturnValue \
654 GNUNET_TESTING_get_trait_ ## name ( \ 670 GNUNET_TESTING_get_trait_ ## name ( \
655 const struct GNUNET_TESTING_Command *cmd, \ 671 const struct GNUNET_TESTING_Command *cmd, \
656 unsigned int index, \ 672 unsigned int index, \
657 type **ret); \ 673 type **ret); \
658 struct GNUNET_TESTING_Trait \ 674 struct GNUNET_TESTING_Trait \
659 GNUNET_TESTING_make_trait_ ## name ( \ 675 GNUNET_TESTING_make_trait_ ## name ( \
660 unsigned int index, \ 676 unsigned int index, \
661 type *value); 677 type * value);
662 678
663 679
664/** 680/**
@@ -667,10 +683,10 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits,
667 */ 683 */
668#define GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT(name,type) \ 684#define GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT(name,type) \
669 enum GNUNET_GenericReturnValue \ 685 enum GNUNET_GenericReturnValue \
670 GNUNET_TESTING_get_trait_ ## name ( \ 686 GNUNET_TESTING_get_trait_ ## name ( \
671 const struct GNUNET_TESTING_Command *cmd, \ 687 const struct GNUNET_TESTING_Command *cmd, \
672 unsigned int index, \ 688 unsigned int index, \
673 type * *ret) \ 689 type **ret) \
674 { \ 690 { \
675 if (NULL == cmd->traits) return GNUNET_SYSERR; \ 691 if (NULL == cmd->traits) return GNUNET_SYSERR; \
676 return cmd->traits (cmd->cls, \ 692 return cmd->traits (cmd->cls, \
@@ -679,7 +695,7 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits,
679 index); \ 695 index); \
680 } \ 696 } \
681 struct GNUNET_TESTING_Trait \ 697 struct GNUNET_TESTING_Trait \
682 GNUNET_TESTING_make_trait_ ## name ( \ 698 GNUNET_TESTING_make_trait_ ## name ( \
683 unsigned int index, \ 699 unsigned int index, \
684 type * value) \ 700 type * value) \
685 { \ 701 { \