From be71a29c05b82cf559b99e11bdd7866a465fff80 Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Mon, 13 Apr 2020 15:28:13 +0200 Subject: [PATCH] security-context -> enclave (#13) Signed-off-by: Mikael Arguedas --- .../include/rmw_dds_common/graph_cache.hpp | 10 ++++---- rmw_dds_common/src/graph_cache.cpp | 24 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/rmw_dds_common/include/rmw_dds_common/graph_cache.hpp b/rmw_dds_common/include/rmw_dds_common/graph_cache.hpp index 2886667..5a1082e 100644 --- a/rmw_dds_common/include/rmw_dds_common/graph_cache.hpp +++ b/rmw_dds_common/include/rmw_dds_common/graph_cache.hpp @@ -172,13 +172,13 @@ class GraphCache /// Add a discovered participant to the cache. /** * \param gid The participant guid. - * \param security_context Name of the security context. + * \param enclave Name of the enclave. */ RMW_DDS_COMMON_PUBLIC void add_participant( const rmw_gid_t & participant_gid, - const std::string & security_context); + const std::string & enclave); /// Remove a participant based on discovery. /** @@ -477,7 +477,7 @@ class GraphCache * \param[inout] node_namespaces A zero initialized string array, where the node namespaces * will be copied. Each item in this array corresponds to an item in the same position of * node_names array. Must not be `nullptr`. - * \param[inout] security_contexts A zero initialized string array, where the security context + * \param[inout] enclaves A zero initialized string array, where the enclave * name of the node will be copied. Each item in this array corresponds to an item in the same * position of node_names array. In case is `nullptr`, it won't be used. * \param[in] allocator. @@ -491,7 +491,7 @@ class GraphCache get_node_names( rcutils_string_array_t * node_names, rcutils_string_array_t * node_namespaces, - rcutils_string_array_t * security_contexts, + rcutils_string_array_t * enclaves, rcutils_allocator_t * allocator) const; /** @@ -521,7 +521,7 @@ operator<<(std::ostream & ostream, const GraphCache & topic_cache); struct ParticipantInfo { GraphCache::NodeEntitiesInfoSeq node_entities_info_seq; - std::string security_context; + std::string enclave; }; struct EntityInfo diff --git a/rmw_dds_common/src/graph_cache.cpp b/rmw_dds_common/src/graph_cache.cpp index 95e3867..5ef8843 100644 --- a/rmw_dds_common/src/graph_cache.cpp +++ b/rmw_dds_common/src/graph_cache.cpp @@ -191,7 +191,7 @@ __create_participant_info_message( void GraphCache::add_participant( const rmw_gid_t & participant_gid, - const std::string & security_context) + const std::string & enclave) { std::lock_guard guard(mutex_); auto it = participants_.find(participant_gid); @@ -203,7 +203,7 @@ GraphCache::add_participant( it = ret.first; assert(ret.second); } - it->second.security_context = security_context; + it->second.enclave = enclave; GRAPH_CACHE_CALL_ON_CHANGE_CALLBACK(this); } @@ -924,7 +924,7 @@ rmw_ret_t GraphCache::get_node_names( rcutils_string_array_t * node_names, rcutils_string_array_t * node_namespaces, - rcutils_string_array_t * security_contexts, + rcutils_string_array_t * enclaves, rcutils_allocator_t * allocator) const { std::lock_guard guard(mutex_); @@ -935,8 +935,8 @@ GraphCache::get_node_names( return RMW_RET_INVALID_ARGUMENT; } if ( - security_contexts && - RMW_RET_OK != rmw_check_zero_rmw_string_array(security_contexts)) + enclaves && + RMW_RET_OK != rmw_check_zero_rmw_string_array(enclaves)) { return RMW_RET_INVALID_ARGUMENT; } @@ -960,9 +960,9 @@ GraphCache::get_node_names( RMW_SET_ERROR_MSG(error_msg.str); goto fail; } - if (security_contexts) { + if (enclaves) { rcutils_ret = - rcutils_string_array_init(security_contexts, nodes_number, allocator); + rcutils_string_array_init(enclaves, nodes_number, allocator); if (RCUTILS_RET_OK != rcutils_ret) { rcutils_error_string_t error_msg = rcutils_get_error_string(); rcutils_reset_error(); @@ -984,10 +984,10 @@ GraphCache::get_node_names( if (!node_namespaces->data[j]) { goto fail; } - if (security_contexts) { - security_contexts->data[j] = rcutils_strdup( - nodes_info.security_context.c_str(), *allocator); - if (!security_contexts->data[j]) { + if (enclaves) { + enclaves->data[j] = rcutils_strdup( + nodes_info.enclave.c_str(), *allocator); + if (!enclaves->data[j]) { goto fail; } } @@ -1036,7 +1036,7 @@ rmw_dds_common::operator<<(std::ostream & ostream, const GraphCache & graph_cach ss << " Discovered participants:" << std::endl; for (const auto & item : graph_cache.participants_) { ss << " gid: '" << item.first << std::endl; - ss << " security context name '" << item.second.security_context << std::endl; + ss << " enclave name '" << item.second.enclave << std::endl; ss << " nodes:" << std::endl; for (const auto & node_info : item.second.node_entities_info_seq) { ss << " namespace: '" << node_info.node_namespace << "' name: '" <<