104typedef enum yang_parsetype_t_ {
113typedef enum yang_stmttype_t_ {
126typedef struct yang_stmt_t_ {
147typedef struct yang_node_t_ {
161typedef struct yang_import_ptr_t_ {
174typedef struct failed_ptr_t_ {
204typedef struct yang_pcb_t_ {
205 struct ncx_module_t_ *
top;
275 dlq_hdr_t *appinfoQ);
450 boolean allow_modifier,
451 boolean *gotinverted);
479 dlq_hdr_t *appinfoQ);
515 dlq_hdr_t *appinfoQ);
546 dlq_hdr_t *appinfoQ);
575 dlq_hdr_t *appinfoQ);
605 dlq_hdr_t *appinfoQ);
634 dlq_hdr_t *appinfoQ);
720 dlq_hdr_t *appinfoQ);
748 dlq_hdr_t *appinfoQ);
777 dlq_hdr_t *appinfoQ);
805 dlq_hdr_t *appinfoQ);
828 const xmlChar *prefix,
854 const xmlChar *prefix,
880 const xmlChar *prefix,
906 const xmlChar *prefix,
932 const xmlChar *prefix,
1014 const xmlChar *name,
1015 const xmlChar *revision);
1158 const xmlChar *datestr);
1195 const xmlChar *modprefix,
1196 const xmlChar *revision,
1197 const xmlChar *descr,
1198 const xmlChar *ref);
1228 const xmlChar *name);
1245 const xmlChar *revstring2);
1260 const xmlChar *revision,
1278 const xmlChar *revision,
1296 uint32 *modnamelen);
1411 const xmlChar *revision);
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:210
ncx_status_t
enumeration for different YANG data-def status values
Definition: ncxtypes.h:583
boolean yang_top_keyword(const xmlChar *keyword)
Check if the string is a top-level YANG keyword.
Definition: yang.c:3458
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
Definition: yang.c:1951
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
Definition: yang.c:379
boolean yang_is_in_yangdata(const yang_pcb_t *pcb)
Get the in_yangdata mode.
Definition: yang.c:4071
xmlChar * yang_make_sid_filename(const xmlChar *modname, const xmlChar *revision)
Malloc and construct a SID filename.
Definition: yang.c:4217
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
Definition: yang.c:1776
int32 yang_compare_revision_dates(const xmlChar *revstring1, const xmlChar *revstring2)
Compare 2 revision strings, which either may be NULL.
Definition: yang.c:3674
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
Definition: yang.c:145
void yang_skip_statement(tk_chain_t *tkc, ncx_module_t *mod)
Skip past the current invalid statement, starting at an invalid keyword.
Definition: yang.c:3400
yang_parsetype_t
YANG parser mode entry types.
Definition: yang.h:104
void yang_free_stmt(yang_stmt_t *stmt)
Delete a YANG statement node.
Definition: yang.c:3185
void yang_free_import_ptr(yang_import_ptr_t *impptr)
Delete a YANG import pointer node.
Definition: yang.c:3570
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.
Definition: yang.c:3501
yang_stmt_t * yang_new_grp_stmt(grp_template_t *grp)
Create a new YANG stmt node for a grouping.
Definition: yang.c:2989
boolean yang_fileext_is_yang(const xmlChar *filename)
Check if the filespec ends with the .yang extension.
Definition: yang.c:3900
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
Definition: yang.c:1868
yang_pcb_t * yang_new_pcb(void)
Create a new YANG parser control block.
Definition: yang.c:2876
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.
Definition: yang.c:794
yang_node_t * yang_new_node(void)
Create a new YANG parser node.
Definition: yang.c:2679
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.
Definition: yang.c:2264
yang_stmt_t * yang_new_deviation_stmt(obj_deviation_t *deviation)
Create a new YANG stmt node for a deviation definition.
Definition: yang.c:3154
status_t yang_consume_pid_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefix, xmlChar **field)
consume an identifier-ref-str token
Definition: yang.c:623
void yang_set_in_yangdata(yang_pcb_t *pcb, boolean val)
Set the in_yangdata mode.
Definition: yang.c:4054
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.
Definition: yang.c:2187
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
Definition: yang.c:1240
status_t yang_consume_semiapp(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ)
consume a stmtsep clause
Definition: yang.c:234
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
Definition: yang.c:1085
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
Definition: yang.c:1399
yang_stmt_t * yang_new_feature_stmt(ncx_feature_t *feature)
Create a new YANG stmt node for a feature definition.
Definition: yang.c:3121
status_t yang_consume_nowsp_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume 1 string without any whitespace
Definition: yang.c:475
boolean yang_fileext_is_json(const xmlChar *filename)
Check if the filespec ends with the .json extension.
Definition: yang.c:4008
void yang_clean_nodeQ(dlq_hdr_t *que)
Delete all the node entries in a YANG parser node Q.
Definition: yang.c:2751
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.
Definition: yang.c:2782
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
Definition: yang.c:1329
yang_stmt_t * yang_new_obj_stmt(obj_template_t *obj)
Create a new YANG stmt node for an object.
Definition: yang.c:3055
void yang_dump_nodeQ(dlq_hdr_t *que, const char *name)
log_debug output for contents of the specified nodeQ
Definition: yang.c:2822
boolean yang_fileext_is_xml(const xmlChar *filename)
Check if the filespec ends with the .xml extension.
Definition: yang.c:3972
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.
Definition: yang.c:2110
yang_stmt_t * yang_new_id_stmt(ncx_identity_t *identity)
Create a new YANG stmt node for an identity.
Definition: yang.c:3088
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.
Definition: yang.c:2427
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
Definition: yang.c:2528
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
Definition: yang.c:1153
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 ...
Definition: yang.c:4190
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.
Definition: yang.c:3636
void yang_free_node(yang_node_t *node)
Clean and delete the memory for a YANG parser node.
Definition: yang.c:2711
status_t yang_extract_filespec_info(const char *filespec, xmlChar **modname, xmlChar **revision, boolean *isyang)
Split a filespec into its filename components.
Definition: yang.c:4100
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
Definition: yang.c:1007
boolean yang_fileext_is_yin(const xmlChar *filename)
Check if the filespec ends with the .yin extension.
Definition: yang.c:3936
xmlChar * yang_make_filename(const xmlChar *modname, const xmlChar *revision, boolean isyang)
Malloc and construct a YANG filename.
Definition: yang.c:3708
void yang_clean_stmtQ(dlq_hdr_t *que)
Delete a Q of YANG statement node.
Definition: yang.c:3206
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.
Definition: yang.c:3243
status_t yang_consume_modifier(tk_chain_t *tkc, ncx_module_t *mod, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one modifier-stmt
Definition: yang.c:2033
void yang_clean_import_ptrQ(dlq_hdr_t *que)
Delete all the node entries in a YANG import pointer node Q.
Definition: yang.c:3607
yang_stmt_t * yang_new_ext_stmt(ext_template_t *ext)
Create a new YANG stmt node for an extension.
Definition: yang.c:3022
void yang_check_imports_used(tk_chain_t *tkc, ncx_module_t *mod)
generate warnings if imports not used
Definition: yang.c:2595
yang_stmt_t * yang_new_typ_stmt(typ_template_t *typ)
Create a new YANG stmt node for a typedef.
Definition: yang.c:2956
void yang_free_pcb(yang_pcb_t *pcb)
Delete a YANG parser control block.
Definition: yang.c:2911
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
Definition: yang.c:930
status_t yang_consume_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume 1 string token
Definition: yang.c:270
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
Definition: yang.c:1594
void yang_final_memcheck(void)
Check the node malloc and free counts.
Definition: yang.c:4035
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.
Definition: yang.c:3770
boolean yang_split_filename(const xmlChar *filename, uint32 *modnamelen)
Split a module parameter into its filename components.
Definition: yang.c:3830
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.
Definition: yang.c:2344
status_t yang_consume_id_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume an identifier-str token
Definition: yang.c:552
@ YANG_PT_NONE
not set
Definition: yang.h:105
@ YANG_PT_INCLUDE
called from module include-stmt
Definition: yang.h:107
@ YANG_PT_IMPORT
called from module import-stmt
Definition: yang.h:108
@ YANG_PT_TOP
called from top level [sub]module
Definition: yang.h:106
YANG Grouping Statement Handler.
YANG module data structures Many internal representations of YANG module constructs.
Global error messages for status code enumerations.
One YANG 'extension' definition – language extension template.
Definition: ext.h:130
pointer to failed modules to track all of them Prevents loading a broken module multiple times
Definition: yang.h:174
xmlChar * modname
module name
Definition: yang.h:176
dlq_hdr_t qhdr
queue header
Definition: yang.h:175
xmlChar * revision
module revision
Definition: yang.h:177
status_t status
reason for failure
Definition: yang.h:178
One YANG 'grouping' definition – sibling set template.
Definition: grp.h:87
YANG error info statement struct used to override default error handling in the server.
Definition: ncxtypes.h:1366
struct to remember error info tkc->cur_err will be checked before tkc->cur for error information
Definition: ncxtypes.h:877
YANG feature entry.
Definition: ncxtypes.h:1021
YANG identity entry.
Definition: ncxtypes.h:1104
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
YANG deviation statement struct.
Definition: obj.h:1454
One YANG data-def-stmt.
Definition: obj.h:1229
token parsing chain (main parser control block)
Definition: tk.h:415
One YANG 'typedef' definition – top-level type template.
Definition: typ.h:477
YANG import pointer node to track all imports used.
Definition: yang.h:161
xmlChar * modname
import module name
Definition: yang.h:163
xmlChar * modprefix
import module prefix
Definition: yang.h:164
xmlChar * ref
import reference
Definition: yang.h:167
dlq_hdr_t qhdr
queue header
Definition: yang.h:162
xmlChar * descr
import module revision date
Definition: yang.h:166
YANG node entry to track if a module has been used already.
Definition: yang.h:147
ncx_error_t tkerr
file and line infor for compiler
Definition: yang.h:156
xmlChar * failedrev
saved revision for failed entries
Definition: yang.h:154
xmlChar * failed
saved name for failed entries
Definition: yang.h:153
dlq_hdr_t qhdr
queue header
Definition: yang.h:148
const xmlChar * revision
revision date in imp/inc/failed
Definition: yang.h:150
status_t res
saved result for 'failed'
Definition: yang.h:155
ncx_module_t * submod
submod for allincQ
Definition: yang.h:152
ncx_module_t * mod
back-ptr to module w/ imp/inc
Definition: yang.h:151
const xmlChar * name
module name in imp/inc/failed
Definition: yang.h:149
YANG parser control block.
Definition: yang.h:204
boolean searchmode
TRUE if just getting ns & version.
Definition: yang.h:214
boolean keepmode
TRUE to keep new mod even if loaded.
Definition: yang.h:216
boolean swaptop
T: keepmode found top already so swap.
Definition: yang.h:229
dlq_hdr_t allimpQ
Q of yang_import_ptr_t.
Definition: yang.h:231
boolean savetkc
TRUE if tkc should be kept in tkc.
Definition: yang.h:219
boolean deviationmode
TRUE if keeping deviations only.
Definition: yang.h:212
dlq_hdr_t * savedevQ
ptr to Q of ncx_save_deviations_t
Definition: yang.h:234
boolean topfound
TRUE if top found, not added.
Definition: yang.h:217
dlq_hdr_t failedQ
load mod or submod failed
Definition: yang.h:240
struct ncx_module_t_ * retmod
nested [sub]mod being returned
Definition: yang.h:206
boolean trackmode
TRUE if yangdump to track re-parse.
Definition: yang.h:221
const xmlChar * revision
back-ptr to rev to match
Definition: yang.h:208
boolean set_supported
TRUE: load, FALSE: import only.
Definition: yang.h:223
boolean res_dev
TRUE: currently resolving a deviation.
Definition: yang.h:224
struct ncx_sm_rootcb_t_ * rootcb
Schema Mount pointers.
Definition: yang.h:244
boolean freetop
T: keeptop=T and wasadd=F and top=live mem.
Definition: yang.h:230
boolean stmtmode
save top-level stmt order
Definition: yang.h:210
struct ncx_module_t_ * parentparm
parent passed for submodule
Definition: yang.h:207
boolean in_yangdata
T: resolving datadefs in rc:yang-data.
Definition: yang.h:227
tk_chain_t * tkc
live or NULL parse chain
Definition: yang.h:236
boolean topadded
TRUE if top in registry; F: need free.
Definition: yang.h:218
struct ncx_module_t_ * top
top-level file
Definition: yang.h:205
boolean docmode
TRUE if saving strings in origtkQ.
Definition: yang.h:220
boolean in_grouping
T: resolving datadefs in a grouping.
Definition: yang.h:226
dlq_hdr_t * topfailedQ
ptr to Q of failed_ptr_t
Definition: yang.h:233
boolean diffmode
TRUE = yangdiff old ver.
Definition: yang.h:211
boolean reparse
TRUE if trackmode + mod already parsed.
Definition: yang.h:222
boolean annotation
TRUE if deviation really annotation.
Definition: yang.h:213
boolean parsemode
TRUE if full parse but no reg-load.
Definition: yang.h:215
dlq_hdr_t impchainQ
2 Qs of yang_node_t
Definition: yang.h:239
dlq_hdr_t * savemodQ
ptr to Q of ncx_module_t: parse mode
Definition: yang.h:235
boolean retmod_malloced
T: if retmod live ncx_new_module.
Definition: yang.h:228
boolean autoloadmode
TRUE if yangcli autoload.
Definition: yang.h:225
boolean with_submods
include submodules
Definition: yang.h:209
YANG statement node to track top-level statement order for doc output.
Definition: yang.h:126
dlq_hdr_t qhdr
queue header
Definition: yang.h:128
yang_stmttype_t stmttype
statement type
Definition: yang.h:131
NCX Syntax Token Handler.
these node pointers are back-pointers and not malloced here
Definition: yang.h:134
obj_template_t * obj
data-def-stmt
Definition: yang.h:138
ext_template_t * ext
extension-stmt
Definition: yang.h:137
ncx_feature_t * feature
feature-stmt
Definition: yang.h:140
ncx_identity_t * identity
identity-stmt
Definition: yang.h:139
grp_template_t * grp
grouping-stmt
Definition: yang.h:136
typ_template_t * typ
typdef-stmt
Definition: yang.h:135
obj_deviation_t * deviation
deviation-stmt
Definition: yang.h:141