yumapro  21.10T-8
YumaPro SDK
agt_cfg.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2022, 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_cfg
13 #define _H_agt_cfg
14 
15 /* FILE: agt_cfg.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 22dec11 abb begun; split out from ncx/rpc ...
37 
38 */
39 
40 #include <time.h>
41 
42 #ifndef _H_agt
43 #include "agt.h"
44 #endif
45 
46 #ifndef _H_cfg
47 #include "cfg.h"
48 #endif
49 
50 #ifndef _H_dlq
51 #include "dlq.h"
52 #endif
53 
54 #ifndef _H_ncxtypes
55 #include "ncxtypes.h"
56 #endif
57 
58 #ifndef _H_op
59 #include "op.h"
60 #endif
61 
62 #ifndef _H_status
63 #include "status.h"
64 #endif
65 
66 #ifndef _H_val
67 #include "val.h"
68 #endif
69 
70 #ifndef _H_xpath
71 #include "xpath.h"
72 #endif
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
78 /********************************************************************
79 * *
80 * C O N S T A N T S *
81 * *
82 *********************************************************************/
83 
84 /* header only */
85 
109 #define AGT_CFG_SET_VALIDATE_DEF(C) (C)->is_validate_def = TRUE
110 
112 #define AGT_CFG_GET_VALIDATE_DEF(C) (C)->is_validate_def
113 
115 #define AGT_CFG_SET_SKIP_SIL(C) (C)->skip_sil = TRUE
116 
118 #define AGT_CFG_GET_SKIP_SIL(C) (C)->skip_sil
119 
121 #define AGT_CFG_SET_SKIP_SIL_PARTIAL(C) (C)->skip_sil_partial = TRUE
122 
124 #define AGT_CFG_GET_SKIP_SIL_PARTIAL(C) (C)->skip_sil_partial
125 
127 #define AGT_CFG_SET_SKIP_SAVE(C) (C)->skip_save = TRUE
128 
130 #define AGT_CFG_GET_SKIP_SAVE(C) (C)->skip_save
131 
133 #define AGT_CFG_GET_COMMENT(C) (C)->comment
134 
136 #define AGT_CFG_SET_COMMENT(C,S) (C)->comment = S
137 
141 #define AGT_CFG_GET_TXCB(M) (M)->rpc_txcb
142 
144 #define AGT_CFG_SET_CUR_SILCALL(C,S) (C)->cur_silcall = S
145 
147 #define AGT_CFG_GET_CUR_SILCALL(C) (C)->cur_silcall
148 
150 #define AGT_CFG_SET_TOP_REPLACE(C) (C)->top_replace = TRUE
151 
153 #define AGT_CFG_IS_TOP_REPLACE(C) (C)->top_replace
154 
155 
156 /********************************************************************
157 * *
158 * T Y P E S *
159 * *
160 *********************************************************************/
161 
162 
164 typedef enum agt_cfg_edit_action_t_ {
167 
170 
173 
176 
179 
182 
186 
187 
189 typedef enum agt_cfg_edit_type_t_ {
194 
195 
224 typedef struct agt_cfg_transaction_t_ {
226  dlq_hdr_t qhdr;
227 
230 
232  xmlChar *txid_str;
233 
235  time_t timestamp;
236 
238  agt_cfg_edit_type_t edit_type;
239 
242 
245 
248 
251 
259 
261  boolean start_bad;
262 
264  boolean rootcheck;
265 
267  boolean rootcheck_done;
268 
270  boolean commitcheck;
271 
273  boolean is_validate;
274 
277 
279  boolean is_commit;
280 
282  boolean is_rollback;
283 
285  boolean is_unload;
286 
289 
291  boolean is_load;
292 
294  boolean is_transhook;
295 
297  boolean top_replace;
298 
301 
304 
306  boolean skip_sil;
307 
310 
312  boolean skip_save;
313 
315  boolean sethook_mode;
316 
319 
321  boolean skip_cb;
322 
324  boolean hook_merge;
325 
328 
331 
334 
337 
340 
343 
345  const xmlChar *comment;
346 
349  dlq_hdr_t undoQ; /* Q of agt_cfg_undo_rec_t */
350 
354  dlq_hdr_t auditQ; /* Q of agt_cfg_audit_rec_t */
355 
359  dlq_hdr_t deadnodeQ; /* Q of ncx_backptr to val_value_t */
360 
367  /* not used anymore. See def_reg implementation instead for
368  * must visit checks
369  */
370  // dlq_hdr_t xpath_visitQ; // backptr to agt_cfg_xpath_visit_t
371 
373  struct agt_cfg_nested_silcall_t_ *cur_silcall;
374 
379  dlq_hdr_t transhookQ;
380 
381 #ifdef WITH_YCONTROL
382 
385  dlq_hdr_t silcallQ;
386 
388  dlq_hdr_t silcall_undoQ;
389 
392 
394  boolean silcall_done;
395 
398 
401 
406  dlq_hdr_t added_silcallQ;
407 #endif // WITH_YCONTROL
408 
409 } YPACK agt_cfg_transaction_t;
410 
411 
425 typedef struct agt_cfg_nested_silcall_t_ {
427  dlq_hdr_t qhdr;
428 
431 
434 
437 
440 
443 
444  /* the newval is a backptr into the subtree
445  * that is really rooted in the undo record that is at
446  * the root of this edit.
447  */
448  val_value_t *newval;
449 
450  /* the curval is a backptr into the subtree
451  * that is really rooted in the undo record that is at
452  * the root of this edit.
453  */
454  val_value_t *curval;
455 
458 
460  dlq_hdr_t nested_silcallQ;
461 
463  struct agt_cfg_nested_silcall_t_ *parent;
464 
475 
477 
478 
497 typedef struct agt_cfg_undo_rec_t_ {
499  dlq_hdr_t qhdr;
500 
502  boolean free_curnode;
503 
506 
508  boolean edit2_merge;
509 
512 
515 
518 
523 
525  boolean added_edit;
526 
528  boolean skip_cb;
529 
531  boolean is_insert;
532 
535 
538 
540  agt_cfg_edit_action_t edit_action;
541 
544 
547 
550 
553 
556 
559 
562 
565 
567  agt_cfg_nested_silcall_t *cur_silcall;
568 
575 
581  xmlChar *save_path;
582 
590  dlq_hdr_t extra_deleteQ;
600  dlq_hdr_t nested_silcallQ;
611  dlq_hdr_t child_undoQ;
615 
618 
621 
624 
627 
628 #ifdef WITH_YCONTROL
629 
632 #endif // WITH_YCONTROL
633 
635  struct agt_cfg_undo_rec_t_ *orig_rev_undo;
636 
637 } YPACK agt_cfg_undo_rec_t;
638 
639 
640 #ifdef WITH_YCONTROL
641 
643 typedef struct agt_cfg_child_silcall_t_ {
645  dlq_hdr_t qhdr;
646 
649 
652 
655 
657 
658 
660 typedef struct agt_cfg_silcall_t_ {
662  dlq_hdr_t qhdr;
663 
666 
669 
672 
674  dlq_hdr_t *subsysQ;
675 
677  dlq_hdr_t keyptrQ;
678 
680  boolean hook_edit;
681 
684 
688  dlq_hdr_t child_editQ;
689 
690 } YPACK agt_cfg_silcall_t;
691 #endif // WITH_YCONTROL
692 
693 
697 typedef struct agt_cfg_audit_rec_t_ {
699  dlq_hdr_t qhdr;
700 
702  xmlChar *target;
703 
706 
712 
715 
716 } YPACK agt_cfg_audit_rec_t;
717 
718 
720 typedef struct agt_cfg_commit_test_t_ {
722  dlq_hdr_t qhdr;
723 
726 
729 
732 
735 
738 
740  uint32 testflags;
741 } YPACK agt_cfg_commit_test_t;
742 
743 
745 typedef struct agt_cfg_xpath_visit_t_ {
747  dlq_hdr_t qhdr;
748 
751 
754 } YPACK agt_cfg_xpath_visit_t;
755 
756 
758 typedef struct agt_cfg_trans_hook_t_ {
760  dlq_hdr_t qhdr;
761 
764 
767 
770 
773 
775  boolean subtree_mode;
776 } YPACK agt_cfg_trans_hook_t;
777 
778 
782 /********************************************************************
783 * *
784 * F U N C T I O N S *
785 * *
786 *********************************************************************/
787 
819 extern agt_cfg_transaction_t *
821  agt_cfg_edit_type_t edit_type,
822  boolean rootcheck,
823  boolean is_validate,
824  boolean is_rollback,
825  status_t *res);
826 
827 
851 extern agt_cfg_transaction_t *
853  agt_cfg_edit_type_t edit_type,
854  boolean rootcheck,
855  boolean is_validate,
856  boolean is_rollback,
857  boolean no_cb,
858  status_t *res);
859 
860 
885 agt_cfg_transaction_t *
887  agt_cfg_edit_type_t edit_type,
888  boolean rootcheck,
889  boolean is_validate,
890  boolean is_rollback,
891  boolean no_cb,
892  ses_cb_t *scb,
893  status_t *res);
894 
895 
903 extern status_t
905  agt_cfg_transaction_t *txcb);
906 
907 
934 extern agt_cfg_transaction_t *
936  agt_cfg_edit_type_t edit_type,
937  boolean rootcheck,
938  boolean is_validate,
939  boolean is_rollback,
940  boolean no_cb,
941  boolean no_silsa_cb,
942  ses_cb_t *scb,
943  status_t *res);
944 
945 
974 extern agt_cfg_transaction_t *
976  agt_cfg_edit_type_t edit_type,
977  boolean rootcheck,
978  boolean is_validate,
979  boolean is_rollback,
980  boolean no_silsa_cb,
982  ses_cb_t *scb,
983  status_t *res);
984 
985 
991 extern void
992  agt_cfg_free_transaction (agt_cfg_transaction_t *txcb);
993 
994 
1002 extern status_t
1003  agt_cfg_init_transactions (const xmlChar *txidfile,
1004  boolean foundfile);
1005 
1006 
1012 extern void
1013  agt_cfg_cleanup_transactions (const xmlChar *txidfile);
1014 
1015 
1022 extern ncx_transaction_id_t
1024 
1025 
1031 extern agt_cfg_undo_rec_t *
1032  agt_cfg_new_undorec (void);
1033 
1034 
1040 extern void
1041  agt_cfg_init_undorec (agt_cfg_undo_rec_t *undo);
1042 
1043 
1049 extern void
1050  agt_cfg_free_undorec (agt_cfg_undo_rec_t *undo);
1051 
1052 
1064 extern void
1065  agt_cfg_clean_undorec (agt_cfg_undo_rec_t *undo);
1066 
1067 
1075 extern agt_cfg_audit_rec_t *
1076  agt_cfg_new_auditrec (const xmlChar *target,
1077  op_editop_t editop);
1078 
1079 
1085 extern void
1086  agt_cfg_free_auditrec (agt_cfg_audit_rec_t *auditrec);
1087 
1088 
1094 extern agt_cfg_commit_test_t *
1095  agt_cfg_new_commit_test (void);
1096 
1097 
1103 extern void
1104  agt_cfg_free_commit_test (agt_cfg_commit_test_t *commit_test);
1105 
1106 
1112 extern void
1113  agt_cfg_set_transaction_commit (agt_cfg_transaction_t *txcb);
1114 
1115 
1121 extern void
1122  agt_cfg_set_transaction_unload (agt_cfg_transaction_t *txcb);
1123 
1124 
1131 extern boolean
1132  agt_cfg_transaction_is_unload (agt_cfg_transaction_t *txcb);
1133 
1134 
1140 extern void
1141  agt_cfg_force_full_root_check (agt_cfg_transaction_t *txcb);
1142 
1143 
1149 extern void
1151 
1152 
1153 #ifdef WITH_YCONTROL
1154 
1164 extern agt_cfg_silcall_t *
1166  val_value_t *newval,
1167  val_value_t *curval,
1168  dlq_hdr_t *subsysQ);
1169 
1170 
1176 extern void
1177  agt_cfg_free_silcall (agt_cfg_silcall_t *silcall);
1178 
1179 
1194 extern status_t
1195  agt_cfg_add_hook_silcall (agt_cfg_transaction_t *txcb,
1196  op_editop_t editop,
1197  val_value_t *newval,
1198  val_value_t *curval,
1199  dlq_hdr_t *subsysQ,
1200  val_value_t *callval,
1201  agt_hook_type_t hook_type);
1202 
1203 
1217 extern status_t
1218  agt_cfg_add_silcall (agt_cfg_transaction_t *txcb,
1219  op_editop_t editop,
1220  val_value_t *newval,
1221  val_value_t *curval,
1222  dlq_hdr_t *subsysQ,
1223  val_value_t *callval);
1224 
1225 
1240 extern status_t
1241  agt_cfg_add_edit2_silcall (agt_cfg_transaction_t *txcb,
1242  op_editop_t editop,
1243  val_value_t *newval,
1244  val_value_t *curval,
1245  dlq_hdr_t *subsysQ,
1246  val_value_t *callval);
1247 
1248 #endif // WITH_YCONTROL
1249 
1250 
1269 extern status_t
1270  agt_cfg_add_nested_silcall (agt_cfg_transaction_t *txcb,
1271  agt_cfg_undo_rec_t *undo,
1272  op_editop_t editop,
1273  val_value_t *newval,
1274  val_value_t *curval,
1275  obj_template_t *callback_obj,
1276  boolean indelete,
1277  boolean in_reverse_delete,
1278  agt_cfg_nested_silcall_t **result);
1279 
1280 
1294 extern agt_cfg_undo_rec_t *
1295  agt_cfg_find_undo_node (agt_cfg_transaction_t *txcb,
1296  val_value_t *newnode,
1297  val_value_t *curnode);
1298 
1299 
1309 extern agt_cfg_undo_rec_t *
1310  agt_cfg_first_child_edit (agt_cfg_transaction_t *txcb,
1311  val_value_t *newnode,
1312  val_value_t *curnode);
1313 
1314 
1322 extern agt_cfg_undo_rec_t *
1323  agt_cfg_next_child_edit (agt_cfg_undo_rec_t *curedit);
1324 
1325 
1337 extern void
1338  agt_cfg_child_edit_fields (agt_cfg_undo_rec_t *child_undo,
1339  op_editop_t *editop,
1340  val_value_t **newval,
1341  val_value_t **curval);
1342 
1343 
1349 extern void
1350  agt_cfg_dump_undo (agt_cfg_undo_rec_t *undo);
1351 
1352 
1358 extern void
1359  agt_cfg_restore_newnode (agt_cfg_undo_rec_t *undo);
1360 
1361 
1370 extern boolean
1371  agt_cfg_use_child_undo (agt_cfg_undo_rec_t *undo,
1372  agt_cfg_undo_rec_t *child_undo);
1373 
1374 
1381 extern agt_cfg_undo_rec_t *
1382  agt_cfg_first_undo (agt_cfg_transaction_t *txcb);
1383 
1384 
1392 extern agt_cfg_undo_rec_t *
1393  agt_cfg_next_undo (agt_cfg_transaction_t *txcb,
1394  agt_cfg_undo_rec_t *cur_undo);
1395 
1396 
1403 extern agt_cfg_undo_rec_t *
1404  agt_cfg_last_undo (agt_cfg_transaction_t *txcb);
1405 
1406 
1414 extern agt_cfg_undo_rec_t *
1415  agt_cfg_prev_undo (agt_cfg_transaction_t *txcb,
1416  agt_cfg_undo_rec_t *cur_undo);
1417 
1418 
1425 extern agt_cfg_undo_rec_t *
1426  agt_cfg_first_child_undo (agt_cfg_undo_rec_t *undo);
1427 
1428 
1435 extern agt_cfg_undo_rec_t *
1436  agt_cfg_next_child_undo (agt_cfg_undo_rec_t *cur_undo);
1437 
1438 
1452 extern agt_cfg_undo_rec_t *
1453  agt_cfg_find_child_undo_node (agt_cfg_undo_rec_t *parent_undo,
1454  val_value_t *newnode,
1455  val_value_t *curnode);
1456 
1457 
1469 extern boolean
1471  val_value_t *next_parent);
1472 
1473 
1484 extern agt_cfg_undo_rec_t *
1485  agt_cfg_find_undo_node_slow (agt_cfg_transaction_t *txcb,
1486  val_value_t *newnode,
1487  val_value_t *curnode);
1488 
1489 
1509 extern boolean
1510  agt_cfg_find_duplicate_silcall (agt_cfg_transaction_t *txcb,
1511  val_value_t *newnode,
1512  val_value_t *curnode);
1513 
1514 
1525 extern boolean
1526  agt_cfg_check_parent_edits (agt_cfg_transaction_t *txcb,
1527  val_value_t *newnode);
1528 
1529 
1539 extern agt_cfg_trans_hook_t *
1541  val_value_t *newval,
1542  val_value_t *curval,
1543  op_editop_t editop);
1544 
1545 
1551 extern void
1552  agt_cfg_free_trans_hook (agt_cfg_trans_hook_t *hook);
1553 
1554 
1561 extern agt_cfg_trans_hook_t *
1562  agt_cfg_first_trans_hook (agt_cfg_transaction_t *txcb);
1563 
1564 
1571 extern agt_cfg_trans_hook_t *
1572  agt_cfg_next_trans_hook (agt_cfg_trans_hook_t *cur_hook);
1573 
1574 
1581 extern agt_cfg_trans_hook_t *
1582  agt_cfg_last_trans_hook (agt_cfg_transaction_t *txcb);
1583 
1584 
1591 extern agt_cfg_trans_hook_t *
1592  agt_cfg_prev_trans_hook (agt_cfg_trans_hook_t *cur_hook);
1593 
1594 
1607 extern boolean
1608  agt_cfg_check_hook_created (agt_cfg_transaction_t *txcb,
1609  val_value_t *newval,
1610  val_value_t *curval);
1611 
1612 
1620 extern agt_cfg_undo_rec_t *
1621  agt_cfg_first_active_undo (agt_cfg_transaction_t *txcb);
1622 
1623 
1633 extern agt_cfg_undo_rec_t *
1634  agt_cfg_next_active_undo (agt_cfg_transaction_t *txcb,
1635  agt_cfg_undo_rec_t *cur_undo);
1636 
1637 
1646 extern agt_cfg_undo_rec_t *
1647  agt_cfg_last_active_undo (agt_cfg_transaction_t *txcb);
1648 
1649 
1659 extern agt_cfg_undo_rec_t *
1660  agt_cfg_prev_active_undo (agt_cfg_transaction_t *txcb,
1661  agt_cfg_undo_rec_t *cur_undo);
1662 
1663 
1670 extern void
1671  agt_cfg_clear_config_txid (agt_cfg_transaction_t *txcb,
1672  cfg_template_t *cfg);
1673 
1674 
1684 extern agt_cfg_undo_rec_t *
1685  agt_cfg_last_active_child_undo (agt_cfg_transaction_t *txcb,
1686  agt_cfg_undo_rec_t *parent_undo);
1687 
1688 
1698 extern agt_cfg_undo_rec_t *
1699  agt_cfg_prev_active_child_undo (agt_cfg_transaction_t *txcb,
1700  agt_cfg_undo_rec_t *cur_undo);
1701 
1702 
1715 extern agt_cfg_undo_rec_t *
1716  agt_cfg_find_undo_node_ascendant (agt_cfg_transaction_t *txcb,
1717  val_value_t *newnode,
1718  val_value_t *curnode);
1719 
1720 
1731 extern agt_cfg_nested_silcall_t *
1732  agt_cfg_find_nested_silcall (agt_cfg_undo_rec_t *undo,
1733  val_value_t *newnode,
1734  val_value_t *curnode);
1735 
1736 
1745 extern boolean
1746  agt_cfg_has_added_edits (agt_cfg_transaction_t *txcb);
1747 
1748 
1752 #ifdef __cplusplus
1753 } /* end extern 'C' */
1754 #endif
1755 
1756 #endif /* _H_agt_cfg */
uint64 ncx_transaction_id_t
transaction is scoped to single session write operation on a config
Definition: ncxtypes.h:700
boolean is_validate
transaction is for the <validate> operation
Definition: agt_cfg.h:273
xmlChar * save_path
if YP-HA Active mode then this path string will be saved so the correct path will be used in YANG Pat...
Definition: agt_cfg.h:581
boolean is_sil_force_replay
nthis is a SIL force replay transaction
Definition: agt_cfg.h:505
status_t commit_res
saved commit phase status
Definition: agt_cfg.h:247
XPath expression result.
Definition: xpath.h:619
dlq provides general double-linked list and queue support:
boolean subsys_add_edit
add_edit mode form subsystem
Definition: agt_cfg.h:631
boolean silcall_invoke_only_sethook
TRUE if the only set-hook callbacks should be invoked.
Definition: agt_cfg.h:339
status_t commit_res
commit status
Definition: agt_cfg.h:439
boolean is_load
loading startup at boot-time
Definition: agt_cfg.h:291
boolean subtree_mode
subtree mode active
Definition: agt_cfg.h:775
agt_cfg_undo_rec_t * agt_cfg_last_active_undo(agt_cfg_transaction_t *txcb)
Get the last active undo record.
Definition: agt_cfg.c:3672
boolean start_bad
running config has YANG validation errors
Definition: agt_cfg.h:261
status_t agt_cfg_add_silcall(agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval, dlq_hdr_t *subsysQ, val_value_t *callval)
Create and fill in a remote SIL callback back pointer Add it to the transaction control block silcall...
Definition: agt_cfg.c:2021
agt_cfg_transaction_t * agt_cfg_new_transaction_ex(ncx_cfg_t cfgid, agt_cfg_edit_type_t edit_type, boolean rootcheck, boolean is_validate, boolean is_rollback, boolean no_cb, status_t *res)
Malloc and initialize agt_cfg_transaction_t struct Extended.
Definition: agt_cfg.c:857
const val_value_t * newval
support for yumaworks-config-change extensions must clone with val_clone_config_data instead of using...
Definition: agt_cfg.h:711
void agt_cfg_init_undorec(agt_cfg_undo_rec_t *undo)
Initialize a new agt_cfg_undo_rec_t struct.
Definition: agt_cfg.c:1525
@ brief NCX configuration database manager
agt_cfg_nested_silcall_t * cur_silcall
current SIL call control block pointer
Definition: agt_cfg.h:567
xmlChar * txid_str
transaction ID string
Definition: agt_cfg.h:232
boolean rootcheck_done
root-check done flag
Definition: agt_cfg.h:267
void agt_cfg_clear_config_txid(agt_cfg_transaction_t *txcb, cfg_template_t *cfg)
Clear current config txid if any.
Definition: agt_cfg.c:3746
val_value_t * curnode_clone
clone of current node before it changes
Definition: agt_cfg.h:558
agt_cfg_transaction_t * agt_cfg_new_transaction(ncx_cfg_t cfgid, agt_cfg_edit_type_t edit_type, boolean rootcheck, boolean is_validate, boolean is_rollback, status_t *res)
Malloc and initialize agt_cfg_transaction_t struct.
Definition: agt_cfg.c:812
status_t rollback_res
rollback phase status
Definition: agt_cfg.h:626
agt_cfg_audit_rec_t * agt_cfg_new_auditrec(const xmlChar *target, op_editop_t editop)
Malloc and initialize a new agt_cfg_audit_rec_t struct.
Definition: agt_cfg.c:1607
xpath_pcb_t * objpcb
XPath control block for object.
Definition: agt_cfg.h:728
boolean edit2_merge
this is EDIT2 merge so child edits needed
Definition: agt_cfg.h:508
boolean sethook_mode
Add_edit API flag : Set hook mode flag.
Definition: agt_cfg.h:315
boolean rootcheck
root-check needed flag
Definition: agt_cfg.h:264
status_t agt_cfg_finish_new_transaction(ses_cb_t *scb, agt_cfg_transaction_t *txcb)
Call the start transaction callback if it was deferred.
Definition: agt_cfg.c:1089
val_value_t * curval_clone
In case of delete-children-first mode newval and curval may get cleaned and deleted before the actual...
Definition: agt_cfg.h:474
One YANG data-def-stmt.
Definition: obj.h:1140
val_value_t * newval
new value
Definition: agt_cfg.h:766
add edit action
Definition: agt_cfg.h:169
val_value_t * newnode_parent
newnode parent node
Definition: agt_cfg.h:549
agt_cfg_undo_rec_t * agt_cfg_prev_active_undo(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *cur_undo)
Get the prev active undo record.
Definition: agt_cfg.c:3706
boolean in_reverse_edit
reverse edit active
Definition: agt_cfg.h:511
agt_cfg_nested_silcall_t * agt_cfg_find_nested_silcall(agt_cfg_undo_rec_t *undo, val_value_t *newnode, val_value_t *curnode)
Match nested callback in provided undo record nested silcall Queue.
Definition: agt_cfg.c:3997
boolean skip_sil_partial
skip SIL partial mode
Definition: agt_cfg.h:517
val_value_t * newval
new value
Definition: agt_cfg.h:651
agt_cfg_transaction_t * agt_cfg_new_transaction_ex2(ncx_cfg_t cfgid, agt_cfg_edit_type_t edit_type, boolean rootcheck, boolean is_validate, boolean is_rollback, boolean no_cb, ses_cb_t *scb, status_t *res)
Malloc and initialize agt_cfg_transaction_t struct Extended2.
Definition: agt_cfg.c:906
status_t agt_cfg_add_hook_silcall(agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval, dlq_hdr_t *subsysQ, val_value_t *callval, agt_hook_type_t hook_type)
Create and fill in a remote Hook SIL callback back pointer Add it to the transaction control block si...
Definition: agt_cfg.c:1927
boolean agt_cfg_use_child_undo(agt_cfg_undo_rec_t *undo, agt_cfg_undo_rec_t *child_undo)
Check if the child edit node should be invoked.
Definition: agt_cfg.c:2811
agt_cfg_undo_rec_t * agt_cfg_next_child_undo(agt_cfg_undo_rec_t *cur_undo)
Get the next child undo record.
Definition: agt_cfg.c:2944
boolean agt_cfg_check_hook_created(agt_cfg_transaction_t *txcb, val_value_t *newval, val_value_t *curval)
Check if the Transaction Hook has been already setup for the current undo record or newval/curval val...
Definition: agt_cfg.c:3536
val_value_t * curnode
current node in edit
Definition: agt_cfg.h:552
replace edit action
Definition: agt_cfg.h:178
boolean agt_cfg_check_parent_edits(agt_cfg_transaction_t *txcb, val_value_t *newnode)
Make sure that current undo is unique and does not have the same undo in different parent undo...
Definition: agt_cfg.c:3351
agt_cfg_trans_hook_t * agt_cfg_next_trans_hook(agt_cfg_trans_hook_t *cur_hook)
Get the next Transaction Hook callback.
Definition: agt_cfg.c:3467
agt_cfg_transaction_t * agt_cfg_new_transaction_ex3(ncx_cfg_t cfgid, agt_cfg_edit_type_t edit_type, boolean rootcheck, boolean is_validate, boolean is_rollback, boolean no_cb, boolean no_silsa_cb, ses_cb_t *scb, status_t *res)
Malloc and initialize agt_cfg_transaction_t struct Extended3.
Definition: agt_cfg.c:960
agt_cfg_undo_rec_t * agt_cfg_prev_active_child_undo(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *cur_undo)
Get the prev active child undo record.
Definition: agt_cfg.c:3835
status_t rollback_res
rollback status
Definition: agt_cfg.h:442
boolean agt_cfg_transaction_is_unload(agt_cfg_transaction_t *txcb)
Check if this transaction is a commit for unloading a module.
Definition: agt_cfg.c:1753
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1052
ncx_transaction_id_t agt_cfg_txid_in_progress(ncx_cfg_t cfgid)
Return the ID of the current transaction ID in progress.
Definition: agt_cfg.c:1479
void agt_cfg_set_transaction_commit(agt_cfg_transaction_t *txcb)
Tag this transaction as a commit from candidate to running.
Definition: agt_cfg.c:1716
Schema and data model Xpath search support.
not set
Definition: agt_cfg.h:190
status_t apply_res
saved apply phase status
Definition: agt_cfg.h:244
set edit action
Definition: agt_cfg.h:172
val_value_t * newnode_marker
newnode marker if swapped out
Definition: agt_cfg.h:546
Transaction Control Block.
Definition: agt_cfg.h:224
boolean post_sethook_mode
Add_edit API flag : Post Set hook mode flag.
Definition: agt_cfg.h:318
agt_cfg_transaction_t * agt_cfg_rerun_transaction(ncx_cfg_t cfgid, agt_cfg_edit_type_t edit_type, boolean rootcheck, boolean is_validate, boolean is_rollback, boolean no_silsa_cb, ncx_transaction_id_t txid, ses_cb_t *scb, status_t *res)
Malloc and initialize agt_cfg_transaction_t struct.
Definition: agt_cfg.c:1162
status_t commit_res
commit phase status
Definition: agt_cfg.h:623
boolean skip_save
need to skip NV-save
Definition: agt_cfg.h:312
agt_cfg_edit_action_t edit_action
internal edit action
Definition: agt_cfg.h:540
status_t agt_cfg_add_edit2_silcall(agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval, dlq_hdr_t *subsysQ, val_value_t *callval)
Create and fill in a remote SIL callback back pointer.
Definition: agt_cfg.c:2113
xpath_result_t * result
XPath result for object eval of objpcb.
Definition: agt_cfg.h:731
boolean root_check_first_done
root-check first done flag
Definition: agt_cfg.h:333
agt_cfg_undo_rec_t * agt_cfg_first_undo(agt_cfg_transaction_t *txcb)
Get the first undo record.
Definition: agt_cfg.c:2841
Value Node Basic Support.
boolean hook_merge
Add_edit API flag : hook merge flag.
Definition: agt_cfg.h:324
boolean silcall_setup_done
TRUE if the silcall setup is done.
Definition: agt_cfg.h:336
void agt_cfg_dump_undo(agt_cfg_undo_rec_t *undo)
Debug log a description of the undo record.
Definition: agt_cfg.c:2742
agt_cfg_undo_rec_t * agt_cfg_last_active_child_undo(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *parent_undo)
Get the last active child undo record.
Definition: agt_cfg.c:3799
agt_cfg_edit_type_t
classify the config edit type
Definition: agt_cfg.h:189
void agt_cfg_cleanup_transactions(const xmlChar *txidfile)
Cleanup the transaction ID functionality.
Definition: agt_cfg.c:1455
boolean skip_cb
Add_edit API flag : skip callback.
Definition: agt_cfg.h:321
agt_cfg_edit_action_t
classify the config edit action type
Definition: agt_cfg.h:164
struct representing 1 configuration database
Definition: cfg.h:225
boolean agt_cfg_has_added_edits(agt_cfg_transaction_t *txcb)
Check if there are added edits in the Queue.
Definition: agt_cfg.c:4069
boolean agt_cfg_find_duplicate_silcall(agt_cfg_transaction_t *txcb, val_value_t *newnode, val_value_t *curnode)
Check if there is already the same callback in the nested silcall.
Definition: agt_cfg.c:3281
status_t validate_res
validate status
Definition: agt_cfg.h:433
status_t agt_cfg_add_nested_silcall(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *undo, op_editop_t editop, val_value_t *newval, val_value_t *curval, obj_template_t *callback_obj, boolean indelete, boolean in_reverse_delete, agt_cfg_nested_silcall_t **result)
Malloc and fill in a new nested SIL callback record.
Definition: agt_cfg.c:2253
op_editop_t editop
edit operation
Definition: agt_cfg.h:648
one set of edit-in-progress variables for one value node
Definition: val.h:791
struct of params to undo an edit operation.
Definition: agt_cfg.h:497
agt_cfg_undo_rec_t * agt_cfg_last_undo(agt_cfg_transaction_t *txcb)
Get the last undo record.
Definition: agt_cfg.c:2883
status_t rollback_res
saved rollback phase status
Definition: agt_cfg.h:250
op_editop_t editop
edit operation
Definition: agt_cfg.h:705
YANG module data structures Many internal representations of YANG module constructs.
void agt_cfg_clean_undorec(agt_cfg_undo_rec_t *undo)
Clean all the memory used by the specified agt_cfg_undo_rec_t but do not free the struct itself...
Definition: agt_cfg.c:1584
agt_cfg_silcall_t * agt_cfg_new_silcall(op_editop_t editop, val_value_t *newval, val_value_t *curval, dlq_hdr_t *subsysQ)
Create and fill in a remote SIL callback back pointer.
Definition: agt_cfg.c:1854
agt_cfg_undo_rec_t * agt_cfg_find_undo_node(agt_cfg_transaction_t *txcb, val_value_t *newnode, val_value_t *curnode)
Find an undo node.
Definition: agt_cfg.c:2439
ncx_transaction_id_t result_txid
transaction ID for result
Definition: agt_cfg.h:734
op_editop_t editop
edit operation
Definition: agt_cfg.h:534
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
boolean fill_candidate_failed
flag fill candidate from running failed
Definition: agt_cfg.h:303
boolean is_rollback
transaction is a rollback
Definition: agt_cfg.h:282
obj_template_t * callback_obj
object template for this callback
Definition: agt_cfg.h:457
agt_cfg_trans_hook_t * agt_cfg_first_trans_hook(agt_cfg_transaction_t *txcb)
Get the first transaction hook record.
Definition: agt_cfg.c:3447
agt_cfg_undo_rec_t * agt_cfg_next_undo(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *cur_undo)
Get the next undo record.
Definition: agt_cfg.c:2861
agt_cfg_undo_rec_t * agt_cfg_first_child_undo(agt_cfg_undo_rec_t *undo)
Get the first child undo record for EDIT2 mode.
Definition: agt_cfg.c:2925
status_t apply_res
apply phase status
Definition: agt_cfg.h:617
struct of Transaction Hooks parameters
Definition: agt_cfg.h:758
agt_cfg_undo_rec_t * agt_cfg_prev_undo(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *cur_undo)
Get the prev undo record.
Definition: agt_cfg.c:2903
obj_template_t * target_obj
target object
Definition: agt_cfg.h:763
void agt_cfg_restore_newnode(agt_cfg_undo_rec_t *undo)
Swap the newnode and newnode_pointers.
Definition: agt_cfg.c:2782
status_t agt_cfg_init_transactions(const xmlChar *txidfile, boolean foundfile)
Initialize the transaction ID functionality.
Definition: agt_cfg.c:1386
boolean is_insert
insert or move
Definition: agt_cfg.h:531
one value to match one type
Definition: val.h:870
boolean silcall_sethook_done
TRUE if the set-hook callbacks already done.
Definition: agt_cfg.h:342
status_t validate_res
validate phase status
Definition: agt_cfg.h:614
op_editop_t editop
edit operation
Definition: agt_cfg.h:430
uint32 testflags
test flags for this object AGT_TEST_FL_FOO bits
Definition: agt_cfg.h:740
val_value_t * curval
current value
Definition: agt_cfg.h:769
move edit action
Definition: agt_cfg.h:175
boolean force_full_root_check
need to force a full root check
Definition: agt_cfg.h:300
boolean check_duplicate_silcall
check duplicate SIL call
Definition: agt_cfg.h:327
op_testop_t
NETCONF edit-config test-option types.
Definition: op.h:160
agt_cfg_undo_rec_t * agt_cfg_find_undo_node_ascendant(agt_cfg_transaction_t *txcb, val_value_t *newnode, val_value_t *curnode)
Find an undo node and check for the ascendant lists match.
Definition: agt_cfg.c:3880
agt_cfg_trans_hook_t * agt_cfg_last_trans_hook(agt_cfg_transaction_t *txcb)
Get the last Transaction Hook entry.
Definition: agt_cfg.c:3488
void agt_cfg_child_edit_fields(agt_cfg_undo_rec_t *child_undo, op_editop_t *editop, val_value_t **newval, val_value_t **curval)
Get the child edit fields from the undo record.
Definition: agt_cfg.c:2647
op_editop_t editop
edit operation
Definition: agt_cfg.h:772
void agt_cfg_free_undorec(agt_cfg_undo_rec_t *undo)
Free all the memory used by the specified agt_cfg_undo_rec_t.
Definition: agt_cfg.c:1558
boolean subsys_add_edit_mode
add_edit mode form subsystem
Definition: agt_cfg.h:400
struct agt_cfg_undo_rec_t_ * orig_rev_undo
back pointer to original undo for reverse edit
Definition: agt_cfg.h:635
Session Control Block.
Definition: ses.h:542
agt_cfg_edit_type_t edit_type
edit type enum
Definition: agt_cfg.h:238
status_t
global error return code
Definition: status_enum.h:186
void agt_cfg_free_silcall(agt_cfg_silcall_t *silcall)
Clean and free a mallocedremote SIL callback back pointer.
Definition: agt_cfg.c:1887
Multi-Protocol Network Management Server.
boolean top_replace
top replace in progress
Definition: agt_cfg.h:297
const val_value_t * curval
current value from edit
Definition: agt_cfg.h:714
obj_template_t * obj
object template for commit test
Definition: agt_cfg.h:725
struct to keep track of XPath tests run in this transaction
Definition: agt_cfg.h:745
boolean added_edit
Add_edit API flag.
Definition: agt_cfg.h:525
val_value_t * parentnode
parent node of edit node
Definition: agt_cfg.h:564
op_editop_t cvtop
converted edit operation
Definition: agt_cfg.h:537
agt_hook_type_t hook_type
SIL-SA Hook type.
Definition: agt_cfg.h:683
ncx_btype_t btyp
base type of this object
Definition: agt_cfg.h:737
void agt_cfg_free_trans_hook(agt_cfg_trans_hook_t *hook)
Clean and free a malloced Trans Hook callback.
Definition: agt_cfg.c:3424
boolean parent_is_edit2_merge
tells if the undo is in the child_undoQ and its parent is in EDIT2 mode
Definition: agt_cfg.h:522
void agt_cfg_free_commit_test(agt_cfg_commit_test_t *commit_test)
Free a previously malloced agt_cfg_commit_test_t struct.
Definition: agt_cfg.c:1690
val_value_t * child_undo_curnode_clone
clone of child node
Definition: agt_cfg.h:561
delete default edit action
Definition: agt_cfg.h:184
Global error messages for status code enumerations.
boolean skip_silsa_hooks
need to skip SIL-SA hooks
Definition: agt_cfg.h:397
REPLACE = subtree replace.
Definition: agt_cfg.h:192
val_value_t * newnode
new node in edit
Definition: agt_cfg.h:543
ncx_transaction_id_t txid
transaction ID (uint64
Definition: agt_cfg.h:229
struct of data for 1 nested SIL callback within 1 undo.
Definition: agt_cfg.h:425
boolean hook_edit
SIL-SA Hook support.
Definition: agt_cfg.h:680
boolean is_commit
transaction is commit candidate to running
Definition: agt_cfg.h:279
struct of data for 1 remote SIL callback
Definition: agt_cfg.h:660
struct for the commit-time tests for a single object
Definition: agt_cfg.h:720
val_value_t * curval
current value
Definition: agt_cfg.h:654
NETCONF protocol operations.
XPath parser control block.
Definition: xpath.h:668
status_t apply_res
apply status
Definition: agt_cfg.h:436
val_value_t * newval
new value
Definition: agt_cfg.h:668
struct agt_cfg_nested_silcall_t_ * parent
back pointer to parent silcall
Definition: agt_cfg.h:463
status_t sil_apply_res
SIL apply phase status.
Definition: agt_cfg.h:620
void agt_cfg_remove_module_commit_tests(ncx_module_t *mod)
Remove module commit tests for specified module.
Definition: agt_cfg.c:1789
void agt_cfg_free_transaction(agt_cfg_transaction_t *txcb)
Clean and free a agt_cfg_transaction_t struct.
Definition: agt_cfg.c:1278
boolean is_validate_def
validate default flag
Definition: agt_cfg.h:276
agt_cfg_undo_rec_t * agt_cfg_new_undorec(void)
Malloc and initialize a new agt_cfg_undo_rec_t struct.
Definition: agt_cfg.c:1501
boolean is_transhook
Trans Start-Cmplt hooks flag.
Definition: agt_cfg.h:294
boolean skip_sil_partial
need to skip SIL partial callbacks
Definition: agt_cfg.h:309
agt_cfg_trans_hook_t * agt_cfg_prev_trans_hook(agt_cfg_trans_hook_t *cur_hook)
Get the previous Trans Hook entry.
Definition: agt_cfg.c:3508
void agt_cfg_free_auditrec(agt_cfg_audit_rec_t *auditrec)
Free all the memory used by the specified agt_cfg_audit_rec_t.
Definition: agt_cfg.c:1647
val_value_t * curval
current value
Definition: agt_cfg.h:671
boolean agt_cfg_ascendant_lists_check(val_value_t *test_val, val_value_t *next_parent)
Test an undo node within specified parent list.
Definition: agt_cfg.c:3094
delete edit action
Definition: agt_cfg.h:181
xpath_pcb_t * xpath
XPath control block for XPath visit.
Definition: agt_cfg.h:750
agt_cfg_undo_rec_t * agt_cfg_next_child_edit(agt_cfg_undo_rec_t *curedit)
Get the next child node edit record for a given transaction.
Definition: agt_cfg.c:2596
boolean is_commit_completeness
Commit completeness cb flag.
Definition: agt_cfg.h:288
not set
Definition: agt_cfg.h:166
boolean silcall_done
silcall done flag
Definition: agt_cfg.h:394
boolean is_unload
transaction is for an unload operation
Definition: agt_cfg.h:285
time_t timestamp
transaction start timestamp
Definition: agt_cfg.h:235
struct agt_cfg_nested_silcall_t_ * cur_silcall
Q of ncx_backptr_t to xpath_pcb_t for keeping track of which auxillary must-stmt validation tests and...
Definition: agt_cfg.h:373
void agt_cfg_force_full_root_check(agt_cfg_transaction_t *txcb)
Tag this transaction as needing a full root check.
Definition: agt_cfg.c:1770
ncx_cfg_t
hardwire the 3 standard configs
Definition: ncxtypes.h:535
xmlChar * target
target for audit record
Definition: agt_cfg.h:702
void agt_cfg_set_transaction_unload(agt_cfg_transaction_t *txcb)
Tag this transaction as a commit for unloading a module.
Definition: agt_cfg.c:1734
agt_cfg_trans_hook_t * agt_cfg_new_trans_hook(obj_template_t *target_obj, val_value_t *newval, val_value_t *curval, op_editop_t editop)
Create and fill in a Trans Hook callback back pointer.
Definition: agt_cfg.c:3393
boolean when_force_delete
when-stmt force delete flag
Definition: agt_cfg.h:514
agt_cfg_undo_rec_t * agt_cfg_first_active_undo(agt_cfg_transaction_t *txcb)
Get the first active undo record.
Definition: agt_cfg.c:3594
val_value_t * valnode
valnode for XPath visit
Definition: agt_cfg.h:753
agt_cfg_undo_rec_t * agt_cfg_find_child_undo_node(agt_cfg_undo_rec_t *parent_undo, val_value_t *newnode, val_value_t *curnode)
Find a child undo node.
Definition: agt_cfg.c:2970
val_editvars_t * newnode_editvars
need to save the newnode->editvars for YP-HA and later YANG Push so the insert operation will not be ...
Definition: agt_cfg.h:574
agt_cfg_undo_rec_t * agt_cfg_find_undo_node_slow(agt_cfg_transaction_t *txcb, val_value_t *newnode, val_value_t *curnode)
Find an undo node and check for the ascendant lists match.
Definition: agt_cfg.c:3139
struct of params to use when generating sysConfigChange notification.
Definition: agt_cfg.h:697
boolean skip_cb
used by add_edit only
Definition: agt_cfg.h:528
REPLACE = full database replace.
Definition: agt_cfg.h:191
agt_cfg_undo_rec_t * agt_cfg_next_active_undo(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *cur_undo)
Get the next active undo record.
Definition: agt_cfg.c:3632
boolean root_check_first
need root-check first
Definition: agt_cfg.h:330
agt_cfg_undo_rec_t * agt_cfg_first_child_edit(agt_cfg_transaction_t *txcb, val_value_t *newnode, val_value_t *curnode)
Get the first child node edit record for a given transaction.
Definition: agt_cfg.c:2519
boolean skip_sil
need to skip SIL callbacks
Definition: agt_cfg.h:306
const xmlChar * comment
comment provided by the caller: do not clone; just use backptr!!
Definition: agt_cfg.h:345
op_editop_t editop
edit operation
Definition: agt_cfg.h:665
agt_cfg_commit_test_t * agt_cfg_new_commit_test(void)
Malloc a agt_cfg_commit_test_t struct.
Definition: agt_cfg.c:1669
op_testop_t test_option
YPW-1356: netconfd: server crash when test-option is test-only and target=running and check-root-firs...
Definition: agt_cfg.h:258
val_value_t * curnode_marker
curnode marker if swapped out
Definition: agt_cfg.h:555
struct of data for 1 children of one remote SIL callback
Definition: agt_cfg.h:643
boolean commitcheck
commit check needed flag
Definition: agt_cfg.h:270
boolean silcall_undo_mode
silcall undo mode active
Definition: agt_cfg.h:391
ncx_btype_t
enumeration of the built-in NCX types These types cannot be overridden and cannot be imported ...
Definition: ncxtypes.h:200
ncx_cfg_t cfg_id
configuration datastore being edited
Definition: agt_cfg.h:241
agt_hook_type_t
Hook types enumeration to specify Hook type.
Definition: agt.h:716
boolean free_curnode
need to free curnode
Definition: agt_cfg.h:502