BSL v1.0.0 - 3.g740079a
AMMOS Bundle Protocol Security Library (BSL)
|
Dynamic BPA descriptor. More...
#include <BPSecLib_Public.h>
Data Fields | |
void * | user_data |
User data pointer for callbacks. | |
int(* | get_sec_src_eid_fn )(void *user_data, BSL_HostEID_t *result) |
Host BPA function to get its security source EID. | |
int(* | eid_init )(void *user_data, BSL_HostEID_t *result) |
Host BPA function to initialize/allocate an EID type. | |
void(* | eid_deinit )(void *user_data, BSL_HostEID_t *eid) |
Host BPA function to deinit/free an EID type. | |
int(* | bundle_metadata_fn )(const BSL_BundleRef_t *bundle_ref, BSL_PrimaryBlock_t *result_primary_block) |
Host BPA function to populate a Primary Block struct. | |
int(* | block_metadata_fn )(const BSL_BundleRef_t *bundle_ref, uint64_t block_num, BSL_CanonicalBlock_t *result_block) |
Host BPA function to populate a Canonical Block struct for a given block number. | |
int(* | block_create_fn )(BSL_BundleRef_t *bundle_ref, uint64_t block_type_code, uint64_t *result_block_num) |
Host BPA function to create a new canonical block with the given type, returning result in the output pointer. | |
int(* | block_remove_fn )(BSL_BundleRef_t *bundle_ref, uint64_t block_num) |
Host BPA function to remove a given canonical block from the bundle. | |
int(* | block_realloc_btsd_fn )(BSL_BundleRef_t *bundle_ref, uint64_t block_num, size_t bytesize) |
Host BPA function to reallocate a canonical block's BTSD, keeping existing data in-place. | |
struct BSL_SeqReader_s *(* | block_read_btsd_fn )(const BSL_BundleRef_t *bundle_ref, uint64_t block_num) |
Host BPA function do create a new sequential reader on a single block-type-specific data. | |
struct BSL_SeqWriter_s *(* | block_write_btsd_fn )(BSL_BundleRef_t *bundle_ref, uint64_t block_num, size_t total_size) |
Host BPA function do create a new sequential writer on a single block-type-specific data. | |
int(* | bundle_delete_fn )(BSL_BundleRef_t *bundle_ref, BSL_ReasonCode_t reason) |
Host BPA function to delete Bundle with a reason code. | |
int(* | eid_to_cbor )(const BSL_HostEID_t *eid, BSL_Data_t *encoded_bytes) |
Host BPA function to encode an EID to CBOR. | |
int(* | eid_from_cbor )(const BSL_Data_t *encoded_bytes, BSL_HostEID_t *eid) |
Host BPA function to decode an EID from CBOR. | |
int(* | eid_from_text )(BSL_HostEID_t *eid, const char *text, void *user_data) |
Host BPA function to parse an EID from a C-string. | |
int(* | eidpat_init )(BSL_HostEIDPattern_t *pat, void *user_data) |
Host BPA function to initialize an EID pattern type. | |
void(* | eidpat_deinit )(BSL_HostEIDPattern_t *pat, void *user_data) |
Host BPA function to deinit an EID pattern type. | |
int(* | eidpat_from_text )(BSL_HostEIDPattern_t *pat, const char *text, void *user_data) |
Host BPA function to parse an EID pattern from a C-string. | |
bool(* | eidpat_match )(const BSL_HostEIDPattern_t *pat, const BSL_HostEID_t *eid, void *user_data) |
Host BPA function that returns true if the given EID matched an EID pattern. | |
Dynamic BPA descriptor.
struct BSL_SeqReader_s *(* BSL_HostDescriptors_t::block_read_btsd_fn) (const BSL_BundleRef_t *bundle_ref, uint64_t block_num) |
Host BPA function do create a new sequential reader on a single block-type-specific data.
[in] | bundle_ref | The bundle to read data from. |
block_num | The specific block number to read BTSD from. |
int(* BSL_HostDescriptors_t::block_realloc_btsd_fn) (BSL_BundleRef_t *bundle_ref, uint64_t block_num, size_t bytesize) |
Host BPA function to reallocate a canonical block's BTSD, keeping existing data in-place.
Referenced by BSL_BundleCtx_ReallocBTSD(), and BSL_HostDescriptors_Set().
struct BSL_SeqWriter_s *(* BSL_HostDescriptors_t::block_write_btsd_fn) (BSL_BundleRef_t *bundle_ref, uint64_t block_num, size_t total_size) |
Host BPA function do create a new sequential writer on a single block-type-specific data.
The writer will call BSL_SeqWriter_Destroy() when it is finished.
[in] | bundle_ref | The bundle to read data from. |
block_num | The specific block number to write BTSD into. | |
total_size | A hint as to the total size that will be written. |
int(* BSL_HostDescriptors_t::bundle_delete_fn) (BSL_BundleRef_t *bundle_ref, BSL_ReasonCode_t reason) |
Host BPA function to delete Bundle with a reason code.
This can be called multiple times per-bundle with different reason codes
Referenced by BSL_BundleCtx_DeleteBundle().
int(* BSL_HostDescriptors_t::eid_from_cbor) (const BSL_Data_t *encoded_bytes, BSL_HostEID_t *eid) |
Host BPA function to decode an EID from CBOR.
[in] | encoded_bytes | Input encoded bytes. Initialized and deinitialized by BSL. The encoded EID must contain a CBOR array head. |
[in,out] | eid | EID value to encode. |
Referenced by BSL_HostDescriptors_Set(), and BSL_HostEID_DecodeFromCBOR().
int(* BSL_HostDescriptors_t::eid_to_cbor) (const BSL_HostEID_t *eid, BSL_Data_t *encoded_bytes) |
Host BPA function to encode an EID to CBOR.
[in] | eid | EID value to encode. |
[in,out] | encoded_bytes | Output encoded bytes. Initialized and deinitialized by BSL. The encoded EID must contain a CBOR array head. If set to NULL, function should return needed size of encoded CBOR bytestring without actually copying data into param. |
Referenced by BSL_HostEID_EncodeToCBOR().