yumapro  20.10-12
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 - 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_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 
167 
170 
173 
176 
179 
182 
185 } agt_cfg_edit_action_t;
186 
187 
189 typedef enum agt_cfg_edit_type_t_ {
193 } 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 
241  ncx_cfg_t cfg_id;
242 
244  status_t apply_res;
245 
247  status_t commit_res;
248 
250  status_t rollback_res;
251 
258  op_testop_t test_option;
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 
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 
427  dlq_hdr_t qhdr;
428 
430  op_editop_t editop;
431 
433  status_t validate_res;
434 
436  status_t apply_res;
437 
439  status_t commit_res;
440 
442  status_t rollback_res;
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 
457  obj_template_t *callback_obj;
458 
460  dlq_hdr_t nested_silcallQ;
461 
464 
474  val_value_t *curval_clone;
475 
476 } YPACK agt_cfg_nested_silcall_t;
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 
534  op_editop_t editop;
535 
537  op_editop_t cvtop;
538 
540  agt_cfg_edit_action_t edit_action;
541 
543  val_value_t *newnode;
544 
546  val_value_t *newnode_marker;
547 
549  val_value_t *newnode_parent;
550 
552  val_value_t *curnode;
553 
555  val_value_t *curnode_marker;
556 
558  val_value_t *curnode_clone;
559 
562 
564  val_value_t *parentnode;
565 
567  agt_cfg_nested_silcall_t *cur_silcall;
568 
574  val_editvars_t *newnode_editvars;
575 
581  xmlChar *save_path;
582 
590  dlq_hdr_t extra_deleteQ;
600  dlq_hdr_t nested_silcallQ;
611  dlq_hdr_t child_undoQ;
614  status_t validate_res;
615 
617  status_t apply_res;
618 
620  status_t sil_apply_res;
621 
623  status_t commit_res;
624 
626  status_t rollback_res;
627 
628 #ifdef WITH_YCONTROL
629 
632 #endif // WITH_YCONTROL
633 
634 } YPACK agt_cfg_undo_rec_t;
635 
636 
637 #ifdef WITH_YCONTROL
638 
640 typedef struct agt_cfg_child_silcall_t_ {
642  dlq_hdr_t qhdr;
643 
645  op_editop_t editop;
646 
648  val_value_t *newval;
649 
651  val_value_t *curval;
652 
653 } YPACK agt_cfg_child_silcall_t;
654 
655 
657 typedef struct agt_cfg_silcall_t_ {
659  dlq_hdr_t qhdr;
660 
662  op_editop_t editop;
663 
665  val_value_t *newval;
666 
668  val_value_t *curval;
669 
671  dlq_hdr_t *subsysQ;
672 
674  dlq_hdr_t keyptrQ;
675 
677  boolean hook_edit;
678 
680  agt_hook_type_t hook_type;
681 
685  dlq_hdr_t child_editQ;
686 
687 } YPACK agt_cfg_silcall_t;
688 #endif // WITH_YCONTROL
689 
690 
694 typedef struct agt_cfg_audit_rec_t_ {
696  dlq_hdr_t qhdr;
697 
699  xmlChar *target;
700 
702  op_editop_t editop;
703 
708  const val_value_t *newval;
709 
711  const val_value_t *curval;
712 
713 } YPACK agt_cfg_audit_rec_t;
714 
715 
717 typedef struct agt_cfg_commit_test_t_ {
719  dlq_hdr_t qhdr;
720 
722  obj_template_t *obj;
723 
725  xpath_pcb_t *objpcb;
726 
728  xpath_result_t *result;
729 
732 
734  ncx_btype_t btyp;
735 
737  uint32 testflags;
738 } YPACK agt_cfg_commit_test_t;
739 
740 
742 typedef struct agt_cfg_xpath_visit_t_ {
744  dlq_hdr_t qhdr;
745 
747  xpath_pcb_t *xpath;
748 
750  val_value_t *valnode;
751 } YPACK agt_cfg_xpath_visit_t;
752 
753 
755 typedef struct agt_cfg_trans_hook_t_ {
757  dlq_hdr_t qhdr;
758 
760  obj_template_t *target_obj;
761 
763  val_value_t *newval;
764 
766  val_value_t *curval;
767 
769  op_editop_t editop;
770 
772  boolean subtree_mode;
773 } YPACK agt_cfg_trans_hook_t;
774 
775 
779 /********************************************************************
780 * *
781 * F U N C T I O N S *
782 * *
783 *********************************************************************/
784 
816 extern agt_cfg_transaction_t *
817  agt_cfg_new_transaction (ncx_cfg_t cfgid,
818  agt_cfg_edit_type_t edit_type,
819  boolean rootcheck,
820  boolean is_validate,
821  boolean is_rollback,
822  status_t *res);
823 
824 
848 extern agt_cfg_transaction_t *
849  agt_cfg_new_transaction_ex (ncx_cfg_t cfgid,
850  agt_cfg_edit_type_t edit_type,
851  boolean rootcheck,
852  boolean is_validate,
853  boolean is_rollback,
854  boolean no_cb,
855  status_t *res);
856 
857 
882 agt_cfg_transaction_t *
883  agt_cfg_new_transaction_ex2 (ncx_cfg_t cfgid,
884  agt_cfg_edit_type_t edit_type,
885  boolean rootcheck,
886  boolean is_validate,
887  boolean is_rollback,
888  boolean no_cb,
889  ses_cb_t *scb,
890  status_t *res);
891 
892 
900 extern status_t
901  agt_cfg_finish_new_transaction (ses_cb_t *scb,
902  agt_cfg_transaction_t *txcb);
903 
904 
931 extern agt_cfg_transaction_t *
932  agt_cfg_new_transaction_ex3 (ncx_cfg_t cfgid,
933  agt_cfg_edit_type_t edit_type,
934  boolean rootcheck,
935  boolean is_validate,
936  boolean is_rollback,
937  boolean no_cb,
938  boolean no_silsa_cb,
939  ses_cb_t *scb,
940  status_t *res);
941 
942 
971 extern agt_cfg_transaction_t *
972  agt_cfg_rerun_transaction (ncx_cfg_t cfgid,
973  agt_cfg_edit_type_t edit_type,
974  boolean rootcheck,
975  boolean is_validate,
976  boolean is_rollback,
977  boolean no_silsa_cb,
979  ses_cb_t *scb,
980  status_t *res);
981 
982 
988 extern void
989  agt_cfg_free_transaction (agt_cfg_transaction_t *txcb);
990 
991 
999 extern status_t
1000  agt_cfg_init_transactions (const xmlChar *txidfile,
1001  boolean foundfile);
1002 
1003 
1009 extern void
1010  agt_cfg_cleanup_transactions (const xmlChar *txidfile);
1011 
1012 
1019 extern ncx_transaction_id_t
1020  agt_cfg_txid_in_progress (ncx_cfg_t cfgid);
1021 
1022 
1028 extern agt_cfg_undo_rec_t *
1029  agt_cfg_new_undorec (void);
1030 
1031 
1037 extern void
1038  agt_cfg_init_undorec (agt_cfg_undo_rec_t *undo);
1039 
1040 
1046 extern void
1047  agt_cfg_free_undorec (agt_cfg_undo_rec_t *undo);
1048 
1049 
1061 extern void
1062  agt_cfg_clean_undorec (agt_cfg_undo_rec_t *undo);
1063 
1064 
1072 extern agt_cfg_audit_rec_t *
1073  agt_cfg_new_auditrec (const xmlChar *target,
1074  op_editop_t editop);
1075 
1076 
1082 extern void
1083  agt_cfg_free_auditrec (agt_cfg_audit_rec_t *auditrec);
1084 
1085 
1091 extern agt_cfg_commit_test_t *
1092  agt_cfg_new_commit_test (void);
1093 
1094 
1100 extern void
1101  agt_cfg_free_commit_test (agt_cfg_commit_test_t *commit_test);
1102 
1103 
1109 extern void
1110  agt_cfg_set_transaction_commit (agt_cfg_transaction_t *txcb);
1111 
1112 
1118 extern void
1119  agt_cfg_set_transaction_unload (agt_cfg_transaction_t *txcb);
1120 
1121 
1128 extern boolean
1129  agt_cfg_transaction_is_unload (agt_cfg_transaction_t *txcb);
1130 
1131 
1137 extern void
1138  agt_cfg_force_full_root_check (agt_cfg_transaction_t *txcb);
1139 
1140 
1146 extern void
1147  agt_cfg_remove_module_commit_tests (ncx_module_t *mod);
1148 
1149 
1150 #ifdef WITH_YCONTROL
1151 
1161 extern agt_cfg_silcall_t *
1162  agt_cfg_new_silcall (op_editop_t editop,
1163  val_value_t *newval,
1164  val_value_t *curval,
1165  dlq_hdr_t *subsysQ);
1166 
1167 
1173 extern void
1174  agt_cfg_free_silcall (agt_cfg_silcall_t *silcall);
1175 
1176 
1191 extern status_t
1192  agt_cfg_add_hook_silcall (agt_cfg_transaction_t *txcb,
1193  op_editop_t editop,
1194  val_value_t *newval,
1195  val_value_t *curval,
1196  dlq_hdr_t *subsysQ,
1197  val_value_t *callval,
1198  agt_hook_type_t hook_type);
1199 
1200 
1214 extern status_t
1215  agt_cfg_add_silcall (agt_cfg_transaction_t *txcb,
1216  op_editop_t editop,
1217  val_value_t *newval,
1218  val_value_t *curval,
1219  dlq_hdr_t *subsysQ,
1220  val_value_t *callval);
1221 
1222 
1237 extern status_t
1238  agt_cfg_add_edit2_silcall (agt_cfg_transaction_t *txcb,
1239  op_editop_t editop,
1240  val_value_t *newval,
1241  val_value_t *curval,
1242  dlq_hdr_t *subsysQ,
1243  val_value_t *callval);
1244 
1245 #endif // WITH_YCONTROL
1246 
1247 
1266 extern status_t
1267  agt_cfg_add_nested_silcall (agt_cfg_transaction_t *txcb,
1268  agt_cfg_undo_rec_t *undo,
1269  op_editop_t editop,
1270  val_value_t *newval,
1271  val_value_t *curval,
1272  obj_template_t *callback_obj,
1273  boolean indelete,
1274  boolean in_reverse_delete,
1275  agt_cfg_nested_silcall_t **result);
1276 
1277 
1291 extern agt_cfg_undo_rec_t *
1292  agt_cfg_find_undo_node (agt_cfg_transaction_t *txcb,
1293  val_value_t *newnode,
1294  val_value_t *curnode);
1295 
1296 
1306 extern agt_cfg_undo_rec_t *
1307  agt_cfg_first_child_edit (agt_cfg_transaction_t *txcb,
1308  val_value_t *newnode,
1309  val_value_t *curnode);
1310 
1311 
1319 extern agt_cfg_undo_rec_t *
1320  agt_cfg_next_child_edit (agt_cfg_undo_rec_t *curedit);
1321 
1322 
1334 extern void
1335  agt_cfg_child_edit_fields (agt_cfg_undo_rec_t *child_undo,
1336  op_editop_t *editop,
1337  val_value_t **newval,
1338  val_value_t **curval);
1339 
1340 
1346 extern void
1347  agt_cfg_dump_undo (agt_cfg_undo_rec_t *undo);
1348 
1349 
1355 extern void
1356  agt_cfg_restore_newnode (agt_cfg_undo_rec_t *undo);
1357 
1358 
1367 extern boolean
1368  agt_cfg_use_child_undo (agt_cfg_undo_rec_t *undo,
1369  agt_cfg_undo_rec_t *child_undo);
1370 
1371 
1378 extern agt_cfg_undo_rec_t *
1379  agt_cfg_first_undo (agt_cfg_transaction_t *txcb);
1380 
1381 
1389 extern agt_cfg_undo_rec_t *
1390  agt_cfg_next_undo (agt_cfg_transaction_t *txcb,
1391  agt_cfg_undo_rec_t *cur_undo);
1392 
1393 
1400 extern agt_cfg_undo_rec_t *
1401  agt_cfg_last_undo (agt_cfg_transaction_t *txcb);
1402 
1403 
1411 extern agt_cfg_undo_rec_t *
1412  agt_cfg_prev_undo (agt_cfg_transaction_t *txcb,
1413  agt_cfg_undo_rec_t *cur_undo);
1414 
1415 
1422 extern agt_cfg_undo_rec_t *
1423  agt_cfg_first_child_undo (agt_cfg_undo_rec_t *undo);
1424 
1425 
1432 extern agt_cfg_undo_rec_t *
1433  agt_cfg_next_child_undo (agt_cfg_undo_rec_t *cur_undo);
1434 
1435 
1449 extern agt_cfg_undo_rec_t *
1450  agt_cfg_find_child_undo_node (agt_cfg_undo_rec_t *parent_undo,
1451  val_value_t *newnode,
1452  val_value_t *curnode);
1453 
1454 
1466 extern boolean
1467  agt_cfg_ascendant_lists_check (val_value_t *test_val,
1468  val_value_t *next_parent);
1469 
1470 
1481 extern agt_cfg_undo_rec_t *
1482  agt_cfg_find_undo_node_slow (agt_cfg_transaction_t *txcb,
1483  val_value_t *newnode,
1484  val_value_t *curnode);
1485 
1486 
1506 extern boolean
1507  agt_cfg_find_duplicate_silcall (agt_cfg_transaction_t *txcb,
1508  val_value_t *newnode,
1509  val_value_t *curnode);
1510 
1511 
1522 extern boolean
1523  agt_cfg_check_parent_edits (agt_cfg_transaction_t *txcb,
1524  val_value_t *newnode);
1525 
1526 
1536 extern agt_cfg_trans_hook_t *
1537  agt_cfg_new_trans_hook (obj_template_t *target_obj,
1538  val_value_t *newval,
1539  val_value_t *curval,
1540  op_editop_t editop);
1541 
1542 
1548 extern void
1549  agt_cfg_free_trans_hook (agt_cfg_trans_hook_t *hook);
1550 
1551 
1558 extern agt_cfg_trans_hook_t *
1559  agt_cfg_first_trans_hook (agt_cfg_transaction_t *txcb);
1560 
1561 
1568 extern agt_cfg_trans_hook_t *
1569  agt_cfg_next_trans_hook (agt_cfg_trans_hook_t *cur_hook);
1570 
1571 
1578 extern agt_cfg_trans_hook_t *
1579  agt_cfg_last_trans_hook (agt_cfg_transaction_t *txcb);
1580 
1581 
1588 extern agt_cfg_trans_hook_t *
1589  agt_cfg_prev_trans_hook (agt_cfg_trans_hook_t *cur_hook);
1590 
1591 
1604 extern boolean
1605  agt_cfg_check_hook_created (agt_cfg_transaction_t *txcb,
1606  val_value_t *newval,
1607  val_value_t *curval);
1608 
1609 
1617 extern agt_cfg_undo_rec_t *
1618  agt_cfg_first_active_undo (agt_cfg_transaction_t *txcb);
1619 
1620 
1630 extern agt_cfg_undo_rec_t *
1631  agt_cfg_next_active_undo (agt_cfg_transaction_t *txcb,
1632  agt_cfg_undo_rec_t *cur_undo);
1633 
1634 
1643 extern agt_cfg_undo_rec_t *
1644  agt_cfg_last_active_undo (agt_cfg_transaction_t *txcb);
1645 
1646 
1656 extern agt_cfg_undo_rec_t *
1657  agt_cfg_prev_active_undo (agt_cfg_transaction_t *txcb,
1658  agt_cfg_undo_rec_t *cur_undo);
1659 
1660 
1667 extern void
1668  agt_cfg_clear_config_txid (agt_cfg_transaction_t *txcb,
1669  cfg_template_t *cfg);
1670 
1671 
1681 extern agt_cfg_undo_rec_t *
1682  agt_cfg_last_active_child_undo (agt_cfg_transaction_t *txcb,
1683  agt_cfg_undo_rec_t *parent_undo);
1684 
1685 
1695 extern agt_cfg_undo_rec_t *
1696  agt_cfg_prev_active_child_undo (agt_cfg_transaction_t *txcb,
1697  agt_cfg_undo_rec_t *cur_undo);
1698 
1699 
1703 #ifdef __cplusplus
1704 } /* end extern 'C' */
1705 #endif
1706 
1707 #endif /* _H_agt_cfg */
agt_cfg_undo_rec_t_::edit_action
agt_cfg_edit_action_t edit_action
internal edit action
Definition: agt_cfg.h:540
agt_cfg_finish_new_transaction
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
agt_cfg_next_child_edit
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
agt_cfg_next_undo
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
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
agt_cfg_undo_rec_t_::curnode_clone
val_value_t * curnode_clone
clone of current node before it changes
Definition: agt_cfg.h:558
cfg.h
agt_cfg_new_silcall
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_next_trans_hook
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:3451
agt_cfg_add_silcall
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
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
agt_cfg_transaction_t_::is_commit
boolean is_commit
transaction is commit candidate to running
Definition: agt_cfg.h:279
agt_cfg_silcall_t_::hook_edit
boolean hook_edit
SIL-SA Hook support.
Definition: agt_cfg.h:677
OP_EDITOP_CREATE
@ OP_EDITOP_CREATE
edit op is create
Definition: op.h:126
AGT_CFG_EDIT_ACTION_DELETE_DEFAULT
@ AGT_CFG_EDIT_ACTION_DELETE_DEFAULT
delete default edit action
Definition: agt_cfg.h:188
agt_util.h
Utility Functions for NCX Server method routines.
agt_cfg_transaction_t_::skip_save
boolean skip_save
need to skip NV-save
Definition: agt_cfg.h:312
OP_EDITOP_REPLACE
@ OP_EDITOP_REPLACE
edit op is replace
Definition: op.h:125
agt_cfg_transaction_t_::sethook_mode
boolean sethook_mode
Add_edit API flag : Set hook mode flag.
Definition: agt_cfg.h:315
OP_EDITOP_NONE
@ OP_EDITOP_NONE
not set
Definition: op.h:123
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
agt_cfg_transaction_t_
Transaction Control Block.
Definition: agt_cfg.h:224
agt_cfg_audit_rec_t_::target
xmlChar * target
target for audit record
Definition: agt_cfg.h:699
agt_cfg_silcall_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:659
AGT_CFG_EDIT_TYPE_FULL
@ AGT_CFG_EDIT_TYPE_FULL
REPLACE = full database replace.
Definition: agt_cfg.h:191
agt_cfg_transaction_t_::txid_str
xmlChar * txid_str
transaction ID string
Definition: agt_cfg.h:232
def_reg_clean_must_visit
void def_reg_clean_must_visit(void)
unregister all must visits entries delete all from the registry
Definition: def_reg.c:732
agt_cfg_undo_rec_t_::extra_deleteQ
dlq_hdr_t extra_deleteQ
extra deletes can occur if a node is added that is part of a choice.
Definition: agt_cfg.h:590
agt_cfg_undo_rec_t_::free_curnode
boolean free_curnode
need to free curnode
Definition: agt_cfg.h:502
AGT_CFG_EDIT_ACTION_SET
@ AGT_CFG_EDIT_ACTION_SET
set edit action
Definition: agt_cfg.h:176
agt_cfg_undo_rec_t_::edit2_merge
boolean edit2_merge
this is EDIT2 merge so child edits needed
Definition: agt_cfg.h:508
agt_cfg_free_trans_hook
void agt_cfg_free_trans_hook(agt_cfg_trans_hook_t *hook)
Clean and free a malloced Trans Hook callback.
Definition: agt_cfg.c:3408
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
agt_cfg_dump_undo
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_first_active_undo
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:3578
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_CFG_STATE_BAD
@ NCX_CFG_STATE_BAD
bad datastore being used anyway
Definition: ncxtypes.h:1421
agt_cb_sa_run_trans_complete
void agt_cb_sa_run_trans_complete(const xmlChar *transaction_id)
This function simply calls agt_sil_transaction_complete_cb, which makes a <server-event> message and ...
Definition: agt_cb.c:2305
val.h
Value Node Basic Support.
agt_cfg_undo_rec_t_::parentnode
val_value_t * parentnode
parent node of edit node
Definition: agt_cfg.h:564
agt_cfg_child_silcall_t_::curval
val_value_t * curval
current value
Definition: agt_cfg.h:651
agt_cfg_prev_trans_hook
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:3492
agt_cfg_restore_newnode
void agt_cfg_restore_newnode(agt_cfg_undo_rec_t *undo)
Swap the newnode and newnode_pointers.
Definition: agt_cfg.c:2782
agt_cfg_xpath_visit_t_::valnode
val_value_t * valnode
valnode for XPath visit
Definition: agt_cfg.h:750
agt_cfg_child_silcall_t_
struct of data for 1 children of one remote SIL callback
Definition: agt_cfg.h:640
agt_cfg_undo_rec_t_::curnode
val_value_t * curnode
current node in edit
Definition: agt_cfg.h:552
agt_cfg_first_child_undo
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
val_gen_keyptrs
status_t val_gen_keyptrs(val_value_t *val, dlq_hdr_t *keyptrQ)
Get all the keys for the specified data node object.
Definition: val_util.c:6929
agt_cfg_undo_rec_t_::is_sil_force_replay
boolean is_sil_force_replay
nthis is a SIL force replay transaction
Definition: agt_cfg.h:505
val_swap_child
void val_swap_child(val_value_t *newchild, val_value_t *curchild)
Swap a child value node with a current value node.
Definition: val.c:8334
ncx_clean_backptrQ
void ncx_clean_backptrQ(dlq_hdr_t *backptrQ)
Clean an entire Q of ncx_backptr_t structs.
Definition: ncx.c:11470
agt_cfg_xpath_visit_t_
struct to keep track of XPath tests run in this transaction
Definition: agt_cfg.h:742
obj_get_mod
ncx_module_t * obj_get_mod(obj_template_t *obj)
Get the module pointer for this object.
Definition: obj.c:12218
agt_cfg_init_transactions
status_t agt_cfg_init_transactions(const xmlChar *txidfile, boolean foundfile)
Initialize the transaction ID functionality.
Definition: agt_cfg.c:1386
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_cfg_audit_rec_t_::editop
op_editop_t editop
edit operation
Definition: agt_cfg.h:702
ncx_num.h
NCX Module Library Number Utility Functions.
agt_cfg_first_trans_hook
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:3431
AGT_CFG_EDIT_ACTION_NONE
@ AGT_CFG_EDIT_ACTION_NONE
not set
Definition: agt_cfg.h:170
agt_cfg_new_transaction_ex
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
val_get_mod_name
const xmlChar * val_get_mod_name(const val_value_t *val)
Get the module name associated with this value node.
Definition: val.c:12223
agt_cfg_transaction_t_::transhookQ
dlq_hdr_t transhookQ
Queue of the Transaction Hook callbacks rigistered for the current transaction.
Definition: agt_cfg.h:379
AGT_CFG_EDIT_ACTION_REPLACE
@ AGT_CFG_EDIT_ACTION_REPLACE
replace edit action
Definition: agt_cfg.h:182
agt_cfg_audit_rec_t_
struct of params to use when generating sysConfigChange notification.
Definition: agt_cfg.h:694
AGT_CFG_EDIT_ACTION_ADD
@ AGT_CFG_EDIT_ACTION_ADD
add edit action
Definition: agt_cfg.h:173
agt_cfg_undo_rec_t_::cvtop
op_editop_t cvtop
converted edit operation
Definition: agt_cfg.h:537
agt_cfg_undo_rec_t_::newnode
val_value_t * newnode
new node in edit
Definition: agt_cfg.h:543
agt_cfg_transaction_t_::silcall_undoQ
dlq_hdr_t silcall_undoQ
silcall undo Q
Definition: agt_cfg.h:388
agt_cfg_commit_test_t_::result
xpath_result_t * result
XPath result for object eval of objpcb.
Definition: agt_cfg.h:728
val_compare
int32 val_compare(const val_value_t *val1, const val_value_t *val2)
Compare 2 val_value_t struct value contents.
Definition: val.c:9456
AGT_CFG_EDIT_ACTION_MOVE
@ AGT_CFG_EDIT_ACTION_MOVE
move edit action
Definition: agt_cfg.h:179
agt_cfg_cleanup_transactions
void agt_cfg_cleanup_transactions(const xmlChar *txidfile)
Cleanup the transaction ID functionality.
Definition: agt_cfg.c:1455
agt_cfg_undo_rec_t_::when_force_delete
boolean when_force_delete
when-stmt force delete flag
Definition: agt_cfg.h:514
agt_cfg_nested_silcall_t_::editop
op_editop_t editop
edit operation
Definition: agt_cfg.h:430
ncx_get_sil_priority_used
boolean ncx_get_sil_priority_used(void)
Get the sil_priority_used flag.
Definition: ncx.c:12965
agt_cfg_undo_rec_t_::rollback_res
status_t rollback_res
rollback phase status
Definition: agt_cfg.h:626
agt_hook_get_type_name
const xmlChar * agt_hook_get_type_name(agt_hook_type_t type)
Get the keyword for the specified agt_hook_type_t enumeration.
Definition: agt_hook_util.c:219
agt_cfg_transaction_t_::undoQ
dlq_hdr_t undoQ
each distinct effective edit point in the data tree will have a separate undo record in the undoQ
Definition: agt_cfg.h:349
agt_cfg_new_commit_test
agt_cfg_commit_test_t * agt_cfg_new_commit_test(void)
Malloc a agt_cfg_commit_test_t struct.
Definition: agt_cfg.c:1669
dlq_lastEntry
#define dlq_lastEntry(listP)
get the last entry in the queue list
Definition: dlq.h:352
ncxmod_read_num_file
status_t ncxmod_read_num_file(const xmlChar *numfile, uint64 *curnum, boolean file_error)
Read the uint64 file and return the value found Expects full filespec, does not call ncx_get_source!...
Definition: ncxmod.c:8550
agt_cfg_trans_hook_t_::target_obj
obj_template_t * target_obj
target object
Definition: agt_cfg.h:760
agt_cfg_undo_rec_t_::cur_silcall
agt_cfg_nested_silcall_t * cur_silcall
current SIL call control block pointer
Definition: agt_cfg.h:567
op.h
NETCONF protocol operations.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
agt_cfg_xpath_visit_t_::xpath
xpath_pcb_t * xpath
XPath control block for XPath visit.
Definition: agt_cfg.h:747
cfg_get_dirty_flag
boolean cfg_get_dirty_flag(const cfg_template_t *cfg)
Get the config dirty flag value.
Definition: cfg.c:2066
agt_cfg_transaction_t_::edit_type
agt_cfg_edit_type_t edit_type
edit type enum
Definition: agt_cfg.h:238
agt_cfg_undo_rec_t_
struct of params to undo an edit operation.
Definition: agt_cfg.h:497
agt_cfg_undo_rec_t_::skip_cb
boolean skip_cb
used by add_edit only
Definition: agt_cfg.h:528
agt_cfg_transaction_t_::silcall_setup_done
boolean silcall_setup_done
TRUE if the silcall setup is done.
Definition: agt_cfg.h:336
agt_cfg_transaction_t_::commitcheck
boolean commitcheck
commit check needed flag
Definition: agt_cfg.h:270
agt_cfg_next_child_undo
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
agt_cfg_transaction_t_::is_transhook
boolean is_transhook
Trans Start-Cmplt hooks flag.
Definition: agt_cfg.h:294
agt_cfg_transaction_t_::subsys_add_edit_mode
boolean subsys_add_edit_mode
add_edit mode form subsystem
Definition: agt_cfg.h:400
agt_cfg_new_transaction_ex3
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_transaction_t_::is_unload
boolean is_unload
transaction is for an unload operation
Definition: agt_cfg.h:285
agt_cfg_silcall_t_::newval
val_value_t * newval
new value
Definition: agt_cfg.h:665
agt_cfg_find_duplicate_silcall
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:3265
agt_cfg_nested_silcall_t_::parent
struct agt_cfg_nested_silcall_t_ * parent
back pointer to parent silcall
Definition: agt_cfg.h:463
agt_cb.h
NETCONF Server Data Model callback handler.
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
agt_cfg_rerun_transaction
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
dlq_insertAhead
void dlq_insertAhead(void *newP, void *nodeP)
insert the new queue entry before the current entry
Definition: dlq.c:447
OP_EDITOP_MERGE
@ OP_EDITOP_MERGE
edit op is merge
Definition: op.h:124
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
AGT_CFG_EDIT_TYPE_NONE
@ AGT_CFG_EDIT_TYPE_NONE
not set
Definition: agt_cfg.h:190
agt_cfg_nested_silcall_t_
struct of data for 1 nested SIL callback within 1 undo.
Definition: agt_cfg.h:425
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_cfg_transaction_t_::apply_res
status_t apply_res
saved apply phase status
Definition: agt_cfg.h:244
def_reg.h
Definition Registry module.
agt_cfg_nested_silcall_t_::rollback_res
status_t rollback_res
rollback status
Definition: agt_cfg.h:442
agt_cfg_transaction_t_::post_sethook_mode
boolean post_sethook_mode
Add_edit API flag : Post Set hook mode flag.
Definition: agt_cfg.h:318
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
agt_cb_run_trans_start
status_t agt_cb_run_trans_start(ses_cb_t *scb, agt_cfg_transaction_t *txcb, boolean isvalidate, boolean isrollback, boolean isrunning, boolean no_silsa_cb)
Run Transaction start callbacks.
Definition: agt_cb.c:1833
agt_cfg_prev_undo
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
AGT_CFG_EDIT_TYPE_PARTIAL
@ AGT_CFG_EDIT_TYPE_PARTIAL
REPLACE = subtree replace.
Definition: agt_cfg.h:192
agt_cfg_transaction_t_::skip_sil_partial
boolean skip_sil_partial
need to skip SIL partial callbacks
Definition: agt_cfg.h:309
agt_cfg_commit_test_t_::btyp
ncx_btype_t btyp
base type of this object
Definition: agt_cfg.h:734
agt_cfg_trans_hook_t_::editop
op_editop_t editop
edit operation
Definition: agt_cfg.h:769
agt_cfg_add_hook_silcall
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
agt_cfg_new_auditrec
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
ncxmod_write_num_file
status_t ncxmod_write_num_file(const xmlChar *numfile, uint64 curnum)
Write the number file with the supplied value Expects full filespec, does not call ncx_get_source!...
Definition: ncxmod.c:8630
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
agt_cfg_clean_undorec
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_first_child_edit
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
agt_cfg_child_silcall_t_::newval
val_value_t * newval
new value
Definition: agt_cfg.h:648
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
agt_cfg_undo_rec_t_::is_insert
boolean is_insert
insert or move
Definition: agt_cfg.h:531
agt_cfg_clear_config_txid
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:3730
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
OP_EDITOP_DELETE
@ OP_EDITOP_DELETE
edit op is delete
Definition: op.h:127
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
agt_cfg_silcall_t_::curval
val_value_t * curval
current value
Definition: agt_cfg.h:668
AGT_CFG_IS_TOP_REPLACE
#define AGT_CFG_IS_TOP_REPLACE(C)
check the top replace mode
Definition: agt_cfg.h:153
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
agt_cfg_use_child_undo
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_child_silcall_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:642
agt_cfg_add_edit2_silcall
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
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.
agt_cfg_prev_active_undo
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:3690
val_index_match
boolean val_index_match(const val_value_t *val1, const val_value_t *val2)
Check 2 val_value structs for the same instance ID.
Definition: val.c:9032
agt_cfg_new_transaction_ex2
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
agt_cfg_xpath_visit_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:744
agt_cfg_silcall_t_
struct of data for 1 remote SIL callback
Definition: agt_cfg.h:657
NCX_CFGID_CANDIDATE
@ NCX_CFGID_CANDIDATE
candidate datastore
Definition: ncxtypes.h:385
agt_cfg_audit_rec_t_::newval
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:708
NCX_CFGID_STARTUP
@ NCX_CFGID_STARTUP
startup datastore
Definition: ncxtypes.h:386
agt_cfg_commit_test_t_::result_txid
ncx_transaction_id_t result_txid
transaction ID for result
Definition: agt_cfg.h:731
agt_cfg_txid_in_progress
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
agt_cfg_last_active_child_undo
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:3783
log_debug_append
void void void void void void void void log_debug_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG log entry.
rpc.h
NETCONF protocol remote procedure call common definitions.
agt_cfg_transaction_t_::rootcheck
boolean rootcheck
root-check needed flag
Definition: agt_cfg.h:264
agt_cfg_find_child_undo_node
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
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
agt_cfg_undo_rec_t_::sil_apply_res
status_t sil_apply_res
SIL apply phase status.
Definition: agt_cfg.h:620
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
agt_cfg_last_active_undo
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:3656
agt_cfg_nested_silcall_t_::validate_res
status_t validate_res
validate status
Definition: agt_cfg.h:433
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
agt_cfg_transaction_t_::root_check_first_done
boolean root_check_first_done
root-check first done flag
Definition: agt_cfg.h:333
agt_cfg_nested_silcall_t_::apply_res
status_t apply_res
apply status
Definition: agt_cfg.h:436
agt_cfg_transaction_t_::root_check_first
boolean root_check_first
need root-check first
Definition: agt_cfg.h:330
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
agt_cfg_transaction_t_::cur_silcall
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
agt_cfg_nested_silcall_t_::curval_clone
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
agt_cfg_undo_rec_t_::child_undo_curnode_clone
val_value_t * child_undo_curnode_clone
clone of child node
Definition: agt_cfg.h:561
agt_cfg_free_auditrec
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
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
agt_cfg_undo_rec_t_::save_path
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
agt_cfg_last_trans_hook
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:3472
dlq_prevEntry
#define dlq_prevEntry(nodeP)
get the previous queue entry before the current entry
Definition: dlq.h:280
agt_cfg_undo_rec_t_::in_reverse_edit
boolean in_reverse_edit
reverse edit active
Definition: agt_cfg.h:511
LOGINFO
#define LOGINFO
Check if at least log-level=info.
Definition: log.h:279
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
ncx_txid2str
status_t ncx_txid2str(ncx_transaction_id_t *txid, xmlChar **retbuff)
Convert a transaction ID to a string.
Definition: ncx.c:12159
agt_cfg_transaction_t_::top_replace
boolean top_replace
top replace in progress
Definition: agt_cfg.h:297
agt.h
Multi-Protocol Network Management Server.
agt_cfg_edit_action_t_
agt_cfg_edit_action_t_
classify the config edit action type
Definition: agt_cfg.h:164
agt_cfg_commit_test_t_::objpcb
xpath_pcb_t * objpcb
XPath control block for object.
Definition: agt_cfg.h:725
agt_cfg_commit_test_t_
struct for the commit-time tests for a single object
Definition: agt_cfg.h:717
agt_cfg_transaction_t_::deadnodeQ
dlq_hdr_t deadnodeQ
contains nodes marked as deleted by the delete_dead_nodes test used for false when-stmt test deletion...
Definition: agt_cfg.h:359
agt_cfg_find_undo_node
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
op_editop_name
const xmlChar * op_editop_name(op_editop_t ed_id)
Get the keyword for the specified op_editop_t enumeration.
Definition: op.c:106
ncx_get_config_state
ncx_config_state_t ncx_get_config_state(void)
Get the config_state flag.
Definition: ncx.c:14979
agt_cfg_transaction_t_::check_duplicate_silcall
boolean check_duplicate_silcall
check duplicate SIL call
Definition: agt_cfg.h:327
agt_cfg_trans_hook_t_::newval
val_value_t * newval
new value
Definition: agt_cfg.h:763
agt_cfg_transaction_t_::is_validate_def
boolean is_validate_def
validate default flag
Definition: agt_cfg.h:276
agt_hook_util.h
NETCONF Server Set/Transaction Hook utility functions.
agt_cfg_undo_rec_t_::parent_is_edit2_merge
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
agt_cfg_new_undorec
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
ncx_first_backptr
ncx_backptr_t * ncx_first_backptr(dlq_hdr_t *que)
Get first back pointer struct.
Definition: ncx.c:11513
agt_cfg_transaction_t_::is_commit_completeness
boolean is_commit_completeness
Commit completeness cb flag.
Definition: agt_cfg.h:288
agt_cfg_free_undorec
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
agt_cfg_transaction_t_::is_load
boolean is_load
loading startup at boot-time
Definition: agt_cfg.h:291
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
agt_cfg_edit_type_t_
agt_cfg_edit_type_t_
classify the config edit type
Definition: agt_cfg.h:189
agt_cfg_last_undo
agt_cfg_undo_rec_t * agt_cfg_last_undo(agt_cfg_transaction_t *txcb)
Get the last undo record.
Definition: agt_cfg.c:2883
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
agt_cfg_commit_test_t_::testflags
uint32 testflags
test flags for this object AGT_TEST_FL_FOO bits
Definition: agt_cfg.h:737
agt_cfg_transaction_t_::force_full_root_check
boolean force_full_root_check
need to force a full root check
Definition: agt_cfg.h:300
agt_cfg_transaction_t_::commit_res
status_t commit_res
saved commit phase status
Definition: agt_cfg.h:247
agt_cfg_nested_silcall_t_::commit_res
status_t commit_res
commit status
Definition: agt_cfg.h:439
agt_cfg_free_transaction
void agt_cfg_free_transaction(agt_cfg_transaction_t *txcb)
Clean and free a agt_cfg_transaction_t struct.
Definition: agt_cfg.c:1278
agt_cfg_find_undo_node_slow
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:3123
val_free_solo_editvars
void val_free_solo_editvars(val_editvars_t *editvars)
Free the editing variables removed from a val_value_t.
Definition: val.c:13411
agt_cfg_transaction_t_::skip_cb
boolean skip_cb
Add_edit API flag : skip callback.
Definition: agt_cfg.h:321
OP_EDITOP_LOAD
@ OP_EDITOP_LOAD
load, internal enum
Definition: op.h:128
agt_cfg_commit_test_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:719
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
agt_cfg_undo_rec_t_::editop
op_editop_t editop
edit operation
Definition: agt_cfg.h:534
tstamp_now
void tstamp_now(time_t *tim)
Set the time_t to the current time.
Definition: tstamp.c:588
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
agt_cfg_ascendant_lists_check
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:3078
ncx_remove_backptr
void ncx_remove_backptr(ncx_backptr_t *ptr)
Remove the specified backptr for deletion.
Definition: ncx.c:11592
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_cfg_nested_silcall_t_::nested_silcallQ
dlq_hdr_t nested_silcallQ
Q of cchild SIL calls.
Definition: agt_cfg.h:460
agt_cfg_transaction_t_::silcall_sethook_done
boolean silcall_sethook_done
TRUE if the set-hook callbacks already done.
Definition: agt_cfg.h:342
agt_cfg_undo_rec_t_::newnode_parent
val_value_t * newnode_parent
newnode parent node
Definition: agt_cfg.h:549
agt_cfg_transaction_t_::timestamp
time_t timestamp
transaction start timestamp
Definition: agt_cfg.h:235
agt_cfg_check_hook_created
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:3520
agt_cfg_transaction_t_::skip_sil
boolean skip_sil
need to skip SIL callbacks
Definition: agt_cfg.h:306
rpc_err.h
NETCONF protocol standard error definitions.
agt_cfg_transaction_t_::silcall_invoke_only_sethook
boolean silcall_invoke_only_sethook
TRUE if the only set-hook callbacks should be invoked.
Definition: agt_cfg.h:339
OP_EDITOP_REMOVE
@ OP_EDITOP_REMOVE
remove, base:1.1 only
Definition: op.h:130
agt_cfg_transaction_t_::cfg_id
ncx_cfg_t cfg_id
configuration datastore being edited
Definition: agt_cfg.h:241
ERR_NCX_CFG_NOT_FOUND
@ ERR_NCX_CFG_NOT_FOUND
307
Definition: status_enum.h:350
agt_cfg_nested_silcall_t_::callback_obj
obj_template_t * callback_obj
object template for this callback
Definition: agt_cfg.h:457
agt_cfg_check_parent_edits
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:3335
agt_cfg.h
Manage Server configuration edit transactions.
agt_cfg_transaction_t_::silcall_undo_mode
boolean silcall_undo_mode
silcall undo mode active
Definition: agt_cfg.h:391
agt_cfg_undo_rec_t_::apply_res
status_t apply_res
apply phase status
Definition: agt_cfg.h:617
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
agt_cfg_child_edit_fields
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
agt_cfg_transaction_t_::hook_merge
boolean hook_merge
Add_edit API flag : hook merge flag.
Definition: agt_cfg.h:324
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_cfg_next_active_undo
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:3616
agt_cfg_transaction_t_::added_silcallQ
dlq_hdr_t added_silcallQ
Q of agt_cfg_silcall_t used to track which objects have remote SIL callbacks involved in this transac...
Definition: agt_cfg.h:406
agt_cfg_transaction_t_::fill_candidate_failed
boolean fill_candidate_failed
flag fill candidate from running failed
Definition: agt_cfg.h:303
agt_cfg_trans_hook_t_
struct of Transaction Hooks parameters
Definition: agt_cfg.h:755
agt_cfg_transaction_t_::skip_silsa_hooks
boolean skip_silsa_hooks
need to skip SIL-SA hooks
Definition: agt_cfg.h:397
agt_cfg_force_full_root_check
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
agt_cfg_prev_active_child_undo
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:3819
agt_cfg_child_silcall_t_::editop
op_editop_t editop
edit operation
Definition: agt_cfg.h:645
agt_cfg_transaction_t_::txid
ncx_transaction_id_t txid
transaction ID (uint64
Definition: agt_cfg.h:229
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
agt_cfg_undo_rec_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:499
agt_cfg_transaction_t_::start_bad
boolean start_bad
running config has YANG validation errors
Definition: agt_cfg.h:261
VAL_BTYPE
#define VAL_BTYPE(V)
Access the base type : same as VAL_TYPE.
Definition: val.h:548
ncx_get_backptr_node
void * ncx_get_backptr_node(ncx_backptr_t *backptr)
Get the back pointer node pointer.
Definition: ncx.c:11577
agt_cfg_audit_rec_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:696
agt_cfg_transaction_t_::silcall_done
boolean silcall_done
silcall done flag
Definition: agt_cfg.h:394
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
cfg_clear_candidate_dirty_flag
void cfg_clear_candidate_dirty_flag(void)
Clear the candidate dirty flag when it is saved to NV-storage or loaded into running from startup.
Definition: cfg.c:2044
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
agt_cfg_free_commit_test
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
TXID_T
#define TXID_T
For convenience.
Definition: ncxtypes.h:550
agt_cfg_transaction_t_::is_rollback
boolean is_rollback
transaction is a rollback
Definition: agt_cfg.h:282
agt_cfg_undo_rec_t_::newnode_marker
val_value_t * newnode_marker
newnode marker if swapped out
Definition: agt_cfg.h:546
obj_get_level
uint32 obj_get_level(const obj_template_t *obj)
Get the nest level for the specified object Top-level is '1' Does not count groupings as a level.
Definition: obj.c:11833
agt_cfg_first_undo
agt_cfg_undo_rec_t * agt_cfg_first_undo(agt_cfg_transaction_t *txcb)
Get the first undo record.
Definition: agt_cfg.c:2841
obj.h
Data Object Support.
cfg_get_config_id
cfg_template_t * cfg_get_config_id(ncx_cfg_t cfgid)
Get the config struct from its ID.
Definition: cfg.c:1530
obj_get_sil_priority
uint8 obj_get_sil_priority(obj_template_t *obj)
Get the SIL priority field.
Definition: obj.c:17194
agt_cfg_transaction_t_::auditQ
dlq_hdr_t auditQ
TBD: this is redundant and can be derived from the undoQ contains edit record highlights used in the ...
Definition: agt_cfg.h:354
agt_cfg_free_silcall
void agt_cfg_free_silcall(agt_cfg_silcall_t *silcall)
Clean and free a mallocedremote SIL callback back pointer.
Definition: agt_cfg.c:1887
agt_cfg_set_transaction_unload
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_silcall_t_::editop
op_editop_t editop
edit operation
Definition: agt_cfg.h:662
AGT_CFG_EDIT_ACTION_DELETE
@ AGT_CFG_EDIT_ACTION_DELETE
delete edit action
Definition: agt_cfg.h:185
agt_cfg_trans_hook_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:757
agt_cfg_transaction_is_unload
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
agt_cfg_silcall_t_::child_editQ
dlq_hdr_t child_editQ
Queue of EDIT2 children edits that will be used in the callback Q of agt_cfg_child_silcall_t.
Definition: agt_cfg.h:685
agt_cfg_transaction_t_::comment
const xmlChar * comment
comment provided by the caller: do not clone; just use backptr!!
Definition: agt_cfg.h:345
agt_cfg_set_transaction_commit
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
agt_cfg_transaction_t_::rootcheck_done
boolean rootcheck_done
root-check done flag
Definition: agt_cfg.h:267
agt_cfg_undo_rec_t_::child_undoQ
dlq_hdr_t child_undoQ
child undo recs can occur in edit2 mode if an existing entry is modified with a merge operation Inste...
Definition: agt_cfg.h:611
agt_cfg_undo_rec_t_::validate_res
status_t validate_res
validate phase status
Definition: agt_cfg.h:614
agt_cfg_silcall_t_::subsysQ
dlq_hdr_t * subsysQ
Q of subsystems that need this edit.
Definition: agt_cfg.h:671
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
agt_cfg_undo_rec_t_::newnode_editvars
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_transaction_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:226
agt_cfg_audit_rec_t_::curval
const val_value_t * curval
current value from edit
Definition: agt_cfg.h:711
val_clone_config_data
val_value_t * val_clone_config_data(const val_value_t *val, status_t *res)
Clone a specified val_value_t struct and sub-trees with config=true only.
Definition: val.c:7903
agt_cfg_commit_test_t_::obj
obj_template_t * obj
object template for commit test
Definition: agt_cfg.h:722
agt_cfg_transaction_t_::rollback_res
status_t rollback_res
saved rollback phase status
Definition: agt_cfg.h:250
agt_cfg_remove_module_commit_tests
void agt_cfg_remove_module_commit_tests(ncx_module_t *mod)
Remove module commit tests for specified module.
Definition: agt_cfg.c:1789
agt_cfg_add_nested_silcall
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
agt_cfg_undo_rec_t_::subsys_add_edit
boolean subsys_add_edit
add_edit mode form subsystem
Definition: agt_cfg.h:631
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
agt_cfg_transaction_t_::test_option
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
agt_cfg_nested_silcall_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: agt_cfg.h:427
agt_cfg_transaction_t_::silcallQ
dlq_hdr_t silcallQ
Q of agt_cfg_silcall_t used to track which objects have remote SIL callbacks involved in this transac...
Definition: agt_cfg.h:385
ncx_free_backptr
void ncx_free_backptr(ncx_backptr_t *ptr)
Free an ncx_backptr_t struct.
Definition: ncx.c:11433
agt_cfg_undo_rec_t_::curnode_marker
val_value_t * curnode_marker
curnode marker if swapped out
Definition: agt_cfg.h:555
agt_cfg_transaction_t_::is_validate
boolean is_validate
transaction is for the <validate> operation
Definition: agt_cfg.h:273
agt_cfg_trans_hook_t_::curval
val_value_t * curval
current value
Definition: agt_cfg.h:766
val_get_sil_priority
uint8 val_get_sil_priority(val_value_t *val)
Get the secondary SIL priority; zero if not found.
Definition: val.c:14322
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
obj_is_root
boolean obj_is_root(const obj_template_t *obj)
Check if object is marked as a root object.
Definition: obj.c:14152
status.h
Global error messages for status code enumerations.
agt_cfg_silcall_t_::hook_type
agt_hook_type_t hook_type
SIL-SA Hook type.
Definition: agt_cfg.h:680
agt_cfg_new_trans_hook
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:3377
agt_cfg_trans_hook_t_::subtree_mode
boolean subtree_mode
subtree mode active
Definition: agt_cfg.h:772
agt_cfg_undo_rec_t_::skip_sil_partial
boolean skip_sil_partial
skip SIL partial mode
Definition: agt_cfg.h:517
agt_cfg_silcall_t_::keyptrQ
dlq_hdr_t keyptrQ
manage list keys: Q of ncx_backptr_t to val_value_t
Definition: agt_cfg.h:674
dlq.h
dlq provides general double-linked list and queue support:
agt_cb_run_trans_complete
void agt_cb_run_trans_complete(agt_cfg_transaction_t *txcb)
Run Transaction Complete callbacks.
Definition: agt_cb.c:1922
agt_cfg_init_undorec
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
agt_cfg_undo_rec_t_::nested_silcallQ
dlq_hdr_t nested_silcallQ
nested silcalls can occur if an edit is created for a node with nested SIL callbacks,...
Definition: agt_cfg.h:600
agt_cfg_new_transaction
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
agt_cfg_undo_rec_t_::added_edit
boolean added_edit
Add_edit API flag.
Definition: agt_cfg.h:525
agt_cfg_undo_rec_t_::commit_res
status_t commit_res
commit phase status
Definition: agt_cfg.h:623
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
ERR_NCX_NO_ACCESS_STATE
@ ERR_NCX_NO_ACCESS_STATE
302
Definition: status_enum.h:345
ncx_transaction_id_t
uint64 ncx_transaction_id_t
transaction is scoped to single session write operation on a config
Definition: ncxtypes.h:548