BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
|
Defines a security operation. More...
Go to the source code of this file.
Functions | |
size_t | BSL_SecOper_Sizeof (void) |
void | BSL_SecOper_Init (BSL_SecOper_t *self, uint64_t context_id, uint64_t target_block_num, uint64_t sec_block_num, BSL_SecBlockType_e sec_type, BSL_SecRole_e sec_role, BSL_PolicyAction_e failure_code) |
Populate a pre-allocated Security Operation with the given values. | |
void | BSL_SecOper_Deinit (BSL_SecOper_t *self) |
Empty and release any resources used internally by this structure. | |
size_t | BSL_SecOper_CountParams (const BSL_SecOper_t *self) |
Get the count of parameters contained within this security operation. | |
bool | BSL_SecOper_IsConsistent (const BSL_SecOper_t *self) |
Returns true if internal consistency and sanity checks pass. | |
void | BSL_SecOper_AppendParam (BSL_SecOper_t *self, const BSL_SecParam_t *param) |
Add the given security parameter to this list of parameters. | |
uint64_t | BSL_SecOper_GetSecurityBlockNum (const BSL_SecOper_t *self) |
Get the block number of the security block containing this sec operation. | |
uint64_t | BSL_SecOper_GetTargetBlockNum (const BSL_SecOper_t *self) |
Get the block number of the target block covered by this security operation. | |
const BSL_SecParam_t * | BSL_SecOper_GetParamAt (const BSL_SecOper_t *self, size_t index) |
Returns a pointer to the Security Parameter at a given index in the list of all paramters. | |
bool | BSL_SecOper_IsRoleSource (const BSL_SecOper_t *self) |
Return true if this security operation's role is SOURCE. | |
bool | BSL_SecOper_IsRoleAccepter (const BSL_SecOper_t *self) |
Return true if this security operation's role is Acceptor. | |
bool | BSL_SecOper_IsBIB (const BSL_SecOper_t *self) |
Return true if this security operation is BIB. | |
Defines a security operation.
Definition in file SecOperation.c.
void BSL_SecOper_AppendParam | ( | BSL_SecOper_t * | self, |
const BSL_SecParam_t * | param | ||
) |
Add the given security parameter to this list of parameters.
self | This security operation |
param | Security parameter to include. |
Definition at line 81 of file SecOperation.c.
References BSL_SecOper_IsConsistent(), and BSL_SecParam_IsConsistent().
Referenced by BSLP_PolicyRule_EvaluateAsSecOper().
size_t BSL_SecOper_CountParams | ( | const BSL_SecOper_t * | self | ) |
Get the count of parameters contained within this security operation.
self | This security operation. |
Definition at line 59 of file SecOperation.c.
References BSL_SecOper_IsConsistent().
Referenced by BSLX_BIB_InitFromSecOper().
void BSL_SecOper_Deinit | ( | BSL_SecOper_t * | self | ) |
Empty and release any resources used internally by this structure.
Certain backend implementations may create dynamic data structures that may need to be cleaned up, so it is essential to call this under all circumstances.
self | Non-NULL pointer to this security operation |
Definition at line 52 of file SecOperation.c.
References BSL_SecOper_IsConsistent().
Referenced by BSL_SecurityActionSet_Deinit().
const BSL_SecParam_t * BSL_SecOper_GetParamAt | ( | const BSL_SecOper_t * | self, |
size_t | index | ||
) |
Returns a pointer to the Security Parameter at a given index in the list of all paramters.
self | This security operation |
index | Index of security paramter list to retrieve from |
Definition at line 105 of file SecOperation.c.
References BSL_SecOper_IsConsistent().
Referenced by BSLX_BIB_InitFromSecOper().
uint64_t BSL_SecOper_GetSecurityBlockNum | ( | const BSL_SecOper_t * | self | ) |
Get the block number of the security block containing this sec operation.
self | This security operation |
Definition at line 91 of file SecOperation.c.
References BSL_SecOper_IsConsistent(), and BSL_SecOper_s::sec_block_num.
uint64_t BSL_SecOper_GetTargetBlockNum | ( | const BSL_SecOper_t * | self | ) |
Get the block number of the target block covered by this security operation.
self | This security operation |
Definition at line 98 of file SecOperation.c.
References BSL_SecOper_IsConsistent(), and BSL_SecOper_s::target_block_num.
void BSL_SecOper_Init | ( | BSL_SecOper_t * | self, |
uint64_t | context_id, | ||
uint64_t | target_block_num, | ||
uint64_t | sec_block_num, | ||
BSL_SecBlockType_e | sec_type, | ||
BSL_SecRole_e | sec_role, | ||
BSL_PolicyAction_e | failure_code | ||
) |
Populate a pre-allocated Security Operation with the given values.
self | Non-NULL pointer to this security operation. |
context_id | ID of the security context |
target_block_num | Block ID of security target block |
sec_block_num | Block ID of security block. |
sec_type | Member of BSL_SecBlock_Type_e enum indicating BIB or BCB |
sec_role | Member of BSL_SecRole_e enum indicating role. |
Definition at line 35 of file SecOperation.c.
References BSL_SecOper_s::_role, BSL_SecOper_IsConsistent(), BSL_SecOper_s::context_id, BSL_SecOper_s::failure_code, BSL_SecOper_s::sec_block_num, and BSL_SecOper_s::target_block_num.
Referenced by BSLP_PolicyRule_EvaluateAsSecOper().
bool BSL_SecOper_IsBIB | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation is BIB.
self | This security operation |
Definition at line 125 of file SecOperation.c.
References BSL_SECBLOCKTYPE_BIB.
Referenced by BSL_SecCtx_ExecutePolicyActionSet().
bool BSL_SecOper_IsConsistent | ( | const BSL_SecOper_t * | self | ) |
Returns true if internal consistency and sanity checks pass.
self | This security operation |
Definition at line 66 of file SecOperation.c.
References BSL_SecOper_s::_role, BSL_SECBLOCKTYPE_BCB, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_ACCEPTOR, BSL_SECROLE_SOURCE, BSL_SECROLE_VERIFIER, BSL_SecOper_s::context_id, and BSL_SecOper_s::target_block_num.
Referenced by BSL_SecOper_AppendParam(), BSL_SecOper_CountParams(), BSL_SecOper_Deinit(), BSL_SecOper_GetParamAt(), BSL_SecOper_GetSecurityBlockNum(), BSL_SecOper_GetTargetBlockNum(), BSL_SecOper_Init(), BSL_SecOutcome_Init(), BSL_SecurityActionSet_AppendSecOper(), and BSL_SecurityActionSet_GetSecOperAtIndex().
bool BSL_SecOper_IsRoleAccepter | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation's role is Acceptor.
self | This Security Operation |
Definition at line 119 of file SecOperation.c.
References BSL_SecOper_s::_role, and BSL_SECROLE_ACCEPTOR.
bool BSL_SecOper_IsRoleSource | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation's role is SOURCE.
self | This Security Operation |
Definition at line 113 of file SecOperation.c.
References BSL_SecOper_s::_role, and BSL_SECROLE_SOURCE.
Referenced by BSL_SecCtx_ExecutePolicyActionSet().
size_t BSL_SecOper_Sizeof | ( | void | ) |
Definition at line 30 of file SecOperation.c.