yumapro  25.10-4
YumaPro SDK
Loading...
Searching...
No Matches
agt_util.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2025, 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_util
13#define _H_agt_util
14
15/* FILE: agt_util.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
32/*********************************************************************
33* *
34* C H A N G E H I S T O R Y *
35* *
36*********************************************************************
37
38date init comment
39----------------------------------------------------------------------
4024-may-06 abb Begun
41
42*/
43
44#ifndef _H_agt
45#include "agt.h"
46#endif
47
48#ifndef _H_agt_cfg
49#include "agt_cfg.h"
50#endif
51
52#ifndef _H_cfg
53#include "cfg.h"
54#endif
55
56#ifndef _H_dlq
57#include "dlq.h"
58#endif
59
60#ifndef _H_getcb
61#include "getcb.h"
62#endif
63
64#ifndef _H_ncxconst
65#include "ncxconst.h"
66#endif
67
68#ifndef _H_ncxtypes
69#include "ncxtypes.h"
70#endif
71
72#ifndef _H_obj
73#include "obj.h"
74#endif
75
76#ifndef _H_rpc
77#include "rpc.h"
78#endif
79
80#ifndef _H_ses
81#include "ses.h"
82#endif
83
84#ifndef _H_status
85#include "status.h"
86#endif
87
88#ifndef _H_val
89#include "val.h"
90#endif
91
92#ifndef _H_xml_msg
93#include "xml_msg.h"
94#endif
95
96#ifndef _H_xml_util
97#include "xml_util.h"
98#endif
99
100#ifndef _H_xpath
101#include "xpath.h"
102#endif
103
104#ifndef _H_yang_patch
105#include "yang_patch.h"
106#endif
107
108#ifdef __cplusplus
109extern "C" {
110#endif
111
112/********************************************************************
113* *
114* F U N C T I O N S *
115* *
116*********************************************************************/
117
143extern status_t
144 agt_get_cfg_from_parm (const xmlChar *parmname,
145 rpc_msg_t *msg,
146 xml_node_t *methnode,
147 cfg_template_t **retcfg);
148
149
161extern status_t
162 agt_get_inline_cfg_from_parm (const xmlChar *parmname,
163 rpc_msg_t *msg,
164 xml_node_t *methnode,
165 val_value_t **retval);
166
167
190extern status_t
191 agt_get_url_from_parm (const xmlChar *parmname,
192 rpc_msg_t *msg,
193 xml_node_t *methnode,
194 const xmlChar **returl,
195 val_value_t **retval);
196
197
207extern xmlChar *
208 agt_get_filespec_from_url (const xmlChar *urlstr,
209 status_t *res);
210
211
223extern const val_value_t *
224 agt_get_parmval (const xmlChar *parmname,
225 rpc_msg_t *msg);
226
227
259extern void
261 xml_msg_hdr_t *msghdr,
262 ncx_layer_t layer,
263 status_t res,
264 const xml_node_t *xmlnode,
265 ncx_node_t parmtyp,
266 const void *error_info,
267 ncx_node_t nodetyp,
268 void *error_path);
269
270
284extern void
286 xml_msg_hdr_t *msghdr,
287 status_t res,
288 obj_template_t *errobj,
289 const xmlChar *badval);
290
291
325extern void
327 xml_msg_hdr_t *msghdr,
328 ncx_layer_t layer,
329 status_t res,
330 const xml_node_t *xmlnode,
331 ncx_node_t parmtyp,
332 const void *error_info,
333 ncx_node_t nodetyp,
334 void *error_path,
335 const ncx_errinfo_t *errinfo);
336
337
374extern void
376 xml_msg_hdr_t *msghdr,
377 ncx_layer_t layer,
378 status_t res,
379 const xml_node_t *xmlnode,
380 ncx_node_t parmtyp,
381 const void *error_parm,
382 ncx_node_t nodetyp,
383 void *error_path,
384 const ncx_errinfo_t *errinfo);
385
386
410extern void
412 xml_msg_hdr_t *msghdr,
413 ncx_layer_t layer,
414 status_t res,
415 const xml_attr_t *xmlattr,
416 const xml_node_t *xmlnode,
417 const xmlChar *badns,
418 ncx_node_t nodetyp,
419 void *errnode);
420
421
440extern void
441 agt_record_insert_error (ses_cb_t *scb,
442 xml_msg_hdr_t *msghdr,
443 status_t res,
444 val_value_t *errval);
445
446
465extern void
466 agt_record_unique_error (ses_cb_t *scb,
467 xml_msg_hdr_t *msghdr,
468 val_value_t *errval,
469 dlq_hdr_t *valuniqueQ);
470
471
483extern status_t
484 agt_validate_filter (ses_cb_t *scb,
485 rpc_msg_t *msg);
486
487
500extern status_t
501 agt_validate_filter_ex (ses_cb_t *scb,
502 rpc_msg_t *msg,
503 val_value_t *filter);
504
505
518extern status_t
519 agt_validate_filter_nmda (rpc_msg_t *msg,
520 val_value_t *filter,
521 boolean is_subtree,
522 boolean is_operational);
523
524
539extern boolean
540 agt_check_config (xml_msg_hdr_t *mhdr,
541 ncx_withdefaults_t withdef,
542 boolean realtest,
543 val_value_t *node);
544
545
562extern boolean
563 agt_check_default (xml_msg_hdr_t *mhdr,
564 ncx_withdefaults_t withdef,
565 boolean realtest,
566 val_value_t *node);
567
568
585extern boolean
586 agt_check_config_false (xml_msg_hdr_t *mhdr,
587 ncx_withdefaults_t withdef,
588 boolean realtest,
589 val_value_t *node);
590
591
610extern boolean
611 agt_check_config_false_default (xml_msg_hdr_t *mhdr,
612 ncx_withdefaults_t withdef,
613 boolean realtest,
614 val_value_t *node);
615
616
633extern boolean
634 agt_check_save (xml_msg_hdr_t *mhdr,
635 ncx_withdefaults_t withdef,
636 boolean realtest,
637 val_value_t *node);
638
639
656extern boolean
657 agt_check_modtags (xml_msg_hdr_t *mhdr,
658 ncx_withdefaults_t withdef,
659 boolean realtest,
660 val_value_t *node);
661
662
679extern boolean agt_check_basic (xml_msg_hdr_t *mhdr,
680 ncx_withdefaults_t withdef,
681 boolean realtest,
682 val_value_t *node);
683
684
696extern status_t
697 agt_output_filter (ses_cb_t *scb,
698 rpc_msg_t *msg,
699 int32 indent);
700
701
712extern status_t
713 agt_output_schema (ses_cb_t *scb,
714 rpc_msg_t *msg,
715 int32 indent);
716
717
729extern status_t
730 agt_output_empty (ses_cb_t *scb,
731 rpc_msg_t *msg,
732 int32 indent);
733
734
744extern status_t
746 boolean cur_exists);
747
748
787extern status_t
788 agt_check_editop (op_editop_t pop,
789 op_editop_t *cop,
790 val_value_t *newnode,
791 val_value_t *curnode,
792 ncx_iqual_t iqual,
793 ncx_protocol_t proto,
794 boolean is_commit,
795 boolean *delete_default);
796
797
810extern status_t
811 agt_enable_feature (const xmlChar *modname,
812 const xmlChar *featurename);
813
814
827extern status_t
828 agt_disable_feature (const xmlChar *modname,
829 const xmlChar *featurename);
830
831
847extern val_value_t *
848 agt_make_leaf (obj_template_t *parentobj,
849 const xmlChar *leafname,
850 const xmlChar *leafstrval,
851 status_t *res);
852
853
869extern val_value_t *
871 const xmlChar *leafname,
872 uint32 leafval,
873 status_t *res);
874
890extern val_value_t *
892 const xmlChar *leafname,
893 int32 leafval,
894 status_t *res);
895
896
912extern val_value_t *
914 const xmlChar *leafname,
915 uint64 leafval,
916 status_t *res);
917
918
934extern val_value_t *
936 const xmlChar *leafname,
937 int64 leafval,
938 status_t *res);
939
940
957extern val_value_t *
959 const xmlChar *leafname,
960 const val_idref_t *leafval,
961 status_t *res);
962
963
978extern val_value_t *
979 agt_make_list (obj_template_t *parentobj,
980 const xmlChar *listname,
981 status_t *res);
982
983
994extern val_value_t *
996 const xmlChar *objname,
997 status_t *res);
998
999
1000#define agt_make_virtual_node agt_make_virtual_leaf
1001
1002
1021extern val_value_t *
1023 const xmlChar *leafname,
1024 getcb_fn_t callbackfn,
1025 status_t *res);
1026
1027
1041extern status_t
1042 agt_add_top_virtual (obj_template_t *obj,
1043 getcb_fn_t callbackfn);
1044
1045
1067extern status_t
1068 agt_add_top_container (obj_template_t *obj,
1069 val_value_t **val);
1070
1071
1095extern status_t
1096 agt_add_container (const xmlChar *modname,
1097 const xmlChar *objname,
1098 val_value_t *parentval,
1099 val_value_t **val);
1100
1101
1102
1119extern val_value_t *
1120 agt_init_cache (const xmlChar *modname,
1121 const xmlChar *objname,
1122 status_t *res);
1123
1124
1142extern status_t
1143 agt_check_cache (val_value_t **cacheptr,
1144 val_value_t *newval,
1145 val_value_t *curval,
1146 op_editop_t editop);
1147
1148
1162extern xpath_pcb_t *
1164 const xmlChar *expr,
1165 status_t *res);
1166
1167
1180extern xmlChar *
1181 agt_make_srid_filespec (const xmlChar *basestr,
1182 const xmlChar *patstr,
1183 const xmlChar *valstr);
1184
1194extern xmlChar *
1196
1197
1210extern xmlChar *
1211 agt_get_target_filespec (const xmlChar *target_url,
1212 status_t *res);
1213
1214
1236extern status_t
1237 agt_set_mod_defaults (ncx_module_t *mod,
1238 val_value_t *valroot,
1239 boolean set_candidate,
1240 boolean set_augment,
1241 boolean force);
1242
1243
1254extern status_t
1256
1257
1266extern status_t
1267 agt_set_val_defaults (val_value_t *val);
1268
1269
1291extern status_t
1292 agt_set_with_defaults (rpc_msg_t *msg,
1293 const xmlChar *modname,
1294 val_value_t **errval);
1295
1296
1306extern void
1307 agt_set_with_owners (rpc_msg_t *msg);
1308
1309
1318extern void
1319 agt_set_depth (rpc_msg_t *msg);
1320
1321
1330extern void
1331 agt_set_depth_nmda (rpc_msg_t *msg);
1332
1333
1350extern val_value_t *
1351 agt_get_key_value (val_value_t *startval,
1352 val_value_t **lastkey);
1353
1354
1375extern val_value_t *
1376 agt_add_top_node_if_missing (ncx_module_t *mod,
1377 const xmlChar *objname,
1378 boolean *added,
1379 status_t *res);
1380
1390extern boolean
1391 agt_any_operations_set (val_value_t *val);
1392
1393
1405extern boolean
1406 agt_apply_this_node (op_editop_t editop,
1407 const val_value_t *newnode,
1408 const val_value_t *curnode);
1409
1410
1431extern boolean
1432 agt_apply_this_node_ex (op_editop_t editop,
1433 const val_value_t *newnode,
1434 const val_value_t *curnode,
1435 boolean ignore_defaults,
1436 boolean childonly,
1437 boolean top_replace);
1438
1439
1447extern boolean
1448 agt_backups_enabled (void);
1449
1450
1460extern xpath_result_t *
1461 agt_get_result_from_xpath (xpath_pcb_t *pcb,
1462 val_value_t *rootval,
1463 status_t *retres);
1464
1465
1474extern val_value_t *
1475 agt_get_first_result_val (xpath_result_t *result);
1476
1477
1492extern void
1493 agt_output_start_container (ses_cb_t *scb,
1494 xml_msg_hdr_t *mhdr,
1495 xmlns_id_t parent_nsid,
1496 xmlns_id_t node_nsid,
1497 const xmlChar *node_name,
1498 int32 indent);
1499
1500
1516extern void
1517 agt_output_start_node (ses_cb_t *scb,
1518 xml_msg_hdr_t *mhdr,
1519 xmlns_id_t parent_nsid,
1520 xmlns_id_t node_nsid,
1521 const xmlChar *node_name,
1522 int32 indent,
1523 boolean try_modname);
1524
1525
1526
1546extern void
1547 agt_output_start_node2 (ses_cb_t *scb,
1548 xml_msg_hdr_t *mhdr,
1549 xmlns_id_t parent_nsid,
1550 xmlns_id_t node_nsid,
1551 const xmlChar *node_name,
1552 int32 indent,
1553 boolean try_modname,
1554 val_value_t *metaval);
1555
1556
1557
1579extern void
1580 agt_output_start_errors_container (ses_cb_t *scb,
1581 xml_msg_hdr_t *mhdr,
1582 xmlns_id_t parent_nsid,
1583 xmlns_id_t nsid,
1584 const xmlChar *elname,
1585 const dlq_hdr_t *attrQ,
1586 boolean isattrq,
1587 int32 indent,
1588 boolean empty);
1589
1590
1603extern void
1604 agt_output_end_container (ses_cb_t *scb,
1605 xml_msg_hdr_t *mhdr,
1606 xmlns_id_t node_nsid,
1607 const xmlChar *node_name,
1608 int32 indent);
1609
1610
1619extern boolean
1620 agt_match_etag (val_value_t *val,
1621 const xmlChar *etag);
1622
1623
1634extern boolean
1635 agt_match_etag_binary (val_value_t *val,
1636 ncx_etag_t etag);
1637
1638
1649extern boolean
1651 time_t *timerec);
1652
1653
1662extern boolean
1664
1665
1682extern val_value_t *
1683 agt_make_leaf2 (obj_template_t *parentobj,
1684 const xmlChar *modname,
1685 const xmlChar *leafname,
1686 const xmlChar *leafstrval,
1687 status_t *res);
1688
1689
1703extern val_value_t *
1705 const xmlChar *modname,
1706 const xmlChar *leafname,
1707 const val_value_t *leafval,
1708 status_t *res);
1709
1710
1727extern val_value_t *
1729 const xmlChar *modname,
1730 const xmlChar *leafname,
1731 uint32 leafval,
1732 status_t *res);
1733
1734
1751extern val_value_t *
1753 const xmlChar *modname,
1754 const xmlChar *leafname,
1755 int32 leafval,
1756 status_t *res);
1757
1758
1775extern val_value_t *
1777 const xmlChar *modname,
1778 const xmlChar *leafname,
1779 uint64 leafval,
1780 status_t *res);
1781
1782
1799extern val_value_t *
1801 const xmlChar *modname,
1802 const xmlChar *leafname,
1803 int64 leafval,
1804 status_t *res);
1805
1806
1827extern val_value_t *
1829 const xmlChar *modname,
1830 const xmlChar *leafname,
1831 const val_idref_t *leafval,
1832 status_t *res);
1833
1834
1848extern val_value_t *
1850 const xmlChar *modname,
1851 const xmlChar *leafname,
1852 const ncx_list_t *listval,
1853 status_t *res);
1854
1855
1869extern val_value_t *
1871 const xmlChar *modname,
1872 const xmlChar *leafname,
1873 boolean boolval,
1874 status_t *res);
1875
1876
1890extern val_value_t *
1892 const xmlChar *modname,
1893 const xmlChar *leafname,
1894 boolean boolval,
1895 status_t *res);
1896
1897
1913extern val_value_t *
1914 agt_make_object2 (obj_template_t *parentobj,
1915 const xmlChar *modname,
1916 const xmlChar *objname,
1917 status_t *res);
1918
1919
1941extern val_value_t *
1942 agt_make_virtual_leaf2 (obj_template_t *parentobj,
1943 const xmlChar *modname,
1944 const xmlChar *leafname,
1945 getcb_fn_t callbackfn,
1946 status_t *res);
1947
1948
1962extern ncx_cfg_t
1964
1965
1975extern boolean
1976 agt_module_in_cli_valset (const xmlChar *modname);
1977
1978
1986extern void
1987 agt_set_basic_withdef_enabled (void);
1988
1989
1990
2000extern boolean
2002
2003
2015extern op_editop_t
2016 agt_cvt_editop (op_editop_t editop,
2017 const val_value_t *newval,
2018 const val_value_t *curval);
2019
2020
2030extern op_editop_t
2031 agt_cvt_editop_acm (op_editop_t editop,
2032 const val_value_t *newval,
2033 const val_value_t *curval);
2034
2035
2046extern op_editop_t
2047 agt_cvt_editop_ex (op_editop_t editop,
2048 const val_value_t *newval,
2049 const val_value_t *curval);
2050
2051
2062extern int
2063 agt_connect_client (const xmlChar *hostname,
2064 uint16_t port);
2065
2066
2067
2079extern int
2080 agt_connect_udp_client (const xmlChar *hostname,
2081 uint16_t port,
2082 boolean *is_ipv6);
2083
2084
2101extern status_t
2103 val_value_t *err_value,
2104 val_value_t **retval);
2105
2106
2115extern uint32
2117
2118
2129extern val_value_t *
2131
2132
2141extern obj_template_t *
2143
2144
2145
2154extern obj_template_t *
2156
2157
2166extern const xmlChar*
2168
2169
2170#ifdef PTHREADS
2180extern boolean
2181 agt_get_ok_for_nolock (rpc_msg_t *msg);
2182
2183
2193extern boolean
2194 agt_getbulk_ok_for_nolock (const xmlChar *pathstr);
2195
2196#endif // PTHREADS
2197
2198
2209extern boolean
2211
2212
2221extern const xmlChar *
2223
2224
2233extern agt_crl_mode_t
2234 agt_crl_mode_enum (const xmlChar *crl_mode);
2235
2236
2248extern val_nodetest_fn_t
2249 agt_util_get_testfn (xml_msg_hdr_t *msg,
2250 boolean getop);
2251
2252
2253
2270extern status_t
2271 agt_fill_dummy_method (const xmlChar *modname,
2272 const xmlChar *rpcname,
2273 xml_node_t *node,
2274 obj_template_t **rpcobj);
2275
2276
2292extern yang_patch_cb_t *
2293 agt_make_yang_patch_cb (const xmlChar *patch_id,
2294 const xmlChar *the_comment,
2295 const xmlChar *patch_root,
2297 uint32 included_changes);
2298
2299
2316extern yang_patch_cb_t *
2317 agt_make_yang_patch_cb_targobj (const xmlChar *patch_id,
2318 const xmlChar *the_comment,
2319 const xmlChar *patch_root,
2321 uint32 included_changes,
2322 obj_template_t *targobj);
2323
2324
2339extern yang_patch_cb_t *
2340 agt_make_yang_patch_cb_file (const xmlChar *patch_id,
2341 const xmlChar *the_comment,
2342 const xmlChar *patch_root,
2343 const xmlChar *filespec,
2344 boolean is_binary);
2345
2346
2362extern boolean
2363 agt_check_included_changes (agt_cfg_transaction_t *txcb,
2364 uint32 included_changes,
2365 obj_template_t *targobj);
2366
2367
2368
2369
2370
2386extern status_t
2387 agt_add_leafy (val_value_t *parentval,
2388 const xmlChar *modname,
2389 const xmlChar *leafname,
2390 const xmlChar *leafstrval);
2391
2392
2408extern status_t
2409 agt_add_uint_leafy (val_value_t *parentval,
2410 const xmlChar *modname,
2411 const xmlChar *leafname,
2412 uint32 leafval);
2413
2414
2415
2431extern status_t
2432 agt_add_int_leafy (val_value_t *parentval,
2433 const xmlChar *modname,
2434 const xmlChar *leafname,
2435 int32 leafval);
2436
2437
2453extern status_t
2455 const xmlChar *modname,
2456 const xmlChar *leafname,
2457 uint64 leafval);
2458
2459
2475extern status_t
2476 agt_add_int64_leafy (val_value_t *parentval,
2477 const xmlChar *modname,
2478 const xmlChar *leafname,
2479 int64 leafval);
2480
2481
2482
2498extern status_t
2500 const xmlChar *modname,
2501 const xmlChar *leafname,
2502 boolean boolval);
2503
2504
2523extern status_t
2524 agt_add_idref_leafy (val_value_t *parentval,
2525 const xmlChar *modname,
2526 const xmlChar *leafname,
2527 const val_idref_t *leafval);
2528
2529
2548extern status_t
2549 agt_add_bits_leafy (val_value_t *parentval,
2550 const xmlChar *modname,
2551 const xmlChar *leafname,
2552 const ncx_list_t *leafval);
2553
2554
2555
2556
2557/***** APIS USED FOR NESTED NOTIFICATION GENERATION ****/
2558
2559
2570extern val_value_t *
2571 agt_make_string_key (const xmlChar *leafval);
2572
2573
2574
2585extern val_value_t *
2586 agt_make_uint_key (uint32 leafval);
2587
2588
2589
2600extern val_value_t *
2601 agt_make_int_key (int32 leafval);
2602
2603
2604
2615extern val_value_t *
2616 agt_make_uint64_key (uint64 leafval);
2617
2618
2619
2630extern val_value_t *
2631 agt_make_int64_key (int64 leafval);
2632
2633
2634
2645extern val_value_t *
2646 agt_make_boolean_key (boolean leafval);
2647
2648
2659extern val_value_t *
2660 agt_make_idref_key (const val_idref_t *leafval);
2661
2662
2673extern val_value_t *
2674 agt_make_bits_key (const ncx_list_t *leafval);
2675
2676
2677/*
2678* @brief make a generic key leaf node from a union
2679*
2680* - OK for SIL or SIL-SA
2681*
2682* @param leafval union version of value to set for key leaf
2683* @return malloced value node
2684*/
2685extern val_value_t *
2686 agt_make_union_key (const val_value_t *leafval);
2687
2688
2699extern status_t
2700 agt_get_sid_set_id (xmlChar *buff,
2701 uint32 bufflen);
2702
2703
2704
2705
2741extern status_t
2742 agt_xpath_force_true (struct xpath_pcb_t_ *pcb,
2743 val_value_t *context,
2744 val_value_t *docroot,
2745 boolean *result);
2746
2747
2784extern status_t
2785 agt_xpath_example (struct xpath_pcb_t_ *pcb,
2786 val_value_t *context,
2787 val_value_t *docroot,
2788 boolean *result);
2789
2790
2791
2808extern agt_edit_parms_cb_t *
2809 agt_new_edit_parms (const xmlChar *patch_id_str,
2810 boolean system_edit,
2811 boolean skip_sil,
2812 const xmlChar *comment);
2813
2814
2831extern status_t
2832 agt_init_edit_parms (agt_edit_parms_cb_t *parms,
2833 const xmlChar *patch_id_str,
2834 boolean system_edit,
2835 boolean skip_sil,
2836 const xmlChar *comment);
2837
2838
2839
2848extern void
2849 agt_clean_edit_parms (agt_edit_parms_cb_t *parms);
2850
2851
2860extern void
2861 agt_free_edit_parms (agt_edit_parms_cb_t *parms);
2862
2863
2887extern status_t
2889 const xmlChar *edit_id_str,
2890 const xmlChar *edit_target,
2891 const xmlChar *edit_operation,
2892 const xmlChar *edit_xml_value,
2893 const xmlChar *insert_point,
2894 const xmlChar *insert_where);
2895
2896
2916extern status_t
2918 agt_edit_parms_cb_t *parms);
2919
2920
2921/*
2922* @brief create malloced struct with SA Push parms
2923*
2924* @return malloced struct
2925* @see agt_free_sa_push_parms
2926*/
2927extern agt_sa_push_parms_t *
2928 agt_new_sa_push_parms (void);
2929
2930
2931/*
2932* @brief free malloced SA parms
2933*
2934* @param sa_parms malloced struct to free
2935* @see agt_new_sa_push_parms
2936*/
2937extern void
2938 agt_free_sa_push_parms (agt_sa_push_parms_t *sa_parms);
2939
2948extern agt_sa_push_parms_t *
2950 status_t *res);
2951
2952
2953
2954
2955
2975extern status_t
2976 agt_get_bulktest (const xml_msg_hdr_t *msg,
2977 const obj_template_t *obj,
2978 const xpath_pcb_t **retpcb,
2979 const xmlChar **retexpr);
2980
2981
2987extern void
2989
2990
3000extern val_value_t *
3002 xmlns_id_t nsid,
3003 const xmlChar *name,
3004 status_t *retres);
3005
3006
3010#ifdef __cplusplus
3011} /* end extern 'C' */
3012#endif
3013
3014#endif /* _H_agt_util */
Multi-Protocol Network Management Server.
Manage Server configuration edit transactions.
NCX configuration database manager.
dlq provides general double-linked list and queue support:
GET1 and GET2 Callback Support.
agt_crl_mode_t
server TLS CRL mode
Definition: agt.h:850
val_value_t * agt_make_boolean_leaf(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, boolean boolval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_BOOL)
Definition: agt_util.c:6698
obj_template_t * agt_get_rpc_output_obj(rpc_msg_t *msg)
Get the rpc output object template.
Definition: agt_util.c:7434
boolean agt_modified_since(val_value_t *val, time_t *timerec)
Check if the timestamp for the object is later then the specified timestamp.
Definition: agt_util.c:6292
boolean agt_notifications_enabled(void)
Check if notifications are enabled.
Definition: agt_util.c:6315
val_value_t * agt_make_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:6337
status_t agt_add_int64_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, int64 leafval)
make a child node from a int64 and add to parent.
Definition: agt_util.c:8536
status_t agt_check_max_access(val_value_t *newval, boolean cur_exists)
Check if the max-access for a parameter is exceeded.
Definition: agt_util.c:3571
status_t agt_add_uint64_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, uint64 leafval)
make a child node from a uint64 and add to parent.
Definition: agt_util.c:8482
boolean agt_backups_enabled(void)
Check if the backup commands are enabled.
Definition: agt_util.c:5872
val_value_t * agt_make_idref_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const val_idref_t *leafval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:6582
val_value_t * agt_make_uint_key(uint32 leafval)
make a generic key leaf node from a uint
Definition: agt_util.c:8786
val_value_t * agt_make_int_leaf(obj_template_t *parentobj, const xmlChar *leafname, int32 leafval, status_t *res)
make an int32 val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:4248
void agt_record_error_errinfo(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path, const ncx_errinfo_t *errinfo)
Generate an rpc_err_rec_t and save it in the msg Use provided error fields.
Definition: agt_util.c:2498
status_t agt_xpath_force_true(struct xpath_pcb_t_ *pcb, val_value_t *context, val_value_t *docroot, boolean *result)
XPath Boolean EVAL Replacement Callback.
Definition: agt_util.c:9091
val_value_t * agt_make_configval(agt_cfg_transaction_t *txcb, xmlns_id_t nsid, const xmlChar *name, status_t *retres)
Make a "<config>" subtree with edits.
Definition: agt_util.c:10007
val_value_t * agt_make_uint_leaf(obj_template_t *parentobj, const xmlChar *leafname, uint32 leafval, status_t *res)
make a uint32 val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:4229
obj_template_t * agt_get_action_output_obj(val_value_t *actionval)
Get the action output object template.
Definition: agt_util.c:7461
val_value_t * agt_make_virtual_leaf(obj_template_t *parentobj, const xmlChar *leafname, getcb_fn_t callbackfn, status_t *res)
make a val_value_t struct for a specified virtual leaf or leaf-list
Definition: agt_util.c:4399
status_t agt_add_bits_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, const ncx_list_t *leafval)
make a child node from a ncx_list_t struct (bits) and add to parent.
Definition: agt_util.c:8708
void agt_record_error(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
Generate an rpc_err_rec_t and save it in the msg.
Definition: agt_util.c:2389
status_t agt_apply_patch_edit(ses_cb_t *scb, agt_edit_parms_cb_t *parms)
SIL version of the db_api_send_edt_full2 API.
Definition: agt_util.c:9391
status_t agt_add_idref_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, const val_idref_t *leafval)
make a child node from a val_idref_t struct and add to parent.
Definition: agt_util.c:8648
xpath_pcb_t * agt_new_xpath_pcb(ses_cb_t *scb, const xmlChar *expr, status_t *res)
Get a new XPath parser control block and set up the server variable bindings.
Definition: agt_util.c:4706
val_value_t * agt_make_int64_key(int64 leafval)
make a generic key leaf node from an int64
Definition: agt_util.c:8860
val_value_t * agt_make_list(obj_template_t *parentobj, const xmlChar *listname, status_t *res)
make a val_value_t struct for a specified list
Definition: agt_util.c:4342
const val_value_t * agt_get_parmval(const xmlChar *parmname, rpc_msg_t *msg)
Get the identified val_value_t for a given parameter.
Definition: agt_util.c:2344
void agt_print_error_headers(void)
Print the error number and error message for each error to STDOUT or the logfile; Used for doxygen he...
Definition: agt_util.c:9750
xmlChar * agt_get_startup_filespec(status_t *res)
Figure out where to store the startup file.
Definition: agt_util.c:4808
boolean agt_module_in_cli_valset(const xmlChar *modname)
Check if there is a module=foo parameter in the CLI parameter set.
Definition: agt_util.c:6907
agt_crl_mode_t agt_crl_mode_enum(const xmlChar *crl_mode)
Get the enum for the CRL mode string.
Definition: agt_util.c:7856
val_value_t * agt_make_object(obj_template_t *parentobj, const xmlChar *objname, status_t *res)
make a val_value_t struct for a specified node
Definition: agt_util.c:4368
val_value_t * agt_make_leaf(obj_template_t *parentobj, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
make a string val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:4210
val_value_t * agt_get_rpc_input(rpc_msg_t *msg)
Get the rpc input value node.
Definition: agt_util.c:7406
val_value_t * agt_make_int64_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, int64 leafval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:6544
val_value_t * agt_make_object2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *objname, status_t *res)
make a val_value_t struct for a specified node
Definition: agt_util.c:6767
void agt_record_attr_error(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_attr_t *xmlattr, const xml_node_t *xmlnode, const xmlChar *badns, ncx_node_t nodetyp, void *errnode)
Generate an rpc_err_rec_t and save it in the msg.
Definition: agt_util.c:2609
val_value_t * agt_make_uint_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, uint32 leafval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:6444
const xmlChar * agt_crl_mode_str(agt_crl_mode_t crl_mode)
Get the string for the CRL mode enum.
Definition: agt_util.c:7825
boolean agt_op_ok_for_maintenance_mode(const obj_template_t *rpcobj)
Check if the operation is OK for maintenance mode.
Definition: agt_util.c:7732
val_value_t * agt_make_int64_leaf(obj_template_t *parentobj, const xmlChar *leafname, int64 leafval, status_t *res)
make an int64 val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:4286
val_value_t * agt_make_bits_key(const ncx_list_t *leafval)
make a generic key leaf node from a bits struct
Definition: agt_util.c:8961
val_value_t * agt_make_empty_leaf(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, boolean boolval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_EMPTY)
Definition: agt_util.c:6730
void agt_record_warning(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_parm, ncx_node_t nodetyp, void *error_path, const ncx_errinfo_t *errinfo)
Generate an rpc_err_rec_t and save it in the msg.
Definition: agt_util.c:2557
const xmlChar * agt_getTermReasonStr(ses_term_reason_t termreason)
Convert the termination reason enum to a string.
Definition: agt_util.c:7491
val_value_t * agt_make_string_key(const xmlChar *leafval)
make a generic key leaf node from a string
Definition: agt_util.c:8760
status_t agt_find_in_datastore(ncx_cfg_t cfg_id, val_value_t *err_value, val_value_t **retval)
Find the node (should be from an <edit-config> content node) in the specified datastore.
Definition: agt_util.c:7305
status_t agt_xpath_example(struct xpath_pcb_t_ *pcb, val_value_t *context, val_value_t *docroot, boolean *result)
XPath Boolean EVAL Replacement Callback.
Definition: agt_util.c:9110
val_value_t * agt_make_boolean_key(boolean leafval)
make a generic key leaf node from a boolean
Definition: agt_util.c:8885
val_value_t * agt_make_int_key(int32 leafval)
make a generic key leaf node from an int
Definition: agt_util.c:8810
uint32 agt_get_error_count(rpc_msg_t *msg)
Get the current number of errors in the rpc msg Q.
Definition: agt_util.c:7379
void agt_record_error_obj(ses_cb_t *scb, xml_msg_hdr_t *msghdr, status_t res, obj_template_t *errobj, const xmlChar *badval)
Generate an rpc_err_rec_t and save it in the msg Use the provided object for <rpc-error> fields.
Definition: agt_util.c:2428
val_value_t * agt_make_idref_leaf(obj_template_t *parentobj, const xmlChar *leafname, const val_idref_t *leafval, status_t *res)
make an identityref val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:4315
status_t agt_add_patch_edit(agt_edit_parms_cb_t *parms, const xmlChar *edit_id_str, const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *insert_point, const xmlChar *insert_where)
Create an edit request and add to YANG Patch in progress.
Definition: agt_util.c:9299
agt_sa_push_parms_t * agt_cvt_val2parms(val_value_t *reqval, status_t *res)
Fill in sa_push_parms from a message val_value_t.
Definition: agt_util.c:9534
status_t agt_add_mod_defaults(val_value_t *val)
Add defaults to the value tree.
Definition: agt_util.c:5130
val_value_t * agt_get_key_value(val_value_t *startval, val_value_t **lastkey)
Get the next expected key value in the ancestor chain.
Definition: agt_util.c:5459
val_value_t * agt_make_uint64_key(uint64 leafval)
make a generic key leaf node from a uint64
Definition: agt_util.c:8835
boolean agt_check_delete_all_allowed(obj_template_t *testobj)
Check if the delete-all or remove-all operation is enabled for for specified object.
Definition: agt_util.c:6978
val_value_t * agt_make_union_leaf(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const val_value_t *leafval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list use a val_value_t for a union
Definition: agt_util.c:6386
val_value_t * agt_make_int_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, int32 leafval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:6477
ncx_cfg_t agt_get_edit_config_id(rpc_msg_t *rpcmsg)
Get the enum ID of the configuration that is being edited.
Definition: agt_util.c:6882
status_t agt_add_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, const xmlChar *leafstrval)
make a child node from a string and add to parent.
Definition: agt_util.c:8320
val_value_t * agt_make_bits_leaf(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const ncx_list_t *listval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_BITS or NCX_BT_SLIST)
Definition: agt_util.c:6658
status_t agt_add_boolean_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, boolean boolval)
make a child node from a boolean and add to parent.
Definition: agt_util.c:8591
xmlChar * agt_make_srid_filespec(const xmlChar *basestr, const xmlChar *patstr, const xmlChar *valstr)
Make a filespec string needed for a filespec with SRID in it.
Definition: agt_util.c:4729
val_value_t * agt_make_uint64_leaf(obj_template_t *parentobj, const xmlChar *leafname, uint64 leafval, status_t *res)
make a uint64 val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:4267
status_t agt_add_int_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, int32 leafval)
make a child node from a int32 and add to parent.
Definition: agt_util.c:8428
val_value_t * agt_make_idref_key(const val_idref_t *leafval)
make a generic key leaf node from an idref struct
Definition: agt_util.c:8906
val_value_t * agt_make_uint64_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, uint64 leafval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:6510
status_t agt_add_uint_leafy(val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, uint32 leafval)
make a child node from a uint32 and add to parent.
Definition: agt_util.c:8374
status_t(* getcb_fn_t)(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
GET1 Callback function for agent node get handler.
Definition: getcb.h:666
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
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
status_t
global error return code
Definition: status_enum.h:219
ses_term_reason_t
Session Termination reason.
Definition: ses.h:491
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_node_t
NCX Internal Node Types.
Definition: ncxtypes.h:460
uint32 ncx_etag_t
The ETag used in RESTCONF messages is the lower 32 bits of a ncx_transaction_id_t.
Definition: ncxtypes.h:778
ncx_cfg_t
hardwire the 3 standard configs
Definition: ncxtypes.h:571
ncx_iqual_t
The instance qualifier types are borrowed from ABNF and RelaxNG.
Definition: ncxtypes.h:483
ncx_protocol_t
NCX session protocol versions supported.
Definition: ncxtypes.h:1037
ncx_layer_t
Enumeration of NETCONF protocol layers.
Definition: ncxtypes.h:530
ncx_withdefaults_t
enum for with-defaults enum values
Definition: ncxtypes.h:1333
Contains NCX constants.
YANG module data structures Many internal representations of YANG module constructs.
Data Object Support.
NETCONF protocol remote procedure call common definitions.
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
Transaction Control Block.
Definition: agt_cfg.h:235
struct to contain all agt_send_edit parameters
Definition: agt.h:2165
SIL-SA PUSH Parameter Block.
Definition: agt.h:902
struct representing 1 configuration database
Definition: cfg.h:229
YANG error info statement struct used to override default error handling in the server.
Definition: ncxtypes.h:1421
header for a NCX List
Definition: ncxtypes.h:895
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1181
One YANG data-def-stmt.
Definition: obj.h:1284
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:185
Session Control Block.
Definition: ses.h:759
one QName for the NCX_BT_IDREF value
Definition: val.h:897
one value to match one type
Definition: val.h:1024
represents one attribute
Definition: xml_util.h:159
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:476
gather node data into a simple struct.
Definition: xml_util.h:207
XPath parser control block.
Definition: xpath.h:754
XPath expression result.
Definition: xpath.h:705
One YANG Patch Request.
Definition: yang_patch.h:155
Value Node Basic Support.
XML and JSON Message send and receive support.
XML Utilities.
Schema and data model Xpath search support.
YANG Patch Media Type.