BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
SecResult.c File Reference

Implementation of a RFC9172 Result. More...

#include "SecResult.h"
+ Include dependency graph for SecResult.c:

Go to the source code of this file.

Functions

int BSL_SecResult_Init (BSL_SecResult_t *self, uint64_t result_id, uint64_t context_id, uint64_t target_block_num, BSL_Data_t content)
 Populate a pre-allocated SecResult.
 
bool BSL_SecResult_IsConsistent (const BSL_SecResult_t *self)
 Return true when internal invariant checks pass.
 
size_t BSL_SecResult_Sizeof (void)
 Returns size in bytes of BSL_SecResult_t.
 

Detailed Description

Implementation of a RFC9172 Result.

Definition in file SecResult.c.

Function Documentation

◆ BSL_SecResult_Init()

int BSL_SecResult_Init ( BSL_SecResult_t self,
uint64_t  result_id,
uint64_t  context_id,
uint64_t  target_block_num,
BSL_Data_t  content 
)

Populate a pre-allocated SecResult.

Parameters
selfNon-NULL pointer to allocated result.
result_idResult ID of corresponding result bytestring, meaning dependent on security context.
context_idID of security context.
target_block_numTarget of the given security result, included here for convenience.
contentRead-only view to data containing the bytes of the security result, which is copied out of here.

Definition at line 28 of file SecResult.c.

References BSL_SecResult_s::_bytelen, BSL_SecResult_s::_bytes, BSL_SecResult_IsConsistent(), BSL_SUCCESS, BSL_SecResult_s::context_id, BSL_Data_s::len, BSL_Data_s::ptr, BSL_SecResult_s::result_id, and BSL_SecResult_s::target_block_num.

◆ BSL_SecResult_IsConsistent()

bool BSL_SecResult_IsConsistent ( const BSL_SecResult_t self)

Return true when internal invariant checks pass.

Parameters
selfThis security result

Definition at line 47 of file SecResult.c.

References BSL_SecResult_s::_bytelen, BSL_SecResult_s::context_id, BSL_SecResult_s::result_id, and BSL_SecResult_s::target_block_num.

Referenced by BSL_SecOutcome_AppendResult(), and BSL_SecResult_Init().

◆ BSL_SecResult_Sizeof()

size_t BSL_SecResult_Sizeof ( void  )

Returns size in bytes of BSL_SecResult_t.

Definition at line 59 of file SecResult.c.