BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
|
Implementation of construct holding details of security operations for a bundle. More...
#include "SecurityActionSet.h"
Go to the source code of this file.
Functions | |
bool | BSL_SecurityActionSet_IsConsistent (const BSL_SecurityActionSet_t *self) |
Return true if internal sanity and consistency checks pass. | |
size_t | BSL_SecurityActionSet_Sizeof (void) |
Returns size of the struct, helpful for dynamic allocation. | |
void | BSL_SecurityActionSet_Init (BSL_SecurityActionSet_t *self) |
Initialize a new security action set. | |
void | BSL_SecurityActionSet_IncrError (BSL_SecurityActionSet_t *self) |
Increment a security failure for this action set. | |
size_t | BSL_SecurityActionSet_CountErrors (const BSL_SecurityActionSet_t *self) |
Returns count of failures after processing this action set. | |
void | BSL_SecurityActionSet_Deinit (BSL_SecurityActionSet_t *self) |
Zeroize, clear, and release itself and any owned resources. | |
int | BSL_SecurityActionSet_AppendSecOper (BSL_SecurityActionSet_t *self, const BSL_SecOper_t *sec_oper) |
Append a security operation to the security action set. | |
size_t | BSL_SecurityActionSet_CountSecOpers (const BSL_SecurityActionSet_t *self) |
Count number of security operations present in this policy action set. | |
const BSL_SecOper_t * | BSL_SecurityActionSet_GetSecOperAtIndex (const BSL_SecurityActionSet_t *self, size_t index) |
Returns the Security Operation at the given index. | |
int | BSL_SecurityActionSet_GetErrCode (const BSL_SecurityActionSet_t *self) |
Get the error code after querying (inspecting) policy actions. | |
Implementation of construct holding details of security operations for a bundle.
Definition in file SecurityActionSet.c.
int BSL_SecurityActionSet_AppendSecOper | ( | BSL_SecurityActionSet_t * | self, |
const BSL_SecOper_t * | sec_oper | ||
) |
Append a security operation to the security action set.
[in,out] | self | This security action set. |
[in] | sec_oper | Security operation to include. |
Definition at line 90 of file SecurityActionSet.c.
References BSL_SecurityActionSet_s::arrays_capacity, BSL_SecOper_IsConsistent(), BSL_SecurityActionSet_IsConsistent(), BSL_SUCCESS, BSL_SecurityActionSet_s::sec_operations, and BSL_SecurityActionSet_s::sec_operations_count.
Referenced by BSLP_QueryPolicy().
size_t BSL_SecurityActionSet_CountErrors | ( | const BSL_SecurityActionSet_t * | self | ) |
Returns count of failures after processing this action set.
[in] | self | Pointer ot this security action set. |
Definition at line 72 of file SecurityActionSet.c.
References BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::err_code.
Referenced by BSLP_QueryPolicy().
size_t BSL_SecurityActionSet_CountSecOpers | ( | const BSL_SecurityActionSet_t * | self | ) |
Count number of security operations present in this policy action set.
self | This action set. |
Definition at line 102 of file SecurityActionSet.c.
References BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::sec_operations_count.
Referenced by BSL_SecCtx_ExecutePolicyActionSet(), and BSL_SecurityActionSet_GetSecOperAtIndex().
void BSL_SecurityActionSet_Deinit | ( | BSL_SecurityActionSet_t * | self | ) |
Zeroize, clear, and release itself and any owned resources.
self | This action set. |
Definition at line 79 of file SecurityActionSet.c.
References BSL_SecurityActionSet_s::arrays_capacity, BSL_SecOper_Deinit(), BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::sec_operations.
int BSL_SecurityActionSet_GetErrCode | ( | const BSL_SecurityActionSet_t * | self | ) |
Get the error code after querying (inspecting) policy actions.
Non-zero indicates error
[in] | self | this action set |
Definition at line 121 of file SecurityActionSet.c.
References BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::err_code.
const BSL_SecOper_t * BSL_SecurityActionSet_GetSecOperAtIndex | ( | const BSL_SecurityActionSet_t * | self, |
size_t | index | ||
) |
Returns the Security Operation at the given index.
self | This action set |
index | index |
Definition at line 108 of file SecurityActionSet.c.
References BSL_SecOper_IsConsistent(), BSL_SecurityActionSet_CountSecOpers(), BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::sec_operations.
Referenced by BSL_SecCtx_ExecutePolicyActionSet().
void BSL_SecurityActionSet_IncrError | ( | BSL_SecurityActionSet_t * | self | ) |
Increment a security failure for this action set.
[in,out] | self | Pointer to this security action set. |
Definition at line 66 of file SecurityActionSet.c.
References BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::err_code.
Referenced by BSLP_QueryPolicy().
void BSL_SecurityActionSet_Init | ( | BSL_SecurityActionSet_t * | self | ) |
Initialize a new security action set.
[in,out] | self | This pre-allocated action set |
Definition at line 56 of file SecurityActionSet.c.
References BSL_SecurityActionSet_s::arrays_capacity, BSL_SecurityActionSet_IsConsistent(), and BSL_SecurityActionSet_s::sec_operations.
Referenced by BSLP_QueryPolicy().
bool BSL_SecurityActionSet_IsConsistent | ( | const BSL_SecurityActionSet_t * | self | ) |
Return true if internal sanity and consistency checks pass.
[in] | self | This action set. |
Definition at line 28 of file SecurityActionSet.c.
References BSL_SecurityActionSet_s::arrays_capacity, BSL_SecurityActionSet_s::new_block_ids, BSL_SecurityActionSet_s::new_block_types, BSL_SecurityActionSet_s::sec_operations, and BSL_SecurityActionSet_s::sec_operations_count.
Referenced by BSL_SecCtx_ExecutePolicyActionSet(), BSL_SecurityActionSet_AppendSecOper(), BSL_SecurityActionSet_CountErrors(), BSL_SecurityActionSet_CountSecOpers(), BSL_SecurityActionSet_Deinit(), BSL_SecurityActionSet_GetErrCode(), BSL_SecurityActionSet_GetSecOperAtIndex(), BSL_SecurityActionSet_IncrError(), BSL_SecurityActionSet_Init(), and BSLP_QueryPolicy().
size_t BSL_SecurityActionSet_Sizeof | ( | void | ) |
Returns size of the struct, helpful for dynamic allocation.
Definition at line 51 of file SecurityActionSet.c.
Referenced by BSLP_QueryPolicy().