yumapro
24.10-3
YumaPro SDK
|
Support YANG Module parser feature statement. More...
Functions | |
void | ncx_feature_init (void) |
Init the ncx_feature module. | |
void | ncx_feature_cleanup (void) |
Cleanup the ncx_feature module. | |
ncx_iffeature_t * | ncx_new_iffeature (void) |
Get a new ncx_iffeature_t struct. More... | |
void | ncx_free_iffeature (ncx_iffeature_t *iff) |
Free a malloced ncx_iffeature_t struct. More... | |
ncx_iff_ref_t * | ncx_new_iff_ref (const xmlChar *prefix, uint32 prefix_len, const xmlChar *featname) |
Get a new ncx_iff_ref_t struct. More... | |
void | ncx_free_iff_ref (ncx_iff_ref_t *iff_ref) |
Free a malloced ncx_iff_ref_t struct. More... | |
ncx_iff_ref_t * | ncx_find_iff_ref (dlq_hdr_t *iff_refQ, const xmlChar *prefix, uint32 prefix_len, const xmlChar *featname) |
Find a ncx_iff_ref_t struct. More... | |
ncx_iffeature_t * | ncx_clone_iffeature (ncx_iffeature_t *srciff) |
Clone a new ncx_iffeature_t struct. More... | |
void | ncx_clean_iffeatureQ (dlq_hdr_t *iffeatureQ) |
Clean a Q of malloced ncx_iffeature_t struct. More... | |
ncx_iffeature_t * | ncx_find_iffeature (dlq_hdr_t *iffeatureQ, const xmlChar *prefix, const xmlChar *name, const xmlChar *modprefix) |
Search a Q of ncx_iffeature_t structs for a match. More... | |
ncx_feature_t * | ncx_new_feature (void) |
Get a new ncx_feature_t struct. More... | |
void | ncx_free_feature (ncx_feature_t *feature) |
Free a malloced ncx_feature_t struct. More... | |
ncx_feature_t * | ncx_find_feature (ncx_module_t *mod, const xmlChar *name) |
Find a ncx_feature_t struct in the module and perhaps any of its submodules. More... | |
ncx_feature_t * | ncx_find_feature_que (dlq_hdr_t *featureQ, const xmlChar *name) |
Find a ncx_feature_t struct in the specified Q. More... | |
ncx_feature_t * | ncx_find_feature_all (ncx_module_t *mod, const xmlChar *name) |
Find a ncx_feature_t struct in the module and perhaps any of its submodules. More... | |
void | ncx_for_all_features (const ncx_module_t *mod, ncx_feature_cbfn_t cbfn, void *cookie, boolean enabledonly) |
Execute a callback function for all features in this module and any submodules. More... | |
uint32 | ncx_feature_count (const ncx_module_t *mod, boolean enabledonly) |
Get the total feature count for this module and any submodules. More... | |
boolean | ncx_feature_enabled (ncx_feature_t *feature) |
Check if the specified feature and any referenced if-features are enabled. More... | |
boolean | ncx_feature_enabled_str (const xmlChar *modname, const xmlChar *revision, const xmlChar *name) |
Find a ncx_feature_t struct and check if it is enabled. More... | |
void | ncx_set_feature_enable_default (boolean flag) |
Set the feature_enable_default flag. More... | |
void | ncx_set_feature_code_default (ncx_feature_code_t code) |
Set the feature_code_default enumeration (deprecated) More... | |
status_t | ncx_set_feature_code_entry (const xmlChar *featstr, ncx_feature_code_t featcode) |
Create or set a feature_entry struct for the specified feature code parameter (deprecated) More... | |
status_t | ncx_set_feature_enable_entry (const xmlChar *featstr, boolean flag) |
Create or set a feature_entry struct for the specified feature enabled parameter. More... | |
status_t | ncx_set_feature_enable (const xmlChar *modname, const xmlChar *name, boolean flag) |
Create or set a feature_entry struct for the specified feature enabled parameter. More... | |
status_t | ncx_set_feature_enable_ex (const xmlChar *modname, const xmlChar *name, boolean flag, boolean force) |
Create or set a feature_entry struct for the specified feature enabled parameter (extended) More... | |
void | ncx_set_feature_parms (ncx_feature_t *feature) |
Check if any feature parameters were set for the specified feature struct. More... | |
void | ncx_set_features_for_mod (ncx_module_t *mod) |
Check if any feature parameters were set for the specified feature struct for all features in a module. More... | |
ncx_feature_t * | ncx_first_feature_from_iff (ncx_iffeature_t *iff) |
Get the feature in the first ncx_iff_ref_t struct. More... | |
const xmlChar * | ncx_get_feature_modname (ncx_feature_t *feat) |
Get the module name string for the feature. More... | |
status_t | yang_feature_consume_iffeature (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *iffeatureQ, dlq_hdr_t *appinfoQ) |
Consume an if-feature-stmt. More... | |
status_t | yang_feature_consume_feature (tk_chain_t *tkc, ncx_module_t *mod) |
Parse the next N tokens as a feature statement. More... | |
status_t | yang_feature_resolve_feature (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, ncx_feature_t *feature) |
Validate all the if-feature clauses present in the specified feature. More... | |
status_t | yang_feature_check_feature_loop (tk_chain_t *tkc, ncx_module_t *mod, ncx_feature_t *feature, ncx_feature_t *startfeature) |
Check for a feature loop. More... | |
status_t | yang_feature_resolve_iffeatureQ (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj) |
Check the Q of if-feature statements for the specified object. More... | |
status_t | yang_feature_resolve_iffeatureQ2 (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *iffeatureQ) |
Check the Q of if-feature statements for the specified object. More... | |
status_t | yang_feature_check_iffeature_mismatch (tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *ancestor, obj_template_t *testobj, ncx_iffeature_t *iff, boolean iserror) |
Check the child object against the ancestor node for 1 if-feature. More... | |
boolean | yang_feature_eval_iffeature (ncx_module_t *mod, ncx_iffeature_t *iff) |
Evaluate the if-feature expression. More... | |
boolean | yang_feature_eval_iffeatureQ (ncx_module_t *mod, dlq_hdr_t *iffQ) |
Evaluate a Q ofif-feature expressions. More... | |
Support YANG Module parser feature statement.
void ncx_clean_iffeatureQ | ( | dlq_hdr_t * | iffeatureQ | ) |
Clean a Q of malloced ncx_iffeature_t struct.
iffeatureQ | address of Q of ncx_iffeature_t to clean |
ncx_iffeature_t * ncx_clone_iffeature | ( | ncx_iffeature_t * | srciff | ) |
Clone a new ncx_iffeature_t struct.
srciff | ifffeature struct to clone |
uint32 ncx_feature_count | ( | const ncx_module_t * | mod, |
boolean | enabledonly | ||
) |
Get the total feature count for this module and any submodules.
mod | module to search for features |
enabledonly | TRUE to only count enabled features FALSE to count all features |
boolean ncx_feature_enabled | ( | ncx_feature_t * | feature | ) |
Check if the specified feature and any referenced if-features are enabled.
feature | feature to check |
boolean ncx_feature_enabled_str | ( | const xmlChar * | modname, |
const xmlChar * | revision, | ||
const xmlChar * | name | ||
) |
Find a ncx_feature_t struct and check if it is enabled.
modname | name of module to search |
revision | module revision string (may be NULL) |
name | feature name to find |
ncx_feature_t * ncx_find_feature | ( | ncx_module_t * | mod, |
const xmlChar * | name | ||
) |
Find a ncx_feature_t struct in the module and perhaps any of its submodules.
mod | module to search |
name | feature name to find |
ncx_feature_t * ncx_find_feature_all | ( | ncx_module_t * | mod, |
const xmlChar * | name | ||
) |
Find a ncx_feature_t struct in the module and perhaps any of its submodules.
mod | module to search (plus allincQ of submodules |
name | feature name to find |
ncx_feature_t * ncx_find_feature_que | ( | dlq_hdr_t * | featureQ, |
const xmlChar * | name | ||
) |
Find a ncx_feature_t struct in the specified Q.
featureQ | Q of ncx_feature_t to search |
name | feature name to find |
ncx_iff_ref_t * ncx_find_iff_ref | ( | dlq_hdr_t * | iff_refQ, |
const xmlChar * | prefix, | ||
uint32 | prefix_len, | ||
const xmlChar * | featname | ||
) |
Find a ncx_iff_ref_t struct.
iff_refQ | Q of ncx_iff_ref_t to check |
prefix | prefix used in identifier-ref-arg (may be NULL) |
prefix_len | length of prefix if it is used |
featname | feature name used in identifier-ref-arg (may be NULL) |
ncx_iffeature_t * ncx_find_iffeature | ( | dlq_hdr_t * | iffeatureQ, |
const xmlChar * | prefix, | ||
const xmlChar * | name, | ||
const xmlChar * | modprefix | ||
) |
Search a Q of ncx_iffeature_t structs for a match.
iffeatureQ | address of Q of ncx_iffeature_t to search |
prefix | prefix to check for; a NULL value indicates the current module |
name | feature name string to find |
modprefix | module prefix to use |
ncx_feature_t * ncx_first_feature_from_iff | ( | ncx_iffeature_t * | iff | ) |
Get the feature in the first ncx_iff_ref_t struct.
if_feature record
iff | iff record to check |
void ncx_for_all_features | ( | const ncx_module_t * | mod, |
ncx_feature_cbfn_t | cbfn, | ||
void * | cookie, | ||
boolean | enabledonly | ||
) |
Execute a callback function for all features in this module and any submodules.
mod | module to search for features |
cbfn | feature callback function |
cookie | cookie value to pass to each iteration of the callback |
enabledonly | TRUE if only callbacks for enabled features FALSE if all features should invoke callbacks |
void ncx_free_feature | ( | ncx_feature_t * | feature | ) |
Free a malloced ncx_feature_t struct.
feature | struct to free |
void ncx_free_iff_ref | ( | ncx_iff_ref_t * | iff_ref | ) |
Free a malloced ncx_iff_ref_t struct.
iff_ref | struct to free |
void ncx_free_iffeature | ( | ncx_iffeature_t * | iff | ) |
Free a malloced ncx_iffeature_t struct.
iff | struct to free |
const xmlChar * ncx_get_feature_modname | ( | ncx_feature_t * | feat | ) |
Get the module name string for the feature.
feat | feature to check |
ncx_feature_t * ncx_new_feature | ( | void | ) |
Get a new ncx_feature_t struct.
ncx_iff_ref_t * ncx_new_iff_ref | ( | const xmlChar * | prefix, |
uint32 | prefix_len, | ||
const xmlChar * | featname | ||
) |
Get a new ncx_iff_ref_t struct.
prefix | prefix used in identifier-ref-arg (may be NULL) |
prefix_len | length of prefix if it is used |
featname | feature name used in identifier-ref-arg (may be NULL) |
ncx_iffeature_t * ncx_new_iffeature | ( | void | ) |
Get a new ncx_iffeature_t struct.
void ncx_set_feature_code_default | ( | ncx_feature_code_t | code | ) |
Set the feature_code_default enumeration (deprecated)
!!! THIS FUNCTION IS DEPRECATED!!! !!! The –feature-code and –feature-code-default parameters are ignored !!! Feature code generation is not controlled by this parameter
code | feature code value |
status_t ncx_set_feature_code_entry | ( | const xmlChar * | featstr, |
ncx_feature_code_t | featcode | ||
) |
Create or set a feature_entry struct for the specified feature code parameter (deprecated)
!!! THIS FUNCTION IS DEPRECATED!!! !!! The –feature-code and –feature-code-default parameters are ignored !!! Feature code generation is not controlled by this parameter
featstr | feature parameter string |
featcode | ncx_feature_code_t enumeration to set |
status_t ncx_set_feature_enable | ( | const xmlChar * | modname, |
const xmlChar * | name, | ||
boolean | flag | ||
) |
Create or set a feature_entry struct for the specified feature enabled parameter.
Called from SIL init code
modname | name of module defining the feature |
name | feature name |
flag | feature enabled flag |
void ncx_set_feature_enable_default | ( | boolean | flag | ) |
Set the feature_enable_default flag.
Server –feature-enable-default CLI parameter
flag | feature enabled flag value |
status_t ncx_set_feature_enable_entry | ( | const xmlChar * | featstr, |
boolean | flag | ||
) |
Create or set a feature_entry struct for the specified feature enabled parameter.
Called from CLI/conf handler code
featstr | feature parameter string |
flag | enabled flag |
status_t ncx_set_feature_enable_ex | ( | const xmlChar * | modname, |
const xmlChar * | name, | ||
boolean | flag, | ||
boolean | force | ||
) |
Create or set a feature_entry struct for the specified feature enabled parameter (extended)
Called from SIL init code
modname | name of module defining the feature |
name | feature name |
flag | feature enabled flag |
force | TRUE to override previous setting |
void ncx_set_feature_parms | ( | ncx_feature_t * | feature | ) |
Check if any feature parameters were set for the specified feature struct.
[out] | feature | feature struct to check
|
void ncx_set_features_for_mod | ( | ncx_module_t * | mod | ) |
Check if any feature parameters were set for the specified feature struct for all features in a module.
[in,out] | mod | module to check
|
status_t yang_feature_check_feature_loop | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
ncx_feature_t * | feature, | ||
ncx_feature_t * | startfeature | ||
) |
Check for a feature loop.
Validate all the if-feature clauses present in the specified feature, after all if-features have been resolved (or at least attempted)
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain |
mod | ncx_module_t in progress |
feature | ncx_feature_t to check now |
startfeature | feature that started this off, so if this is reached again, it will trigger an error |
status_t yang_feature_check_iffeature_mismatch | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
obj_template_t * | ancestor, | ||
obj_template_t * | testobj, | ||
ncx_iffeature_t * | iff, | ||
boolean | iserror | ||
) |
Check the child object against the ancestor node for 1 if-feature.
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain |
mod | module in progress |
ancestor | ancestor node of child to compare against and stop the check |
testobj | current object being checked |
iff | current if-feature record within the testobj to check |
iserror | TRUE if checking for key-stmt and mismatch is an error |
status_t yang_feature_consume_feature | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod | ||
) |
Parse the next N tokens as a feature statement.
Create an ncx_feature_t struct and add it to the module or submodule featureQ
Error messages are printed by this function!! Do not duplicate error messages upon error return
Current token is the 'feature' keyword
tkc | token chain |
mod | module struct that will get updated |
status_t yang_feature_consume_iffeature | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
dlq_hdr_t * | iffeatureQ, | ||
dlq_hdr_t * | appinfoQ | ||
) |
Consume an if-feature-stmt.
(was yang.c:yang_consume_iffeature)
consume one if-feature-stmt into iffeatureQ Parse the if-feature statement
Current token is the 'if-feature' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | iffeatureQ | Q of ncx_iffeature_t to hold the new if-feature
|
[out] | appinfoQ | queue to store appinfo (extension usage)
|
boolean yang_feature_eval_iffeature | ( | ncx_module_t * | mod, |
ncx_iffeature_t * | iff | ||
) |
Evaluate the if-feature expression.
mod | module containing the object with the if-feature-stmt MAY BE NULL |
iff | if-feature record within the node to check |
boolean yang_feature_eval_iffeatureQ | ( | ncx_module_t * | mod, |
dlq_hdr_t * | iffQ | ||
) |
Evaluate a Q ofif-feature expressions.
mod | module containing the object with the if-feature-stmt MAY BE NULL |
iffQ | Q of if-feature records within the node to check |
status_t yang_feature_resolve_feature | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
ncx_feature_t * | feature | ||
) |
Validate all the if-feature clauses present in the specified feature.
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block to use |
tkc | token chain |
mod | ncx_module_t in progress |
feature | ncx_feature_t to check |
status_t yang_feature_resolve_iffeatureQ | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
obj_template_t * | obj | ||
) |
Check the Q of if-feature statements for the specified object.
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block |
tkc | token chain |
mod | module in progress |
obj | object to check |
status_t yang_feature_resolve_iffeatureQ2 | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
dlq_hdr_t * | iffeatureQ | ||
) |
Check the Q of if-feature statements for the specified object.
FOR YANG 1.1 ONLY
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block |
tkc | token chain |
mod | module in progress |
iffeatureQ | que queue of ncx_iffeature_t to check |