20 #include "rcutils/env.h"
22 #include "rcl/error_handling.h"
25 const char *
const RCL_LOCALHOST_ENV_VAR =
"ROS_LOCALHOST_ONLY";
30 const char * ros_local_host_env_val = NULL;
31 const char * get_env_error_str = NULL;
37 get_env_error_str = rcutils_get_env(RCL_LOCALHOST_ENV_VAR, &ros_local_host_env_val);
38 if (NULL != get_env_error_str) {
39 RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(
40 "Error getting env var '" RCUTILS_STRINGIFY(RCL_LOCALHOST_ENV_VAR)
"': %s\n",
44 *localhost_only = (ros_local_host_env_val != NULL &&
46 ros_local_host_env_val,
47 "1") == 0) ? RMW_LOCALHOST_ONLY_ENABLED : RMW_LOCALHOST_ONLY_DISABLED;
RCL_PUBLIC rcl_ret_t rcl_get_localhost_only(rmw_localhost_only_t *localhost_only)
Determine if the user wants to communicate using loopback only.
#define RCL_RET_OK
Success return code.
#define RCL_RET_INVALID_ARGUMENT
Invalid argument return code.
#define RCL_RET_ERROR
Unspecified error return code.
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.