-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use one participant per context API changes (#189)
Signed-off-by: ivanpauno <[email protected]>
- Loading branch information
Showing
11 changed files
with
280 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2019 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW__LOCALHOST_H_ | ||
#define RMW__LOCALHOST_H_ | ||
|
||
#include "rmw/visibility_control.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
/// Used to specify if the context can only communicate through localhost. | ||
typedef enum RMW_PUBLIC_TYPE rmw_localhost_only_t | ||
{ | ||
/// Uses ROS_LOCALHOST_ONLY environment variable. | ||
RMW_LOCALHOST_ONLY_DEFAULT = 0, | ||
/// Forces using only localhost. | ||
RMW_LOCALHOST_ONLY_ENABLED = 1, | ||
/// Forces disabling localhost only. | ||
RMW_LOCALHOST_ONLY_DISABLED = 2, | ||
} rmw_localhost_only_t; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // RMW__LOCALHOST_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// Copyright 2020 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW__SECURITY_OPTIONS_H_ | ||
#define RMW__SECURITY_OPTIONS_H_ | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#include <stdbool.h> | ||
|
||
#include "rcutils/allocator.h" | ||
|
||
#include "rmw/ret_types.h" | ||
#include "rmw/visibility_control.h" | ||
|
||
typedef enum RMW_PUBLIC_TYPE rmw_security_enforcement_policy_t | ||
{ | ||
RMW_SECURITY_ENFORCEMENT_PERMISSIVE, | ||
RMW_SECURITY_ENFORCEMENT_ENFORCE, | ||
} rmw_security_enforcement_policy_t; | ||
|
||
typedef struct RMW_PUBLIC_TYPE rmw_security_options_t | ||
{ | ||
enum rmw_security_enforcement_policy_t enforce_security; | ||
char * security_root_path; | ||
} rmw_security_options_t; | ||
|
||
/// Get zero initialized security options. | ||
RMW_PUBLIC | ||
rmw_security_options_t | ||
rmw_get_zero_initialized_security_options(); | ||
|
||
/// Get default initialized security options. | ||
RMW_PUBLIC | ||
rmw_security_options_t | ||
rmw_get_default_security_options(); | ||
|
||
/// Copy the given security options. | ||
/** | ||
* \param src security options to be copied. | ||
* \param allocator allocator used when copying data to the new security options. | ||
* \param dst security options to be set. | ||
* \returns RMW_RET_BAD_ALLOC, or | ||
* \returns RMW_RET_OK | ||
*/ | ||
RMW_PUBLIC | ||
rmw_ret_t | ||
rmw_security_options_copy( | ||
const rmw_security_options_t * src, | ||
const rcutils_allocator_t * allocator, | ||
rmw_security_options_t * dst); | ||
|
||
/// Set the security root path for the given security options. | ||
/** | ||
* The provided `security_root_path` will be copied into allocated memory. | ||
* | ||
* \param security_root_path path to be set. | ||
* \param allocator allocator used to allocate the new path. | ||
* \param security_options security options to be set. | ||
* \returns RMW_RET_BAD_ALLOC, or | ||
* \returns RMW_RET_OK | ||
*/ | ||
rmw_ret_t | ||
rmw_security_options_set_root_path( | ||
const char * security_root_path, | ||
const rcutils_allocator_t * allocator, | ||
rmw_security_options_t * security_options); | ||
|
||
/// Finalize the given security_options. | ||
/** | ||
* \param security_options security options to be finalized. | ||
* \param allocator allocator used to deallocate the root path. | ||
* \returns RMW_RET_ERROR, or | ||
* \returns RMW_RET_OK | ||
*/ | ||
RMW_PUBLIC | ||
rmw_ret_t | ||
rmw_security_options_fini( | ||
rmw_security_options_t * security_options, | ||
const rcutils_allocator_t * allocator); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // RMW__SECURITY_OPTIONS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.