yumapro  20.10-12
YumaPro SDK
agt_tree.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_agt_tree
13 #define _H_agt_tree
14 
15 /* FILE: agt_tree.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
29 /*********************************************************************
30 * *
31 * C H A N G E H I S T O R Y *
32 * *
33 *********************************************************************
34 
35 date init comment
36 ----------------------------------------------------------------------
37 16-jun-06 abb Begun
38 
39 */
40 
41 #ifndef _H_cfg
42 #include "cfg.h"
43 #endif
44 
45 #ifndef _H_rpc
46 #include "rpc.h"
47 #endif
48 
49 #ifndef _H_ses
50 #include "ses.h"
51 #endif
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 
71 /********************************************************************
72 * *
73 * F U N C T I O N S *
74 * *
75 *********************************************************************/
76 
77 
123 extern ncx_filptr_t *
124  agt_tree_prune_filter (ses_cb_t *scb,
125  rpc_msg_t *msg,
126  const cfg_template_t *cfg,
127  boolean getop,
128  boolean *do_all);
129 
130 
178 extern ncx_filptr_t *
179  agt_tree_prune_filter2 (ses_cb_t *scb,
180  rpc_msg_t *msg,
181  val_value_t *root,
182  obj_template_t *root_obj,
183  val_value_t *filter,
184  boolean getop,
185  boolean *do_all);
186 
187 
199 extern void
200  agt_tree_output_filter (ses_cb_t *scb,
201  rpc_msg_t *msg,
202  ncx_filptr_t *top,
203  int32 indent,
204  boolean getop);
205 
206 
221 extern boolean
222  agt_tree_test_filter (xml_msg_hdr_t *msghdr,
223  ses_cb_t *scb,
224  val_value_t *filter,
225  val_value_t *topval);
226 
227 
239 extern void
240  agt_tree_output_node_from_obj_xml (ses_cb_t *scb,
241  xml_msg_hdr_t *msg,
242  ncx_filptr_t *filptr,
243  obj_template_t *obj,
244  int32 indent,
245  boolean getop);
246 
247 
274 extern void
275  agt_tree_output_node_from_obj_json (ses_cb_t *scb,
276  xml_msg_hdr_t *msg,
277  ncx_filptr_t *filptr,
278  obj_template_t *obj,
279  int32 indent,
280  boolean getop,
281  boolean isfirst,
282  boolean islast,
283  boolean isfirstchild,
284  boolean isfirstsibling,
285  boolean force_lastsibling,
286  boolean force_lastsib_value,
287  boolean force_array_obj);
288 
289 
298 extern boolean
299  agt_tree_attr_test (val_value_t *filval,
300  val_value_t *targval);
301 
302 
314 extern boolean
315  agt_tree_content_match_test (ses_cb_t *scb,
316  const xmlChar *testval,
317  val_value_t *curval);
318 
319 
333 extern obj_template_t *
335  const xmlChar *obj_name,
336  obj_template_t *parent_obj,
337  boolean *more_matches);
338 
339 
340 #ifdef PTHREADS
341 
350 extern boolean
351  agt_tree_filter_ok_for_nolock (val_value_t *filterval);
352 #endif // PTHREADS
353 
354 
381 extern status_t
382  agt_tree_cvt_subtree_xpath (ses_cb_t *scb,
383  rpc_msg_t *msg,
384  const cfg_template_t *cfg,
385  boolean getop,
386  val_value_t *filter,
387  boolean *skiptop,
388  xmlChar **xpathstr);
389 
390 
394 #ifdef __cplusplus
395 } /* end extern 'C' */
396 #endif
397 
398 #endif /* _H_agt_tree */
ses.h
NETCONF Session Common definitions module.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
NCX_MATCH_EXACT
@ NCX_MATCH_EXACT
exact (default)
Definition: ncxtypes.h:523
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
ncx_free_filptr
void ncx_free_filptr(ncx_filptr_t *filptr)
Free a new ncx_filptr_t struct or add to the cache if room.
Definition: ncx.c:6271
xml_msg_set_cur_depth
void xml_msg_set_cur_depth(xml_msg_hdr_t *msg, uint32 cur_depth)
Set the message cur_depth value.
Definition: xml_msg.c:1427
cfg.h
NCX_BT_INT32
@ NCX_BT_INT32
int32
Definition: ncxtypes.h:209
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
NCX_BT_BINARY
@ NCX_BT_BINARY
binary (base64)
Definition: ncxtypes.h:218
agt_util.h
Utility Functions for NCX Server method routines.
ses_new_indent_count
int32 ses_new_indent_count(boolean indent_in, int32 indent, int32 indent_amount)
Get the new indent count from the current and indent_amount.
Definition: ses.c:4148
ncx_decode_num
status_t ncx_decode_num(const xmlChar *numstr, ncx_btype_t btyp, ncx_num_t *retnum)
Handle some sort of number string.
Definition: ncx_num.c:1288
xml_msg_save_filptr
void xml_msg_save_filptr(xml_msg_hdr_t *msg, ncx_filptr_t *filptr)
Store current message subtree filter in the Queue for later cleanup.
Definition: xml_msg.c:1799
getcb_need_get2
boolean getcb_need_get2(obj_template_t *curobj, obj_template_t *reqobj)
check if the node has a get2 callback or in a choice/case subtree that has get2 callback
Definition: getcb.c:8233
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
obj_is_in_aio_get2
boolean obj_is_in_aio_get2(obj_template_t *obj)
Check if this object is a child of a node with sil-aio-get2 extension setup or if this object itself ...
Definition: obj.c:18305
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
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
NCX_BT_BOOLEAN
@ NCX_BT_BOOLEAN
boolean
Definition: ncxtypes.h:206
val.h
Value Node Basic Support.
NCX_BT_INSTANCE_ID
@ NCX_BT_INSTANCE_ID
instance-identifier
Definition: ncxtypes.h:219
xml_util.h
XML Utilities.
agt_tree.h
Server subtree filter processing for <filter> element in <get> and <get-config> operations.
NCX_BT_IDREF
@ NCX_BT_IDREF
identityref
Definition: ncxtypes.h:222
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
agt_tree_filter_ok_for_nolock
boolean agt_tree_filter_ok_for_nolock(val_value_t *filterval)
Check a filter to see if it selects only top-level config=false.
Definition: agt_tree.c:3872
ERR_NCX_MULTIPLE_MATCHES
@ ERR_NCX_MULTIPLE_MATCHES
381
Definition: status_enum.h:424
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
NCX_PROTO_NETCONF11
@ NCX_PROTO_NETCONF11
RFC 6241 base:1.1.
Definition: ncxtypes.h:784
tk.h
NCX Syntax Token Handler.
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.
agt_tree_output_node_from_obj_json
void agt_tree_output_node_from_obj_json(ses_cb_t *scb, xml_msg_hdr_t *msg, ncx_filptr_t *filptr, obj_template_t *obj, int32 indent, boolean getop, boolean isfirst, boolean islast, boolean isfirstchild, boolean isfirstsibling, boolean force_lastsibling, boolean force_lastsib_value, boolean force_array_obj)
Output the get2 callback node from the value node to the specified session; JSON format.
Definition: agt_tree.c:3502
xml_wr.h
XML Write functions.
obj_next_child_deep
obj_template_t * obj_next_child_deep(obj_template_t *obj)
Get the next child object if the specified object has any children.
Definition: obj.c:7138
ncx_num.h
NCX Module Library Number Utility Functions.
NCX_MATCH_FIRST
@ NCX_MATCH_FIRST
match all chars case-insensitive, return first match
Definition: ncxtypes.h:531
agt_tree_content_match_test
boolean agt_tree_content_match_test(ses_cb_t *scb, const xmlChar *testval, val_value_t *curval)
Check a content match node against the corresponding node in the target.
Definition: agt_tree.c:3739
val_get_next_index
val_index_t * val_get_next_index(const val_index_t *valindex)
Get the next index entry, if any for this value node.
Definition: val.c:10714
ncx_find_next_data_object
obj_template_t * ncx_find_next_data_object(ncx_module_t *mod, obj_template_t *obj)
Check the next obj_template_t in in any module that matches the object name string.
Definition: ncx.c:4266
xml_wr_check_child_obj
void xml_wr_check_child_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn)
Generate entire val_value_t *w/filter) for GET2.
Definition: xml_wr.c:4130
json_wr_start_object_val
void json_wr_start_object_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 startindent)
generate start of a JSON object based on val value tree
Definition: json_wr.c:1540
agt_tree_get2.h
NETCONF Subtree Filtering Implementation for NCX. Support for Get2 callback data retrieval.
ncx_clean_mbackptrQ
void ncx_clean_mbackptrQ(dlq_hdr_t *backptrQ)
Clean an entire Q of ncx_backptr_t structs Use ncx_free_mbackptr to free node pointers.
Definition: ncx.c:11492
ncx_next_backptr
ncx_backptr_t * ncx_next_backptr(ncx_backptr_t *curptr)
Get next back pointer struct.
Definition: ncx.c:11545
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
NCX_BT_ANYDATA
@ NCX_BT_ANYDATA
YANG 1.1 anydata.
Definition: ncxtypes.h:229
ERR_NCX_NO_INSTANCE
@ ERR_NCX_NO_INSTANCE
1009
Definition: status_enum.h:498
op.h
NETCONF protocol operations.
val_first_child_qname
val_value_t * val_first_child_qname(val_value_t *parent, xmlns_id_t nsid, const xmlChar *name)
Get the first corresponding child node instance, by QName.
Definition: val.c:8818
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
val_is_virtual
boolean val_is_virtual(const val_value_t *val)
Check if the specified value is a virtual value such that a 'get' callback function is required to ac...
Definition: val.c:11260
NCX_BT_UINT8
@ NCX_BT_UINT8
uint8
Definition: ncxtypes.h:211
ses_putchar
void ses_putchar(ses_cb_t *scb, uint32 ch)
Write one char to the session, without any translation.
Definition: ses.c:2353
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
dlq_block_insertAhead
void dlq_block_insertAhead(dlq_hdrT *srcP, void *dstP)
insert all the entries in the srcP queue list before the dstP queue entry
Definition: dlq.c:800
val_meta_match
boolean val_meta_match(val_value_t *val, val_value_t *metaval)
Return true if the corresponding attribute exists and has the same value.
Definition: val.c:5582
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
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.
agt_val.h
NETCONF Server database callback handler.
agt_tree_find_child_object
obj_template_t * agt_tree_find_child_object(xmlns_id_t obj_id, const xmlChar *obj_name, obj_template_t *parent_obj, boolean *more_matches)
find the child object template from a namespace ID (may be zero)
Definition: agt_tree.c:3775
ncx_check_any_object_nolock_get
boolean ncx_check_any_object_nolock_get(const xmlChar *objname)
Check if the object name will match any config=true nodes.
Definition: ncx.c:14573
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
def_reg.h
Definition Registry module.
obj_find_child_ex
obj_template_t * obj_find_child_ex(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname, ncx_name_match_t match_names, boolean alt_names, boolean dataonly, status_t *retres)
Find a child object with the specified Qname extended match modes.
Definition: obj.c:6296
val_nodetest_fn_t
boolean(* val_nodetest_fn_t)(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
user function callback template to test output of a specified node.
Definition: val_util.h:132
NCX_BT_ENUM
@ NCX_BT_ENUM
enumeration
Definition: ncxtypes.h:204
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
NCX_BT_LIST
@ NCX_BT_LIST
internal, YANG list
Definition: ncxtypes.h:228
SES_MY_USERNAME
#define SES_MY_USERNAME(S)
get username
Definition: ses.h:111
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
NCX_BT_UINT64
@ NCX_BT_UINT64
uint64
Definition: ncxtypes.h:214
agt_tree_cvt_subtree_xpath
status_t agt_tree_cvt_subtree_xpath(ses_cb_t *scb, rpc_msg_t *msg, const cfg_template_t *cfg, boolean getop, val_value_t *filter, boolean *skiptop, xmlChar **xpathstr)
Convert a subtree filter to an XPath filter.
Definition: agt_tree.c:3954
agt_util_get_testfn
val_nodetest_fn_t agt_util_get_testfn(xml_msg_hdr_t *msg, boolean getop)
Get the test function that should be used for a specific get operation based on with-default paramete...
Definition: agt_util.c:6910
getcb_get2_allowed
boolean getcb_get2_allowed(xml_msg_hdr_t *msg, obj_template_t *chobj)
Check if the current node and operation are allowed to use the GET2 callback if there is one; Used to...
Definition: getcb.c:8931
val_dump_value
void val_dump_value(val_value_t *val, int32 startindent, log_debug_t lvl)
Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (...
Definition: val.c:5688
agt_tree_output_node_from_obj_xml
void agt_tree_output_node_from_obj_xml(ses_cb_t *scb, xml_msg_hdr_t *msg, ncx_filptr_t *filptr, obj_template_t *obj, int32 indent, boolean getop)
Output the get2 callback node from the value node to the specified session.
Definition: agt_tree.c:3297
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
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
ses_get_protocol
ncx_protocol_t ses_get_protocol(const ses_cb_t *scb)
Get the NETCONF protocol set (or unset) for this session.
Definition: ses.c:3854
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ses_message_indent_count
int32 ses_message_indent_count(const ses_cb_t *scb)
Get the message indent count for this session.
Definition: ses.c:2822
ncx_find_object
obj_template_t * ncx_find_object(ncx_module_t *mod, const xmlChar *objname)
Find a top level module object.
Definition: ncx.c:4345
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
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
ncx_match_any_object_ex
obj_template_t * ncx_match_any_object_ex(const xmlChar *modname, const xmlChar *objname, boolean dataonly, ncx_name_match_t name_match, boolean alt_names, status_t *retres)
Match any object in any YANG module with double extra search options.
Definition: ncx.c:4171
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
val_util.h
Value Node Utilities.
val_get_anyxml_tracking
void val_get_anyxml_tracking(const val_value_t *val, boolean *iskey, boolean *isconfig, boolean *isunknown)
Set the anyxml tracking data for this node.
Definition: val_util.c:8054
json_wr.h
JSON Write functions.
xmlns_wildcard_id
xmlns_id_t xmlns_wildcard_id(void)
Get the ID for the base:1.1 wildcard namespace or 0 if it doesn't exist.
Definition: xmlns.c:1053
NCX_BT_INT64
@ NCX_BT_INT64
int64
Definition: ncxtypes.h:210
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
XML_MSG_LAST_GET2_FILPTR
#define XML_MSG_LAST_GET2_FILPTR(M)
The last GET2 Filter Pointer; may be used in case there are some AIO nodes still left.
Definition: xml_msg.h:309
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
NCX_BT_UINT16
@ NCX_BT_UINT16
uint16
Definition: ncxtypes.h:212
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ses_is_dbapi_system_session
boolean ses_is_dbapi_system_session(ses_cb_t *scb)
Check if the specified session is a DB-API control session for system edits.
Definition: ses.c:4478
xml_wr_end_elem
void xml_wr_end_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write an end tag to the specified session.
Definition: xml_wr.c:3114
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
b64.h
Base64 Utilities.
NCX_BT_CONTAINER
@ NCX_BT_CONTAINER
internal container
Definition: ncxtypes.h:225
val_replace_stringval
void val_replace_stringval(val_value_t *val, const xmlChar *str)
Replace the string value, not the entire value.
Definition: val.c:8193
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
xmlns_get_ns_prefix
const xmlChar * xmlns_get_ns_prefix(xmlns_id_t ns_id)
Get the prefix for the specified namespace.
Definition: xmlns.c:669
val_all_whitespace
boolean val_all_whitespace(const xmlChar *str)
Check if a string is all whitespace.
Definition: val.c:11719
xml_msg_get_cur_depth
uint32 xml_msg_get_cur_depth(xml_msg_hdr_t *msg)
Get the message cur_depth value.
Definition: xml_msg.c:1411
ses_is_system_session
boolean ses_is_system_session(ses_cb_t *scb)
Check if the specified session is an internal system session.
Definition: ses.c:4441
obj_get_config_flag
boolean obj_get_config_flag(const obj_template_t *obj)
Get the config flag for an obj_template_t Return the explicit value or the inherited value Also retur...
Definition: obj.c:11174
obj_is_anydata
boolean obj_is_anydata(const obj_template_t *obj)
Check if object is an anydata.
Definition: obj.c:13284
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
val_get_virtual_value
val_value_t * val_get_virtual_value(ses_cb_t *scb, val_value_t *val, status_t *res)
Get the value of a virtual value node.
Definition: val.c:11310
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
ncx_compare_nums
int32 ncx_compare_nums(const ncx_num_t *num1, const ncx_num_t *num2, ncx_btype_t btyp)
Compare 2 ncx_num_t union contents.
Definition: ncx_num.c:242
agt.h
Multi-Protocol Network Management Server.
json_wr_end_array
void json_wr_end_array(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate end of a JSON array
Definition: json_wr.c:1829
agt_tree_get2_check_value
status_t agt_tree_get2_check_value(xml_msg_hdr_t *msg, ses_cb_t *scb, obj_template_t *filobj, val_value_t *curval)
Get the value for the specified object via the get2 callback and just simple check if it is exist or ...
Definition: agt_tree_get2.c:2060
xml_wr_full_check_val
void xml_wr_full_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean expand_varexpr)
Generate entire val_value_t *w/filter)
Definition: xml_wr.c:3517
xml_msg_get_max_depth
uint32 xml_msg_get_max_depth(xml_msg_hdr_t *msg)
Get the message max_depth value.
Definition: xml_msg.c:1343
xml_trim_string
xmlChar * xml_trim_string(xmlChar *str)
trim leading and trailing whitespace inline in the same buffer
Definition: xml_util.c:2646
agt_tree_output_filter
void agt_tree_output_filter(ses_cb_t *scb, rpc_msg_t *msg, ncx_filptr_t *top, int32 indent, boolean getop)
get and get-config step 2.
Definition: agt_tree.c:3139
xml_wr_begin_elem_ex
void xml_wr_begin_elem_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean empty)
Write a start or empty XML tag to the specified session.
Definition: xml_wr.c:3001
obj_is_anyxml
boolean obj_is_anyxml(const obj_template_t *obj)
Check if object is an anyxml.
Definition: obj.c:13271
agt_acm_val_read_allowed
boolean agt_acm_val_read_allowed(xml_msg_hdr_t *msg, const xmlChar *user, val_value_t *val)
Check if the specified user is allowed to read a value node.
Definition: agt_acm.c:618
agt_tree_prune_filter2
ncx_filptr_t * agt_tree_prune_filter2(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *root, obj_template_t *root_obj, val_value_t *filter, boolean getop, boolean *do_all)
get and get-config step 1.
Definition: agt_tree.c:3021
ncx_first_backptr
ncx_backptr_t * ncx_first_backptr(dlq_hdr_t *que)
Get first back pointer struct.
Definition: ncx.c:11513
XML_MSG_DEPTH_TARGET
#define XML_MSG_DEPTH_TARGET(M)
GET2 depth target for the level 1 node.
Definition: xml_msg.h:326
log_debug4_append
void void void void void void void void void void void void void void log_debug4_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG4 log entry.
obj_find_child_fast
obj_template_t * obj_find_child_fast(obj_template_t *obj, xmlns_id_t nsid, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6239
ncx_clean_num
void ncx_clean_num(ncx_btype_t btyp, ncx_num_t *num)
Scrub the memory in a ncx_num_t by freeing all the sub-fields.
Definition: ncx_num.c:189
NCX_BT_ANY
@ NCX_BT_ANY
anyxml
Definition: ncxtypes.h:202
val_force_empty
void val_force_empty(val_value_t *val)
Convert a simple node to an empty type.
Definition: val.c:13101
NCX_BT_SLIST
@ NCX_BT_SLIST
ncx:xsdlist extension (internal, deprecated)
Definition: ncxtypes.h:223
ses_indent
void ses_indent(ses_cb_t *scb, int32 indent)
Write the proper newline + indentation to the specified session.
Definition: ses.c:2768
agt_tree_prune_filter
ncx_filptr_t * agt_tree_prune_filter(ses_cb_t *scb, rpc_msg_t *msg, const cfg_template_t *cfg, boolean getop, boolean *do_all)
get and get-config step 1.
Definition: agt_tree.c:2951
getcb_new_get2cb
getcb_get2_t * getcb_new_get2cb(void)
Malloc and init a new get2 control block.
Definition: getcb.c:5672
json_wr_check_child_obj_ex
void json_wr_check_child_obj_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *parent_get2cb, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn, boolean isfirst, boolean isfirstchild)
generate entire val_value_t *w/filter) (extended version)
Definition: json_wr.c:2971
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
obj_ok_for_nolock
boolean obj_ok_for_nolock(const obj_template_t *obj)
check an object OK for nolock
Definition: obj.c:18194
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.
xmlns_nc_id
xmlns_id_t xmlns_nc_id(void)
Get the ID for the NETCONF namespace or 0 if it doesn't exist.
Definition: xmlns.c:880
val_get_next_meta
val_value_t * val_get_next_meta(val_value_t *curnode)
Get the next metaQ entry from the specified entry.
Definition: val.c:5475
json_wr_start_array_val
void json_wr_start_array_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 startindent, boolean startbrace, boolean startbracket)
generate start of a JSON array; use value node
Definition: json_wr.c:1767
rpc_err.h
NETCONF protocol standard error definitions.
obj_is_top_aio_get2
boolean obj_is_top_aio_get2(obj_template_t *obj)
Check if this object is a really top level holder of extension sil-aio-get2.
Definition: obj.c:18349
NCX_BT_BITS
@ NCX_BT_BITS
bits
Definition: ncxtypes.h:203
NCX_BT_FLOAT64
@ NCX_BT_FLOAT64
hidden: just for XPath
Definition: ncxtypes.h:216
NCX_BT_UINT32
@ NCX_BT_UINT32
uint32
Definition: ncxtypes.h:213
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_acm.h
NETCONF Server Access Control Entry Points.
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
xmlns_get_modptr
void * xmlns_get_modptr(xmlns_id_t nsid)
get the module pointer for the namespace ID
Definition: xmlns.c:1151
YANGAPI_LAUNCHPT_DATASTORE
@ YANGAPI_LAUNCHPT_DATASTORE
/restconf/data launch point
Definition: yangapi.h:134
log_debug2_append
void void void void void void void void void void log_debug2_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG2 log entry.
b64_decode
status_t b64_decode(const uint8_t *inbuff, uint32_t inbufflen, uint8_t *outbuff, uint32_t outbufflen, uint32_t *retlen)
Decode a base64 string.
Definition: b64.c:310
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
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
val_get_metaQ
dlq_hdr_t * val_get_metaQ(val_value_t *val)
Get the meta Q header for the value.
Definition: val.c:5391
ses_get_out_encoding
ncx_display_mode_t ses_get_out_encoding(ses_cb_t *scb)
Get the output encoding.
Definition: ses.c:4126
ERR_NCX_PROTO11_NOT_ENABLED
@ ERR_NCX_PROTO11_NOT_ENABLED
379
Definition: status_enum.h:422
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
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
agt_rpcerr.h
NETCONF protocol <rpc-error> server-side handler.
val_next_child_qname
val_value_t * val_next_child_qname(val_value_t *parent, xmlns_id_t nsid, const xmlChar *name, val_value_t *curchild)
Get the next corresponding child node instance, by QName.
Definition: val.c:8842
obj.h
Data Object Support.
agt_tree_attr_test
boolean agt_tree_attr_test(val_value_t *filval, val_value_t *targval)
Check any attribute match expressions.
Definition: agt_tree.c:3669
SES_MY_SID
#define SES_MY_SID(S)
get session-id
Definition: ses.h:105
ncx_new_filptr
ncx_filptr_t * ncx_new_filptr(void)
Get a new ncx_filptr_t struct.
Definition: ncx.c:6234
json_wr_end_object
void json_wr_end_object(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate end of a JSON object
Definition: json_wr.c:1642
ncx_find_object_nsid
obj_template_t * ncx_find_object_nsid(xmlns_id_t nsid, const xmlChar *objname)
Find a top level module object by module NSID.
Definition: ncx.c:4363
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
val_sprintf_simval_nc
status_t val_sprintf_simval_nc(xmlChar *buff, const val_value_t *val, uint32 *len)
Sprintf the xmlChar string NETCONF representation of a simple value.
Definition: val.c:9931
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
xmlns_inv_id
xmlns_id_t xmlns_inv_id(void)
Get the INVALID namespace ID.
Definition: xmlns.c:931
agt_tree_test_filter
boolean agt_tree_test_filter(xml_msg_hdr_t *msghdr, ses_cb_t *scb, val_value_t *filter, val_value_t *topval)
notification filter evaluation
Definition: agt_tree.c:3204
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
json_wr_max_check_val
status_t json_wr_max_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, val_value_t *val, int32 startindent, val_nodetest_fn_t testfn, boolean isfirst, boolean islast, boolean isfirstchild, boolean isfirstsibling, boolean force_lastsibling, boolean force_lastsib_value, boolean force_array_obj)
generate entire val_value_t *w/filter)
Definition: json_wr.c:1955
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
xmlns_ncx_id
xmlns_id_t xmlns_ncx_id(void)
Get the ID for the NETCONF Extensions namespace or 0 if it doesn't exist.
Definition: xmlns.c:897
NCX_BT_DECIMAL64
@ NCX_BT_DECIMAL64
decimal64
Definition: ncxtypes.h:215
NCX_BT_STRING
@ NCX_BT_STRING
string
Definition: ncxtypes.h:217
agt_tree_get2_retrieve_value
status_t agt_tree_get2_retrieve_value(xml_msg_hdr_t *msg, ses_cb_t *scb, ncx_filptr_t *parent_filptr, ncx_filptr_t *filptr, val_value_t *filchild, obj_template_t *filobj, val_value_t *curval, boolean getop, boolean *force_remove, getcb_api_mode_t api_mode, int32 startindent)
Get the value for the specified object via the get2 callback or check the parent result for the node.
Definition: agt_tree_get2.c:1941
NCX_BT_INT8
@ NCX_BT_INT8
int8
Definition: ncxtypes.h:207
NCX_DISPLAY_MODE_JSON
@ NCX_DISPLAY_MODE_JSON
JSON (RFC 7951 format)
Definition: ncxtypes.h:466
xmlns.h
XML namespace support.
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
agt_tree_get2_retrieve_aio_values
status_t agt_tree_get2_retrieve_aio_values(xml_msg_hdr_t *msg, ses_cb_t *scb, ncx_filptr_t *filptr, obj_template_t *filobj, val_value_t *curval, boolean getop, getcb_api_mode_t api_mode, int32 startindent)
Get the value for the specified object via the get2 callback or check the parent result for the node.
Definition: agt_tree_get2.c:2141
status.h
Global error messages for status code enumerations.
NCX_BT_NONE
@ NCX_BT_NONE
base type not set
Definition: ncxtypes.h:201
yangapi.h
YANG-API definitions (pre-RESTCONF)
obj_is_password
boolean obj_is_password(const obj_template_t *obj)
Check if object is marked as a password object.
Definition: obj.c:14195
NCX_DISPLAY_MODE_XML
@ NCX_DISPLAY_MODE_XML
XML display mode.
Definition: ncxtypes.h:460
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:
obj_has_get2cb
boolean obj_has_get2cb(obj_template_t *obj)
Check if current object has GET2 callback registered.
Definition: obj.c:18099
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
typ_has_children
boolean typ_has_children(ncx_btype_t btyp)
Check if this is a data type that uses the val.v.childQ.
Definition: typ.c:3056
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
val_get_first_meta
val_value_t * val_get_first_meta(dlq_hdr_t *queue)
Get the first metaQ entry from the specified Queue.
Definition: val.c:5423
NCX_BT_INT16
@ NCX_BT_INT16
int16
Definition: ncxtypes.h:208
val_get_first_index
val_index_t * val_get_first_index(const val_value_t *val)
Get the first index entry, if any for this value node.
Definition: val.c:10685