DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
ref.h File Reference

This file contains the definitions for ARI object reference paths and their segments. More...

#include "idseg.h"
#include "type.h"
#include "cace/config.h"
#include <m-string.h>
#include <stdint.h>
#include <stdbool.h>
#include <time.h>
+ Include dependency graph for ref.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  cace_ari_date_t
 Represent a decoded date value. More...
 
struct  cace_ari_objpath_t
 The entire object path as part of a full obj_ref_t. More...
 
struct  cace_ari_params_t
 Given parameter storage for an cace_ari_ref_t. More...
 
struct  cace_ari_ref_t
 Represent an object reference or namespace reference ARI in accordance with [5]. More...
 

Enumerations

enum  cace_ari_param_state_e { CACE_ARI_PARAMS_NONE , CACE_ARI_PARAMS_AC , CACE_ARI_PARAMS_AM }
 Indicate the presence of parameters in cace_ari_params_t. More...
 

Functions

void cace_ari_date_init (cace_ari_date_t *obj)
 
void cace_ari_date_deinit (cace_ari_date_t *obj)
 
void cace_ari_date_copy (cace_ari_date_t *obj, const cace_ari_date_t *src)
 
int cace_ari_date_cmp (const cace_ari_date_t *left, const cace_ari_date_t *right)
 
int cace_ari_date_from_text (cace_ari_date_t *obj, const char *text)
 A helper function to decode date text.
 
void cace_ari_objpath_init (cace_ari_objpath_t *obj)
 
void cace_ari_objpath_deinit (cace_ari_objpath_t *obj)
 
void cace_ari_objpath_copy (cace_ari_objpath_t *obj, const cace_ari_objpath_t *src)
 
bool cace_ari_objpath_equal (const cace_ari_objpath_t *left, const cace_ari_objpath_t *right)
 
bool cace_ari_objpath_cmp (const cace_ari_objpath_t *left, const cace_ari_objpath_t *right)
 
int cace_ari_objpath_derive_type (cace_ari_objpath_t *path)
 Derive the ARI Type of a referenced object.
 
void cace_ari_objpath_set_textid (cace_ari_objpath_t *path, const char *org_id, const char *model_id, cace_ari_type_t type_id, const char *obj_id)
 Set the ARI as an object reference with a specific text-named path.
 
void cace_ari_objpath_set_textid_opt (cace_ari_objpath_t *path, const char *org_id, const char *model_id, const cace_ari_type_t *type_id, const char *obj_id)
 Set the ARI as an object reference with a specific text-named path.
 
void cace_ari_objpath_set_intid (cace_ari_objpath_t *path, cace_ari_int_id_t org_id, cace_ari_int_id_t model_id, cace_ari_type_t type_id, cace_ari_int_id_t obj_id)
 Set the ARI as an object reference with a specific integer-enumerated path.
 
void cace_ari_objpath_set_intid_opt (cace_ari_objpath_t *path, const cace_ari_int_id_t *org_id, const cace_ari_int_id_t *model_id, const cace_ari_type_t *type_id, const cace_ari_int_id_t *obj_id)
 Set the ARI as an object reference with a specific integer-enumerated path.
 
int cace_ari_params_deinit (cace_ari_params_t *obj)
 
int cace_ari_params_copy (cace_ari_params_t *obj, const cace_ari_params_t *src)
 
struct cace_ari_ac_s * cace_ari_params_set_ac (cace_ari_params_t *obj, struct cace_ari_list_s *src)
 Set the parameters to a specific state.
 
struct cace_ari_am_s * cace_ari_params_set_am (cace_ari_params_t *obj, struct cace_ari_tree_s *src)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void cace_ari_ref_deinit (cace_ari_ref_t *obj)
 
int cace_ari_ref_copy (cace_ari_ref_t *obj, const cace_ari_ref_t *src)
 

Detailed Description

This file contains the definitions for ARI object reference paths and their segments.

Enumeration Type Documentation

◆ cace_ari_param_state_e

