GNUnet 0.21.1
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
31
32#include "messenger-testing.h"
33
36 const char *peer_label,
37 const char *system_label,
39 topology,
40 unsigned int peer_index);
41
42
45 const char *service_label);
46
49 const char *service_label,
50 const char *room_key);
51
56#define GNUNET_MESSENGER_MAKE_DECL_SIMPLE_TRAIT(name,type) \
57 enum GNUNET_GenericReturnValue \
58 GNUNET_MESSENGER_get_trait_ ## name ( \
59 const struct GNUNET_TESTING_Command *cmd, \
60 type **ret); \
61 struct GNUNET_TESTING_Trait \
62 GNUNET_MESSENGER_make_trait_ ## name ( \
63 type * value);
64
65
70#define GNUNET_MESSENGER_MAKE_IMPL_SIMPLE_TRAIT(name,type) \
71 enum GNUNET_GenericReturnValue \
72 GNUNET_MESSENGER_get_trait_ ## name ( \
73 const struct GNUNET_TESTING_Command *cmd, \
74 type * *ret) \
75 { \
76 if (NULL == cmd->traits) return GNUNET_SYSERR; \
77 return cmd->traits (cmd->cls, \
78 (const void **) ret, \
79 GNUNET_S (name), \
80 0); \
81 } \
82 struct GNUNET_TESTING_Trait \
83 GNUNET_MESSENGER_make_trait_ ## name ( \
84 type * value) \
85 { \
86 struct GNUNET_TESTING_Trait ret = { \
87 .trait_name = GNUNET_S (name), \
88 .ptr = (const void *) value \
89 }; \
90 return ret; \
91 }
92
93
97#define GNUNET_MESSENGER_SIMPLE_TRAITS(op) \
98 op (state, struct GNUNET_MESSENGER_StartServiceState)
99
101
102#endif
103/* 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.
testing lib for messenger service
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.