GNUnet 0.22.1
testing_dhtu_cmd_send.c
Go to the documentation of this file.
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
26#include "platform.h"
27#include "gnunet_testing_ng_lib.h"
28#include "gnunet_testing_netjail_lib.h"
29
30
35{
36
41
42};
43
44
50static void
51send_cleanup (void *cls)
52{
53 struct SendState *ss = cls;
54
55 GNUNET_free (ss);
56}
57
58
70send_traits (void *cls,
71 const void **ret,
72 const char *trait,
73 unsigned int index)
74{
75 return GNUNET_NO;
76}
77
78
85static void
86send_run (void *cls,
88{
89 struct SendState *ss = cls;
90
92}
93
94
97{
98 struct SendState *ss;
99
100 ss = GNUNET_new (struct SendState);
101
102 {
103 struct GNUNET_TESTING_Command cmd = {
104 .cls = ss,
105 .run = &send_run,
106 .ac = &ss->ac,
107 .cleanup = &send_cleanup,
108 .traits = &send_traits
109 };
110
112 label);
113 return cmd;
114 }
115}
static int ret
Final status code.
Definition: gnunet-arm.c:93
static struct GNUNET_TESTING_Interpreter * is
void GNUNET_TESTING_async_finish(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has finished.
void GNUNET_TESTING_set_label(struct GNUNET_TESTING_CommandLabel *label, const char *value)
Set label to value.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_NO
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
State each asynchronous command must have in its closure.
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.
void * cls
Closure for all commands with command-specific context information.
Global state of the interpreter, used by a command to access information about other commands.
State for the 'send' command.
struct GNUNET_TESTING_AsyncContext ac
Mandatory context for async commands.
static void send_cleanup(void *cls)
struct GNUNET_TESTING_Command GNUNET_TESTING_DHTU_cmd_send(const char *label)
static void send_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
Run the 'send' command.
static enum GNUNET_GenericReturnValue send_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Return trains of the send command.