|
BSL v1.1.1 - 50.g42e5d9b
AMMOS Bundle Protocol Security Library (BSL)
|
Declaration of a variant-type container for options, parameters, and results. More...
#include "bsl/BPSecLib_Private.h"#include "bsl/dynamic/CBOR.h"#include <m-array.h>#include <m-bptree.h>#include <m-bstring.h>#include <m-shared-ptr.h>#include <stdint.h>
Include dependency graph for Variant.h:
This graph shows which files directly or indirectly include this file:Data Structures | |
| struct | BSL_Variant_t |
| Represents a security option, parameter, or result within in an ASB. More... | |
Macros | |
| #define | M_OPL_BSL_Variant_t() |
| OPLIST for BSL_Variant_s. | |
Enumerations | |
| enum | BSLB_Variant_Type_e { BSLB_VARIANT_TYPE_UNKNOWN = 0 , BSLB_VARIANT_TYPE_INT64 , BSLB_VARIANT_TYPE_BYTESTR , BSLB_VARIANT_TYPE_TEXTSTR , BSLB_VARIANT_TYPE_RAW } |
| Types of values in BSL_Variant_s. More... | |
Functions | |
| int | BSL_Variant_Decode (QCBORDecodeContext *dec, BSL_Variant_t *pair) |
| Decode from CBOR, as a pair of items either in an array or from a map key-value. | |
| void | BSL_Variant_Encode (QCBOREncodeContext *enc, const BSL_Variant_t *pair) |
| Encode to CBOR, as a pair of items either in an array or a map key-value. | |
| static BSL_Variant_t * | BSLB_VariantPtrMap_add (BSLB_VariantPtrMap_t map, int64_t key) |
| Workaround default shared-ptr INIT being a NULL pointer. | |
Declaration of a variant-type container for options, parameters, and results.
Declaration of an (id, value) pair container.
The details from the RFC Section 3.6 [1] are as follows:
This field captures one or more security context parameters that should be used when processing the security service described by this security block. This field SHALL be represented by a CBOR array. Each entry in this array is a single security context parameter. A single parameter SHALL also be represented as a CBOR array comprising a 2-tuple of the Id and value of the parameter, as follows.
Parameter Id:
- This field identifies which parameter is being specified.
- This field SHALL be represented as a CBOR unsigned integer.
- Parameter Ids are selected as described in Section 3.10.
Parameter Value:
- This field captures the value associated with this parameter.
- This field SHALL be represented by the applicable CBOR representation of the parameter, in accordance with Section 3.10.
| #define M_OPL_BSL_Variant_t | ( | ) |
OPLIST for BSL_Variant_s.
| enum BSLB_Variant_Type_e |
Types of values in BSL_Variant_s.
Security options, parameters, and results defined in RFC9173 may be unsigned integers or bytestrings.
| int BSL_Variant_Decode | ( | QCBORDecodeContext * | dec, |
| BSL_Variant_t * | pair | ||
| ) |
Decode from CBOR, as a pair of items either in an array or from a map key-value.
Matches the BSL_CBOR_Decode_f signature.
References ASSERT_ARG_NONNULL, BSL_Data_InitView(), BSL_ERR_DECODING, BSL_LOG_DEBUG, BSL_LOG_ERR, BSL_SUCCESS, BSL_Variant_SetBytestr(), BSL_Variant_SetInt64(), BSL_Variant_SetRaw(), and BSL_Data_t::len.
Referenced by BSL_AbsSecBlock_Decode(), and BSLX_CoseMsg_Headers_Decode_Map().
| void BSL_Variant_Encode | ( | QCBOREncodeContext * | enc, |
| const BSL_Variant_t * | pair | ||
| ) |
Encode to CBOR, as a pair of items either in an array or a map key-value.
Matches the BSL_CBOR_Encode_f signature.
References BSL_LOG_CRIT, BSL_Variant_GetAsBytestr(), BSL_Variant_GetAsInt64(), BSL_Variant_GetAsRaw(), BSL_Variant_IsBytestr(), BSL_Variant_IsInt64(), BSL_Variant_IsRaw(), and UsefulBufC_FROM_BSL_Data.
Referenced by BSL_AbsSecBlock_Encode(), and BSLX_CoseMsg_Headers_Encode_Map().
|
inlinestatic |
Workaround default shared-ptr INIT being a NULL pointer.
| [in,out] | map | The map to ensure a specific key exists in. |
| key | The key to add or update. |
References BSL_LOG_WARNING.
Referenced by BSL_AbsSecBlock_Decode(), BSL_SecOper_AddOption(), BSL_SecOper_AddParam(), BSL_SecOper_AddResult(), BSLP_PolicyOptions_SC1(), BSLP_PolicyOptions_SC2(), BSLP_PolicyOptions_SC3(), BSLP_PolicyRule_AddOption(), and BSLP_RegisterPolicyFromBitstring().