diff options
Diffstat (limited to 'src/testbed/testbed_api_cmd_peer.c')
-rw-r--r-- | src/testbed/testbed_api_cmd_peer.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/testbed/testbed_api_cmd_peer.c b/src/testbed/testbed_api_cmd_peer.c index 4a727bc94..2e253e408 100644 --- a/src/testbed/testbed_api_cmd_peer.c +++ b/src/testbed/testbed_api_cmd_peer.c | |||
@@ -20,8 +20,8 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | /** | 22 | /** |
23 | * @file testbed/testbed_api_cmd_controller.c | 23 | * @file testbed/testbed_api_cmd_peer.c |
24 | * @brief Command to create a controller. | 24 | * @brief Command to create a peer. |
25 | * @author t3sserakt | 25 | * @author t3sserakt |
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
@@ -54,10 +54,43 @@ peer_traits (void *cls, | |||
54 | const char *trait, | 54 | const char *trait, |
55 | unsigned int index) | 55 | unsigned int index) |
56 | { | 56 | { |
57 | (void) cls; | 57 | struct PeerCmdState *ps = cls; |
58 | |||
59 | struct GNUNET_TESTING_Trait traits[] = { | ||
60 | { | ||
61 | .index = 0, | ||
62 | .trait_name = "peer", | ||
63 | .ptr = (const void *) ps->peer, | ||
64 | }, | ||
65 | GNUNET_TESTING_trait_end () | ||
66 | }; | ||
67 | |||
68 | return GNUNET_TESTING_get_trait (traits, | ||
69 | ret, | ||
70 | trait, | ||
71 | index); | ||
72 | |||
58 | return GNUNET_OK; | 73 | return GNUNET_OK; |
59 | } | 74 | } |
60 | 75 | ||
76 | /** | ||
77 | * Offer data from trait | ||
78 | * | ||
79 | * @param cmd command to extract the controller from. | ||
80 | * @param peer pointer GNUNET_TESTBED_PEER | ||
81 | * @return #GNUNET_OK on success. | ||
82 | */ | ||
83 | int | ||
84 | GNUNET_TESTBED_get_trait_peer (const struct GNUNET_TESTING_Command *cmd, | ||
85 | struct GNUNET_TESTBED_Peer ** | ||
86 | peer) | ||
87 | { | ||
88 | return cmd->traits (cmd->cls, | ||
89 | (const void **) peer, | ||
90 | "peer", | ||
91 | (unsigned int) 0); | ||
92 | } | ||
93 | |||
61 | 94 | ||
62 | /** | 95 | /** |
63 | * | 96 | * |
@@ -110,7 +143,6 @@ peer_started_cb (void *cls, | |||
110 | if (NULL == emsg) | 143 | if (NULL == emsg) |
111 | { | 144 | { |
112 | ps->peer_ready = GNUNET_YES; | 145 | ps->peer_ready = GNUNET_YES; |
113 | GNUNET_TESTING_interpreter_next (ps->is); | ||
114 | } | 146 | } |
115 | else | 147 | else |
116 | { | 148 | { |