BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
bsl_mock_bpa_encode.c File Reference

Definitions for bundle and block encoding. More...

#include <BPSecLib_Private.h>
#include "bsl_mock_bpa.h"
#include "bsl_mock_bpa_encode.h"
#include "bsl_mock_bpa_crc.h"
+ Include dependency graph for bsl_mock_bpa_encode.c:

Go to the source code of this file.

Functions

int bsl_mock_encode_eid (QCBOREncodeContext *enc, const BSL_HostEID_t *eid)
 Encode a single EID.
 
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.
 
static int _cmp (const void *a, const void *b)
 
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 }
 

Detailed Description

Definitions for bundle and block encoding.

Definition in file bsl_mock_bpa_encode.c.

Function Documentation

◆ _cmp()

static int _cmp ( const void *  a,
const void *  b 
)
static

Definition at line 159 of file bsl_mock_bpa_encode.c.

◆ bsl_mock_encode_bundle()

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.

Definition at line 167 of file bsl_mock_bpa_encode.c.

References bsl_mock_encode_canonical(), and bsl_mock_encode_primary().

◆ bsl_mock_encode_canonical()

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.

Definition at line 126 of file bsl_mock_bpa_encode.c.

References BSL_BUNDLECRCTYPE_16, BSL_BUNDLECRCTYPE_32, and mock_bpa_crc_apply().

Referenced by bsl_mock_encode_bundle().

◆ bsl_mock_encode_eid()

int bsl_mock_encode_eid ( QCBOREncodeContext *  enc,
const BSL_HostEID_t eid 
)

◆ bsl_mock_encode_primary()

int bsl_mock_encode_primary ( QCBOREncodeContext *  enc,
const MockBPA_PrimaryBlock_t blk 
)

Encode primary block to a CBOR data.

Parameters
[in]encThe encoder.
[in]blkprimary block information to be encoded
Returns
0 if successful

Definition at line 79 of file bsl_mock_bpa_encode.c.

References BSL_BUNDLE_IS_FRAGMENT, BSL_BUNDLECRCTYPE_16, BSL_BUNDLECRCTYPE_32, bsl_mock_encode_eid(), and mock_bpa_crc_apply().

Referenced by bsl_mock_encode_bundle().

Variable Documentation

◆ zero_crc

const uint8_t zero_crc[] = { 0, 0, 0, 0 }
static

Definition at line 77 of file bsl_mock_bpa_encode.c.