rcl  master
C API providing common ROS client library functionality.
security.h
Go to the documentation of this file.
1 // Copyright 2018-2020 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
16 
17 #ifndef RCL__SECURITY_H_
18 #define RCL__SECURITY_H_
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include <stdbool.h>
26 
27 #include "rcl/allocator.h"
28 #include "rcl/types.h"
29 #include "rcl/visibility_control.h"
30 #include "rmw/security_options.h"
31 
32 #ifndef ROS_SECURITY_ENCLAVE_OVERRIDE
33 # define ROS_SECURITY_ENCLAVE_OVERRIDE "ROS_SECURITY_ENCLAVE_OVERRIDE"
35 #endif
36 
37 #ifndef ROS_SECURITY_KEYSTORE_VAR_NAME
38 # define ROS_SECURITY_KEYSTORE_VAR_NAME "ROS_SECURITY_KEYSTORE"
40 #endif
41 
42 #ifndef ROS_SECURITY_STRATEGY_VAR_NAME
43 # define ROS_SECURITY_STRATEGY_VAR_NAME "ROS_SECURITY_STRATEGY"
45 #endif
46 
47 #ifndef ROS_SECURITY_ENABLE_VAR_NAME
48 # define ROS_SECURITY_ENABLE_VAR_NAME "ROS_SECURITY_ENABLE"
50 #endif
51 
53 
68 RCL_PUBLIC
71  const char * name,
72  const rcutils_allocator_t * allocator,
73  rmw_security_options_t * security_options);
74 
76 
85 RCL_PUBLIC
87 rcl_security_enabled(bool * use_security);
88 
90 
100 RCL_PUBLIC
101 rcl_ret_t
103 
105 
125 RCL_PUBLIC
126 char *
127 rcl_get_secure_root(const char * name, const rcl_allocator_t * allocator);
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif // RCL__SECURITY_H_
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_get_enforcement_policy
rcl_ret_t rcl_get_enforcement_policy(rmw_security_enforcement_policy_t *policy)
Get security enforcement policy from the environment.
rmw_security_options_t
rcl_get_secure_root
char * rcl_get_secure_root(const char *name, const rcl_allocator_t *allocator)
Return the secure root given a enclave name.
rcl_security_enabled
rcl_ret_t rcl_security_enabled(bool *use_security)
Check if security has to be used, according to the environment.
rmw_security_enforcement_policy_t
enum RMW_PUBLIC_TYPE rmw_security_enforcement_policy_t rmw_security_enforcement_policy_t
rcutils_allocator_t
allocator.h
rcl_get_security_options_from_environment
rcl_ret_t rcl_get_security_options_from_environment(const char *name, const rcutils_allocator_t *allocator, rmw_security_options_t *security_options)
Initialize security options from values in the environment variables and given names.
security_options.h