GNUnet 0.22.2
messenger-testing-cmds.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2023 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#ifndef MESSENGER_TESTING_CMDS_H
27#define MESSENGER_TESTING_CMDS_H
28
29#include "gnunet_testing_lib.h"
30#include "messenger-testing.h"
31
34 const char *peer_label,
35 const char *system_label,
37 topology,
38 unsigned int peer_index);
39
40
43 const char *service_label);
44
47 const char *service_label,
48 const char *room_key);
49
54#define GNUNET_MESSENGER_MAKE_DECL_SIMPLE_TRAIT(name,type) \
55 enum GNUNET_GenericReturnValue \
56 GNUNET_MESSENGER_get_trait_ ## name ( \
57 const struct GNUNET_TESTING_Command *cmd, \
58 type * *ret); \
59 struct GNUNET_TESTING_Trait \
60 GNUNET_MESSENGER_make_trait_ ## name ( \
61 type * value);
62
63
68#define GNUNET_MESSENGER_MAKE_IMPL_SIMPLE_TRAIT(name,type) \
69 enum GNUNET_GenericReturnValue \
70 GNUNET_MESSENGER_get_trait_ ## name ( \
71 const struct GNUNET_TESTING_Command *cmd, \
72 type * *ret) \
73 { \
74 if (NULL == cmd->traits) return GNUNET_SYSERR; \
75 return cmd->traits (cmd->cls, \
76 (const void **) ret, \
77 GNUNET_S (name), \
78 0); \
79 } \
80 struct GNUNET_TESTING_Trait \
81 GNUNET_MESSENGER_make_trait_ ## name ( \
82 type * value) \
83 { \
84 struct GNUNET_TESTING_Trait ret = { \
85 .trait_name = GNUNET_S (name), \
86 .ptr = (const void *) value \
87 }; \
88 return ret; \
89 }
90
91
95#define GNUNET_MESSENGER_SIMPLE_TRAITS(op) \
96 op (state, struct GNUNET_MESSENGER_StartServiceState)
97
99
100#endif
101/* end of messenger-testing-cmds.h */
char * room_key
#define GNUNET_MESSENGER_MAKE_DECL_SIMPLE_TRAIT(name, type)
Create headers for a trait with name name for statically allocated data of type type.
struct GNUNET_TESTING_Command GNUNET_MESSENGER_cmd_join_room(const char *label, const char *service_label, const char *room_key)
struct GNUNET_TESTING_Command GNUNET_MESSENGER_cmd_stop_service(const char *label, const char *service_label)
struct GNUNET_TESTING_Command GNUNET_MESSENGER_cmd_start_service(const char *label, const char *peer_label, const char *system_label, struct GNUNET_MESSENGER_TestStageTopology *topology, unsigned int peer_index)
#define GNUNET_MESSENGER_SIMPLE_TRAITS(op)
Call op on all simple traits.
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.