yumapro
24.10-1
YumaPro SDK
|
Schema Mount Core Functions. 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_t * | sm_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_t * | sm_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_t * | sm_find_module_allroots (const xmlChar *modname, const xmlChar *revision, boolean withdev) |
Find an ncx_module_t in the any rootcb. More... | |
obj_template_t * | sm_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_t * | sm_first_mounted_obj (ncx_sm_rootcb_t *rootcb, boolean augment_ok) |
Find the first data node. More... | |
obj_template_t * | sm_next_mounted_obj (obj_template_t *curobj, boolean augment_ok) |
Find the next data node. More... | |
obj_template_t * | sm_last_mounted_obj (ncx_sm_rootcb_t *rootcb, boolean augment_ok) |
Find the first data node. More... | |
obj_template_t * | sm_prev_mounted_obj (obj_template_t *curobj, boolean augment_ok) |
Find the previous data node. More... | |
obj_template_t * | sm_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_t * | sm_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_t * | sm_clone_mpid (const ncx_sm_mpid_t *mpid, val_value_t *valroot) |
Clone an existing MPID. More... | |
ncx_sm_mpid_t * | sm_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_t * | sm_get_mpi_valroot (val_value_t *val) |
Get the current value root value. More... | |
ncx_sm_mpid_t * | sm_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_t * | sm_get_first_mpid (ncx_sm_rootcb_t *rootcb) |
Get the first MPID struct in the rootcb. More... | |
ncx_sm_mpid_t * | sm_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_t * | sm_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_t * | sm_save_rootcb (obj_template_t *obj, const xmlChar *label) |
Set the with_schema_mount value. More... | |
ncx_sm_rootcb_t * | sm_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_t * | sm_get_first_module (ncx_sm_rootcb_t *rootcb) |
Get first module from Root Control Block. More... | |
ncx_module_t * | sm_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_t * | sm_val_to_mpid (val_value_t *mpidval, boolean preserve, status_t *res) |
Convert a "mpid" YANG container to an MPID value. More... | |
val_value_t * | sm_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_t * | sm_get_first_anckey (const ncx_sm_mpid_t *mpid) |
Get first ancestor key from the MPID. More... | |
val_value_t * | sm_get_next_anckey (const val_value_t *curkey) |
Get next ancestor key from the MPID. More... | |
ncx_sm_rootcb_t * | sm_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... | |
Schema Mount Core Functions.
status_t sm_activate_mpid | ( | ncx_sm_rootcb_t * | rootcb, |
ncx_sm_mpid_t * | mpid | ||
) |
Setup a new MPID.
rootcb | root control block to use |
mpid | MPID to setup the valroot with the rootcb yanglib |
void sm_clean_yanglib_cb | ( | ncx_yanglib_cb_t * | cb | ) |
Clean a YANG Library control block struct.
cb | yanglib control block to clean |
void sm_cleanup | ( | void | ) |
Cleanup Schema Mount handler.
void sm_clear_all_rootcbs | ( | dlq_hdr_t * | saveQ | ) |
Retrieve all the rootcb entries or clear the rootcbQ.
Used only by yangcli to get the rootcbs while loading the top-level modules or clearing the queue for next use
[out] | saveQ | queue header to retrieve all the entries in the rootcbQ
|
ncx_sm_mpid_t * sm_clone_mpid | ( | const ncx_sm_mpid_t * | mpid, |
val_value_t * | valroot | ||
) |
Clone an existing MPID.
mpid | Mount Point ID control block to clone |
valroot | value node getting this MPID
|
void sm_dump_all_rootcb | ( | void | ) |
Print the interesting fields in all rootcbs.
void sm_dump_mpid | ( | const ncx_sm_mpid_t * | mpid | ) |
Dump the contents of a MPID struct if DEBUG.
This is an external API that can be used in SIL code
Non-const needed for val_dump_value; not modified
mpid | Mount Point ID control block to dump |
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.
–log-level=debug or higher
rootcb | Root Control Block to output |
obj_template_t * sm_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.
rootcb | control block to print |
objname | object name to match |
obj_template_t * sm_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.
Check if an obj_template_t in in any module that matches a data node
obj | obj_template_t to check |
modname | module name that defines the obj_template_t == NULL and first match will be done, and the module ignored (Name instead of QName) |
objname | object name to find |
match_names | enum for selected match names mode alt_names == TRUE if alt-name should be checked in addition to the YANG node name == FALSE to check YANG names only |
alt_names | TRUE if alt-name should be checked |
dataonly | TRUE to check just data nodes FALSE to check all nodes |
retres | address of return status |
ncx_module_t * sm_find_deviation | ( | ncx_sm_rootcb_t * | rootcb, |
const xmlChar * | modname, | ||
const xmlChar * | revision | ||
) |
Find an ncx_module_t in the rootcb->devQ;.
rootcb->devQ These are the deviation modules that are already loaded into Mount Point
rootcb | control block to use |
modname | module name |
revision | module revision date |
ncx_module_t * sm_find_module | ( | ncx_sm_rootcb_t * | rootcb, |
const xmlChar * | modname, | ||
const xmlChar * | revision | ||
) |
Find an ncx_module_t in the rootcb->modQ.
rootcb->modQ These are the modules that are already loaded into Mount Point
rootcb | control block to use |
modname | module name |
revision | module revision date |
ncx_module_t * sm_find_module_allroots | ( | const xmlChar * | modname, |
const xmlChar * | revision, | ||
boolean | withdev | ||
) |
Find an ncx_module_t in the any rootcb.
Will return the first match or NULL if no match. Used by YANG Library get-schema operation
modname | module name |
revision | module revision date |
withdev | TRUE to check deviation modules as well |
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.
chval | child value within the mount point this is expected to be the action value node from the parsed input message but that is not required. | |
[out] | mpidval | address of return MPID value node
|
ncx_sm_rootcb_t * sm_find_rootcb | ( | const xmlChar * | label, |
const xmlChar * | modname | ||
) |
Find a Mount Point Control Block Entry in the rootcbQ.
label | label name to match |
modname | module name to match |
obj_template_t * sm_first_mounted_obj | ( | ncx_sm_rootcb_t * | rootcb, |
boolean | augment_ok | ||
) |
Find the first data node.
Check if an obj_template_t in in any module that matches a data node
rootcb | control block to use |
augment_ok | TRUE to include augment objects |
void sm_free_mpid | ( | ncx_sm_mpid_t * | mpid | ) |
free a malloced Mount Point ID control block
mpid | Mount Point ID control block to free |
void sm_free_rootcb | ( | ncx_sm_rootcb_t * | rootcb | ) |
Free a ncx_sm_rootcb_t Control Block record.
rootcb | Mount Point Control Block to free |
ncx_sm_mpid_t * sm_get_ancestor_mpid | ( | val_value_t * | val | ) |
Get the MPID for the specified mounted node.
This is an API for SIL or SIL-SA callback code
val | value to check |
val_value_t * sm_get_first_anckey | ( | const ncx_sm_mpid_t * | mpid | ) |
Get first ancestor key from the MPID.
mpid | Mount Point Instance Descriptor to use |
ncx_module_t * sm_get_first_module | ( | ncx_sm_rootcb_t * | rootcb | ) |
Get first module from Root Control Block.
rootcb | Mount Point Control Block to use |
ncx_sm_mpid_t * sm_get_first_mpid | ( | ncx_sm_rootcb_t * | rootcb | ) |
Get the first MPID struct in the rootcb.
rootcb | root control block to check |
ncx_module_t * sm_get_last_module | ( | ncx_sm_rootcb_t * | rootcb | ) |
Get the last module from Root Control Block.
rootcb | Mount Point Control Block to use |
val_value_t * sm_get_mpi_valroot | ( | val_value_t * | val | ) |
Get the current value root value.
Get the back-ptr to the Mount Point root value
val | value to check |
ncx_sm_mpid_t * sm_get_mpid_from_msg | ( | rpc_msg_t * | msg | ) |
Get the MPID struct from the message header if set.
This field is set by the server during RPC or action processing so SIL code in schema mounted modules can identify which mount point instance is being used by the client
msg | RPC msg message header to check |
val_value_t * sm_get_next_anckey | ( | const val_value_t * | curkey | ) |
Get next ancestor key from the MPID.
curkey | current kley entry |
ncx_sm_mpid_t * sm_get_next_mpid | ( | ncx_sm_mpid_t * | curmpid | ) |
Get the next MPID struct in the rootcb.
curmpid | current MPID to get next for |
ncx_sm_rootcb_t * sm_get_rootcb_for_mpid | ( | ncx_sm_mpid_t * | mpid | ) |
Get the rootcb for an MPID.
Should work on SIL. May not work on SIL-SA
mpid | MPID to check |
void sm_init | ( | void | ) |
Initialize Schema Mount handler.
void sm_init_yanglib_cb | ( | ncx_yanglib_cb_t * | cb | ) |
Init a YANG Library control block struct.
cb | yanglib control block to init |
obj_template_t * sm_last_mounted_obj | ( | ncx_sm_rootcb_t * | rootcb, |
boolean | augment_ok | ||
) |
Find the first data node.
Check if an obj_template_t in in any module that matches a data node
rootcb | control block to use |
augment_ok | TRUE to include augment objects |
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
Support for YANG library get-schema operation
msg | xml_msg_hdr_t to use |
rootcb | root control block to check |
modname | module name to count all revisions |
uint32 sm_mod_revision_count_allroots | ( | xml_msg_hdr_t * | msg, |
const xmlChar * | modname | ||
) |
get the module revision count for all rootcbs
Support for YANG library get-schema operation
msg | xml_msg_hdr_t to use |
modname | module name to count all revisions |
val_value_t * sm_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.
Definition is in yumaworks-sil-sa.yang 'mpid-parm' grouping
+--rw mpid | | +--rw module? string | | +--rw label? string | | +--rw objpath? string | | +--rw keys? <anyxml>
mpid | struct to convert | |
mpidobj | object template for return value | |
preserve | TRUE to steal fields from mpid; FALSE to preserve mpid | |
[out] | res | address of return status
|
ncx_sm_mpid_t * sm_new_mpid | ( | void | ) |
Malloc and initialize an MPID struct.
obj_template_t * sm_next_mounted_obj | ( | obj_template_t * | curobj, |
boolean | augment_ok | ||
) |
Find the next data node.
Check if an obj_template_t in in any module that matches a data node
curobj | node to find next from |
augment_ok | TRUE to include augment objects |
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.
mpid | MPID to use for ancestor keys |
keyQ | queue of val_value_t will have ancestor keys prepended to it. They are cloned so val_free_value is required for all added entries to this queue |
obj_template_t * sm_prev_mounted_obj | ( | obj_template_t * | curobj, |
boolean | augment_ok | ||
) |
Find the previous data node.
Check if an obj_template_t in in any module that matches a data node
curobj | node to find previous from |
augment_ok | TRUE to include augment objects |
void sm_register_yanglib_cbfn | ( | sm_yanglib_cbfn_t | cbfn | ) |
register a yanglib_cb setup callback
cbfn | callback function to register |
ncx_sm_rootcb_t * sm_save_rootcb | ( | obj_template_t * | obj, |
const xmlChar * | label | ||
) |
Set the with_schema_mount value.
Save Mount Point Control Block Entry into rootcbQ for lookup
obj | object template to use |
label | label name of the Mount Point |
ncx_sm_rootcb_t * sm_search_rootcbs | ( | dlq_hdr_t * | searchQ, |
sm_rootcb_searchfn_t | searchfn, | ||
void * | cookie | ||
) |
search all the rootcbs in the specified queue
searchQ | Q of ncx_sm_rootcb_t to search NULL to use the top-levvel rootcbQ |
searchfn | callback to invoke for the search |
cookie | pointer to pass to the callback function |
void sm_setup_cur_rootcb | ( | ncx_sm_rootcb_t * | rootcb | ) |
setup NCX library to use the rootCB for schema mount
rootcb | schema mount root control block NULL for top level |
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.
msg | XML message header in progress |
val | current MP value to use |
obj | current MP object to use |
status_t sm_setup_yanglib | ( | ncx_sm_rootcb_t * | rootcb | ) |
Setup the YANG library early because the get-sm-yanglib operation is enabled.
rootcb | Mount Point to setup YANG library |
void sm_show_rootcb | ( | ncx_sm_rootcb_t * | rootcb | ) |
Print the interesting fields in Root Control block for yangcli report capabilities.
–log-level=info or higher
rootcb | Root Control Block to output |
ncx_sm_mpid_t * sm_val_to_mpid | ( | val_value_t * | mpidval, |
boolean | preserve, | ||
status_t * | res | ||
) |
Convert a "mpid" YANG container to an MPID value.
Definition is in yumaworks-sil-sa.yang 'mpid-parm' grouping
+--rw mpid | | +--rw module? string | | +--rw label? string | | +--rw objpath? string | | +--rw keys? <anydata>
mpidval | value node for message 'mpid' container to convert | |
preserve | TRUE to steal fields from mpidval; FALSE to preserve mpidval | |
[out] | res | address of return status
|