Indicate the presence of parameters in cace_ari_params_t.

Enumerator
CACE_ARI_PARAMS_NONE 
CACE_ARI_PARAMS_AC 
CACE_ARI_PARAMS_AM 

Function Documentation

◆ cace_ari_date_cmp()

int cace_ari_date_cmp ( const cace_ari_date_t left,
const cace_ari_date_t right 
)

◆ cace_ari_date_copy()

void cace_ari_date_copy ( cace_ari_date_t obj,
const cace_ari_date_t src 
)

◆ cace_ari_date_deinit()

void cace_ari_date_deinit ( cace_ari_date_t obj)

◆ cace_ari_date_from_text()

int cace_ari_date_from_text ( cace_ari_date_t obj,
const char *  text 
)

A helper function to decode date text.

Parameters
[out]objThe object to decode into, setting its cace_ari_date_t::valid state depending on decoding success.
[in]textThe text to decode.

References cace_data_deinit(), cace_data_init_view_cstr(), cace_date_decode(), CHKERR1, cace_ari_date_t::parts, and cace_ari_date_t::valid.

Referenced by cace_amm_obj_store_add_ns(), test_ari_text_encode_nsref_text(), TEST_CASE(), and TEST_CASE().

◆ cace_ari_date_init()

void cace_ari_date_init ( cace_ari_date_t obj)

◆ cace_ari_objpath_cmp()

◆ cace_ari_objpath_copy()

◆ cace_ari_objpath_deinit()

◆ cace_ari_objpath_derive_type()

int cace_ari_objpath_derive_type ( cace_ari_objpath_t path)

Derive the ARI Type of a referenced object.

This sets the cace_ari_objpath_t::ari_type based on the cace_ari_objpath_t::type_id value.

Parameters
[in,out]pathThe object to update.
Returns
Zero upon success.
Postcondition
Also marks cace_ari_objpath_t::has_ari_type to indicate success.

References cace_ari_objpath_t::ari_type, cace_ari_idseg_t::as_int, cace_ari_idseg_t::as_text, cace_ari_type_from_name(), cace_ari_type_to_name(), cace_ari_valid_type_for_objpath(), CHKERR1, cace_ari_idseg_t::form, cace_ari_objpath_t::has_ari_type, and cace_ari_objpath_t::type_id.

Referenced by cace_ari_cbor_decode_stream().

◆ cace_ari_objpath_equal()

◆ cace_ari_objpath_init()

◆ cace_ari_objpath_set_intid()

void cace_ari_objpath_set_intid ( cace_ari_objpath_t path,
cace_ari_int_id_t  org_id,
cace_ari_int_id_t  model_id,
cace_ari_type_t  type_id,
cace_ari_int_id_t  obj_id 
)

Set the ARI as an object reference with a specific integer-enumerated path.

Parameters
[in,out]pathThe path to modify.
[in]org_idThe organization ID.
[in]model_idThe model ID.
type_idThe object type ID.
[in]obj_idThe object ID.

References cace_ari_objpath_set_intid_opt().

Referenced by cace_ari_set_objref_path_intid().

◆ cace_ari_objpath_set_intid_opt()

void cace_ari_objpath_set_intid_opt ( cace_ari_objpath_t path,
const cace_ari_int_id_t org_id,
const cace_ari_int_id_t model_id,
const cace_ari_type_t type_id,
const cace_ari_int_id_t obj_id 
)

Set the ARI as an object reference with a specific integer-enumerated path.

For all pointer arguments, the pointed-to lifetime does not need to outlast this function call. Pointed-to values are copied into the path.

Parameters
[in,out]pathThe path to modify.
[in]org_idThe organization ID, or NULL for none.
[in]model_idThe model ID, or NULL for none.
type_idThe object type ID, or NULL for none.
[in]obj_idThe object ID, or NULL for none.

