yumapro  20.10-12
YumaPro SDK
yang_obj.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_yang_obj
13 #define _H_yang_obj
14 
15 /* FILE: yang_obj.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 11-def-07 abb Begun; start from yang_parse.c
36 
37 */
38 
39 #ifndef _H_dlq
40 #include "dlq.h"
41 #endif
42 
43 #ifndef _H_grp
44 #include "grp.h"
45 #endif
46 
47 #ifndef _H_ncxtypes
48 #include "ncxtypes.h"
49 #endif
50 
51 #ifndef _H_obj
52 #include "obj.h"
53 #endif
54 
55 #ifndef _H_status
56 #include "status.h"
57 #endif
58 
59 #ifndef _H_tk
60 #include "tk.h"
61 #endif
62 
63 #ifndef _H_yang
64 #include "yang.h"
65 #endif
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 /* Group definied in obj.h */
72 
186 /********************************************************************
187 * *
188 * T Y P E S *
189 * *
190 *********************************************************************/
191 
192 
193 /********************************************************************
194 * *
195 * F U N C T I O N S *
196 * *
197 *********************************************************************/
198 
199 
220 extern status_t
221  yang_obj_consume_datadef (yang_pcb_t *pcb,
222  tk_chain_t *tkc,
223  ncx_module_t *mod,
224  dlq_hdr_t *que,
225  obj_template_t *parent);
226 
227 
249 extern status_t
250  yang_obj_consume_datadef_grp (yang_pcb_t *pcb,
251  tk_chain_t *tkc,
252  ncx_module_t *mod,
253  dlq_hdr_t *que,
254  obj_template_t *parent,
255  grp_template_t *grp);
256 
257 
277 extern status_t
278  yang_obj_consume_rpc (yang_pcb_t *pcb,
279  tk_chain_t *tkc,
280  ncx_module_t *mod);
281 
282 
300 extern status_t
301  yang_obj_consume_notification (yang_pcb_t *pcb,
302  tk_chain_t *tkc,
303  ncx_module_t *mod);
304 
322 extern status_t
323  yang_obj_consume_augment (yang_pcb_t *pcb,
324  tk_chain_t *tkc,
325  ncx_module_t *mod);
326 
327 
346 extern status_t
347  yang_obj_consume_deviation (yang_pcb_t *pcb,
348  tk_chain_t *tkc,
349  ncx_module_t *mod);
350 
351 
370 extern status_t
371  yang_obj_resolve_datadefs (yang_pcb_t *pcb,
372  tk_chain_t *tkc,
373  ncx_module_t *mod,
374  dlq_hdr_t *datadefQ);
375 
376 
398 extern status_t
399  yang_obj_resolve_uses (yang_pcb_t *pcb,
400  tk_chain_t *tkc,
401  ncx_module_t *mod,
402  dlq_hdr_t *datadefQ);
403 
404 
422 extern status_t
423  yang_obj_resolve_augments (yang_pcb_t *pcb,
424  tk_chain_t *tkc,
425  ncx_module_t *mod,
426  dlq_hdr_t *datadefQ);
427 
428 
447 extern status_t
448  yang_obj_resolve_augments_final (yang_pcb_t *pcb,
449  tk_chain_t *tkc,
450  ncx_module_t *mod,
451  dlq_hdr_t *datadefQ);
452 
453 
468 extern status_t
469  yang_obj_resolve_deviations (yang_pcb_t *pcb,
470  tk_chain_t *tkc,
471  ncx_module_t *mod);
472 
473 
496 extern status_t
497  yang_obj_resolve_final (yang_pcb_t *pcb,
498  tk_chain_t *tkc,
499  ncx_module_t *mod,
500  dlq_hdr_t *datadefQ,
501  boolean ingrouping,
502  boolean is_top);
503 
504 
522 extern status_t
523  yang_obj_top_resolve_final (yang_pcb_t *pcb,
524  tk_chain_t *tkc,
525  ncx_module_t *mod,
526  dlq_hdr_t *datadefQ);
527 
528 
551 extern status_t
552  yang_obj_resolve_xpath (yang_pcb_t *pcb,
553  tk_chain_t *tkc,
554  ncx_module_t *mod,
555  dlq_hdr_t *datadefQ);
556 
557 
573 extern status_t
574  yang_obj_resolve_xpath_final (yang_pcb_t *pcb,
575  tk_chain_t *tkc,
576  ncx_module_t *mod,
577  dlq_hdr_t *datadefQ);
578 
579 
592 extern status_t
593  yang_obj_check_leafref_loops (tk_chain_t *tkc,
594  ncx_module_t *mod,
595  dlq_hdr_t *datadefQ);
596 
597 
607 extern status_t
608  yang_obj_remove_deleted_nodes (yang_pcb_t *pcb,
609  tk_chain_t *tkc,
610  ncx_module_t *mod,
611  dlq_hdr_t *datadefQ);
612 
613 
623 extern status_t
624  set_tkc_error (tk_chain_t *tkc,
625  ncx_module_t *mod,
626  ncx_error_t *err,
627  status_t res);
628 
643 extern status_t
644  yang_obj_add_object (tk_chain_t *tkc,
645  ncx_module_t *mod,
646  dlq_hdr_t *que,
647  obj_template_t *obj);
648 
649 
654 #ifdef __cplusplus
655 } /* end extern 'C' */
656 #endif
657 
658 
659 #endif /* _H_yang_obj */
ERR_NCX_IF_FEATURE_KEY
@ ERR_NCX_IF_FEATURE_KEY
410
Definition: status_enum.h:453
OBJ_TYP_AUGMENT
@ OBJ_TYP_AUGMENT
augment, used at top or inside obj
Definition: obj.h:622
obj_first_child
obj_template_t * obj_first_child(obj_template_t *obj)
Get the first child object if the specified object has any children.
Definition: obj.c:6687
typ_get_basetype
ncx_btype_t typ_get_basetype(const typ_def_t *typdef)
Get the final base type of the specified typ_def_t.
Definition: typ.c:1764
obj_gen_object_id
status_t obj_gen_object_id(const obj_template_t *obj, xmlChar **buff)
Malloc and Generate the object ID for an object node.
Definition: obj.c:9987
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
ncx_find_grouping
grp_template_t * ncx_find_grouping(ncx_module_t *mod, const xmlChar *grpname, boolean useall)
Find the YANG grouping.
Definition: ncx.c:3651
OBJ_TYP_NONE
@ OBJ_TYP_NONE
not set
Definition: obj.h:612
obj_get_default_case
obj_template_t * obj_get_default_case(obj_template_t *obj)
Get the default case for the specified OBJ_TYP_CHOICE object.
Definition: obj.c:11703
TK_TT_TSTRING
@ TK_TT_TSTRING
token string
Definition: tk.h:319
obj_has_iffeature
boolean obj_has_iffeature(obj_template_t *obj)
Check any if-feature statements exist for the specified object.
Definition: obj.c:14623
obj_is_uses
boolean obj_is_uses(const obj_template_t *obj)
Check if object is a YANG uses-stmt.
Definition: obj.c:13465
ERR_NCX_MISSING_REFTARGET
@ ERR_NCX_MISSING_REFTARGET
366
Definition: status_enum.h:409
obj_get_defvalQ
dlq_hdr_t * obj_get_defvalQ(obj_template_t *obj)
Get the leaf-list default Q.
Definition: obj.c:17420
obj_next_defval_tk
obj_defval_tk_t * obj_next_defval_tk(const obj_defval_tk_t *defval_tk)
Get the next defval_tk entry.
Definition: obj.c:17458
obj_set_ncx_flags
void obj_set_ncx_flags(obj_template_t *obj)
Check the NCX appinfo extensions and set flags as needed.
Definition: obj.c:15295
ERR_NCX_REFINE_NOT_ALLOWED
@ ERR_NCX_REFINE_NOT_ALLOWED
324
Definition: status_enum.h:367
ncx_ok_skip_deviation_module
boolean ncx_ok_skip_deviation_module(const xmlChar *modname, dlq_hdr_t *save_deviationsQ)
Check if it is OK to skip this YANG module for deviations.
Definition: ncx.c:12798
ERR_NCX_MANDATORY_AUGEXTERN
@ ERR_NCX_MANDATORY_AUGEXTERN
1056
Definition: status_enum.h:545
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
xpath_find_schema_target_err
status_t xpath_find_schema_target_err(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, dlq_hdr_t *datadefQ, const xmlChar *target, obj_template_t **targobj, dlq_hdr_t **targQ, ncx_error_t *tkerr)
find target, save in *targobj, use the errtk if error
Definition: xpath.c:2406
ERR_NCX_DEFCHOICE_NOT_OPTIONAL
@ ERR_NCX_DEFCHOICE_NOT_OPTIONAL
326
Definition: status_enum.h:369
OBJ_DARG_NOT_SUPPORTED
@ OBJ_DARG_NOT_SUPPORTED
deviate not-supported
Definition: obj.h:1192
ncx_find_next_appinfo2
ncx_appinfo_t * ncx_find_next_appinfo2(ncx_appinfo_t *current, const xmlChar *prefix, const xmlChar *varname)
Find the next instance of an appinfo entry by name (First match is returned, not const version) The e...
Definition: ncx_appinfo.c:644
ncx_consume_appinfo
status_t ncx_consume_appinfo(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ)
Check if an appinfo clause is present.
Definition: ncx_appinfo.c:761
ncx_appinfo.h
NCX Module Library Extension (Application Info) Utility Functions.
obj_clone_template
obj_template_t * obj_clone_template(ncx_module_t *mod, obj_template_t *srcobj, dlq_hdr_t *mobjQ)
Clone an obj_template_t Copy the pointers from the srcobj into the new obj.
Definition: obj.c:8663
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
dlq_block_enque
void dlq_block_enque(dlq_hdrT *srcP, dlq_hdrT *dstP)
add all the queue entries in the srcP queue list to the end of the dstP queue list
Definition: dlq.c:731
yang_typ_resolve_type
status_t yang_typ_resolve_type(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *typdef, const xmlChar *defval, obj_template_t *obj)
Resolve a type-stmt.
Definition: yang_typ.c:5488
yang_grp_resolve_groupings
status_t yang_grp_resolve_groupings(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *groupingQ, obj_template_t *parent)
Resolve grouping-stmts (first pass)
Definition: yang_grp.c:477
OBJ_TYP_LIST
@ OBJ_TYP_LIST
list: last real database object
Definition: obj.h:617
obj_is_p_container
boolean obj_is_p_container(const obj_template_t *obj)
Check if the object is an Presence-container.
Definition: obj.c:14507
xpath1_parse_expr
status_t xpath1_parse_expr(tk_chain_t *tkc, ncx_module_t *mod, xpath_pcb_t *pcb, xpath_source_t source)
Parse the XPATH 1.0 expression string.
Definition: xpath1.c:4816
obj_get_typdef
typ_def_t * obj_get_typdef(obj_template_t *obj)
Get the typdef for the leaf or leaf-list.
Definition: obj.c:11991
ERR_NCX_USING_RESERVED_NAME
@ ERR_NCX_USING_RESERVED_NAME
1044
Definition: status_enum.h:533
obj_find_grouping
grp_template_t * obj_find_grouping(obj_template_t *obj, const xmlChar *grpname)
Check if a grp_template_t in the obj groupingQ hierarchy.
Definition: obj.c:8343
obj_find_defval
boolean obj_find_defval(obj_template_t *obj, const xmlChar *find_defval)
Find a default.
Definition: obj.c:17547
obj_add_metadata
status_t obj_add_metadata(obj_metadata_t *meta, obj_template_t *obj)
Add the filled out object metadata definition to the object.
Definition: obj.c:15082
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
ncx_warning_enabled
boolean ncx_warning_enabled(status_t res)
Check if a specific status_t code is enabled.
Definition: ncx.c:9394
obj_is_abstract
boolean obj_is_abstract(const obj_template_t *obj)
Check if object is being used as an object identifier or error-info.
Definition: obj.c:14291
yang_typ_consume_type
status_t yang_typ_consume_type(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *intypdef)
Consume a type-stmt.
Definition: yang_typ.c:4947
obj_is_mandatory
boolean obj_is_mandatory(obj_template_t *obj)
Figure out if the obj is YANG mandatory or not.
Definition: obj.c:13510
ERR_NCX_WRONG_TKVAL
@ ERR_NCX_WRONG_TKVAL
246
Definition: status_enum.h:285
ncx_valid_name2
boolean ncx_valid_name2(const xmlChar *str)
Check if an xmlChar string is a valid NCX name.
Definition: ncx.c:7637
yang_grp.h
YANG Module parser grouping statement support.
obj_find_template_test
obj_template_t * obj_find_template_test(dlq_hdr_t *que, const xmlChar *modname, const xmlChar *objname)
Find an object with the specified name Test version; do not set 'used' flag.
Definition: obj.c:5784
obj_get_units
const xmlChar * obj_get_units(obj_template_t *obj)
Get the units clause for this object, if any.
Definition: obj.c:12631
typ_ok_for_metadata
boolean typ_ok_for_metadata(ncx_btype_t btyp)
Check if the base type is okay to use in an XML attribute.
Definition: typ.c:4553
yang_typ_resolve_typedefs
status_t yang_typ_resolve_typedefs(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *typeQ, obj_template_t *parent)
Resovlve the typeQ of typedefs.
Definition: yang_typ.c:5305
obj_is_terminal
boolean obj_is_terminal(const obj_template_t *obj)
Check if object is a proper leaf or leaflist or anyxml.
Definition: obj.c:13493
LOG_DEBUG_DEBUG4
@ LOG_DEBUG_DEBUG4
debug level 4
Definition: log.h:397
yang_consume_when
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:1572
NCX_PREFIX
#define NCX_PREFIX
default prefix to use for NCX namespace
Definition: ncxconst.h:244
obj_new_template
obj_template_t * obj_new_template(obj_type_t objtype)
Malloc and initialize the fields in a an object template.
Definition: obj.c:5393
XPATH_NONCONFIG_WARN
#define XPATH_NONCONFIG_WARN(P)
YPW-1363: check nonconfig warning.
Definition: xpath.h:307
ERR_NCX_TOP_LEVEL_MANDATORY
@ ERR_NCX_TOP_LEVEL_MANDATORY
1048
Definition: status_enum.h:537
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
typ_ok_for_inline_index
boolean typ_ok_for_inline_index(ncx_yang_version_t langver, ncx_btype_t btyp)
Check if the base type is okay to use in an inline index decl.
Definition: typ.c:4502
ncx_find_appinfo
ncx_appinfo_t * ncx_find_appinfo(dlq_hdr_t *appinfoQ, const xmlChar *prefix, const xmlChar *varname)
Find an appinfo entry by name (First match is returned) The entry returned is not removed from the Q.
Definition: ncx_appinfo.c:495
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
OBJ_TYP_NOTIF
@ OBJ_TYP_NOTIF
notification
Definition: obj.h:625
yang_feature.h
YANG feature statement support.
obj_is_leaf_list
boolean obj_is_leaf_list(const obj_template_t *obj)
Check if object is a proper leaf-list.
Definition: obj.c:13336
ncx_get_modname
const xmlChar * ncx_get_modname(const ncx_module_t *mod)
Get the main module name.
Definition: ncx.c:4834
OBJ_TYP_CHOICE
@ OBJ_TYP_CHOICE
choice
Definition: obj.h:618
obj_get_mustQ
dlq_hdr_t * obj_get_mustQ(const obj_template_t *obj)
Get the mustQ for this obj.
Definition: obj.c:11312
xml_util.h
XML Utilities.
NCX_BT_IDREF
@ NCX_BT_IDREF
identityref
Definition: ncxtypes.h:222
obj_is_rpcio_input
boolean obj_is_rpcio_input(const obj_template_t *obj)
Check if the object is an RPC IO node.
Definition: obj.c:14009
yang_obj_consume_datadef
status_t yang_obj_consume_datadef(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *que, obj_template_t *parent)
Parse the next N tokens as a data-def-stmt.
Definition: yang_obj.c:11141
tk_free_chain
void tk_free_chain(tk_chain_t *tkc)
Cleanup and deallocate a tk_chain_t.
Definition: tk.c:3205
obj_in_abstract
boolean obj_in_abstract(const obj_template_t *obj)
Check if object is being used as an object identifier or error-info CHECK ENTIRE TREE UP TO ROOT.
Definition: obj.c:14305
obj_next_key
obj_key_t * obj_next_key(obj_key_t *objkey)
Get the next key record.
Definition: obj.c:9559
TK_CUR_LNUM
#define TK_CUR_LNUM(T)
return the current line number
Definition: tk.h:179
obj_first_key
obj_key_t * obj_first_key(obj_template_t *obj)
Get the first key record.
Definition: obj.c:9472
yang_obj_consume_augment
status_t yang_obj_consume_augment(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod)
Parse the next N tokens as a top-level augment-stmt.
Definition: yang_obj.c:11324
ncx_clean_backptrQ
void ncx_clean_backptrQ(dlq_hdr_t *backptrQ)
Clean an entire Q of ncx_backptr_t structs.
Definition: ncx.c:11470
NCX_BT_LEAFREF
@ NCX_BT_LEAFREF
leafref (needs special processing)
Definition: ncxtypes.h:221
obj_get_mod
ncx_module_t * obj_get_mod(obj_template_t *obj)
Get the module pointer for this object.
Definition: obj.c:12218
tk.h
NCX Syntax Token Handler.
obj_free_deviate
void obj_free_deviate(obj_deviate_t *deviate)
Clean and free an object deviate statement.
Definition: obj.c:9852
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
yang_is_in_yangdata
boolean yang_is_in_yangdata(const yang_pcb_t *pcb)
Get the in_yangdata mode.
Definition: yang.c:4074
obj_new_iffeature_ptr
obj_iffeature_ptr_t * obj_new_iffeature_ptr(ncx_iffeature_t *iff)
Malloc and initialize a new obj_iffeature_ptr_t struct.
Definition: obj.c:16138
yang_consume_strclause
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:1047
ERR_NCX_MISSING_DATA_DEF_STMT
@ ERR_NCX_MISSING_DATA_DEF_STMT
413
Definition: status_enum.h:456
obj_npcon_has_defaults_slow
boolean obj_npcon_has_defaults_slow(obj_template_t *obj)
Check if the specified NP container has defaults within it Must be a config object!...
Definition: obj.c:11776
yang_typ_consume_typedef
status_t yang_typ_consume_typedef(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *que)
Consume a typedef-stmt.
Definition: yang_typ.c:5016
obj_first_unique
obj_unique_t * obj_first_unique(obj_template_t *listobj)
Get the first unique-stmt for a list.
Definition: obj.c:9242
yang_obj_consume_datadef_grp
status_t yang_obj_consume_datadef_grp(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *que, obj_template_t *parent, grp_template_t *grp)
Parse the next N tokens as a data-def-stmt (in a grouping)
Definition: yang_obj.c:11187
obj_new_key
obj_key_t * obj_new_key(void)
Alloc and Init a obj_key_t struct.
Definition: obj.c:9350
obj_dump_child_list
void obj_dump_child_list(log_debug_t lvl, dlq_hdr_t *datadefQ, uint32 startindent, uint32 indent)
Dump the object names in a datadefQ – just child level uses log_write_level() for writing ....
Definition: obj.c:15711
ncx_next_backptr
ncx_backptr_t * ncx_next_backptr(ncx_backptr_t *curptr)
Get next back pointer struct.
Definition: ncx.c:11545
obj_is_external_augment
boolean obj_is_external_augment(obj_template_t *obj)
Check if an object is an external augment.
Definition: obj.c:15942
yang_feature_resolve_iffeatureQ
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.
Definition: yang_feature.c:1479
yang_skip_statement
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:3421
obj_first_unique_comp
obj_unique_comp_t * obj_first_unique_comp(obj_unique_t *un)
Get the first identifier in a unique-stmt for a list.
Definition: obj.c:9300
obj_is_key
boolean obj_is_key(const obj_template_t *obj)
Check if object is being used as a key leaf within a list.
Definition: obj.c:14278
NCX_BT_ANYDATA
@ NCX_BT_ANYDATA
YANG 1.1 anydata.
Definition: ncxtypes.h:229
obj_free_unique
void obj_free_unique(obj_unique_t *un)
Free a obj_unique_t struct.
Definition: obj.c:9101
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
obj_get_config_flag_deep
boolean obj_get_config_flag_deep(const obj_template_t *obj)
get config flag during augment expand
Definition: obj.c:13010
ncxconst.h
Contains NCX constants.
XP_SRC_YANG
@ XP_SRC_YANG
YANG must or when.
Definition: xpath.h:376
yang_obj_resolve_xpath
status_t yang_obj_resolve_xpath(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolve XPath statements.
Definition: yang_obj.c:12293
xml_isspace
boolean xml_isspace(uint32 ch)
Check if an xmlChar is a space char.
Definition: xml_util.c:1901
yang_new_deviation_stmt
yang_stmt_t * yang_new_deviation_stmt(obj_deviation_t *deviation)
Create a new YANG stmt node for a deviation definition.
Definition: yang.c:3166
obj_is_obsolete
boolean obj_is_obsolete(const obj_template_t *obj)
Check if the object has obsolete status.
Definition: obj.c:17094
yang_obj_add_object
status_t yang_obj_add_object(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *que, obj_template_t *obj)
Check if an object already exists, and add it if not.
Definition: yang_obj.c:12598
TK_ADV
#define TK_ADV(T)
advance the current token pointer
Definition: tk.h:107
NCX_IQUAL_ZMORE
@ NCX_IQUAL_ZMORE
'*' == 0 or more
Definition: ncxtypes.h:300
typ_clean_typdef
void typ_clean_typdef(typ_def_t *typdef)
Clean a typ_def_t struct, but do not delete it.
Definition: typ.c:488
ERR_NCX_INVALID_AUGTARGET
@ ERR_NCX_INVALID_AUGTARGET
345
Definition: status_enum.h:388
OBJ_TYP_CONTAINER
@ OBJ_TYP_CONTAINER
container
Definition: obj.h:614
ncx_print_errormsg
void ncx_print_errormsg(tk_chain_t *tkc, ncx_module_t *mod, status_t res)
Print an parse error message to STDOUT.
Definition: ncx.c:7048
yang_grp_check_nest_loop
status_t yang_grp_check_nest_loop(tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, grp_template_t *grp)
Check the 'uses' object and determine if it is contained within the group being used.
Definition: yang_grp.c:853
yang_consume_string
status_t yang_consume_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume 1 string token
Definition: yang.c:227
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
TK_CUR_LPOS
#define TK_CUR_LPOS(T)
return the current line position
Definition: tk.h:182
obj_find_delete_defval
void obj_find_delete_defval(obj_template_t *obj, const xmlChar *defval)
Find and delete a leaf-list default for deviate delete default foo.
Definition: obj.c:17515
yang_grp_resolve_final
status_t yang_grp_resolve_final(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *groupingQ)
Resolve Q of groupings.
Definition: yang_grp.c:770
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
obj_is_action
boolean obj_is_action(const obj_template_t *obj)
Check if the object is a YANG 1.1 action.
Definition: obj.c:14028
dlq_insertAhead
void dlq_insertAhead(void *newP, void *nodeP)
insert the new queue entry before the current entry
Definition: dlq.c:447
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
ERR_NCX_ENTRY_EXISTS
@ ERR_NCX_ENTRY_EXISTS
223
Definition: status_enum.h:262
yang_obj_consume_rpc
status_t yang_obj_consume_rpc(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod)
Parse the next N tokens as a rpc-stmt.
Definition: yang_obj.c:11233
obj_is_data
boolean obj_is_data(const obj_template_t *obj)
Check if the object is defined within data or within a notification or RPC instead.
Definition: obj.c:13755
ncx_warning_elevated
boolean ncx_warning_elevated(status_t res)
Check if a specific status_t code is elevated.
Definition: ncx.c:9439
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
typ_get_basetype_typdef
typ_def_t * typ_get_basetype_typdef(ncx_btype_t btyp)
Get the default typdef for the specified base type.
Definition: typ.c:2039
obj_is_notif
boolean obj_is_notif(const obj_template_t *obj)
Check if the object is a notification.
Definition: obj.c:14083
xpath1.h
XPath 1.0 expression support.
obj_is_leafy
boolean obj_is_leafy(const obj_template_t *obj)
Check if object is a proper leaf or leaflist.
Definition: obj.c:13478
obj_in_action
boolean obj_in_action(const obj_template_t *obj)
Check if the object is within or is an action method.
Definition: obj.c:14041
def_reg.h
Definition Registry module.
obj_find_key2
obj_key_t * obj_find_key2(dlq_hdr_t *que, obj_template_t *keyobj)
Find a specific key component, check for a specific node in case deep keys are supported,...
Definition: obj.c:9436
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
ERR_NCX_NONCONFIG_XPATH
@ ERR_NCX_NONCONFIG_XPATH
1055
Definition: status_enum.h:544
ERR_NCX_WRONG_INDEX_TYPE
@ ERR_NCX_WRONG_INDEX_TYPE
304
Definition: status_enum.h:347
TK_TT_RBRACE
@ TK_TT_RBRACE
right brace '}'
Definition: tk.h:287
ncx_module_t_::parent
struct ncx_module_t_ * parent
if this is a submodule
Definition: ncxtypes.h:970
yang_typ_resolve_type_final
status_t yang_typ_resolve_type_final(tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *typdef, const xmlChar *name, const xmlChar *defval, obj_template_t *obj)
Resolve a type-stmt (final pass)
Definition: yang_typ.c:5529
ERR_NCX_TOP_LEVEL_MANDATORY_FAILED
@ ERR_NCX_TOP_LEVEL_MANDATORY_FAILED
384
Definition: status_enum.h:427
obj_next_unique_comp
obj_unique_comp_t * obj_next_unique_comp(obj_unique_comp_t *uncomp)
Get the next unique-stmt component for a list.
Definition: obj.c:9327
ERR_NCX_WRONG_TKTYPE
@ ERR_NCX_WRONG_TKTYPE
245
Definition: status_enum.h:284
obj_in_notif
boolean obj_in_notif(const obj_template_t *obj)
Check if the object is in a notification.
Definition: obj.c:13952
yang_typ.h
YANG Module parser typedef and type statement support.
ncx_consume_token
status_t ncx_consume_token(tk_chain_t *tkc, ncx_module_t *mod, tk_type_t ttyp)
Consume the next token which should be a 1 or 2 char token without any value.
Definition: ncx.c:7901
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
yang_new_obj_stmt
yang_stmt_t * yang_new_obj_stmt(obj_template_t *obj)
Create a new YANG stmt node for an object.
Definition: yang.c:3061
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
obj_first_dev_defval_tk
obj_defval_tk_t * obj_first_dev_defval_tk(const obj_deviate_t *dev)
Get the first defval_tk entry.
Definition: obj.c:17477
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
yang_obj_remove_deleted_nodes
status_t yang_obj_remove_deleted_nodes(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Find any nodes marked for deletion and remove them.
Definition: yang_obj.c:12476
set_tkc_error
status_t set_tkc_error(tk_chain_t *tkc, ncx_module_t *mod, ncx_error_t *err, status_t res)
utility function for setting and reporting tkc errors.
Definition: yang_obj.c:12565
dlq_remove
void dlq_remove(void *nodeP)
remove the queue entry from its queue list entry MUST have been enqueued somehow before this function...
Definition: dlq.c:519
obj_set_dup_local
void obj_set_dup_local(obj_template_t *obj)
Flag the object as one that has a duplicate sibling with the same local-name and different module nam...
Definition: obj.c:16833
ncx_get_status_string
const xmlChar * ncx_get_status_string(ncx_status_t status)
Get the string for the enum value of a ncx_status_t enum.
Definition: ncx.c:6951
ERR_NCX_WRONG_TYPE
@ ERR_NCX_WRONG_TYPE
231
Definition: status_enum.h:270
yang_consume_boolean
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:1756
obj_is_top
boolean obj_is_top(const obj_template_t *obj)
Check if the object is top-level object within the YANG module that defines it.
Definition: obj.c:14748
ncx_invoke_yang_obj_callbacks
void ncx_invoke_yang_obj_callbacks(ncx_module_t *mod, obj_template_t *obj)
Invoke all the callback functions for a parse-object event.
Definition: ncx.c:8678
obj_is_deleted
boolean obj_is_deleted(const obj_template_t *obj)
Check if object has been deleted by a deviate not-supported.
Definition: obj.c:14339
ERR_NCX_MANDATORY_NOT_ALLOWED
@ ERR_NCX_MANDATORY_NOT_ALLOWED
335
Definition: status_enum.h:378
OBJ_TYP_ANYDATA
@ OBJ_TYP_ANYDATA
anydata: YANG 1.1 only
Definition: obj.h:626
obj_is_rpcio
boolean obj_is_rpcio(const obj_template_t *obj)
Check if the object is an RPC IO node.
Definition: obj.c:13996
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
obj_new_deviate
obj_deviate_t * obj_new_deviate(void)
Malloc and initialize the fields in a an object deviate statement.
Definition: obj.c:9827
yang_obj_resolve_final
status_t yang_obj_resolve_final(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ, boolean ingrouping, boolean is_top)
Resolve objects (final pass)
Definition: yang_obj.c:11963
obj_next_child
obj_template_t * obj_next_child(obj_template_t *obj)
Get the next child object if the specified object has any children.
Definition: obj.c:6860
obj_free_template
void obj_free_template(obj_template_t *obj)
Scrub the memory in a obj_template_t by freeing all the sub-fields and then freeing the entire struct...
Definition: obj.c:5531
yang_obj_resolve_deviations
status_t yang_obj_resolve_deviations(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod)
Resolve deviation-stmts.
Definition: yang_obj.c:11811
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
SET_MOD_ABORTED
#define SET_MOD_ABORTED(M)
Set module aborted flag.
Definition: ncxtypes.h:67
obj_free_defval_tk
void obj_free_defval_tk(obj_defval_tk_t *def)
Delete an object default tk record;.
Definition: obj.c:17402
obj_new_unique
obj_unique_t * obj_new_unique(void)
Alloc and Init a obj_unique_t struct.
Definition: obj.c:9055
yang_typ_resolve_leafref
status_t yang_typ_resolve_leafref(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *testobj)
Resolve the typdef in a leafref leaf or leaf-list.
Definition: yang_typ.c:5674
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
OBJ_TYP_REFINE
@ OBJ_TYP_REFINE
refine, child of uses only
Definition: obj.h:621
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
yang.h
YANG Module parser utilities.
obj_sort_children
void obj_sort_children(obj_template_t *obj)
Check all the child nodes of the specified object and rearrange them into alphabetical order,...
Definition: obj.c:15216
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
xpath1_validate_expr_ex
status_t xpath1_validate_expr_ex(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean missing_is_error, boolean set_backptrs, ncx_xpath_type_t backptr_type)
Validate the previously parsed expression string.
Definition: xpath1.c:4975
xpath_find_schema_target_force_mod
status_t xpath_find_schema_target_force_mod(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, ncx_module_t *force_mod, obj_template_t *obj, dlq_hdr_t *datadefQ, const xmlChar *target, obj_template_t **targobj, dlq_hdr_t **targQ)
find target, save in *targobj, force the module
Definition: xpath.c:2337
xpath_find_schema_target
status_t xpath_find_schema_target(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, dlq_hdr_t *datadefQ, const xmlChar *target, obj_template_t **targobj, dlq_hdr_t **targQ)
Find the schema target, save in *targobj.
Definition: xpath.c:2275
typ.h
Parameter Type Handler.
tk_get_btype_sym
const char * tk_get_btype_sym(ncx_btype_t btyp)
Get the symbolic token symbol for one of the base types.
Definition: tk.c:3324
dlq_count
unsigned int dlq_count(const dlq_hdrT *listP)
get the number of queue entries in the listP queue list
Definition: dlq.c:994
obj_get_keystr
const xmlChar * obj_get_keystr(obj_template_t *obj)
Get the key string for this list object.
Definition: obj.c:15786
yang_obj_consume_deviation
status_t yang_obj_consume_deviation(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod)
Parse the next N tokens as a top-level deviation-stmt.
Definition: yang_obj.c:11366
obj_free_metadata
void obj_free_metadata(obj_metadata_t *meta)
Scrub the memory in a obj_metadata_t by freeing all the sub-fields and then freeing the entire struct...
Definition: obj.c:15052
ncx_module_t_::datadefQ
dlq_hdr_t datadefQ
Q of obj_template_t.
Definition: ncxtypes.h:958
yangconst.h
Contains YANG constants separated to prevent H file include loops.
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
ncx_set_list
status_t ncx_set_list(ncx_btype_t btyp, const xmlChar *strval, ncx_list_t *list)
consume a generic string list with base type checking Parse the XML input as an NCX_BT_SLIST
Definition: ncx_list.c:751
yang_consume_descr
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:888
NCX_STATUS_CURRENT
@ NCX_STATUS_CURRENT
current (default)
Definition: ncxtypes.h:420
OBJ_TYP_CASE
@ OBJ_TYP_CASE
case: last named database object
Definition: obj.h:619
obj_find_template_top
obj_template_t * obj_find_template_top(ncx_module_t *mod, const xmlChar *modname, const xmlChar *objname)
Check if an obj_template_t in the mod->datadefQ or any of the include files visible to this module.
Definition: obj.c:5826
YANG_K_ACTION
#define YANG_K_ACTION
YANG keyword/YIN element names.
Definition: yangconst.h:108
ERR_NCX_EOF
@ ERR_NCX_EOF
244
Definition: status_enum.h:283
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
obj_get_leaf_list_defset
boolean obj_get_leaf_list_defset(const obj_template_t *obj)
Get the defset flag for a leaf-list.
Definition: obj.c:17496
obj_next_unique
obj_unique_t * obj_next_unique(obj_unique_t *un)
Get the next unique-stmt for a list.
Definition: obj.c:9274
NCX_XPATH_TYPE_NONE
@ NCX_XPATH_TYPE_NONE
not set
Definition: ncxtypes.h:1020
ERR_NCX_TYPE_NOT_INDEX
@ ERR_NCX_TYPE_NOT_INDEX
252
Definition: status_enum.h:291
obj_get_appinfoQ
dlq_hdr_t * obj_get_appinfoQ(obj_template_t *obj)
Get the appinfoQ for this obj.
Definition: obj.c:11286
TK_TT_SEMICOL
@ TK_TT_SEMICOL
semi-colon ';'
Definition: tk.h:288
OBJ_TYP_LEAF_LIST
@ OBJ_TYP_LEAF_LIST
leaf-list
Definition: obj.h:616
yang_consume_pid_string
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:581
yang_obj_resolve_augments_final
status_t yang_obj_resolve_augments_final(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolve augmnet statements (final pass)
Definition: yang_obj.c:11759
ncx_set_error
void ncx_set_error(ncx_error_t *tkerr, ncx_module_t *mod, uint32 linenum, uint32 linepos)
Set the fields in an ncx_error_t struct.
Definition: ncx.c:9746
obj_is_np_container
boolean obj_is_np_container(const obj_template_t *obj)
Check if the object is an Non-Presence-container.
Definition: obj.c:14487
OBJ_TYP_RPC
@ OBJ_TYP_RPC
rpc-stmt
Definition: obj.h:623
obj_new_defval_tk
obj_defval_tk_t * obj_new_defval_tk(void)
Create a new object default tk record;.
Definition: obj.c:17385
obj_get_status
ncx_status_t obj_get_status(const obj_template_t *obj)
Get the status field for this obj.
Definition: obj.c:10752
yang_consume_max_elements
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:1301
yang_obj_resolve_xpath_final
status_t yang_obj_resolve_xpath_final(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolve XPath statements (final pass)
Definition: yang_obj.c:12327
xpath_find_pcb
xpath_pcb_t * xpath_find_pcb(dlq_hdr_t *pcbQ, const xmlChar *exprstr)
Find an XPath PCB.
Definition: xpath.c:2932
yang_obj_resolve_augments
status_t yang_obj_resolve_augments(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolve augment statements.
Definition: yang_obj.c:11722
obj_free_deviation
void obj_free_deviation(obj_deviation_t *deviation)
Clean and free an object deviation statement.
Definition: obj.c:9937
ncx_first_backptr
ncx_backptr_t * ncx_first_backptr(dlq_hdr_t *que)
Get first back pointer struct.
Definition: ncx.c:11513
obj_get_xpath_oper_ok
boolean obj_get_xpath_oper_ok(const obj_template_t *obj)
Get the object XPath oper OK flag.
Definition: obj.c:18505
obj_is_container
boolean obj_is_container(const obj_template_t *obj)
Check if object is a YANG container.
Definition: obj.c:13405
tk_tokenize_metadata_string
tk_chain_t * tk_tokenize_metadata_string(ncx_module_t *mod, xmlChar *str, status_t *res)
The specified ncx:metadata string is parsed into tokens convert the ncx:metadata content to 1 or 2 to...
Definition: tk.c:3938
OBJ_TYP_ANYXML
@ OBJ_TYP_ANYXML
anyxml
Definition: obj.h:613
yang_find_imp_grouping
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:2169
ERR_NCX_STMT_IGNORED
@ ERR_NCX_STMT_IGNORED
1017
Definition: status_enum.h:506
yang_typ_consume_metadata_type
status_t yang_typ_consume_metadata_type(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *intypdef)
Consume a type-stmt for metadata.
Definition: yang_typ.c:4981
ncx_module_t_::ref
xmlChar * ref
reference-stmt (not saved on server)
Definition: ncxtypes.h:921
ERR_NCX_UNKNOWN_OBJECT
@ ERR_NCX_UNKNOWN_OBJECT
293
Definition: status_enum.h:336
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
obj_get_datadefQ
dlq_hdr_t * obj_get_datadefQ(obj_template_t *obj)
Get the datadefQ (or caseQ) if this object has one.
Definition: obj.c:11455
obj_new_unique_comp
obj_unique_comp_t * obj_new_unique_comp(void)
Alloc and Init a obj_unique_comp_t struct.
Definition: obj.c:9155
obj_in_rpc
boolean obj_in_rpc(const obj_template_t *obj)
Check if the object is in an rpc/input section.
Definition: obj.c:13876
NCX_BT_ANY
@ NCX_BT_ANY
anyxml
Definition: ncxtypes.h:202
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
NCX_NT_OBJ
@ NCX_NT_OBJ
obj_template_t
Definition: ncxtypes.h:277
ncx_mod_missing_err
void ncx_mod_missing_err(tk_chain_t *tkc, ncx_module_t *mod, const char *stmtstr, const char *expstr)
Print an error for wrong token, mandatory sub-statement is missing.
Definition: ncx.c:7316
obj_is_cloned
boolean obj_is_cloned(const obj_template_t *obj)
Figure out if the obj is a cloned object, inserted via uses or augment statements.
Definition: obj.c:13669
ncx_module_t_::name
xmlChar * name
module name
Definition: ncxtypes.h:902
ncx_netconfd_running
boolean ncx_netconfd_running(void)
Check if netconfd running.
Definition: ncx.c:11805
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
obj_new_deviation
obj_deviation_t * obj_new_deviation(void)
Malloc and initialize the fields in a an object deviation statement.
Definition: obj.c:9913
TK_TT_LBRACE
@ TK_TT_LBRACE
left brace '{'
Definition: tk.h:286
ERR_NCX_INVALID_CONDITIONAL
@ ERR_NCX_INVALID_CONDITIONAL
343
Definition: status_enum.h:386
obj_has_when_stmts
boolean obj_has_when_stmts(obj_template_t *obj)
Check if any when-stmts apply to this object Does not check if they are true, just any when-stmts pre...
Definition: obj.c:14980
yang_consume_ordered_by
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:1206
obj_is_choice
boolean obj_is_choice(const obj_template_t *obj)
Check if object is a YANG choice.
Definition: obj.c:13425
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
obj_is_final
boolean obj_is_final(obj_template_t *obj)
Check if the object template represents a fully expanded template or if it is inside a grouping.
Definition: obj.c:17837
obj_set_abstract
void obj_set_abstract(obj_template_t *obj)
Set the abstract flag for the yang-data node.
Definition: obj.c:17703
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
yang_check_obj_used
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:2518
obj_is_leaf
boolean obj_is_leaf(const obj_template_t *obj)
Check if object is a proper leaf.
Definition: obj.c:13323
ERR_NCX_UNIQUE_CONDITIONAL_MISMATCH
@ ERR_NCX_UNIQUE_CONDITIONAL_MISMATCH
1050
Definition: status_enum.h:539
OBJ_TYP_RPCIO
@ OBJ_TYP_RPCIO
rpc input or output
Definition: obj.h:624
obj_is_mandatory_when_ex
boolean obj_is_mandatory_when_ex(obj_template_t *obj, boolean config_only)
Figure out if the obj is YANG mandatory or not Check the when-stmts, not just mandatory-stmt.
Definition: obj.c:13584
OBJ_DARG_NONE
@ OBJ_DARG_NONE
not set
Definition: obj.h:1188
ERR_NCX_INVALID_STATUS_REF
@ ERR_NCX_INVALID_STATUS_REF
416
Definition: status_enum.h:459
NC_OPERATION_ATTR_NAME
#define NC_OPERATION_ATTR_NAME
NETCONF edit-config operation attribute name.
Definition: ncxconst.h:118
ncx_find_import
ncx_import_t * ncx_find_import(const ncx_module_t *mod, const xmlChar *module)
Search the importQ for a specified module name.
Definition: ncx.c:5541
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
yang_consume_id_string
status_t yang_consume_id_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume an identifier-str token
Definition: yang.c:510
OBJ_TYP_USES
@ OBJ_TYP_USES
uses-stmt has no name
Definition: obj.h:620
yang_feature_consume_iffeature
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.
Definition: yang_feature.c:1311
obj_find_case
obj_case_t * obj_find_case(obj_choice_t *choic, const xmlChar *modname, const xmlChar *casname)
Find a specified case arm by name.
Definition: obj.c:8070
ncx_new_save_deviations
ncx_save_deviations_t * ncx_new_save_deviations(ncx_module_t *devmod, boolean annotation)
Create a deviation save structure.
Definition: ncx.c:9671
ncx_list.h
NCX Module Library List Utility Functions.
ERR_NCX_INVALID_DEV_STMT
@ ERR_NCX_INVALID_DEV_STMT
347
Definition: status_enum.h:390
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
NCX_STATUS_OBSOLETE
@ NCX_STATUS_OBSOLETE
obsolete removed from tree
Definition: ncxtypes.h:422
obj_find_template_all
obj_template_t * obj_find_template_all(ncx_module_t *mod, const xmlChar *modname, const xmlChar *objname)
Check if an obj_template_t in the mod->datadefQ or any of the include files used within the entire ma...
Definition: obj.c:6041
obj_is_cli
boolean obj_is_cli(const obj_template_t *obj)
Check if object is marked as a CLI object.
Definition: obj.c:14222
OBJ_DARG_REPLACE
@ OBJ_DARG_REPLACE
deviate replace
Definition: obj.h:1191
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
obj_first_defval_tk
obj_defval_tk_t * obj_first_defval_tk(const obj_refine_t *ref)
Get the first defval_tk entry.
Definition: obj.c:17439
yang_grp_consume_grouping
status_t yang_grp_consume_grouping(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *que, obj_template_t *parent)
Consume a grouping-stmt.
Definition: yang_grp.c:230
typ_new_typdef
typ_def_t * typ_new_typdef(void)
Malloc and initialize the fields in a typ_def_t.
Definition: typ.c:354
obj_set_xpath_oper_ok
void obj_set_xpath_oper_ok(obj_template_t *obj)
Set the object XPath oper OK flag.
Definition: obj.c:18527
yang_obj_resolve_uses
status_t yang_obj_resolve_uses(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolves uses-stmts.
Definition: yang_obj.c:11575
obj_set_key_leaf
void obj_set_key_leaf(obj_template_t *obj, uint16 keynum)
Set the key data for the object.
Definition: obj.c:16872
obj_get_basetype
ncx_btype_t obj_get_basetype(const obj_template_t *obj)
Get the NCX base type enum for the object type.
Definition: obj.c:12077
yang_obj_resolve_datadefs
status_t yang_obj_resolve_datadefs(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolve data-def-stmts.
Definition: yang_obj.c:11531
obj_is_enabled
boolean obj_is_enabled(obj_template_t *obj)
Check any if-feature statement that may cause the specified object to be invisible.
Definition: obj.c:14527
ncx_get_backptr_node
void * ncx_get_backptr_node(ncx_backptr_t *backptr)
Get the back pointer node pointer.
Definition: ncx.c:11577
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ERR_NCX_DUP_UNIQUE_COMP
@ ERR_NCX_DUP_UNIQUE_COMP
1016
Definition: status_enum.h:505
ncx_mod_exp_err
void ncx_mod_exp_err(tk_chain_t *tkc, ncx_module_t *mod, status_t result, const char *expstr)
Print an error for wrong token, expected a different token.
Definition: ncx.c:7220
obj_get_default
const xmlChar * obj_get_default(const obj_template_t *obj)
Get the default value for the specified object.
Definition: obj.c:11570
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
TK_CUR_TYP
#define TK_CUR_TYP(T)
return the current token type
Definition: tk.h:125
yang_obj.h
YANG Module parser support for data-def-stmt.
grp.h
YANG Grouping Statement Handler.
ERR_NCX_LEAFREF_LOOP
@ ERR_NCX_LEAFREF_LOOP
359
Definition: status_enum.h:402
OBJ_TYP_ACTION
@ OBJ_TYP_ACTION
not really data, YANG 1.1 only
Definition: obj.h:627
yang_feature_check_iffeature_mismatch
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.
Definition: yang_feature.c:1581
CHK_EXIT
#define CHK_EXIT(res, retres)
used in parser routines to decide if processing can continue will exit the function if critical error...
Definition: yangconst.h:221
obj_delete_all_defvals
void obj_delete_all_defvals(obj_template_t *obj)
Delete all the original defaults for a leaf-list default for deviate replace default foo.
Definition: obj.c:17578
yang_consume_uint32
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:1931
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
OBJ_DARG_ADD
@ OBJ_DARG_ADD
deviate add
Definition: obj.h:1189
yang_obj_consume_notification
status_t yang_obj_consume_notification(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod)
Parse the next N tokens as a notification-stmt.
Definition: yang_obj.c:11277
obj_find_unique
obj_unique_t * obj_find_unique(dlq_hdr_t *que, const xmlChar *xpath)
Find a specific unique-stmt.
Definition: obj.c:9206
yang_consume_status
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:1115
obj_is_data_db
boolean obj_is_data_db(const obj_template_t *obj)
Check if the object is some sort of data Constrained to only check the config DB objects,...
Definition: obj.c:13788
yang_obj_check_leafref_loops
status_t yang_obj_check_leafref_loops(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Check all leafref objects for hard-wired object loops Must be done after yang_obj_resolve_xpath.
Definition: yang_obj.c:12361
obj_is_mandatory_when
boolean obj_is_mandatory_when(obj_template_t *obj)
Figure out if the obj is YANG mandatory or not Check the when-stmts, not just mandatory-stmt.
Definition: obj.c:13656
ncx_find_iffeature
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.
Definition: ncx_feature.c:745
obj_new_metadata
obj_metadata_t * obj_new_metadata(void)
Malloc and initialize the fields in a an obj_metadata_t.
Definition: obj.c:15021
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
ncx_get_top_mandatory_allowed
boolean ncx_get_top_mandatory_allowed(void)
Check if top-level mandatory objects are allowed or not.
Definition: ncx.c:10760
ERR_NCX_DATA_MISSING
@ ERR_NCX_DATA_MISSING
272
Definition: status_enum.h:313
NCX_CL_NAMED
@ NCX_CL_NAMED
a restriction of a named type
Definition: ncxtypes.h:247
NEED_EXIT
#define NEED_EXIT(res)
used in parser routines to decide if processing can continue does not return, just evaluates to TRUE ...
Definition: yangconst.h:234
ERR_NCX_DUP_REFINE_STMT
@ ERR_NCX_DUP_REFINE_STMT
346
Definition: status_enum.h:389
obj_has_name
boolean obj_has_name(const obj_template_t *obj)
Check if the specified object type has a name.
Definition: obj.c:10667
ERR_NCX_WHEN_KEY
@ ERR_NCX_WHEN_KEY
409
Definition: status_enum.h:452
OBJ_TYP_LEAF
@ OBJ_TYP_LEAF
leaf
Definition: obj.h:615
yang_consume_must
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:1375
NCX_BT_STRING
@ NCX_BT_STRING
string
Definition: ncxtypes.h:217
ERR_NCX_INVALID_UNIQUE_NODE
@ ERR_NCX_INVALID_UNIQUE_NODE
352
Definition: status_enum.h:395
ncx_resolve_appinfoQ_ex
status_t ncx_resolve_appinfoQ_ex(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ, ncx_node_t node_type, void *node)
Validate all the appinfo clauses present in the specified Q.
Definition: ncx_appinfo.c:911
ncx_module_t_::nsid
xmlns_id_t nsid
assigned by xmlns
Definition: ncxtypes.h:938
ncx_free_backptr
void ncx_free_backptr(ncx_backptr_t *ptr)
Free an ncx_backptr_t struct.
Definition: ncx.c:11433
typ_free_typdef
void typ_free_typdef(typ_def_t *typdef)
Scrub the memory in a typ_def_t by freeing all Then free the typdef itself.
Definition: typ.c:467
yang_obj_top_resolve_final
status_t yang_obj_top_resolve_final(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *datadefQ)
Resolve top-level objects (final pass)
Definition: yang_obj.c:12225
obj_is_refine
boolean obj_is_refine(const obj_template_t *obj)
Figure out if the obj is a refinement object, within a uses-stmt.
Definition: obj.c:13742
obj_get_typestr
const xmlChar * obj_get_typestr(const obj_template_t *obj)
Get the name of the object type.
Definition: obj.c:11392
TK_TT_MSTRING
@ TK_TT_MSTRING
module-qualified token string
Definition: tk.h:320
ncx_get_parent_mod
ncx_module_t * ncx_get_parent_mod(ncx_module_t *mod)
Find the correct module by checking mod->parent nodes.
Definition: ncx.c:9995
yang_grp_resolve_complete
status_t yang_grp_resolve_complete(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *groupingQ, obj_template_t *parent)
Resolve grouping-stmts (second pass)
Definition: yang_grp.c:671
obj_is_deleted_ex
boolean obj_is_deleted_ex(const obj_template_t *obj)
Check if object has been deleted by a deviate not-supported Or if its parent was deleted by deviation...
Definition: obj.c:14361
obj_is_root
boolean obj_is_root(const obj_template_t *obj)
Check if object is marked as a root object.
Definition: obj.c:14152
obj_get_config_flag_check
boolean obj_get_config_flag_check(const obj_template_t *obj, boolean *ingrp)
get config flag during YANG module checking
Definition: obj.c:13101
OBJ_DARG_DELETE
@ OBJ_DARG_DELETE
deviate delete
Definition: obj.h:1190
status.h
Global error messages for status code enumerations.
obj_clone_template_case
obj_template_t * obj_clone_template_case(ncx_module_t *mod, obj_template_t *srcobj, dlq_hdr_t *mobjQ)
Clone an obj_template_t but make sure it is wrapped in a OBJ_TYP_CASE layer.
Definition: obj.c:8984
NCX_BT_NONE
@ NCX_BT_NONE
base type not set
Definition: ncxtypes.h:201
dlq.h
dlq provides general double-linked list and queue support:
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
val_simval_ok_ex
status_t val_simval_ok_ex(typ_def_t *typdef, const xmlChar *simval, ncx_errinfo_t **errinfo, ncx_module_t *mod)
check any simple type to see if it is valid, but do not retrieve the value; used to check the default...
Definition: val.c:4443
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
NCX_DEF_INDENT
#define NCX_DEF_INDENT
default indent amount for nesting XML or other structured output
Definition: ncxconst.h:441