DTNMA Reference Tools v2.0.0 - 9.gaff6489
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains definitions for ARI text CODEC functions. More...
#include "base.h"
#include "containers.h"
#include "cace/config.h"
#include <m-string.h>
#include <stdint.h>
#include <stdbool.h>
Data Structures | |
struct | cace_ari_text_enc_opts_t |
Parameters for ARI text encoding. More... | |
Macros | |
#define | CACE_ARI_TEXT_ENC_OPTS_DEFAULT |
Enumerations | |
enum | cace_ari_text_scheme_prefix_e { CACE_ARI_TEXT_SCHEME_NONE , CACE_ARI_TEXT_SCHEME_FIRST , CACE_ARI_TEXT_SCHEME_ALL } |
Options for URI scheme presence. More... | |
enum | cace_ari_text_aritype_e { CACE_ARI_TEXT_ARITYPE_ORIG , CACE_ARI_TEXT_ARITYPE_TEXT , CACE_ARI_TEXT_ARITYPE_INT } |
Options for encoding ARITYPE values. More... | |
enum | cace_ari_int_base_e { CACE_ARI_TEXT_INT_BASE2 = 2 , CACE_ARI_TEXT_INT_BASE10 = 10 , CACE_ARI_TEXT_INT_BASE16 = 16 } |
Options for encoding integer bases. More... | |
enum | cace_ari_bstr_form_e { CACE_ARI_TEXT_BSTR_RAW , CACE_ARI_TEXT_BSTR_BASE16 , CACE_ARI_TEXT_BSTR_BASE64URL } |
Options for encoding byte strings. More... | |
Functions | |
int | cace_ari_text_encode_objpath (string_t text, const cace_ari_objpath_t *path, enum cace_ari_text_aritype_e show) |
Encode just an object path, which can be useful for debugging output. | |
int | cace_ari_text_encode (string_t text, const cace_ari_t *ari, cace_ari_text_enc_opts_t opts) |
Encode an ARI to text form. | |
int | cace_ari_text_decode (cace_ari_t *ari, const string_t text, char **errm) |
Decode an ARI from text form. | |
This file contains definitions for ARI text CODEC functions.
#define CACE_ARI_TEXT_ENC_OPTS_DEFAULT |
enum cace_ari_bstr_form_e |
Options for encoding byte strings.
Enumerator | |
---|---|
CACE_ARI_TEXT_BSTR_RAW | Attempt to output as text. |
CACE_ARI_TEXT_BSTR_BASE16 | Base16 according to Section 8 of RFC 4648 [10]. |
enum cace_ari_int_base_e |
int cace_ari_text_decode | ( | cace_ari_t * | ari, |
const string_t | text, | ||
char ** | errm | ||
) |
Decode an ARI from text form.
[out] | ari | The struct to decode into. |
text | A null-terminated UTF-8 text string. | |
[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(). |
int cace_ari_text_encode | ( | string_t | text, |
const cace_ari_t * | ari, | ||
cace_ari_text_enc_opts_t | opts | ||
) |
Encode an ARI to text form.
[out] | text | The data buffer to modify and write the result into. It will contain a null-terminated UTF-8 string if successful. |
ari | The ARI to encode from. | |
opts | Encoding parameters. |
References cace_ari_text_encode(), CHKERR1, cace_ari_text_enc_state_t::depth, and cace_ari_text_enc_state_t::out.
Referenced by cace_amp_msg_decode(), cace_amp_msg_encode(), cace_amp_proxy_cli_recv(), cace_amp_proxy_cli_send(), cace_amp_proxy_msg_recv(), cace_amp_socket_send(), cace_ari_text_encode(), check_encode(), and refdm_db_insert_rptset().