Debian Codegraph @

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

raw
1 /*
2 * Copyright(c) 2006 to 2021 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_SECURITY_CONFIG_TEST_UTILS_H_
13 #define SECURITY_CORE_TEST_SECURITY_CONFIG_TEST_UTILS_H_
14
15 #include <stdlib.h>
16 #include "dds/ddsrt/environ.h"
17
18 struct kvp {
19 const char *key;
20 const char *value;
21 int32_t count;
22 };
23
24 const char * expand_lookup_vars (const char *name, void * data);
25 const char * expand_lookup_vars_env (const char *name, void * data);
26 int32_t expand_lookup_unmatched (const struct kvp * lookup_table);
27
28 char * get_governance_topic_rule (const char * topic_expr, bool discovery_protection, bool liveliness_protection,
29 bool read_ac, bool write_ac, DDS_Security_ProtectionKind metadata_protection_kind, DDS_Security_BasicProtectionKind data_protection_kind);
30 char * get_governance_config (bool allow_unauth_pp, bool enable_join_ac, DDS_Security_ProtectionKind discovery_protection_kind, DDS_Security_ProtectionKind liveliness_protection_kind,
31 DDS_Security_ProtectionKind rtps_protection_kind, const char * topic_rules, bool add_prefix);
32
33 char * get_permissions_rules_w_partitions (const char * domain_id, const char * allow_pub_topic, const char * allow_sub_topic, const char ** allow_parts, const char * deny_pub_topic, const char * deny_sub_topic, const char ** deny_parts);
34 char * get_permissions_rules (const char * domain_id, const char * allow_pub_topic, const char * allow_sub_topic,
35 const char * deny_pub_topic, const char * deny_sub_topic);
36 char * get_permissions_grant (const char * grant_name, const char * subject_name, dds_time_t not_before, dds_time_t not_after,
37 const char * rules_xml, const char * default_policy);
38 char * get_permissions_default_grant (const char * grant_name, const char * subject_name, const char * topic_name);
39 char * get_permissions_config (char * grants[], size_t ngrants, bool add_prefix);
40
41 #endif /* SECURITY_CORE_TEST_SECURITY_CONFIG_TEST_UTILS_H_ */