BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
decode.h File Reference

Declarations for bundle and block decoding. More...

#include "eid.h"
#include "bundle.h"
#include <qcbor/qcbor_decode.h>
+ Include dependency graph for decode.h:
+ This graph shows which files directly or indirectly include this file:

Functions

int bsl_mock_decode_eid (const BSL_Data_t *encoded_bytes, BSL_HostEID_t *eid)
 Decode a single EID.
 
int bsl_mock_decode_eid_from_ctx (QCBORDecodeContext *dec, BSL_HostEID_t *eid)
 Decode a single EID from a QCBOR Decode Context.
 
int bsl_mock_decode_primary (QCBORDecodeContext *dec, MockBPA_PrimaryBlock_t *blk)
 Encode primary block to a CBOR bytestring.
 
int bsl_mock_decode_canonical (QCBORDecodeContext *dec, 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_decode_bundle (QCBORDecodeContext *dec, 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.
 

Detailed Description

Declarations for bundle and block decoding.

Function Documentation

◆ bsl_mock_decode_bundle()

int bsl_mock_decode_bundle ( QCBORDecodeContext *  dec,
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.

References MockBPA_CanonicalBlock_t::blk_num, MockBPA_Bundle_t::blocks, MockBPA_Bundle_t::blocks_num, BSL_CHKERR1, BSL_LOG_DEBUG, BSL_LOG_ERR, BSL_LOG_WARNING, bsl_mock_decode_canonical(), bsl_mock_decode_primary(), and MockBPA_Bundle_t::primary_block.

Referenced by LLVMFuzzerTestOneInput(), mock_bpa_decode(), and test_bsl_loopback_bundle().

◆ bsl_mock_decode_canonical()

int bsl_mock_decode_canonical ( QCBORDecodeContext *  dec,
MockBPA_CanonicalBlock_t blk 
)

◆ bsl_mock_decode_eid()

int bsl_mock_decode_eid ( const BSL_Data_t encoded_bytes,
BSL_HostEID_t eid 
)

◆ bsl_mock_decode_eid_from_ctx()

int bsl_mock_decode_eid_from_ctx ( QCBORDecodeContext *  dec,
BSL_HostEID_t eid 
)

Decode a single EID from a QCBOR Decode Context.

Parameters
[in]decQCBOR Decode Context.
[in,out]eidThe EID Value.

References BSL_Data_Deinit(), BSL_Data_InitView(), bsl_mock_decode_eid(), and BSL_Data_t::len.

Referenced by bsl_mock_decode_primary(), and test_bsl_loopback_eid().

◆ bsl_mock_decode_primary()