GNUnet  0.11.x
testbed_api_cmd_tng_connect.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 
21 
29 static void
31  const struct GNUNET_TESTING_Command *cmd,
33 {
34  struct TngConnectState *tcs = cls;
35 
36  tcs->ah = GNUNET_TRANSPORT_application_init (tcs->cfg);
37 }
38 
41 {
42  struct TngConnectState *tcs;
43 
44  ts = GNUNET_new (struct TngConnectState);
45 
46  struct GNUNET_TESTING_Command cmd = {
47  .cls = tcs,
48  .label = label,
49  .run = &tng_connect_run,
50  .cleanup = &tmg_connect_cleanup,
51  .traits = &tng_connect_traits
52  };
53 
54  return cmd;
55 }
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_tng_connect(const char *label)
const char * label
Label for the command.
A command to be run by the interpreter.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Global state of the interpreter, used by a command to access information about other commands...
Definition: testing.h:34
struct GNUNET_TESTING_Interpreter * is
static void tng_connect_run(void *cls, const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TESTING_Interpreter *is)
struct GNUNET_TRANSPORT_ApplicationHandle * GNUNET_TRANSPORT_application_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the TRANSPORT application client handle.
void * cls
Closure for all commands with command-specific context information.