Debian Codegraph @

src/security/core/tests/common/access_control_wrapper.h

raw
1 /*
2 * Copyright(c) 2006 to 2020 ZettaScale Technology and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v. 2.0 which is available at
6 * http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
7 * v. 1.0 which is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 *
10 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11 */
12 #ifndef SECURITY_CORE_TEST_ACCESS_CONTROL_WRAPPER_H_
13 #define SECURITY_CORE_TEST_ACCESS_CONTROL_WRAPPER_H_
14
15 #include "dds/ddsi/ddsi_domaingv.h"
16 #include "dds/security/dds_security_api.h"
17 #include "dds/security/access_control_wrapper_export.h"
18
19 /* Topic name prefix expected by this wrapper when running in not-allowed
20 mode. This prefix is used to exclude built-in topics from being disallowed. */
21 #define AC_WRAPPER_TOPIC_PREFIX "ddssec_access_control_"
22
23 struct dds_security_access_control_impl;
24
25 /* Init in all-ok mode: all functions return success without calling the actual plugin */
26 SECURITY_EXPORT int init_test_access_control_all_ok(const char *argument, void **context, struct ddsi_domaingv *gv);
27 SECURITY_EXPORT int finalize_test_access_control_all_ok(void *context);
28
29 /* Init in missing function mode: one of the function pointers is null */
30 SECURITY_EXPORT int init_test_access_control_missing_func(const char *argument, void **context, struct ddsi_domaingv *gv);
31 SECURITY_EXPORT int finalize_test_access_control_missing_func(void *context);
32
33 SECURITY_EXPORT int init_test_access_control_wrapped(const char *argument, void **context, struct ddsi_domaingv *gv);
34 SECURITY_EXPORT int finalize_test_access_control_wrapped(void *context);
35
36 /* Init functions for not-allowed modes */
37 #define INIT_NOT_ALLOWED_DECL(name_) \
38 SECURITY_EXPORT int init_test_access_control_##name_ (const char *argument, void **context, struct ddsi_domaingv *gv);
39
40 INIT_NOT_ALLOWED_DECL(local_participant_not_allowed)
41 INIT_NOT_ALLOWED_DECL(local_topic_not_allowed)
42 INIT_NOT_ALLOWED_DECL(local_writer_not_allowed)
43 INIT_NOT_ALLOWED_DECL(local_reader_not_allowed)
44 INIT_NOT_ALLOWED_DECL(local_permissions_not_allowed)
45 INIT_NOT_ALLOWED_DECL(remote_participant_not_allowed)
46 INIT_NOT_ALLOWED_DECL(remote_topic_not_allowed)
47 INIT_NOT_ALLOWED_DECL(remote_writer_not_allowed)
48 INIT_NOT_ALLOWED_DECL(remote_reader_not_allowed)
49 INIT_NOT_ALLOWED_DECL(remote_reader_relay_only)
50 INIT_NOT_ALLOWED_DECL(remote_permissions_not_allowed)
51
52 SECURITY_EXPORT int finalize_test_access_control_not_allowed(void *context);
53
54 #endif /* SECURITY_CORE_TEST_ACCESS_CONTROL_WRAPPER_H_ */