31#ifndef BSL_BPSECLIB_PUBLIC_H_
32#define BSL_BPSECLIB_PUBLIC_H_
39#if defined(__GNUC__) || defined(__clang__)
40#define BSL_REQUIRE_CHECK __attribute__((warn_unused_result))
42#define BSL_REQUIRE_CHECK
61#define BSL_DEFAULT_STRLEN (128)
62typedef char BSL_StaticString_t[BSL_DEFAULT_STRLEN];
176 uint64_t array_block_ids[array_count],
size_t *result_count);
183 int (*block_create_fn)(
BSL_BundleRef_t *bundle_ref, uint64_t block_type_code, uint64_t *result_block_num);
189 int (*block_realloc_btsd_fn)(
BSL_BundleRef_t *bundle_ref, uint64_t block_num,
size_t bytesize);
198 int (*eid_from_text)(
BSL_HostEID_t *eid,
const char *text,
void *user_data);
struct BSL_PrimaryBlock_s BSL_PrimaryBlock_t
Contains Bundle Primary Block fields and metadata.
BSL_BundleCRCType_e
Block CRC types.
@ BSL_BUNDLECRCTYPE_NONE
No CRC value.
@ BSL_BUNDLECRCTYPE_16
CRC-16.
@ BSL_BUNDLECRCTYPE_32
CRC-32C.
BSL_REQUIRE_CHECK int BSL_API_RegisterPolicyProvider(BSL_LibCtx_t *lib, BSL_PolicyDesc_t desc)
Register a Policy Provider module with the BSL.
#define BSL_REQUIRE_CHECK
This annotation on a function requires the caller to capture and inspect the return value.
struct BSL_BundleRef_s BSL_BundleRef_t
Reference to a Bundle owned and stored in the host BPA.
struct BSL_HostEID_s BSL_HostEID_t
Opaque pointer to BPA-specific Endpoint ID storage.
int BSL_HostDescriptors_Set(BSL_HostDescriptors_t desc)
Set the BPA descriptor (callbacks) for this process.
BSL_REQUIRE_CHECK int BSL_API_InitLib(BSL_LibCtx_t *bsl)
Initialize the BPSecLib (BSL) library context.
void BSL_HostDescriptors_Get(BSL_HostDescriptors_t *desc)
Copy the BPA descriptor for this process.
struct BSL_HostEIDPattern_s BSL_HostEIDPattern_t
Reference to a EID pattern owned and stored in the BPA.
BSL_REQUIRE_CHECK int BSL_API_RegisterSecurityContext(BSL_LibCtx_t *lib, uint64_t sec_ctx_id, BSL_SecCtxDesc_t desc)
Register a security context module with the BSL.
BSL_PolicyLocation_e
Indicates where in the lifecycle of the BPA the bundle is querying for security policy.
@ BSL_POLICYLOCATION_APPOUT
Bundle destination at delivery.
@ BSL_POLICYLOCATION_APPIN
Bundle source at creation.
@ BSL_POLICYLOCATION_CLIN
Bundle ingress from CLA.
@ BSL_POLICYLOCATION_CLOUT
Bundle egress to CLA.
BSL_REQUIRE_CHECK int BSL_API_QuerySecurity(const BSL_LibCtx_t *bsl, BSL_SecurityActionSet_t *output_action_set, const BSL_BundleRef_t *bundle, BSL_PolicyLocation_e location)
Query BSL to populate a BSL_SecurityActionSet_t containg security processing instructions.
BSL_REQUIRE_CHECK int BSL_API_ApplySecurity(const BSL_LibCtx_t *bsl, BSL_SecurityResponseSet_t *response_output, BSL_BundleRef_t *bundle, const BSL_SecurityActionSet_t *policy_actions)
Performs the given security operations on a Bundle, modifying or even dropping it entirely.
struct BSL_CanonicalBlock_s BSL_CanonicalBlock_t
Structure containing parsed Canonical Block fields.
BSL_REQUIRE_CHECK int BSL_API_DeinitLib(BSL_LibCtx_t *bsl)
Deinitialize and release any resources held by the BSL.
Reference to a Bundle owned and stored in the host BPA.
void * data
Opaque pointer, not used by the BSL.
Structure containing parsed Canonical Block fields.
uint64_t flags
CBOR-decoded flags field.
uint64_t block_num
CBOR-decoded block number (should always be > 0)
void * btsd
Pointer to BTSD owned by the host BPA.
size_t btsd_len
Length in bytes of the BTSD pointer.
uint64_t crc
CBOR-decoded block CRC.
uint64_t type_code
CBOR-decoded block type code (should be > 0)
void * user_data
User data pointer for callbacks.
Reference to a EID pattern owned and stored in the BPA.
void * handle
Opaque pointer for BPA backend to use.
Opaque pointer to BPA-specific Endpoint ID storage.
void * handle
Opaque pointer for BPA backend to use.
Concrete definition of library context.
Descriptor of opaque data and callbacks for Policy Provider.
Contains Bundle Primary Block fields and metadata.
uint64_t field_bundle_creation_time
CBOR-decoded bundle creation time.
uint64_t field_adu_length
CBOR-decoded field of ADU length.
uint64_t field_seq_num
CBOR-decoded sequence number.
size_t block_count
Helpful count of total canonical blocks in bundle, not a field of the header.
uint64_t field_lifetime
CBOR-decoded lifetime.
BSL_HostEID_t field_src_node_id
Source in host BPA's internal representation of an EID.
uint64_t field_frag_offset
CBOR-decoded fragment offset (warning, may not be implemented yet).
uint64_t field_crc_type
CBOR-decoded field of Primary Block CRC type.
BSL_HostEID_t field_report_to_eid
Report-to EID in host BPA's internal representation of an EID.
uint64_t field_flags
CBOR-decoded field of bundle processing control flags.
uint64_t field_version
CBOR-decoded field of Primary Block BP version.
BSL_HostEID_t field_dest_eid
Destination in host BPA's internal representation of an EID.
Security Context descriptor (interface)
Contains the populated security operations for this bundle.
Contains the results and outcomes after performing the security operations.