rcl  master
C API providing common ROS client library functionality.
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:

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_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_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...
 
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_validate_enclave_name()

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.

◆ rcl_validate_enclave_name_with_size()

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.

◆ rcl_enclave_name_validation_result_string()

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.