yumapro
24.10-1
YumaPro SDK
|
YANG Parser Control Block and General Access Functions. More...
Data Structures | |
struct | yang_stmt_t |
YANG statement node to track top-level statement order for doc output. More... | |
struct | yang_node_t |
YANG node entry to track if a module has been used already. More... | |
struct | yang_import_ptr_t |
YANG import pointer node to track all imports used. More... | |
struct | failed_ptr_t |
pointer to failed modules to track all of them Prevents loading a broken module multiple times More... | |
struct | yang_pcb_t |
YANG parser control block. More... | |
Enumerations | |
enum | yang_parsetype_t { YANG_PT_NONE , YANG_PT_TOP , YANG_PT_INCLUDE , YANG_PT_IMPORT } |
YANG parser mode entry types. More... | |
Functions | |
status_t | yang_consume_semiapp (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ) |
consume a stmtsep clause More... | |
status_t | yang_consume_semiapp2 (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ, boolean plain_ok) |
consume a stmtsep clause, check plain_ok More... | |
status_t | yang_consume_string (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field) |
consume 1 string token More... | |
status_t | yang_consume_keyword (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefix, xmlChar **field) |
consume 1 YANG keyword or vendor extension keyword More... | |
status_t | yang_consume_nowsp_string (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field) |
consume 1 string without any whitespace More... | |
status_t | yang_consume_id_string (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field) |
consume an identifier-str token More... | |
status_t | yang_consume_pid_string (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefix, xmlChar **field) |
consume an identifier-ref-str token More... | |
status_t | yang_consume_error_stmts (tk_chain_t *tkc, ncx_module_t *mod, ncx_errinfo_t *errinfo, dlq_hdr_t *appinfoQ, boolean allow_modifier, boolean *gotinverted) |
consume the range. More... | |
status_t | yang_consume_descr (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **str, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one descriptive string clause More... | |
status_t | yang_consume_pid (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefixstr, xmlChar **str, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one [prefix:]name clause More... | |
status_t | yang_consume_strclause (tk_chain_t *tkc, ncx_module_t *mod, xmlChar **str, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one normative string clause More... | |
status_t | yang_consume_status (tk_chain_t *tkc, ncx_module_t *mod, ncx_status_t *status, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one status clause More... | |
status_t | yang_consume_ordered_by (tk_chain_t *tkc, ncx_module_t *mod, boolean *ordsys, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one ordered-by clause More... | |
status_t | yang_consume_max_elements (tk_chain_t *tkc, ncx_module_t *mod, uint32 *maxelems, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one max-elements clause More... | |
status_t | yang_consume_must (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *mustQ, dlq_hdr_t *appinfoQ, boolean do_parse) |
consume one must-stmt into mustQ More... | |
status_t | yang_consume_when (tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, boolean *whenflag) |
consume one when-stmt into obj->when More... | |
status_t | yang_consume_boolean (tk_chain_t *tkc, ncx_module_t *mod, boolean *boolval, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one boolean clause Parse the boolean parameter based statement More... | |
status_t | yang_consume_int32 (tk_chain_t *tkc, ncx_module_t *mod, int32 *num, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one int32 clause Parse the int32 based parameter statement More... | |
status_t | yang_consume_uint32 (tk_chain_t *tkc, ncx_module_t *mod, uint32 *num, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one uint32 clause More... | |
status_t | yang_consume_modifier (tk_chain_t *tkc, ncx_module_t *mod, boolean *dupflag, dlq_hdr_t *appinfoQ) |
consume one modifier-stmt More... | |
status_t | yang_find_imp_typedef (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, typ_template_t **typ) |
Find the specified imported typedef. More... | |
status_t | yang_find_imp_grouping (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, grp_template_t **grp) |
Find the specified imported grouping. More... | |
status_t | yang_find_imp_extension (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, ext_template_t **ext) |
Find the specified imported extension. More... | |
status_t | yang_find_imp_feature (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, ncx_feature_t **feature) |
Find the specified imported feature. More... | |
status_t | yang_find_imp_identity (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, ncx_identity_t **identity) |
Find the specified imported identity. More... | |
void | yang_check_obj_used (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *typeQ, dlq_hdr_t *grpQ) |
generate warnings if local typedefs/groupings not used More... | |
void | yang_check_imports_used (tk_chain_t *tkc, ncx_module_t *mod) |
generate warnings if imports not used More... | |
yang_node_t * | yang_new_node (void) |
Create a new YANG parser node. More... | |
void | yang_free_node (yang_node_t *node) |
Clean and delete the memory for a YANG parser node. More... | |
void | yang_clean_nodeQ (dlq_hdr_t *que) |
Delete all the node entries in a YANG parser node Q. More... | |
yang_node_t * | yang_find_node (const dlq_hdr_t *que, const xmlChar *name, const xmlChar *revision) |
Find a YANG parser node in the specified Q. More... | |
void | yang_dump_nodeQ (dlq_hdr_t *que, const char *name) |
log_debug output for contents of the specified nodeQ More... | |
yang_pcb_t * | yang_new_pcb (void) |
Create a new YANG parser control block. More... | |
void | yang_free_pcb (yang_pcb_t *pcb) |
Delete a YANG parser control block. More... | |
yang_stmt_t * | yang_new_typ_stmt (typ_template_t *typ) |
Create a new YANG stmt node for a typedef. More... | |
yang_stmt_t * | yang_new_grp_stmt (grp_template_t *grp) |
Create a new YANG stmt node for a grouping. More... | |
yang_stmt_t * | yang_new_ext_stmt (ext_template_t *ext) |
Create a new YANG stmt node for an extension. More... | |
yang_stmt_t * | yang_new_obj_stmt (obj_template_t *obj) |
Create a new YANG stmt node for an object. More... | |
yang_stmt_t * | yang_new_id_stmt (ncx_identity_t *identity) |
Create a new YANG stmt node for an identity. More... | |
yang_stmt_t * | yang_new_feature_stmt (ncx_feature_t *feature) |
Create a new YANG stmt node for a feature definition. More... | |
yang_stmt_t * | yang_new_deviation_stmt (obj_deviation_t *deviation) |
Create a new YANG stmt node for a deviation definition. More... | |
void | yang_free_stmt (yang_stmt_t *stmt) |
Delete a YANG statement node. More... | |
void | yang_clean_stmtQ (dlq_hdr_t *que) |
Delete a Q of YANG statement node. More... | |
status_t | yang_validate_date_string (tk_chain_t *tkc, ncx_module_t *mod, ncx_error_t *tkerr, const xmlChar *datestr) |
Validate a YANG date string for a revision entry. More... | |
void | yang_skip_statement (tk_chain_t *tkc, ncx_module_t *mod) |
Skip past the current invalid statement, starting at an invalid keyword. More... | |
boolean | yang_top_keyword (const xmlChar *keyword) |
Check if the string is a top-level YANG keyword. More... | |
yang_import_ptr_t * | yang_new_import_ptr (const xmlChar *modname, const xmlChar *modprefix, const xmlChar *revision, const xmlChar *descr, const xmlChar *ref) |
Create a new YANG import pointer node. More... | |
void | yang_free_import_ptr (yang_import_ptr_t *impptr) |
Delete a YANG import pointer node. More... | |
void | yang_clean_import_ptrQ (dlq_hdr_t *que) |
Delete all the node entries in a YANG import pointer node Q. More... | |
yang_import_ptr_t * | yang_find_import_ptr (dlq_hdr_t *que, const xmlChar *name) |
Find a YANG import pointer node in the specified Q. More... | |
int32 | yang_compare_revision_dates (const xmlChar *revstring1, const xmlChar *revstring2) |
Compare 2 revision strings, which either may be NULL. More... | |
xmlChar * | yang_make_filename (const xmlChar *modname, const xmlChar *revision, boolean isyang) |
Malloc and construct a YANG filename. More... | |
status_t | yang_copy_filename (const xmlChar *modname, const xmlChar *revision, xmlChar *buffer, uint32 bufflen, boolean isyang) |
Construct a YANG filename into a provided buffer. More... | |
boolean | yang_split_filename (const xmlChar *filename, uint32 *modnamelen) |
Split a module parameter into its filename components. More... | |
boolean | yang_fileext_is_yang (const xmlChar *filename) |
Check if the filespec ends with the .yang extension. More... | |
boolean | yang_fileext_is_yin (const xmlChar *filename) |
Check if the filespec ends with the .yin extension. More... | |
boolean | yang_fileext_is_xml (const xmlChar *filename) |
Check if the filespec ends with the .xml extension. More... | |
boolean | yang_fileext_is_json (const xmlChar *filename) |
Check if the filespec ends with the .json extension. More... | |
void | yang_final_memcheck (void) |
Check the node malloc and free counts. More... | |
void | yang_set_in_yangdata (yang_pcb_t *pcb, boolean val) |
Set the in_yangdata mode. More... | |
boolean | yang_is_in_yangdata (const yang_pcb_t *pcb) |
Get the in_yangdata mode. More... | |
status_t | yang_extract_filespec_info (const char *filespec, xmlChar **modname, xmlChar **revision, boolean *isyang) |
Split a filespec into its filename components. More... | |
void | yang_clean_pcb_top (yang_pcb_t *pcb) |
Make sure pcb->top is freed before the pcb is reused after the bestmatch failed and NULL revision is tried. More... | |
xmlChar * | yang_make_sid_filename (const xmlChar *modname, const xmlChar *revision) |
Malloc and construct a SID filename. More... | |
uint32 | yang_hash (const xmlChar *key, uint32 len) |
Generate a yang-hash for the specified key. More... | |
YANG Parser Control Block and General Access Functions.
Support Experimental YANG Hash identifiers (NOT USED)
enum yang_parsetype_t |
void yang_check_imports_used | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod | ||
) |
generate warnings if imports not used
Check if the imports statements are actually used Check if the import is newer than the importing module Generate warnings if so
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain in progress |
mod | module in progress |
void yang_check_obj_used | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
dlq_hdr_t * | typeQ, | ||
dlq_hdr_t * | grpQ | ||
) |
generate warnings if local typedefs/groupings not used
Check if the local typedefs and groupings are actually used Generate warnings if not used
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain in progress |
mod | module in progress |
typeQ | typedef Q to check |
grpQ | pgrouping Q to check |
void yang_clean_import_ptrQ | ( | dlq_hdr_t * | que | ) |
Delete all the node entries in a YANG import pointer node Q.
que | Q of yang_import_ptr_t to clean |
void yang_clean_nodeQ | ( | dlq_hdr_t * | que | ) |
Delete all the node entries in a YANG parser node Q.
que | Q of yang_node_t to clean |
void yang_clean_pcb_top | ( | yang_pcb_t * | pcb | ) |
Make sure pcb->top is freed before the pcb is reused after the bestmatch failed and NULL revision is tried.
pcb | pcb to clean |
void yang_clean_stmtQ | ( | dlq_hdr_t * | que | ) |
Delete a Q of YANG statement node.
que | Q of yang_stmt_t node to delete |
int32 yang_compare_revision_dates | ( | const xmlChar * | revstring1, |
const xmlChar * | revstring2 | ||
) |
Compare 2 revision strings, which either may be NULL.
revstring1 | revision string 1 (may be NULL) |
revstring2 | revision string 2 (may be NULL) |
-1 if revision 1 < revision 2 0 of they are the same +1 if revision1 > revision 2
status_t yang_consume_boolean | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
boolean * | boolval, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one boolean clause Parse the boolean parameter based statement
Current token is the starting keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | boolval | boolean value to set (may be NULL)
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_descr | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | str, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one descriptive string clause
Parse the description or reference statement
Current token is the starting keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[in,out] | str | string to set (may be NULL)
|
[out] | dupflag | flag to check if entry already found (may be NULL)
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_error_stmts | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
ncx_errinfo_t * | errinfo, | ||
dlq_hdr_t * | appinfoQ, | ||
boolean | allow_modifier, | ||
boolean * | gotinverted | ||
) |
consume the range.
length. pattern. must error info extensions
Parse the sub-section as a sub-section for error-app-tag and error-message clauses
Current token is the starting left brace for the sub-section that is extending a range, length, pattern, or must statement
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | errinfo | pointer to valid ncx_errinfo_t struct
|
[out] | appinfoQ | Q to hold any extensions found
|
allow_modifier | TRUE to check for YANG 1.1 modifier keyword | |
[out] | gotinverted | address of return got invert-match flag
|
status_t yang_consume_id_string | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | field | ||
) |
consume an identifier-str token
Consume a YANG string token in any of the 3 forms Check that it is a valid YANG identifier string
Error messages are printed by this function!! Do not duplicate error messages upon error return
current token is advanced
tkc | token chain | |
mod | module in progress | |
[out] | field | address of field to get the name string (may be NULL)
|
status_t yang_consume_int32 | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
int32 * | num, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one int32 clause Parse the int32 based parameter statement
Current token is the starting keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | num | address of int32 value to set (may be NULL)
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_keyword | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | prefix, | ||
xmlChar ** | field | ||
) |
consume 1 YANG keyword or vendor extension keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
current token is advanced
tkc | token chain | |
mod | module in progress | |
[out] | prefix | address of field to get the prefix string (may be NULL)
|
[out] | field | address of field to get the name string (may be NULL)
|
status_t yang_consume_max_elements | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
uint32 * | maxelems, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one max-elements clause
Parse the max-elements statement
Current token is the 'max-elements' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | maxelems | address of max-elements object to set (may be NULL)
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_modifier | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one modifier-stmt
Current token is the 'modifier' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
Only modifier supported is invert-match This code simply checks the syntax and does not set any fields
tkc | token chain | |
mod | module in progress | |
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_must | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
dlq_hdr_t * | mustQ, | ||
dlq_hdr_t * | appinfoQ, | ||
boolean | do_parse | ||
) |
consume one must-stmt into mustQ
Parse the must statement
Current token is the 'must' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | mustQ | address of Q of xpath_pcb_t structs to store a new malloced xpath_pcb_t
|
[out] | appinfoQ | Q to hold any extensions found
|
do_parse | TRUE to attempt xpath1_parse_expr; FALSE to skip |
status_t yang_consume_nowsp_string | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | field | ||
) |
consume 1 string without any whitespace
Consume a YANG string token in any of the 3 forms Check No whitespace allowed!
Error messages are printed by this function!! Do not duplicate error messages upon error return
current token is advanced
tkc | token chain | |
mod | module in progress | |
[out] | field | address of field to get the name string (may be NULL)
|
status_t yang_consume_ordered_by | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
boolean * | ordsys, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one ordered-by clause
Parse the ordered-by statement
Current token is the 'ordered-by' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | ordsys | address of ordered-by object to set
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_pid | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | prefixstr, | ||
xmlChar ** | str, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one [prefix:]name clause
Parse the rest of the statement (2 forms):
keyword [prefix:]name; keyword [prefix:]name { appinfo }
Current token is the starting keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | prefixstr | address of prefix string to set (may be NULL)
|
[out] | str | address of string to set (may be NULL)
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_pid_string | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | prefix, | ||
xmlChar ** | field | ||
) |
consume an identifier-ref-str token
Consume a YANG string token in any of the 3 forms Check that it is a valid identifier-ref-string Get the prefix if any is set
Error messages are printed by this function!! Do not duplicate error messages upon error return
current token is advanced
tkc | token chain | |
mod | module in progress | |
[out] | prefix | address of field to get the prefix string (may be NULL)
|
[out] | field | address of field to get the name string (may be NULL)
|
status_t yang_consume_semiapp | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume a stmtsep clause
Consume a semi-colon to end a simple clause, or consume a vendor extension
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | appinfoQ | queue to receive any vendor extension found
|
status_t yang_consume_semiapp2 | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
dlq_hdr_t * | appinfoQ, | ||
boolean | plain_ok | ||
) |
consume a stmtsep clause, check plain_ok
Consume a semi-colon to end a simple clause, or consume a vendor extension
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | appinfoQ | queue to receive any vendor extension found
|
plain_ok | TRUE if plain YANG OK; FALSE if only ext. stmts |
status_t yang_consume_status | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
ncx_status_t * | status, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one status clause
Parse the status statement
Current token is the 'status' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | status | address of status object to set (may be NULL)
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_strclause | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | str, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one normative string clause
Parse the string-parameter-based statement
Current token is the starting keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | str | address of string to set
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_string | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
xmlChar ** | field | ||
) |
consume 1 string token
Consume a YANG string token in any of the 3 forms
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | field | address of field to get the string (may be NULL)
|
status_t yang_consume_uint32 | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
uint32 * | num, | ||
boolean * | dupflag, | ||
dlq_hdr_t * | appinfoQ | ||
) |
consume one uint32 clause
Parse the uint32 based parameter statement
Current token is the starting keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | num | address of uint32 value to set (may be NULL)
|
[out] | dupflag | address of flag to check if entry already found
|
[out] | appinfoQ | Q to hold any extensions found
|
status_t yang_consume_when | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
obj_template_t * | obj, | ||
boolean * | whenflag | ||
) |
consume one when-stmt into obj->when
Parse the when statement
Current token is the 'when' keyword
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain | |
mod | module in progress | |
[out] | obj | obj_template_t of the parent object of this 'when'
|
[out] | whenflag | address of boolean set-once flag for the when-stmt an error will be generated if the value passed in is TRUE.
|
status_t yang_copy_filename | ( | const xmlChar * | modname, |
const xmlChar * | revision, | ||
xmlChar * | buffer, | ||
uint32 | bufflen, | ||
boolean | isyang | ||
) |
Construct a YANG filename into a provided buffer.
modname | [sub]module name |
revision | [sub]module revision date (may be NULL) |
buffer | buffer to copy filename into |
bufflen | number of bytes available in buffer |
isyang | TRUE for YANG extension FALSE for YIN extension |
void yang_dump_nodeQ | ( | dlq_hdr_t * | que, |
const char * | name | ||
) |
log_debug output for contents of the specified nodeQ
que | Q of yang_node_t to check |
name | Q name (may be NULL) |
status_t yang_extract_filespec_info | ( | const char * | filespec, |
xmlChar ** | modname, | ||
xmlChar ** | revision, | ||
boolean * | isyang | ||
) |
Split a filespec into its filename components.
filespec | filespec string | |
[out] | modname | address of return malloced module name
|
[out] | revision | address of return malloced revision date
|
[out] | isyang | address of return yang/yin flag
|
boolean yang_fileext_is_json | ( | const xmlChar * | filename | ) |
Check if the filespec ends with the .json extension.
filename | filename string |
boolean yang_fileext_is_xml | ( | const xmlChar * | filename | ) |
Check if the filespec ends with the .xml extension.
filename | filename string |
boolean yang_fileext_is_yang | ( | const xmlChar * | filename | ) |
Check if the filespec ends with the .yang extension.
filename | filename string |
boolean yang_fileext_is_yin | ( | const xmlChar * | filename | ) |
Check if the filespec ends with the .yin extension.
filename | filename string |
void yang_final_memcheck | ( | void | ) |
Check the node malloc and free counts.
status_t yang_find_imp_extension | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
const xmlChar * | prefix, | ||
const xmlChar * | name, | ||
ncx_error_t * | tkerr, | ||
ext_template_t ** | ext | ||
) |
Find the specified imported extension.
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 | module in progress | |
prefix | prefix value to use | |
name | extension name to use | |
tkerr | error record to use in error messages (may be NULL) | |
[out] | ext | address of return ext_template_t pointer
|
status_t yang_find_imp_feature | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
const xmlChar * | prefix, | ||
const xmlChar * | name, | ||
ncx_error_t * | tkerr, | ||
ncx_feature_t ** | feature | ||
) |
Find the specified imported 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 | module in progress | |
prefix | prefix value to use | |
name | feature name to use | |
tkerr | error record to use in error messages (may be NULL) | |
[out] | feature | address of return ncx_feature_t pointer
|
status_t yang_find_imp_grouping | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
const xmlChar * | prefix, | ||
const xmlChar * | name, | ||
ncx_error_t * | tkerr, | ||
grp_template_t ** | grp | ||
) |
Find the specified imported grouping.
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 | module in progress | |
prefix | prefix value to use | |
name | grouping name to use | |
tkerr | error record to use in error messages (may be NULL) | |
[out] | grp | address of return grp_template_t pointer
|
status_t yang_find_imp_identity | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
const xmlChar * | prefix, | ||
const xmlChar * | name, | ||
ncx_error_t * | tkerr, | ||
ncx_identity_t ** | identity | ||
) |
Find the specified imported identity.
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 | module in progress | |
prefix | prefix value to use | |
name | feature name to use | |
tkerr | error record to use in error messages (may be NULL) | |
[out] | identity | address of return ncx_identity_t pointer
|
status_t yang_find_imp_typedef | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
const xmlChar * | prefix, | ||
const xmlChar * | name, | ||
ncx_error_t * | tkerr, | ||
typ_template_t ** | typ | ||
) |
Find the specified imported typedef.
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 | module in progress | |
prefix | prefix value to use | |
name | type name to find | |
tkerr | error record to use in error messages (may be NULL) | |
[out] | typ | address of return typ_template_t pointer
|
yang_import_ptr_t * yang_find_import_ptr | ( | dlq_hdr_t * | que, |
const xmlChar * | name | ||
) |
Find a YANG import pointer node in the specified Q.
que | Q of yang_import_ptr_t to check |
name | module name to find |
yang_node_t * yang_find_node | ( | const dlq_hdr_t * | que, |
const xmlChar * | name, | ||
const xmlChar * | revision | ||
) |
Find a YANG parser node in the specified Q.
que | Q of yang_node_t to check |
name | module name to find |
revision | module revision date (may be NULL) |
void yang_free_import_ptr | ( | yang_import_ptr_t * | impptr | ) |
Delete a YANG import pointer node.
impptr | import pointer node to delete |
void yang_free_node | ( | yang_node_t * | node | ) |
Clean and delete the memory for a YANG parser node.
node | parser node to delete |
void yang_free_pcb | ( | yang_pcb_t * | pcb | ) |
Delete a YANG parser control block.
pcb | parser control block to delete |
void yang_free_stmt | ( | yang_stmt_t * | stmt | ) |
Delete a YANG statement node.
stmt | yang_stmt_t node to delete |
uint32 yang_hash | ( | const xmlChar * | key, |
uint32 | len | ||
) |
Generate a yang-hash for the specified key.
Murmur3_32 hash function but only return low 30 bits The seed is fixed to be 42
key | string to hash |
len | length of key in bytes |
boolean yang_is_in_yangdata | ( | const yang_pcb_t * | pcb | ) |
Get the in_yangdata mode.
pcb | parser control block to check |
xmlChar * yang_make_filename | ( | const xmlChar * | modname, |
const xmlChar * | revision, | ||
boolean | isyang | ||
) |
Malloc and construct a YANG filename.
modname | [sub]module name |
revision | [sub]module revision date (may be NULL) |
isyang | TRUE for YANG extension FALSE for YIN extension |
xmlChar * yang_make_sid_filename | ( | const xmlChar * | modname, |
const xmlChar * | revision | ||
) |
Malloc and construct a SID filename.
modname | name |
revision | (may be NULL) |
yang_stmt_t * yang_new_deviation_stmt | ( | obj_deviation_t * | deviation | ) |
Create a new YANG stmt node for a deviation definition.
deviation | deviation template to use for new statement struct |
yang_stmt_t * yang_new_ext_stmt | ( | ext_template_t * | ext | ) |
Create a new YANG stmt node for an extension.
ext | extension template to use for new statement struct |
yang_stmt_t * yang_new_feature_stmt | ( | ncx_feature_t * | feature | ) |
Create a new YANG stmt node for a feature definition.
feature | feature template to use for new statement struct |
yang_stmt_t * yang_new_grp_stmt | ( | grp_template_t * | grp | ) |
Create a new YANG stmt node for a grouping.
grp | grouping template to use for new statement struct |
yang_stmt_t * yang_new_id_stmt | ( | ncx_identity_t * | identity | ) |
Create a new YANG stmt node for an identity.
identity | identity template to use for new statement struct |
yang_import_ptr_t * yang_new_import_ptr | ( | const xmlChar * | modname, |
const xmlChar * | modprefix, | ||
const xmlChar * | revision, | ||
const xmlChar * | descr, | ||
const xmlChar * | ref | ||
) |
Create a new YANG import pointer node.
modname | module name to set |
modprefix | module prefix to set |
revision | revision date to set |
descr | description string (YANG 1.1) |
ref | reference string (YANG 1.1) |
yang_node_t * yang_new_node | ( | void | ) |
Create a new YANG parser node.
yang_stmt_t * yang_new_obj_stmt | ( | obj_template_t * | obj | ) |
Create a new YANG stmt node for an object.
obj | object template to use for new statement struct |
yang_pcb_t * yang_new_pcb | ( | void | ) |
Create a new YANG parser control block.
yang_stmt_t * yang_new_typ_stmt | ( | typ_template_t * | typ | ) |
Create a new YANG stmt node for a typedef.
typ | type template to use for new statement struct |
void yang_set_in_yangdata | ( | yang_pcb_t * | pcb, |
boolean | val | ||
) |
Set the in_yangdata mode.
pcb | parser control block to set |
val | current mode to set |
void yang_skip_statement | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod | ||
) |
Skip past the current invalid statement, starting at an invalid keyword.
tkc | token chain in progress |
mod | module in progress |
boolean yang_split_filename | ( | const xmlChar * | filename, |
uint32 * | modnamelen | ||
) |
Split a module parameter into its filename components.
filename | filename string | |
[out] | modnamelen | address of return modname length
|
boolean yang_top_keyword | ( | const xmlChar * | keyword | ) |
Check if the string is a top-level YANG keyword.
keyword | string to check |
status_t yang_validate_date_string | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
ncx_error_t * | tkerr, | ||
const xmlChar * | datestr | ||
) |
Validate a YANG date string for a revision entry.
Expected format is: YYYY-MM-DD
Error messages are printed by this function
tkc | token chain in progress |
mod | module in progress |
tkerr | error struct to use (may be NULL to use tkc->cur) |
datestr | string to validate |