yumapro
24.10-3
YumaPro SDK
|
YANG Specific XPath Expression Handling. More...
Functions | |
status_t | xpath_yang_parse_path (tk_chain_t *tkc, ncx_module_t *mod, xpath_source_t source, xpath_pcb_t *pcb) |
Parse the leafref path as a leafref path. More... | |
status_t | xpath_yang_parse_path_ex (tk_chain_t *tkc, ncx_module_t *mod, xpath_source_t source, xpath_pcb_t *pcb, boolean logerrors, ncx_leafref_class_t *leafref_class) |
Parse the leafref path as a leafref path (extended) More... | |
status_t | xpath_yang_parse_path_ex2 (tk_chain_t *tkc, ncx_module_t *mod, xpath_source_t source, xpath_pcb_t *pcb, boolean logerrors, boolean is_xpath, ncx_leafref_class_t *leafref_class) |
Parse the leafref path as a leafref path (extended2) More... | |
status_t | xpath_yang_validate_path (ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean schemainst, obj_template_t **leafobj) |
Validate the previously parsed leafref path. More... | |
status_t | xpath_yang_validate_path_ex (ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean schemainst, obj_template_t **leafobj, boolean logerrors, boolean is_xpath) |
Validate the previously parsed leafref path (extended) More... | |
status_t | xpath_yang_validate_path_dev (ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean schemainst, obj_template_t **leafobj, boolean logerrors, boolean is_xpath, ncx_module_t *rootmod) |
Validate the previously parsed leafref path (deviation) More... | |
status_t | xpath_yang_validate_xmlpath (xmlTextReaderPtr reader, xpath_pcb_t *pcb, obj_template_t *pathobj, boolean logerrors, obj_template_t **targobj) |
Validate an instance-identifier expression (XML path) within an XML PDU context. More... | |
status_t | xpath_yang_validate_xmlkey (xmlTextReaderPtr reader, xpath_pcb_t *pcb, obj_template_t *obj, boolean logerrors) |
Validate a key XML attribute value given in (XML Key) More... | |
val_value_t * | xpath_yang_make_instanceid_val (xpath_pcb_t *pcb, status_t *retres, val_value_t **deepest) |
Make a value subtree out of an instance-identifier Used by yangcli to send PDUs from CLI target parameters. More... | |
status_t | xpath_yang_get_namespaces (const xpath_pcb_t *pcb, ncx_prefix_info_t *nsid_array, uint32 max_nsids, uint32 *num_nsids) |
Get the namespace URI IDs used in the specified XPath expression;. More... | |
val_value_t * | xpath_yang_make_instanceid_str (const xmlChar *target, status_t *retres, val_value_t **targval) |
Return the instance ID string for the target object. More... | |
YANG Specific XPath Expression Handling.
status_t xpath_yang_get_namespaces | ( | const xpath_pcb_t * | pcb, |
ncx_prefix_info_t * | nsid_array, | ||
uint32 | max_nsids, | ||
uint32 * | num_nsids | ||
) |
Get the namespace URI IDs used in the specified XPath expression;.
usually an instance-identifier or schema-instance node but this function simply reports all the TK_TT_MSTRING tokens that have an nsid set
The XPath pcb must be previously parsed and found valid
pcb | the XPath parser control block to use | |
[out] | nsid_array | address of return array of ncx_prefix_info_t
|
max_nsids | number of NSIDs that can be held | |
[out] | num_nsids | address of return number of NSIDs written to the buffer.
|
val_value_t * xpath_yang_make_instanceid_str | ( | const xmlChar * | target, |
status_t * | retres, | ||
val_value_t ** | targval | ||
) |
Return the instance ID string for the target object.
Return a value struct from root containing all the predicate assignments in the instance identifier
target | string that represent XPath for the instance-identifier | |
[out] | retres | address of return status
|
[out] | targval | address of return value
|
val_value_t * xpath_yang_make_instanceid_val | ( | xpath_pcb_t * | pcb, |
status_t * | retres, | ||
val_value_t ** | deepest | ||
) |
Make a value subtree out of an instance-identifier Used by yangcli to send PDUs from CLI target parameters.
The XPath pcb must be previously parsed and found valid It must be an instance-identifier value, not a leafref path
pcb | the leafref parser control block, possibly cloned from from the typdef | |
[out] | retres | address of return status (may be NULL)
|
[out] | deepest | address of return deepest node created (may be NULL)
|
status_t xpath_yang_parse_path | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xpath_source_t | source, | ||
xpath_pcb_t * | pcb | ||
) |
Parse the leafref path as a leafref path.
DOES NOT VALIDATE PATH NODES USED IN THIS PHASE A 2-pass validation is used in case the path expression is defined within a grouping. This pass is used on all objects, even in groupings
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | parent token chain (may be NULL) | |
mod | module in progress | |
source | context for this expression XP_SRC_LEAFREF or XP_SRC_INSTANCEID | |
[in,out] | pcb | initialized xpath parser control block for the leafref path
|
status_t xpath_yang_parse_path_ex | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xpath_source_t | source, | ||
xpath_pcb_t * | pcb, | ||
boolean | logerrors, | ||
ncx_leafref_class_t * | leafref_class | ||
) |
Parse the leafref path as a leafref path (extended)
DOES NOT VALIDATE PATH NODES USED IN THIS PHASE A 2-pass validation is used in case the path expression is defined within a grouping. This pass is used on all objects, even in groupings
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | parent token chain (may be NULL) | |
mod | module in progress | |
source | context for this expression XP_SRC_LEAFREF or XP_SRC_INSTANCEID | |
[in,out] | pcb | initialized xpath parser control block for the leafref path
|
logerrors | TRUE to log errors FALSE to suppress error messages | |
[out] | leafref_class | address of return leafref class
|
status_t xpath_yang_parse_path_ex2 | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xpath_source_t | source, | ||
xpath_pcb_t * | pcb, | ||
boolean | logerrors, | ||
boolean | is_xpath, | ||
ncx_leafref_class_t * | leafref_class | ||
) |
Parse the leafref path as a leafref path (extended2)
DOES NOT VALIDATE PATH NODES USED IN THIS PHASE A 2-pass validation is used in case the path expression is defined within a grouping. This pass is used on all objects, even in groupings
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | parent token chain (may be NULL) | |
mod | module in progress | |
source | context for this expression XP_SRC_LEAFREF or XP_SRC_INSTANCEID | |
pcb | initialized xpath parser control block for the leafref path
| |
logerrors | TRUE to log errors FALSE to suppress error messages | |
is_xpath | TRUE to allow predicate leafs other than keys This allows yangcli to generate content-match | |
[out] | leafref_class | address of return leafref class
|
status_t xpath_yang_validate_path | ( | ncx_module_t * | mod, |
obj_template_t * | obj, | ||
xpath_pcb_t * | pcb, | ||
boolean | schemainst, | ||
obj_template_t ** | leafobj | ||
) |
Validate the previously parsed leafref path.
A 2-pass validation is used in case the path expression is defined within a grouping. This pass is used only on cooked (real) objects
Called after all 'uses' and 'augment' expansion so validation against cooked object tree can be done
Error messages are printed by this function!! Do not duplicate error messages upon error return
mod | module containing the 'obj' (in progress) NULL if no object in progress | |
obj | object using the leafref data type | |
pcb | the leafref parser control block, possibly cloned from from the typdef | |
schemainst | TRUE if ncx:schema-instance string FALSE to use the pcb->source field to determine the exact parse mode | |
[out] | leafobj | address of the return target object
|
status_t xpath_yang_validate_path_dev | ( | ncx_module_t * | mod, |
obj_template_t * | obj, | ||
xpath_pcb_t * | pcb, | ||
boolean | schemainst, | ||
obj_template_t ** | leafobj, | ||
boolean | logerrors, | ||
boolean | is_xpath, | ||
ncx_module_t * | rootmod | ||
) |
Validate the previously parsed leafref path (deviation)
YPW-1416: add rootmod parameter to track module in progress after replacing leafref type make sure module in progress is found instead of calling check_import and reparsing
A 2-pass validation is used in case the path expression is defined within a grouping. This pass is used only on cooked (real) objects
Called after all 'uses' and 'augment' expansion so validation against cooked object tree can be done
Error messages are printed by this function!! Do not duplicate error messages upon error return
mod | module containing the 'obj' (in progress) NULL if no object in progress | |
obj | object using the leafref data type | |
pcb | the leafref parser control block, possibly cloned from from the typdef | |
schemainst | TRUE if ncx:schema-instance string FALSE to use the pcb->source field to determine the exact parse mode | |
[out] | leafobj | address of the return target object
|
logerrors | TRUE to log errors, FALSE to suppress errors val_parse uses FALSE if basetype NCX_BT_UNION | |
is_xpath | TRUE to allow predicate leafs other than keys This allows yangcli to generate content-match filters | |
rootmod | root module being parsed; used during deviation processing for validating leafref; module will not get found and then duplicated |
status_t xpath_yang_validate_path_ex | ( | ncx_module_t * | mod, |
obj_template_t * | obj, | ||
xpath_pcb_t * | pcb, | ||
boolean | schemainst, | ||
obj_template_t ** | leafobj, | ||
boolean | logerrors, | ||
boolean | is_xpath | ||
) |
Validate the previously parsed leafref path (extended)
A 2-pass validation is used in case the path expression is defined within a grouping. This pass is used only on cooked (real) objects
Called after all 'uses' and 'augment' expansion so validation against cooked object tree can be done
Error messages are printed by this function!! Do not duplicate error messages upon error return
mod | module containing the 'obj' (in progress) NULL if no object in progress | |
obj | object using the leafref data type | |
pcb | the leafref parser control block, possibly cloned from from the typdef | |
schemainst | TRUE if ncx:schema-instance string FALSE to use the pcb->source field to determine the exact parse mode | |
[out] | leafobj | address of the return target object
|
logerrors | TRUE to log errors FALSE to suppress error messages | |
is_xpath | TRUE to allow predicate leafs other than keys This allows yangcli to generate content-match |
status_t xpath_yang_validate_xmlkey | ( | xmlTextReaderPtr | reader, |
xpath_pcb_t * | pcb, | ||
obj_template_t * | obj, | ||
boolean | logerrors | ||
) |
Validate a key XML attribute value given in (XML Key)
an <edit-config> operation with an 'insert' attribute Check that a complete set of predicates is present for the specified list of leaf-list
reader | XML reader to use |
pcb | initialized XPath parser control block with a possibly unchecked pcb->exprstr. This function will call tk_tokenize_xpath_string if it has not already been called. |
obj | list or leaf-list object associated with the pcb->exprstr predicate expression (MAY be NULL if first-pass parsing and object is not known yet – parsed in XML attribute) |
logerrors | TRUE if log_error and ncx_print_errormsg should be used to log XPath errors and warnings FALSE if internal error info should be recorded in the xpath_result_t struct instead !!! use FALSE unless DEBUG mode !!! |
status_t xpath_yang_validate_xmlpath | ( | xmlTextReaderPtr | reader, |
xpath_pcb_t * | pcb, | ||
obj_template_t * | pathobj, | ||
boolean | logerrors, | ||
obj_template_t ** | targobj | ||
) |
Validate an instance-identifier expression (XML path) within an XML PDU context.
reader | XML reader to use | |
pcb | initialized XPath parser control block with a possibly unchecked pcb->exprstr. This function will call tk_tokenize_xpath_string if it has not already been called. | |
pathobj | object to create identifier for | |
logerrors | TRUE if log_error and ncx_print_errormsg should be used to log XPath errors and warnings FALSE if internal error info should be recorded in the xpath_result_t struct instead !!! use FALSE unless DEBUG mode !!! | |
[out] | targobj | address of return target object
|