|
DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains definitions for ARI CBOR CODEC functions. More...
#include "base.h"#include "containers.h"#include "cace/cace_data.h"#include <qcbor/qcbor_encode.h>#include <qcbor/qcbor_decode.h>#include <stdint.h>#include <stdbool.h>
Include dependency graph for cbor.h:
This graph shows which files directly or indirectly include this file:Functions | |
| int | cace_ari_cbor_encode (cace_data_t *buf, const cace_ari_t *ari) |
| Encode an ARI to binary form. | |
| int | cace_ari_cbor_encode_stream (QCBOREncodeContext *encoder, const cace_ari_t *ari) |
| Lower-level stream encoding interface. | |
| int | cace_ari_cbor_decode (cace_ari_t *ari, const cace_data_t *buf, size_t *used, char **errm) |
| Decode an ARI from binary form. | |
| int | cace_ari_cbor_decode_stream (QCBORDecodeContext *decoder, cace_ari_t *ari) |
| Lower-level stream decoding interface. | |
This file contains definitions for ARI CBOR CODEC functions.
| int cace_ari_cbor_decode | ( | cace_ari_t * | ari, |
| const cace_data_t * | buf, | ||
| size_t * | used, | ||
| char ** | errm | ||
| ) |
Decode an ARI from binary form.
used is non-null, extra data after the ARI is not considered to be a decoding failure and the caller is assumed to compare the used value against the buffer size itself.| [out] | ari | The ARI to decode into. The struct must already be initialized. |
| [in] | buf | The buffer to decode from. |
| [out] | used | If non-null, the size of used data for this decoding is placed here. This is set even if decoding fails to allow skipping well-formed CBOR which is not a valid ARI. |
| [out] | errm | If non-null, this will be set to a specific error message associated with any failure. When the return code is non-zero, if the pointed-to pointer is non-null it must be freed using CACE_FREE(). |
References cace_ari_cbor_decode_stream(), cace_ari_reset(), CHKERR1, errm, cace_data_t::len, and cace_data_t::ptr.
Referenced by agentParseHex(), cace_amp_msg_decode(), cace_amp_proxy_cli_recv(), cace_amp_proxy_msg_recv(), check_cnst(), check_convert(), check_decoding(), check_lookup(), check_match(), check_normalize(), LLVMFuzzerTestOneInput(), read_cbor(), read_cborhex(), stdin_recv(), suiteSetUp(), test_ari_cmp(), test_ari_equal(), test_ari_hash(), test_cace_ari_cbor_decode_invalid(), test_cace_ari_cbor_decode_partial(), TEST_CASE(), TEST_CASE(), test_util_ari_decode(), and transform_cbor_str_to_cace_data().
| int cace_ari_cbor_decode_stream | ( | QCBORDecodeContext * | decoder, |
| cace_ari_t * | ari | ||
| ) |
Lower-level stream decoding interface.
| [in] | decoder | The existing decoder to write with. |
| [out] | ari | The ARI to decode into. The struct must already be initialized. |
References cace_ari_lit_t::ari_type, cace_ari_prim_val_u::as_ac, cace_ari_params_t::as_ac, cace_ari_prim_val_u::as_am, cace_ari_params_t::as_am, cace_ari_prim_val_u::as_execset, cace_ari_prim_val_u::as_rptset, cace_ari_prim_val_u::as_tbl, cace_ari_prim_val_u::as_timespec, cace_ari_cbor_decode_ac(), cace_ari_cbor_decode_am(), cace_ari_cbor_decode_execset(), cace_ari_cbor_decode_idseg(), cace_ari_cbor_decode_label(), cace_ari_cbor_decode_optdate(), cace_ari_cbor_decode_primval(), cace_ari_cbor_decode_rptset(), cace_ari_cbor_decode_tbl(), cace_ari_cbor_decode_timespec(), cace_ari_init_lit(), cace_ari_init_objref(), cace_ari_lit_init_container(), cace_ari_objpath_derive_type(), CACE_ARI_PARAMS_AC, CACE_ARI_PARAMS_AM, CACE_ARI_PARAMS_NONE, CACE_ARI_PRIM_TIMESPEC, cace_ari_reset(), CACE_ARI_TYPE_AC, CACE_ARI_TYPE_AM, CACE_ARI_TYPE_ARITYPE, CACE_ARI_TYPE_EXECSET, CACE_ARI_TYPE_LABEL, CACE_ARI_TYPE_RPTSET, CACE_ARI_TYPE_TBL, CACE_ARI_TYPE_TD, CACE_ARI_TYPE_TP, cace_ari_lit_t::has_ari_type, cace_ari_objpath_t::model_id, cace_ari_objpath_t::model_rev, cace_ari_objpath_t::obj_id, cace_ari_ref_t::objpath, cace_ari_objpath_t::org_id, cace_ari_ref_t::params, cace_ari_lit_t::prim_type, cace_ari_params_t::state, cace_ari_objpath_t::type_id, cace_ari_date_t::valid, and cace_ari_lit_t::value.
Referenced by cace_ari_cbor_decode(), cace_ari_cbor_decode_ac(), cace_ari_cbor_decode_am(), cace_ari_cbor_decode_execset(), cace_ari_cbor_decode_report(), cace_ari_cbor_decode_rptset(), and cace_ari_cbor_decode_tbl().
| int cace_ari_cbor_encode | ( | cace_data_t * | buf, |
| const cace_ari_t * | ari | ||
| ) |
Encode an ARI to binary form.
| [out] | buf | The data buffer to modify and write the result into. It will contain a well-formed CBOR item if successful. |
| [in] | ari | The ARI to encode from. |
References cace_ari_cbor_encode_stream(), cace_data_copy_from(), CACE_LOG_WARNING, CHKERR1, cace_data_t::len, and cace_data_t::ptr.
Referenced by agentShowHexReports(), cace_amp_msg_encode(), cace_amp_proxy_cli_send(), cace_amp_proxy_msg_send(), check_convert(), check_encoding(), LLVMFuzzerTestOneInput(), refdm_db_insert_execset(), refdm_db_insert_rptset(), stdout_send(), TEST_CASE(), test_util_ari_encode(), write_cbor(), and write_cborhex().
| int cace_ari_cbor_encode_stream | ( | QCBOREncodeContext * | encoder, |
| const cace_ari_t * | ari | ||
| ) |
Lower-level stream encoding interface.
| [in] | encoder | The existing encoder to write with. |
| [in] | ari | The ARI to encode from. |
References cace_ari_lit_t::ari_type, cace_ari_objpath_t::ari_type, cace_ari_prim_val_u::as_ac, cace_ari_params_t::as_ac, cace_ari_prim_val_u::as_am, cace_ari_params_t::as_am, cace_ari_prim_val_u::as_execset, cace_ari_t::as_lit, cace_ari_t::as_ref, cace_ari_prim_val_u::as_rptset, cace_ari_prim_val_u::as_tbl, cace_ari_cbor_encode_ac(), cace_ari_cbor_encode_am(), cace_ari_cbor_encode_execset(), cace_ari_cbor_encode_idseg(), cace_ari_cbor_encode_optdate(), cace_ari_cbor_encode_primval(), cace_ari_cbor_encode_rptset(), cace_ari_cbor_encode_tbl(), CACE_ARI_PARAMS_AC, CACE_ARI_PARAMS_AM, CACE_ARI_PARAMS_NONE, CACE_ARI_TYPE_AC, CACE_ARI_TYPE_AM, CACE_ARI_TYPE_ARITYPE, CACE_ARI_TYPE_EXECSET, CACE_ARI_TYPE_LABEL, CACE_ARI_TYPE_RPTSET, CACE_ARI_TYPE_TBL, CHKERR1, cace_ari_lit_t::has_ari_type, cace_ari_objpath_t::has_ari_type, cace_ari_t::is_ref, cace_ari_objpath_t::model_id, cace_ari_objpath_t::model_rev, cace_ari_objpath_t::obj_id, cace_ari_ref_t::objpath, cace_ari_objpath_t::org_id, cace_ari_ref_t::params, cace_ari_params_t::state, cace_ari_objpath_t::type_id, and cace_ari_lit_t::value.
Referenced by cace_ari_cbor_encode(), cace_ari_cbor_encode_ac(), cace_ari_cbor_encode_am(), cace_ari_cbor_encode_execset(), cace_ari_cbor_encode_report(), cace_ari_cbor_encode_rptset(), and cace_ari_cbor_encode_tbl().