yumapro  20.10-12
YumaPro SDK
cli.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_cli
13 #define _H_cli
14 
15 /* FILE: cli.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*********************************************************************
29 * *
30 * C H A N G E H I S T O R Y *
31 * *
32 *********************************************************************
33 
34 date init comment
35 ----------------------------------------------------------------------
36 21-oct-05 abb Begun
37 09-feb-06 abb Change from xmlTextReader to rpc_agt callback
38  API format
39 10-feb-07 abb Split out common functions from agt_ps_parse.h
40 29-jul-08 abb change to cli.h; remove all by CLI parsing;
41  conversion from NCX parmset to YANG object
42 07-feb-09 abb Add cli_rawparm_t and cli_parse_raw
43  for bootstrap CLI support
44 
45 */
46 
47 #include <xmlstring.h>
48 
49 #ifndef _H_dlq
50 #include "dlq.h"
51 #endif
52 
53 #ifndef _H_ncxtypes
54 #include "ncxtypes.h"
55 #endif
56 
57 #ifndef _H_obj
58 #include "obj.h"
59 #endif
60 
61 #ifndef _H_runstack
62 #include "runstack.h"
63 #endif
64 
65 #ifndef _H_status
66 #include "status.h"
67 #endif
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 /********************************************************************
74 * *
75 * C O N S T A N T S *
76 * *
77 *********************************************************************/
78 
79 /* value only of full test values for the valonly parameter */
80 #define VALONLY TRUE
81 #define FULLTEST FALSE
82 
83 
84 /* plain or script values for the climode parameter */
85 #define SCRIPTMODE TRUE
86 #define PLAINMODE FALSE
87 
88 /********************************************************************
89 * *
90 * T Y P E S *
91 * *
92 *********************************************************************/
93 
94 /* Heading only */
95 
121 typedef enum cli_mode_t_ {
125 } cli_mode_t;
126 
127 
128 
130 typedef struct cli_rawparm_t_ {
131  dlq_hdr_t qhdr;
132  const char *name;
133  char *value;
134  boolean hasvalue;
135  boolean xsdlist;
136  ncx_list_t *ncx_list;
137  int32 count;
138 } cli_rawparm_t;
139 
140 
152 typedef val_value_t *
153  (*cli_xml_buffer_fn_t) (const xmlChar *xmlbuff,
154  obj_template_t *targetobj,
155  status_t *res);
156 
157 
158 
169 typedef status_t
170  (*cli_var_replace_fn_t) (runstack_context_t *rcxt,
171  val_value_t *val);
172 
173 
174 /********************************************************************
175 * *
176 * F U N C T I O N S *
177 * *
178 *********************************************************************/
179 
188 extern cli_rawparm_t *
189  cli_new_rawparm (const xmlChar *name, boolean xsdlist);
190 
191 
198 extern cli_rawparm_t *
199  cli_new_empty_rawparm (const xmlChar *name);
200 
201 
207 extern void
208  cli_free_rawparm (cli_rawparm_t *parm);
209 
210 
216 extern void
217  cli_clean_rawparmQ (dlq_hdr_t *parmQ);
218 
219 
227 extern cli_rawparm_t *
228  cli_find_rawparm (const xmlChar *name,
229  dlq_hdr_t *parmQ);
230 
231 
285 extern status_t
286  cli_parse_raw (int argc,
287  char *argv[],
288  dlq_hdr_t *rawparmQ);
289 
290 
378 extern val_value_t *
379  cli_parse (runstack_context_t *rcxt,
380  int argc,
381  char *argv[],
382  obj_template_t *obj,
383  boolean valonly,
384  boolean script,
385  boolean autocomp,
386  cli_mode_t mode,
387  status_t *status);
388 
389 
390 
427 extern val_value_t *
428  cli_parse_inline (runstack_context_t *rcxt,
429  int argc,
430  char *argv[],
431  obj_template_t *obj,
432  boolean valonly,
433  boolean script,
434  boolean autocomp,
435  cli_mode_t mode,
436  status_t *status,
437  cli_xml_buffer_fn_t cbfn,
438  cli_var_replace_fn_t cbfn2);
439 
440 
460 extern status_t
461  cli_parse_parm (runstack_context_t *rcxt,
462  val_value_t *val,
463  obj_template_t *obj,
464  const xmlChar *strval,
465  boolean script);
466 
467 
490 extern status_t
491  cli_parse_parm_ret (runstack_context_t *rcxt,
492  val_value_t *val,
493  obj_template_t *obj,
494  const xmlChar *strval,
495  boolean script,
496  val_value_t **retval);
497 
498 
521 extern status_t
522  cli_parse_parm_binary (runstack_context_t *rcxt,
523  val_value_t *val,
524  obj_template_t *obj,
525  const xmlChar *strval,
526  boolean script,
527  val_value_t **retval);
528 
529 
551 extern status_t
552  cli_parse_parm_ex (runstack_context_t *rcxt,
553  val_value_t *val,
554  obj_template_t *obj,
555  const xmlChar *strval,
556  boolean script,
557  ncx_bad_data_t bad_data);
558 
561 #ifdef __cplusplus
562 } /* end extern 'C' */
563 #endif
564 
565 #endif /* _H_cli */
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
cli_xml_buffer_fn_t
val_value_t *(* cli_xml_buffer_fn_t)(const xmlChar *xmlbuff, obj_template_t *targetobj, status_t *res)
Read an XML buffer and convert it into a real data structure.
Definition: cli.h:153
NCX_BAD_DATA_CHECK
@ NCX_BAD_DATA_CHECK
NCX_BAD_DATA_CHECK to prompt user to keep or re-enter value.
Definition: ncxtypes.h:439
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
cli_parse_raw
status_t cli_parse_raw(int argc, char *argv[], dlq_hdr_t *rawparmQ)
Generate N sets of variable/value pairs for the specified boot-strap CLI parameters.
Definition: cli.c:1212
val_set_dname
status_t val_set_dname(val_value_t *val, const xmlChar *dname)
Set the dname field.
Definition: val.c:15387
cfg.h
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
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
val_set_simval_obj
status_t val_set_simval_obj(val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
Set an initialized val_value_t as a simple type.
Definition: val_util.c:4444
var_get_script_val_ex
val_value_t * var_get_script_val_ex(runstack_context_t *rcxt, obj_template_t *parentobj, obj_template_t *obj, val_value_t *val, const xmlChar *strval, boolean istop, val_value_t *fillval, status_t *res)
Create or fill in a val_value_t struct for a parameter assignment within the script processing mode A...
Definition: var.c:2113
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
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
NCX_BAD_DATA_ERROR
@ NCX_BAD_DATA_ERROR
NCX_BAD_DATA_ERROR to prompt user to re-enter value.
Definition: ncxtypes.h:442
ncx_warning_enabled
boolean ncx_warning_enabled(status_t res)
Check if a specific status_t code is enabled.
Definition: ncx.c:9394
val_set_name
void val_set_name(val_value_t *val, const xmlChar *name, uint32 namelen)
Set (or reset) the name of a value struct.
Definition: val.c:2875
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
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
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
val_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
obj_is_cli_equals_ok
boolean obj_is_cli_equals_ok(const obj_template_t *obj)
Check if object is marked as ncx:default-parm-equals-ok.
Definition: obj.c:15987
cli_parse_parm_ret
status_t cli_parse_parm_ret(runstack_context_t *rcxt, val_value_t *val, obj_template_t *obj, const xmlChar *strval, boolean script, val_value_t **retval)
Create a val_value_t struct for the specified parm value, and insert it into the parent container val...
Definition: cli.c:2248
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.
runstack.h
CLI run stack manager.
cli_clean_rawparmQ
void cli_clean_rawparmQ(dlq_hdr_t *parmQ)
Clean and free a Q of raw parm entries.
Definition: cli.c:1109
val_add_defaults
status_t val_add_defaults(val_value_t *val, boolean scriptmode)
Add defaults to an initialized complex value.
Definition: val_util.c:2692
NCX_BT_ANYDATA
@ NCX_BT_ANYDATA
YANG 1.1 anydata.
Definition: ncxtypes.h:229
val_instance_check
status_t val_instance_check(val_value_t *root, val_value_t *val, obj_template_t *obj)
Check for the proper number of object instances for the specified value struct.
Definition: val_util.c:2806
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
VAL_FL_DEFSET
#define VAL_FL_DEFSET
if set, this value was added by val_add_defaults
Definition: val.h:184
val_simval_ok
status_t val_simval_ok(typ_def_t *typdef, const xmlChar *simval)
check any simple type to see if it is valid, but do not retrieve the value; used to check the default...
Definition: val.c:4379
ERR_NCX_UNKNOWN_PARM
@ ERR_NCX_UNKNOWN_PARM
227
Definition: status_enum.h:266
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_valid_fname_ch
boolean ncx_valid_fname_ch(uint32 ch)
Check if an xmlChar is a valid NCX name string first char.
Definition: ncx.c:7573
val_get_dname
const xmlChar * val_get_dname(const val_value_t *val)
Get the dname field if set; NULL if not set.
Definition: val.c:15363
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.
cli_parse_parm_ex
status_t cli_parse_parm_ex(runstack_context_t *rcxt, val_value_t *val, obj_template_t *obj, const xmlChar *strval, boolean script, ncx_bad_data_t bad_data)
Create a val_value_t struct for the specified parm value, and insert it into the parent container val...
Definition: cli.c:2294
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
cli_var_replace_fn_t
status_t(* cli_var_replace_fn_t)(runstack_context_t *rcxt, val_value_t *val)
Check a val_value_t for variable usage to be replaced by the variable value.
Definition: cli.h:170
NCX_BAD_DATA_IGNORE
@ NCX_BAD_DATA_IGNORE
NCX_BAD_DATA_IGNORE to silently accept invalid input values.
Definition: ncxtypes.h:433
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
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
cli_rawparm_t_::qhdr
dlq_hdr_t qhdr
queue header to store rawparm in a dlq
Definition: cli.h:131
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
cli_parse_inline
val_value_t * cli_parse_inline(runstack_context_t *rcxt, int argc, char *argv[], obj_template_t *obj, boolean valonly, boolean script, boolean autocomp, cli_mode_t mode, status_t *status, cli_xml_buffer_fn_t cbfn, cli_var_replace_fn_t cbfn2)
schema based CLI support
Definition: cli.c:1558
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
cli_rawparm_t_::value
char * value
stored value if set
Definition: cli.h:133
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
val_util.h
Value Node Utilities.
cli_mode_t_
cli_mode_t_
CLI parsing modes.
Definition: cli.h:121
cli_parse_parm_binary
status_t cli_parse_parm_binary(runstack_context_t *rcxt, val_value_t *val, obj_template_t *obj, const xmlChar *strval, boolean script, val_value_t **retval)
Create a val_value_t struct for the specified parm value, and insert it into the value set Extended.
Definition: cli.c:594
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
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
ERR_NCX_UNENDED_QSTRING
@ ERR_NCX_UNENDED_QSTRING
239
Definition: status_enum.h:278
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
ERR_NCX_WRONG_LEN
@ ERR_NCX_WRONG_LEN
222
Definition: status_enum.h:261
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xml_strncmp
int xml_strncmp(const xmlChar *s1, const xmlChar *s2, uint32 maxlen)
String compare for xmlChar for at most 'maxlen' xmlChars.
Definition: xml_util.c:1824
json_parse_buffer
status_t json_parse_buffer(xmlChar *buff, obj_template_t *obj, dlq_hdr_t *returnQ)
Parse buffer of JSON into val_value_t structs.
Definition: json_parse.c:2639
ncx_ok_for_inline_data
boolean ncx_ok_for_inline_data(obj_template_t *obj)
Check if the object is OK for inline data.
Definition: ncx.c:14405
val_child.h
Value Node Child Access Support.
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
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.
typ.h
Parameter Type Handler.
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
val_remove_false_when
status_t val_remove_false_when(val_value_t *val, boolean *deleteme)
Remove false when-stmt nodes.
Definition: val_util.c:4206
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
ERR_NCX_AMBIGUOUS_CMD
@ ERR_NCX_AMBIGUOUS_CMD
355
Definition: status_enum.h:398
cli_rawparm_t_::xsdlist
boolean xsdlist
true if a list is expected
Definition: cli.h:135
ncx_free_list
void ncx_free_list(ncx_list_t *list)
Clean and free an allocated ncx_list_t.
Definition: ncx_list.c:170
cli_rawparm_t_::hasvalue
boolean hasvalue
indicates value is set
Definition: cli.h:134
cli_parse_parm
status_t cli_parse_parm(runstack_context_t *rcxt, val_value_t *val, obj_template_t *obj, const xmlChar *strval, boolean script)
Create a val_value_t struct for the specified parm value, and insert it into the parent container val...
Definition: cli.c:2209
CLI_MODE_NONE
@ CLI_MODE_NONE
mode not set
Definition: cli.h:122
obj_find_child_str
obj_template_t * obj_find_child_str(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname, uint32 objnamelen)
Find a child object with the specified Qname.
Definition: obj.c:6559
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
obj_is_container
boolean obj_is_container(const obj_template_t *obj)
Check if object is a YANG container.
Definition: obj.c:13405
cli_parse
val_value_t * cli_parse(runstack_context_t *rcxt, int argc, char *argv[], obj_template_t *obj, boolean valonly, boolean script, boolean autocomp, cli_mode_t mode, status_t *status)
schema based CLI support
Definition: cli.c:1533
cli_rawparm_t_::name
const char * name
parameter name
Definition: cli.h:132
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
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
NCX_BT_ANY
@ NCX_BT_ANY
anyxml
Definition: ncxtypes.h:202
NCX_BT_SLIST
@ NCX_BT_SLIST
ncx:xsdlist extension (internal, deprecated)
Definition: ncxtypes.h:223
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_valid_name_ch
boolean ncx_valid_name_ch(uint32 ch)
Check if the character is a valid YANG identifier chara.
Definition: ncx.c:7549
cli_new_empty_rawparm
cli_rawparm_t * cli_new_empty_rawparm(const xmlChar *name)
Malloc and init a raw parm entry that has no value (NCX_BT_EMPTY)
Definition: cli.c:1052
CLI_MODE_PROGRAM
@ CLI_MODE_PROGRAM
real argc, argv
Definition: cli.h:123
obj_is_choice
boolean obj_is_choice(const obj_template_t *obj)
Check if object is a YANG choice.
Definition: obj.c:13425
NCX_BAD_DATA_WARN
@ NCX_BAD_DATA_WARN
NCX_BAD_DATA_WARN to warn and accept invalid input values.
Definition: ncxtypes.h:436
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
var_get_script_val
val_value_t * var_get_script_val(runstack_context_t *rcxt, obj_template_t *obj, val_value_t *val, const xmlChar *strval, boolean istop, status_t *res)
Create or fill in a val_value_t struct for a parameter assignment within the script processing mode.
Definition: var.c:2058
obj_is_leaf
boolean obj_is_leaf(const obj_template_t *obj)
Check if object is a proper leaf.
Definition: obj.c:13323
CLI_MODE_COMMAND
@ CLI_MODE_COMMAND
called from yangcli command parser
Definition: cli.h:124
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
cli.h
command line interpreter parsing to internal val_value_t format
ncx_list.h
NCX Module Library List Utility Functions.
val_clean_valQ
void val_clean_valQ(dlq_hdr_t *valQ)
Clean a queue of val_value_t.
Definition: val.c:13911
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
cli_rawparm_t_
used for bootstrap CLI parms only, no validation
Definition: cli.h:130
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
NCX_INLINE_TAG
#define NCX_INLINE_TAG
start/end inline XML or JSON data
Definition: ncxconst.h:1672
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
obj_get_default_parm
obj_template_t * obj_get_default_parm(obj_template_t *obj)
Get the ncx:default-parm object for this object Only supported for OBJ_TYP_CONTAINER and OBJ_TYP_RPCI...
Definition: obj.c:12941
cli_free_rawparm
void cli_free_rawparm(cli_rawparm_t *parm)
Clean and free a raw parm entry.
Definition: cli.c:1081
cli_rawparm_t_::count
int32 count
count field if duplicates
Definition: cli.h:137
ncx_get_gen_string
obj_template_t * ncx_get_gen_string(void)
Get the object template for the NCX generic string leaf.
Definition: ncx.c:6692
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
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
cli_new_rawparm
cli_rawparm_t * cli_new_rawparm(const xmlChar *name, boolean xsdlist)
bootstrap CLI support Malloc and init a raw parm entry
Definition: cli.c:1018
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
obj_ok_for_cli
boolean obj_ok_for_cli(obj_template_t *obj)
Figure out if the obj is OK for current CLI implementation.
Definition: obj.c:14776
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
obj.h
Data Object Support.
cli_rawparm_t_::ncx_list
ncx_list_t * ncx_list
value if a list is expected
Definition: cli.h:136
json_parse.h
JSON input stream parser module.
cli_find_rawparm
cli_rawparm_t * cli_find_rawparm(const xmlChar *name, dlq_hdr_t *parmQ)
Find the specified raw parm entry.
Definition: cli.c:1140
ERR_NCX_USING_BADDATA
@ ERR_NCX_USING_BADDATA
1042
Definition: status_enum.h:531
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
ERR_NCX_WRONG_DATATYP
@ ERR_NCX_WRONG_DATATYP
285
Definition: status_enum.h:328
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
ERR_NCX_DATA_MISSING
@ ERR_NCX_DATA_MISSING
272
Definition: status_enum.h:313
ERR_NCX_EMPTY_VAL
@ ERR_NCX_EMPTY_VAL
235
Definition: status_enum.h:274
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
ncx_new_list
ncx_list_t * ncx_new_list(ncx_btype_t btyp)
Malloc Initialize an allocated ncx_list_t.
Definition: ncx_list.c:90
obj_match_child_str
obj_template_t * obj_match_child_str(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname, uint32 objnamelen, uint32 *matchcount)
Match a child object with the specified Qname Find first command that matches all N chars of objname.
Definition: obj.c:6628
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
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
status.h
Global error messages for status code enumerations.
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support:
var.h
NCX Variable Support. Used within a runstack by a CLI user or script.
val_replace
status_t val_replace(val_value_t *val, val_value_t *copy)
Replace a specified val_value_t struct and sub-trees.
Definition: val.c:7974
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297