References cace_ari_objpath_t::ari_type, cace_ari_idseg_t::as_int, cace_ari_objpath_deinit(), CHKVOID, cace_ari_idseg_t::form, cace_ari_objpath_t::has_ari_type, cace_ari_objpath_t::model_id, cace_ari_objpath_t::obj_id, cace_ari_objpath_t::org_id, and cace_ari_objpath_t::type_id.

Referenced by cace_ari_objpath_set_intid(), cace_ari_set_nsref_path_intid(), and test_cace_ari_cbor_encode_objref_path_int().

◆ cace_ari_objpath_set_textid()

void cace_ari_objpath_set_textid ( cace_ari_objpath_t path,
const char *  org_id,
const char *  model_id,
cace_ari_type_t  type_id,
const char *  obj_id 
)

Set the ARI as an object reference with a specific text-named path.

Parameters
[in,out]pathThe path to modify.
[in]org_idThe organization ID.
[in]model_idThe model ID.
type_idThe object type ID.
[in]obj_idThe object ID.

References cace_ari_objpath_set_textid_opt().

Referenced by cace_amm_obj_ns_add_obj(), cace_amm_semtype_dlist_name(), cace_amm_semtype_seq_name(), cace_amm_semtype_tblt_name(), cace_amm_semtype_ulist_name(), cace_amm_semtype_umap_name(), cace_amm_semtype_union_name(), cace_amm_semtype_use_name(), and cace_ari_set_objref_path_textid().

◆ cace_ari_objpath_set_textid_opt()

void cace_ari_objpath_set_textid_opt ( cace_ari_objpath_t path,
const char *  org_id,
const char *  model_id,
const cace_ari_type_t type_id,
const char *  obj_id 
)

Set the ARI as an object reference with a specific text-named path.

For all pointer arguments, the pointed-to lifetime does not need to outlast this function call. Pointed-to values are copied into the path.

Parameters
[in,out]pathThe path to modify.
[in]org_idThe organization ID, or NULL for none.
[in]model_idThe model ID, or NULL for none.
type_idThe object type ID, or NULL for none.
[in]obj_idThe object ID, or NULL for none.

References cace_ari_objpath_t::ari_type, cace_ari_idseg_t::as_text, cace_ari_objpath_deinit(), cace_ari_type_to_name(), CHKVOID, cace_ari_idseg_t::form, cace_ari_objpath_t::has_ari_type, cace_ari_objpath_t::model_id, cace_ari_objpath_t::obj_id, cace_ari_objpath_t::org_id, and cace_ari_objpath_t::type_id.

Referenced by cace_ari_objpath_set_textid(), and TEST_CASE().

◆ cace_ari_params_copy()

◆ cace_ari_params_deinit()

◆ cace_ari_params_set_ac()

struct cace_ari_ac_s * cace_ari_params_set_ac ( cace_ari_params_t obj,
struct cace_ari_list_s *  src 
)

Set the parameters to a specific state.

Parameters
[in,out]objThe state to modify, which must already be initialized.
[in,out]srcAn optional existing value struct to move from.
Returns
The new parameters.

References cace_ari_params_t::as_ac, CACE_ARI_PARAMS_AC, cace_ari_params_deinit(), CACE_MALLOC, CHKNULL, cace_ari_ac_t::items, and cace_ari_params_t::state.

Referenced by main(), suite_adms_init(), test_refda_adm_ietf_alarms_purge_all(), test_refda_adm_ietf_dtnma_agent_ctrl_ensure_var(), test_refda_adm_ietf_dtnma_agent_ctrl_var_store_reset(), test_refda_exec_wait_cond(), test_refda_exec_wait_for(), test_refda_exec_wait_until(), and test_util_group_add().

◆ cace_ari_params_set_am()

struct cace_ari_am_s * cace_ari_params_set_am ( cace_ari_params_t obj,
struct cace_ari_tree_s *  src 
)

◆ cace_ari_ref_copy()

int cace_ari_ref_copy ( cace_ari_ref_t obj,
const cace_ari_ref_t src 
)

◆ cace_ari_ref_deinit()