diff options
Diffstat (limited to 'src/dhtu/testing_dhtu_cmd_send.c')
-rw-r--r-- | src/dhtu/testing_dhtu_cmd_send.c | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/src/dhtu/testing_dhtu_cmd_send.c b/src/dhtu/testing_dhtu_cmd_send.c deleted file mode 100644 index fe8e1c18a..000000000 --- a/src/dhtu/testing_dhtu_cmd_send.c +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testing/testing_dhtu_cmd_send.c | ||
23 | * @brief use DHTU to send a message | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_testing_ng_lib.h" | ||
28 | #include "gnunet_testing_netjail_lib.h" | ||
29 | |||
30 | |||
31 | /** | ||
32 | * State for the 'send' command. | ||
33 | */ | ||
34 | struct SendState | ||
35 | { | ||
36 | |||
37 | /** | ||
38 | * Mandatory context for async commands. | ||
39 | */ | ||
40 | struct GNUNET_TESTING_AsyncContext ac; | ||
41 | |||
42 | }; | ||
43 | |||
44 | |||
45 | /** | ||
46 | * | ||
47 | * | ||
48 | * @param cls a `struct SendState` | ||
49 | */ | ||
50 | static void | ||
51 | send_cleanup (void *cls) | ||
52 | { | ||
53 | struct SendState *ss = cls; | ||
54 | |||
55 | GNUNET_free (ss); | ||
56 | } | ||
57 | |||
58 | |||
59 | /** | ||
60 | * Return trains of the ``send`` command. | ||
61 | * | ||
62 | * @param cls closure. | ||
63 | * @param[out] ret result | ||
64 | * @param trait name of the trait. | ||
65 | * @param index index number of the object to offer. | ||
66 | * @return #GNUNET_OK on success. | ||
67 | * #GNUNET_NO if no trait was found | ||
68 | */ | ||
69 | static enum GNUNET_GenericReturnValue | ||
70 | send_traits (void *cls, | ||
71 | const void **ret, | ||
72 | const char *trait, | ||
73 | unsigned int index) | ||
74 | { | ||
75 | return GNUNET_NO; | ||
76 | } | ||
77 | |||
78 | |||
79 | /** | ||
80 | * Run the 'send' command. | ||
81 | * | ||
82 | * @param cls closure. | ||
83 | * @param is interpreter state. | ||
84 | */ | ||
85 | static void | ||
86 | send_run (void *cls, | ||
87 | struct GNUNET_TESTING_Interpreter *is) | ||
88 | { | ||
89 | struct SendState *ss = cls; | ||
90 | |||
91 | #if 0 | ||
92 | other_cmd = GNUNET_TESTING_interpreter_lookup_command (ss->other_label); | ||
93 | GNUNET_TESTING_get_trait_XXX (other_cmd, | ||
94 | &data); | ||
95 | #endif | ||
96 | GNUNET_TESTING_async_finish (&ss->ac); | ||
97 | } | ||
98 | |||
99 | |||
100 | struct GNUNET_TESTING_Command | ||
101 | GNUNET_TESTING_DHTU_cmd_send (const char *label) | ||
102 | { | ||
103 | struct SendState *ss; | ||
104 | |||
105 | ss = GNUNET_new (struct SendState); | ||
106 | |||
107 | { | ||
108 | struct GNUNET_TESTING_Command cmd = { | ||
109 | .cls = ss, | ||
110 | .label = label, | ||
111 | .run = &send_run, | ||
112 | .ac = &ss->ac, | ||
113 | .cleanup = &send_cleanup, | ||
114 | .traits = &send_traits | ||
115 | }; | ||
116 | |||
117 | return cmd; | ||
118 | } | ||
119 | } | ||