diff options
author | t3sserakt <t3ss@posteo.de> | 2021-08-24 11:22:45 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-08-24 11:22:45 +0200 |
commit | 9d5a8c05f3a33c49fd97e5b8ef99d58b96704c6d (patch) | |
tree | 0d6c5bdfe5746b8bad8b8e2b4ce71e51940f407e /src | |
parent | 3d3d4a2ecadb2ab31cb6219db46489d1081f5ebc (diff) | |
download | gnunet-9d5a8c05f3a33c49fd97e5b8ef99d58b96704c6d.tar.gz gnunet-9d5a8c05f3a33c49fd97e5b8ef99d58b96704c6d.zip |
- added header changes for cmds to stop a peer and remove a test environment, used in simple send test case plugin
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 6 | ||||
-rw-r--r-- | src/transport/transport-testing-ng.h | 74 |
2 files changed, 61 insertions, 19 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 035d1bcad..939863d67 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -838,11 +838,17 @@ GNUNET_TESTING_get_trait_test_system (const struct | |||
838 | GNUNET_TESTING_Command *cmd, | 838 | GNUNET_TESTING_Command *cmd, |
839 | struct GNUNET_TESTING_System **test_system); | 839 | struct GNUNET_TESTING_System **test_system); |
840 | 840 | ||
841 | |||
841 | struct GNUNET_TESTING_Command | 842 | struct GNUNET_TESTING_Command |
842 | GNUNET_TESTING_cmd_system_create (const char *label, | 843 | GNUNET_TESTING_cmd_system_create (const char *label, |
843 | const char *testdir); | 844 | const char *testdir); |
844 | 845 | ||
845 | 846 | ||
847 | struct GNUNET_TESTING_Command | ||
848 | GNUNET_TESTING_cmd_system_destroy (const char *label, | ||
849 | const char *create_label); | ||
850 | |||
851 | |||
846 | /** | 852 | /** |
847 | * Create command. | 853 | * Create command. |
848 | * | 854 | * |
diff --git a/src/transport/transport-testing-ng.h b/src/transport/transport-testing-ng.h index cd5ba65a9..cd4e1f3fe 100644 --- a/src/transport/transport-testing-ng.h +++ b/src/transport/transport-testing-ng.h | |||
@@ -22,50 +22,86 @@ | |||
22 | * @author t3sserakt | 22 | * @author t3sserakt |
23 | */ | 23 | */ |
24 | 24 | ||
25 | struct TngState | 25 | struct StartPeerState |
26 | { | 26 | { |
27 | /** | 27 | /** |
28 | * Handle to operation | 28 | * Receive callback |
29 | */ | 29 | */ |
30 | struct GNUNET_TESTBED_Operation *operation; | 30 | struct GNUNET_MQ_MessageHandler *handlers; |
31 | |||
32 | const char *cfgname; | ||
33 | |||
34 | /** | ||
35 | * Peer's configuration | ||
36 | */ | ||
37 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
38 | |||
39 | struct GNUNET_TESTING_Peer *peer; | ||
31 | 40 | ||
32 | /** | 41 | /** |
33 | * Flag indicating if service is ready. | 42 | * Peer identity |
34 | */ | 43 | */ |
35 | int service_ready; | 44 | struct GNUNET_PeerIdentity id; |
36 | 45 | ||
37 | /** | 46 | /** |
38 | * Abort task identifier | 47 | * Peer's transport service handle |
39 | */ | 48 | */ |
40 | struct GNUNET_SCHEDULER_Task *abort_task; | 49 | struct GNUNET_TRANSPORT_CoreHandle *th; |
41 | 50 | ||
42 | /** | 51 | /** |
43 | * Label of peer command. | 52 | * Application handle |
44 | */ | 53 | */ |
45 | const char *peer_label; | 54 | struct GNUNET_TRANSPORT_ApplicationHandle *ah; |
46 | 55 | ||
47 | /** | 56 | /** |
48 | * Name of service to start. | 57 | * Peer's PEERSTORE Handle |
49 | */ | 58 | */ |
50 | const char *servicename; | 59 | struct GNUNET_PEERSTORE_Handle *ph; |
51 | 60 | ||
52 | /** | 61 | /** |
53 | * Peer identity of the system. | 62 | * Hello get task |
54 | */ | 63 | */ |
55 | struct GNUNET_PeerIdentity *peer_identity; | 64 | struct GNUNET_SCHEDULER_Task *rh_task; |
56 | 65 | ||
57 | /** | 66 | /** |
58 | * Message handler for transport service. | 67 | * Peer's transport get hello handle to retrieve peer's HELLO message |
59 | */ | 68 | */ |
60 | const struct GNUNET_MQ_MessageHandler *handlers; | 69 | struct GNUNET_PEERSTORE_IterateContext *pic; |
61 | 70 | ||
62 | /** | 71 | /** |
63 | * Notify connect callback | 72 | * Hello |
64 | */ | 73 | */ |
65 | GNUNET_TRANSPORT_NotifyConnect nc; | 74 | char *hello; |
75 | |||
76 | /** | ||
77 | * Hello size | ||
78 | */ | ||
79 | size_t hello_size; | ||
80 | |||
81 | char *m; | ||
82 | |||
83 | char *n; | ||
84 | |||
85 | char *local_m; | ||
86 | |||
87 | unsigned int finished; | ||
88 | |||
89 | const char *system_label; | ||
66 | 90 | ||
67 | /** | 91 | /** |
68 | * Closure for the @a nc callback | 92 | * An unique number to identify the peer |
69 | */ | 93 | */ |
70 | void *cb_cls; | 94 | unsigned int no; |
95 | |||
96 | struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map; | ||
97 | |||
98 | struct GNUNET_TESTING_System *tl_system; | ||
99 | |||
71 | }; | 100 | }; |
101 | |||
102 | |||
103 | int | ||
104 | GNUNET_TRANSPORT_get_trait_state (const struct | ||
105 | GNUNET_TESTING_Command | ||
106 | *cmd, | ||
107 | struct StartPeerState **sps); | ||