BSL v0.0.0 - 0.g33cf081
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
BSL_HostDescriptors_t Struct Reference

Dynamic BPA descriptor. More...

#include <BPSecLib_Public.h>

+ Collaboration diagram for BSL_HostDescriptors_t:

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 )(void *encoder, const BSL_HostEID_t *eid)
 Host BPA function to encode an EID to CBOR.
 
int(* eid_from_cbor )(void *encoder, BSL_HostEID_t *eid)
 Host BPA function to decode an EID from a CBOR context.
 
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.
 

Detailed Description

Dynamic BPA descriptor.

Field Documentation

◆ block_read_btsd_fn

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.

Parameters
[in]bundle_refThe bundle to read data from.
block_numThe specific block number to read BTSD from.
Returns
A pointer to a reader struct or NULL if the reader cannot be configured for any reason.

◆ block_realloc_btsd_fn

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.

Deprecated:
use sequential writer to do this

Referenced by BSL_BundleCtx_ReallocBTSD(), and BSL_HostDescriptors_Set().

◆ block_write_btsd_fn

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.

Note
The BPA must double-buffer to allow a reader and writer on the same block.
Parameters
[in]bundle_refThe bundle to read data from.
block_numThe specific block number to write BTSD into.
total_sizeA hint as to the total size that will be written.
Returns
A pointer to a reader struct or NULL if the reader cannot be configured for any reason.

◆ bundle_delete_fn

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().


The documentation for this struct was generated from the following file: