yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
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
35date init comment
36----------------------------------------------------------------------
3716-jun-06 abb Begun
38
39*/
40
41#ifdef WITH_YANG_CBOR
42#ifndef _H_cbor_wr
43#include "cbor_wr.h"
44#endif
45#endif
46
47#ifndef _H_cfg
48#include "cfg.h"
49#endif
50
51#ifndef _H_rpc
52#include "rpc.h"
53#endif
54
55#ifndef _H_ses
56#include "ses.h"
57#endif
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63
77/********************************************************************
78* *
79* F U N C T I O N S *
80* *
81*********************************************************************/
82
83
129extern ncx_filptr_t *
131 rpc_msg_t *msg,
132 const cfg_template_t *cfg,
133 boolean getop,
134 boolean *do_all);
135
136
184extern ncx_filptr_t *
186 rpc_msg_t *msg,
187 val_value_t *root,
188 obj_template_t *root_obj,
189 val_value_t *filter,
190 boolean getop,
191 boolean *do_all);
192
193
205extern void
207 rpc_msg_t *msg,
208 ncx_filptr_t *top,
209 int32 indent,
210 boolean getop);
211
212
227extern boolean
229 ses_cb_t *scb,
230 val_value_t *filter,
231 val_value_t *topval);
232
233
245extern void
247 xml_msg_hdr_t *msg,
248 ncx_filptr_t *filptr,
249 obj_template_t *obj,
250 int32 indent,
251 boolean getop);
252
253
280extern void
282 xml_msg_hdr_t *msg,
283 ncx_filptr_t *filptr,
284 obj_template_t *obj,
285 int32 indent,
286 boolean getop,
287 boolean isfirst,
288 boolean islast,
289 boolean isfirstchild,
290 boolean isfirstsibling,
291 boolean force_lastsibling,
292 boolean force_lastsib_value,
293 boolean force_array_obj);
294
295
296
297#ifdef WITH_YANG_CBOR
309extern void
311 xml_msg_hdr_t *msg,
312 ncx_filptr_t *filptr,
313 obj_template_t *obj,
314 boolean getop,
315 cbor_wr_parms_t *parms);
316
317#endif // WITH_YANG_CBOR
318
319
328extern boolean
330 val_value_t *targval);
331
332
344extern boolean
346 const xmlChar *testval,
347 val_value_t *curval);
348
349
363extern obj_template_t *
365 const xmlChar *obj_name,
366 obj_template_t *parent_obj,
367 boolean *more_matches);
368
369
370#ifdef PTHREADS
380extern boolean
382#endif // PTHREADS
383
384
411extern status_t
413 rpc_msg_t *msg,
414 const cfg_template_t *cfg,
415 boolean getop,
416 val_value_t *filter,
417 boolean *skiptop,
418 xmlChar **xpathstr);
419
420
424#ifdef __cplusplus
425} /* end extern 'C' */
426#endif
427
428#endif /* _H_agt_tree */
CBOR Write functions.
@ brief NCX configuration database manager
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:3872
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:4761
boolean agt_tree_attr_test(val_value_t *filval, val_value_t *targval)
Check any attribute match expressions.
Definition: agt_tree.c:4473
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:4579
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:4077
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:4543
void agt_tree_output_node_from_obj_cbor(ses_cb_t *scb, xml_msg_hdr_t *msg, ncx_filptr_t *filptr, obj_template_t *obj, boolean getop, cbor_wr_parms_t *parms)
Output the get2 callback node from the value node to the specified session.
Definition: agt_tree.c:4440
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:3781
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:3586
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:3516
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:4676
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:3705
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
NETCONF protocol remote procedure call common definitions.
NETCONF Session Common definitions module.
Parameter Request Block used instead of passing lots of leafs.
Definition: cbor_wr.h:112
struct representing 1 configuration database
Definition: cfg.h:229
struct for holding r/o pointer to generic internal node for filtering purposes
Definition: ncxtypes.h:1061
One YANG data-def-stmt.
Definition: obj.h:1229
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:185
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404