yumapro  20.10-12
YumaPro SDK
yang.h File Reference

YANG Module parser utilities. More...

#include <xmlstring.h>
#include "dlq.h"
#include "ext.h"
#include "grp.h"
#include "ncxtypes.h"
#include "obj.h"
#include "status.h"
#include "tk.h"
#include "typ.h"
Include dependency graph for yang.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  yang_stmt_t_
 YANG statement node to track top-level statement order for doc output. More...
 
union  yang_stmt_t_::s_
 these node pointers are back-pointers and not malloced here 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_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...
 
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...
 

Detailed Description

YANG Module parser utilities.