|
BSL v1.0.0 - 4.g1b6a605
AMMOS Bundle Protocol Security Library (BSL)
|
Implementation of a RFC9172 Result. More...
#include "SecResult.h"
Include dependency graph for SecResult.c:Functions | |
| void | BSL_SecResult_Init (BSL_SecResult_t *self) |
| Initialize to a default empty state. | |
| void | BSL_SecResult_InitSet (BSL_SecResult_t *self, const BSL_SecResult_t *src) |
| Initialize to a copy of another value. | |
| void | BSL_SecResult_Deinit (BSL_SecResult_t *self) |
| De-initialize a result. | |
| int | BSL_SecResult_InitFull (BSL_SecResult_t *self, uint64_t result_id, uint64_t context_id, uint64_t target_block_num, const BSL_Data_t *content) |
| Initialize and populate a pre-allocated result. | |
| void | BSL_SecResult_Set (BSL_SecResult_t *self, const BSL_SecResult_t *src) |
| Overwrite with a copy of another value. | |
| bool | BSL_SecResult_IsConsistent (const BSL_SecResult_t *self) |
| Return true when internal invariant checks pass. | |
| int | BSL_SecResult_GetAsBytestr (const BSL_SecResult_t *self, BSL_Data_t *out) |
| Retrieve byte string value of result. | |
| size_t | BSL_SecResult_Sizeof (void) |
| Returns size in bytes of BSL_SecResult_s. | |
Implementation of a RFC9172 Result.
| void BSL_SecResult_Deinit | ( | BSL_SecResult_t * | self | ) |
De-initialize a result.
| [in,out] | self | The object to deinitialize. |
Referenced by BSL_AbsSecBlock_DecodeFromCBOR().
| int BSL_SecResult_GetAsBytestr | ( | const BSL_SecResult_t * | self, |
| BSL_Data_t * | out | ||
| ) |
Retrieve byte string value of result.
| [in] | self | This Security Parameter |
| [out] | out | Pointer to data struct which will be made a view onto this parameter value. |
References BSL_Data_InitView(), and BSL_SecResult_IsConsistent().
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), test_RFC9173_AppendixA_Example1_BIB_Source(), and test_RFC9173_AppendixA_Example2_BCB_Source().
| void BSL_SecResult_Init | ( | BSL_SecResult_t * | self | ) |
Initialize to a default empty state.
| [out] | self | The object to initialize. |
Referenced by BSL_SecResult_InitSet().
| int BSL_SecResult_InitFull | ( | BSL_SecResult_t * | self, |
| uint64_t | result_id, | ||
| uint64_t | context_id, | ||
| uint64_t | target_block_num, | ||
| const BSL_Data_t * | content | ||
| ) |
Initialize and populate a pre-allocated result.
| [out] | self | Non-NULL pointer to uninitialized result. |
| [in] | result_id | Result ID of corresponding result bytestring, meaning dependent on security context. |
| [in] | context_id | ID of security context. |
| [in] | target_block_num | Target of the given security result, included here for convenience. |
| [in] | content | Read-only view to data containing the bytes of the security result, which is copied out of here. |
References BSL_SecResult_IsConsistent(), BSL_SUCCESS, BSL_Data_t::len, and BSL_Data_t::ptr.
Referenced by BSL_AbsSecBlock_DecodeFromCBOR().
| void BSL_SecResult_InitSet | ( | BSL_SecResult_t * | self, |
| const BSL_SecResult_t * | src | ||
| ) |
Initialize to a copy of another value.
| [out] | self | The object to initialize. |
| [in] | src | The source of the copy. |
References BSL_SecResult_Init(), and BSL_SecResult_Set().
| bool BSL_SecResult_IsConsistent | ( | const BSL_SecResult_t * | self | ) |
Return true when internal invariant checks pass.
| self | This security result |
Referenced by BSL_SecOutcome_AppendResult(), BSL_SecResult_GetAsBytestr(), and BSL_SecResult_InitFull().
| void BSL_SecResult_Set | ( | BSL_SecResult_t * | self, |
| const BSL_SecResult_t * | src | ||
| ) |
Overwrite with a copy of another value.
| [in,out] | self | The object to overwrite. |
| [in] | src | The source of the copy. |
Referenced by BSL_SecResult_InitSet().