ROS 2 rclcpp + rcl - humble  humble
ROS 2 C++ Client Library with ROS Client Library
Macros | Functions
validate_enclave_name.h File Reference
#include "rmw/validate_namespace.h"
#include "rmw/validate_node_name.h"
#include "rcl/macros.h"
#include "rcl/types.h"
#include "rcl/visibility_control.h"
Include dependency graph for validate_enclave_name.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RCL_ENCLAVE_NAME_VALID   RMW_NAMESPACE_VALID
 The enclave name is valid.
 
#define RCL_ENCLAVE_NAME_INVALID_IS_EMPTY_STRING   RMW_NAMESPACE_INVALID_IS_EMPTY_STRING
 The enclave name is invalid because it is an empty string.
 
#define RCL_ENCLAVE_NAME_INVALID_NOT_ABSOLUTE   RMW_NAMESPACE_INVALID_NOT_ABSOLUTE
 The enclave name is invalid because it is not absolute.
 
#define RCL_ENCLAVE_NAME_INVALID_ENDS_WITH_FORWARD_SLASH    RMW_NAMESPACE_INVALID_ENDS_WITH_FORWARD_SLASH
 The enclave name is invalid because it ends with a forward slash.
 
#define RCL_ENCLAVE_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS    RMW_NAMESPACE_INVALID_CONTAINS_UNALLOWED_CHARACTERS
 The enclave name is invalid because it has characters that are not allowed.
 
#define RCL_ENCLAVE_NAME_INVALID_CONTAINS_REPEATED_FORWARD_SLASH    RMW_NAMESPACE_INVALID_CONTAINS_REPEATED_FORWARD_SLASH
 The enclave name is invalid because it contains repeated forward slashes.
 
#define RCL_ENCLAVE_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER    RMW_NAMESPACE_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER
 The enclave name is invalid because one of the tokens starts with a number.
 
#define RCL_ENCLAVE_NAME_INVALID_TOO_LONG   RMW_NAMESPACE_INVALID_TOO_LONG
 The enclave name is invalid because the name is too long.
 
#define RCL_ENCLAVE_NAME_MAX_LENGTH   RMW_NODE_NAME_MAX_NAME_LENGTH
 The maximum length of an enclave name.
 

Functions

RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_validate_enclave_name (const char *enclave, int *validation_result, size_t *invalid_index)
 Determine if a given enclave name is valid. More...
 
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_validate_enclave_name_with_size (const char *enclave, size_t enclave_length, int *validation_result, size_t *invalid_index)
 Deterimine if a given enclave name is valid. More...
 
RCL_PUBLIC RCL_WARN_UNUSED const char * rcl_enclave_name_validation_result_string (int validation_result)
 Return a validation result description, or NULL if unknown or RCL_ENCLAVE_NAME_VALID. More...
 

Function Documentation

◆ rcl_enclave_name_validation_result_string()

RCL_PUBLIC RCL_WARN_UNUSED const char* rcl_enclave_name_validation_result_string ( int  validation_result)

Return a validation result description, or NULL if unknown or RCL_ENCLAVE_NAME_VALID.

Parameters
[in]validation_resultThe validation result to get the string for
Returns
A string description of the validation result if successful, or
NULL if the validation result is invalid.

Definition at line 128 of file validate_enclave_name.c.

References RCL_ENCLAVE_NAME_INVALID_CONTAINS_REPEATED_FORWARD_SLASH, RCL_ENCLAVE_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS, RCL_ENCLAVE_NAME_INVALID_ENDS_WITH_FORWARD_SLASH, RCL_ENCLAVE_NAME_INVALID_IS_EMPTY_STRING, RCL_ENCLAVE_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER, RCL_ENCLAVE_NAME_INVALID_NOT_ABSOLUTE, RCL_ENCLAVE_NAME_INVALID_TOO_LONG, and RCL_ENCLAVE_NAME_VALID.

Referenced by rcl_init().

Here is the caller graph for this function:

◆ rcl_validate_enclave_name()

RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_validate_enclave_name ( const char *  enclave,
int *  validation_result,
size_t *  invalid_index 
)

Determine if a given enclave name is valid.

The same rules as rmw_validate_namespace() are used. The only difference is in the maximum allowed length, which can be up to 255 characters.

Parameters
[in]enclaveenclave to be validated
[out]validation_resultint in which the result of the check is stored
[out]invalid_indexindex of the input string where an error occurred
Returns
RCL_RET_OK on successfully running the check, or
RCL_RET_INVALID_ARGUMENT on invalid parameters, or
RCL_RET_ERROR when an unspecified error occurs.

Definition at line 31 of file validate_enclave_name.c.

References RCL_RET_INVALID_ARGUMENT, and rcl_validate_enclave_name_with_size().

Referenced by rcl_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcl_validate_enclave_name_with_size()

RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_validate_enclave_name_with_size ( const char *  enclave,
size_t  enclave_length,
int *  validation_result,
size_t *  invalid_index 
)

Deterimine if a given enclave name is valid.

This is an overload of rcl_validate_enclave_name() with an extra parameter for the length of enclave.

Parameters
[in]enclaveenclave to be validated
[in]enclave_lengthThe number of characters in enclave
[out]validation_resultint in which the result of the check is stored
[out]invalid_indexindex of the input string where an error occurred
Returns
RCL_RET_OK on successfully running the check, or
RCL_RET_INVALID_ARGUMENT on invalid parameters, or
RCL_RET_ERROR when an unspecified error occurs.

Definition at line 42 of file validate_enclave_name.c.

References RCL_ENCLAVE_NAME_INVALID_CONTAINS_REPEATED_FORWARD_SLASH, RCL_ENCLAVE_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS, RCL_ENCLAVE_NAME_INVALID_ENDS_WITH_FORWARD_SLASH, RCL_ENCLAVE_NAME_INVALID_IS_EMPTY_STRING, RCL_ENCLAVE_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER, RCL_ENCLAVE_NAME_INVALID_NOT_ABSOLUTE, RCL_ENCLAVE_NAME_INVALID_TOO_LONG, RCL_ENCLAVE_NAME_MAX_LENGTH, RCL_ENCLAVE_NAME_VALID, RCL_RET_ERROR, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.

Referenced by rcl_validate_enclave_name().

Here is the caller graph for this function: