yumapro  23.10T-8
YumaPro SDK
Loading...
Searching...
No Matches
sm.h File Reference

Schema Mount Handling. More...

#include <xmlreader.h>
#include "ncxtypes.h"
#include "obj.h"
#include "status_enum.h"
Include dependency graph for sm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef status_t(* sm_yanglib_cbfn_t) (ncx_sm_rootcb_t *rootcb)
 yang library SIL code callback to setup a yanglib_cb More...
 
typedef boolean(* sm_rootcb_searchfn_t) (ncx_sm_rootcb_t *rootcb, void *cookie)
 ROOTCB Search Callback Function. More...
 

Functions

void sm_init (void)
 Initialize Schema Mount handler. More...
 
void sm_cleanup (void)
 Cleanup Schema Mount handler. More...
 
void sm_dump_rootcb (ncx_sm_rootcb_t *rootcb)
 Print the interesting fields in Root Control block Must be debug for some info, debug4 for full info. More...
 
void sm_show_rootcb (ncx_sm_rootcb_t *rootcb)
 Print the interesting fields in Root Control block for yangcli report capabilities. More...
 
void sm_dump_all_rootcb (void)
 Print the interesting fields in all rootcbs. More...
 
ncx_module_tsm_find_module (ncx_sm_rootcb_t *rootcb, const xmlChar *modname, const xmlChar *revision)
 Find an ncx_module_t in the rootcb->modQ. More...
 
ncx_module_tsm_find_deviation (ncx_sm_rootcb_t *rootcb, const xmlChar *modname, const xmlChar *revision)
 Find an ncx_module_t in the rootcb->devQ;. More...
 
ncx_module_tsm_find_module_allroots (const xmlChar *modname, const xmlChar *revision, boolean withdev)
 Find an ncx_module_t in the any rootcb. More...
 
obj_template_tsm_find_any_object (ncx_sm_rootcb_t *rootcb, const xmlChar *objname)
 Check if an obj_template_t is in any module that matches the object name string. More...
 
obj_template_tsm_first_mounted_obj (ncx_sm_rootcb_t *rootcb, boolean augment_ok)
 Find the first data node. More...
 
obj_template_tsm_next_mounted_obj (obj_template_t *curobj, boolean augment_ok)
 Find the next data node. More...
 
obj_template_tsm_last_mounted_obj (ncx_sm_rootcb_t *rootcb, boolean augment_ok)
 Find the first data node. More...
 
obj_template_tsm_prev_mounted_obj (obj_template_t *curobj, boolean augment_ok)
 Find the previous data node. More...
 
obj_template_tsm_find_child_obj (obj_template_t *obj, const xmlChar *modname, const xmlChar *objname, ncx_name_match_t match_names, boolean alt_names, boolean dataonly, status_t *retres)
 Find the previous data node. More...
 
void sm_setup_cur_rootcb (ncx_sm_rootcb_t *rootcb)
 setup NCX library to use the rootCB for schema mount More...
 
void sm_init_yanglib_cb (ncx_yanglib_cb_t *cb)
 Init a YANG Library control block struct. More...
 
void sm_clean_yanglib_cb (ncx_yanglib_cb_t *cb)
 Clean a YANG Library control block struct. More...
 
void sm_register_yanglib_cbfn (sm_yanglib_cbfn_t cbfn)
 register a yanglib_cb setup callback More...
 
ncx_sm_mpid_tsm_new_mpid (void)
 Malloc and initialize an MPID struct. More...
 
void sm_free_mpid (ncx_sm_mpid_t *mpid)
 free a malloced Mount Point ID control block More...
 
status_t sm_setup_mpid (xml_msg_hdr_t *msg, val_value_t *val, obj_template_t *obj)
 Set Up ancestor keys and yanglib for the current MPI. More...
 
void sm_dump_mpid (const ncx_sm_mpid_t *mpid)
 Dump the contents of a MPID struct if DEBUG. More...
 
ncx_sm_mpid_tsm_clone_mpid (const ncx_sm_mpid_t *mpid, val_value_t *valroot)
 Clone an existing MPID. More...
 
ncx_sm_mpid_tsm_get_mpid_from_msg (rpc_msg_t *msg)
 Get the MPID struct from the message header if set. More...
 
status_t sm_find_mpidval_from_input (val_value_t *chval, val_value_t **mpidval)
 Get the MPID value node from the parsed val_value_t tree prepresenting the ancestors of the action or SM RPC method. More...
 
val_value_tsm_get_mpi_valroot (val_value_t *val)
 Get the current value root value. More...
 
ncx_sm_mpid_tsm_get_ancestor_mpid (val_value_t *val)
 Get the MPID for the specified mounted node. More...
 
status_t sm_patch_notif_keyQ (const ncx_sm_mpid_t *mpid, dlq_hdr_t *keyQ)
 Patch the keyQ for a notification to prepend the SM ancestor keys to the queue. More...
 
ncx_sm_mpid_tsm_get_first_mpid (ncx_sm_rootcb_t *rootcb)
 Get the first MPID struct in the rootcb. More...
 
ncx_sm_mpid_tsm_get_next_mpid (ncx_sm_mpid_t *curmpid)
 Get the next MPID struct in the rootcb. More...
 
status_t sm_activate_mpid (ncx_sm_rootcb_t *rootcb, ncx_sm_mpid_t *mpid)
 Setup a new MPID. More...
 
ncx_sm_rootcb_tsm_search_rootcbs (dlq_hdr_t *searchQ, sm_rootcb_searchfn_t searchfn, void *cookie)
 search all the rootcbs in the specified queue More...
 
ncx_sm_rootcb_tsm_save_rootcb (obj_template_t *obj, const xmlChar *label)
 Set the with_schema_mount value. More...
 
ncx_sm_rootcb_tsm_find_rootcb (const xmlChar *label, const xmlChar *modname)
 Find a Mount Point Control Block Entry in the rootcbQ. More...
 
void sm_free_rootcb (ncx_sm_rootcb_t *rootcb)
 Free a ncx_sm_rootcb_t Control Block record. More...
 
ncx_module_tsm_get_first_module (ncx_sm_rootcb_t *rootcb)
 Get first module from Root Control Block. More...
 
ncx_module_tsm_get_last_module (ncx_sm_rootcb_t *rootcb)
 Get the last module from Root Control Block. More...
 
void sm_clear_all_rootcbs (dlq_hdr_t *saveQ)
 Retrieve all the rootcb entries or clear the rootcbQ. More...
 
ncx_sm_mpid_tsm_val_to_mpid (val_value_t *mpidval, boolean preserve, status_t *res)
 Convert a "mpid" YANG container to an MPID value. More...
 
val_value_tsm_mpid_to_val (ncx_sm_mpid_t *mpid, obj_template_t *mpidobj, boolean preserve, status_t *res)
 Convert a "mpid" struct to a YANG container. More...
 
val_value_tsm_get_first_anckey (const ncx_sm_mpid_t *mpid)
 Get first ancestor key from the MPID. More...
 
val_value_tsm_get_next_anckey (const val_value_t *curkey)
 Get next ancestor key from the MPID. More...
 
ncx_sm_rootcb_tsm_get_rootcb_for_mpid (ncx_sm_mpid_t *mpid)
 Get the rootcb for an MPID. More...
 
uint32 sm_mod_revision_count (xml_msg_hdr_t *msg, ncx_sm_rootcb_t *rootcb, const xmlChar *modname)
 get the module revision count for one rootcb More...
 
uint32 sm_mod_revision_count_allroots (xml_msg_hdr_t *msg, const xmlChar *modname)
 get the module revision count for all rootcbs More...
 
status_t sm_setup_yanglib (ncx_sm_rootcb_t *rootcb)
 Setup the YANG library early because the get-sm-yanglib operation is enabled. More...
 

Detailed Description

Schema Mount Handling.

Typedef Documentation

◆ sm_rootcb_searchfn_t

typedef boolean(* sm_rootcb_searchfn_t) (ncx_sm_rootcb_t *rootcb, void *cookie)

ROOTCB Search Callback Function.

INTERNAL API ONLY! Used for schema mount to scan the rootcbQ and test the CB with this callback

Parameters
rootcbstruct to check
cookiepointer passed in sm_search_rootcbs function
Returns
FALSE to stop the search here; TRUE to keep going

◆ sm_yanglib_cbfn_t

typedef status_t(* sm_yanglib_cbfn_t) (ncx_sm_rootcb_t *rootcb)

yang library SIL code callback to setup a yanglib_cb

INTERNAL API ONLY! Used for schema mount

The rootcb->yanglib_cb will be setup The rootcb->modQ is expected to be filled in already

Parameters
rootcbroot control block to setup
Returns
status