BSL v1.0.0 - 3.g740079a
AMMOS Bundle Protocol Security Library (BSL)
|
Definitions for bundle and block encoding. More...
Functions | |
int | bsl_mock_encode_eid (const BSL_HostEID_t *eid, BSL_Data_t *encoded_bytes) |
Encode a single EID. | |
int | bsl_mock_encode_eid_from_ctx (QCBOREncodeContext *enc, const BSL_HostEID_t *eid) |
Encode a single EID from a QCBOR Encode Context. | |
int | bsl_mock_encode_primary (QCBOREncodeContext *enc, const MockBPA_PrimaryBlock_t *blk) |
Encode primary block to a CBOR data. | |
int | bsl_mock_encode_canonical (QCBOREncodeContext *enc, const MockBPA_CanonicalBlock_t *blk) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
int | bsl_mock_encode_bundle (QCBOREncodeContext *enc, const MockBPA_Bundle_t *bundle) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Variables | |
static const uint8_t | zero_crc [] = { 0, 0, 0, 0 } |
Definitions for bundle and block encoding.
int bsl_mock_encode_eid | ( | const BSL_HostEID_t * | eid, |
BSL_Data_t * | encoded_bytes | ||
) |
Encode a single EID.
Matches the signature for the BSL_HostDescriptors_t::eid_to_cbor function.
[in] | eid | The EID value. |
[in,out] | encoded_bytes | Resulting encoded bytes. NULL if checking for required CBOR length. |
References bsl_mock_eid_t::as_ipn, bsl_mock_eid_t::as_raw, bsl_eid_ipn_ssp_t::auth_num, BSL_ERR_ENCODING, BSL_LOG_DEBUG, BSL_LOG_ERR, BSL_MOCK_EID_IPN, CHKERR1, BSL_HostEID_t::handle, BSL_Data_t::len, bsl_eid_ipn_ssp_t::ncomp, bsl_eid_ipn_ssp_t::node_num, BSL_Data_t::ptr, bsl_mock_eid_t::scheme, bsl_mock_eid_t::ssp, and bsl_eid_ipn_ssp_t::svc_num.
Referenced by MockBPA_Agent_Descriptors().
int bsl_mock_encode_eid_from_ctx | ( | QCBOREncodeContext * | enc, |
const BSL_HostEID_t * | eid | ||
) |
Encode a single EID from a QCBOR Encode Context.
[in,out] | enc | QCBOR Encode Context. |
[in] | eid | The EID Value. |
References BSL_Data_Deinit(), BSL_Data_InitBuffer(), BSL_ERR_ENCODING, BSL_HostEID_EncodeToCBOR(), BSL_LOG_ERR, BSL_SUCCESS, BSL_Data_t::len, and BSL_Data_t::ptr.
Referenced by bsl_mock_encode_primary().
int bsl_mock_encode_primary | ( | QCBOREncodeContext * | enc, |
const MockBPA_PrimaryBlock_t * | blk | ||
) |
Encode primary block to a CBOR data.
[in] | enc | The encoder. |
[in] | blk | primary block information to be encoded |
References BSL_BUNDLE_IS_FRAGMENT, BSL_BUNDLECRCTYPE_16, BSL_BUNDLECRCTYPE_32, bsl_mock_encode_eid_from_ctx(), and mock_bpa_crc_apply().
Referenced by bsl_mock_encode_bundle().