yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
agt_val.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2024, 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_val
13#define _H_agt_val
14
15/* FILE: agt_val.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
34date init comment
35----------------------------------------------------------------------
3620-may-06 abb Begun
3730-sep-08 abb Implement AGT_CB_TEST_APPLY and
38 agt_val_split_root_test for YANG support of
39 dummy running config commit-time validation
40*/
41
42#ifndef _H_agt
43#include "agt.h"
44#endif
45
46#ifndef _H_agt_cfg
47#include "agt_cfg.h"
48#endif
49
50#ifndef _H_cfg
51#include "cfg.h"
52#endif
53
54#ifndef _H_ncxtypes
55#include "ncxtypes.h.h"
56#endif
57
58#ifndef _H_op
59#include "op.h"
60#endif
61
62#ifndef _H_rpc
63#include "rpc.h"
64#endif
65
66#ifndef _H_ses
67#include "ses.h"
68#endif
69
70#ifndef _H_status
71#include "status.h"
72#endif
73
74#ifndef _H_val
75#include "val.h"
76#endif
77
78#ifndef _H_xml_msg
79#include "xml_msg.h"
80#endif
81
82#ifndef _H_yang_patch
83#include "yang_patch.h"
84#endif
85
86#ifdef __cplusplus
87extern "C" {
88#endif
89
90/********************************************************************
91* *
92* C O N S T A N T S *
93* *
94*********************************************************************/
95
96/********************************************************************
97* *
98* T Y P E S *
99* *
100*********************************************************************/
101
102/********************************************************************
103* *
104* F U N C T I O N S *
105* *
106*********************************************************************/
107
170extern status_t
172 rpc_msg_t *rpcmsg,
173 xml_msg_hdr_t *msg,
174 val_value_t *rpcinput,
175 obj_template_t *rpcroot);
176
177
178
179
212extern status_t
214 rpc_msg_t *rpcmsg,
215 xml_msg_hdr_t *msg,
216 val_value_t *rpcinput,
217 obj_template_t *rpcroot,
218 val_value_t *action_val);
219
220
244extern status_t
246 xml_msg_hdr_t *msg,
247 val_value_t *valset,
248 val_value_t *valroot,
249 ncx_layer_t layer);
250
251
295extern status_t
297 xml_msg_hdr_t *msghdr,
299 val_value_t *root);
300
301
337extern status_t
339 rpc_msg_t *msg,
340 cfg_template_t *target,
341 val_value_t *valroot,
342 op_editop_t editop,
343 boolean with_sil_callbacks);
344
345
363extern status_t
365 rpc_msg_t *msg,
366 cfg_template_t *target,
367 val_value_t *pducfg,
368 op_editop_t editop);
369
370
400extern status_t
402 rpc_msg_t *msg,
403 cfg_template_t *source,
404 cfg_template_t *target,
405 boolean save_nvstore,
406 boolean save_backup,
407 const xmlChar *backup_source,
408 boolean *save_backup_done,
409 boolean *rootcheck_done,
410 status_t *rootcheck_res);
411
412
430extern status_t
432 rpc_msg_t *msg,
433 cfg_template_t *source,
434 cfg_template_t *target);
435
436
447extern status_t
449 rpc_msg_t *msg,
450 val_value_t *root);
451
452
453
467extern status_t
469 rpc_msg_t *msg,
470 val_value_t *root);
471
472
473
479extern void
481
482
502extern void
504 boolean set_augment);
505
506
524extern void
526
527
535extern void
537
538
552extern boolean
554 agt_cfg_undo_rec_t *undo,
555 val_value_t *newnode,
556 val_value_t *curnode,
557 boolean find_real_edit);
558
559
572extern status_t
574 rpc_msg_t *msg,
575 val_value_t *deleteval,
576 boolean isfirst);
577
578
597extern status_t
599 val_value_t *curnode,
600 val_value_t *newnode_parent,
601 boolean for_extra_delete,
602 boolean for_commit_deletes,
603 agt_cfg_undo_rec_t **ret_undo,
604 agt_cfg_undo_rec_t **ret_parent_undo);
605
606
623extern status_t
625 rpc_msg_t *msg,
627 const xmlChar *defpath,
628 val_value_t *edit_value,
629 op_editop_t editop);
630
631
672extern status_t
674 rpc_msg_t *msg,
676 const xmlChar *defpath,
677 val_value_t *edit_value,
678 const xmlChar *edit_operation,
679 const xmlChar *insert_where,
680 const xmlChar *insert_point);
681
682
683
757extern status_t
759 rpc_msg_t *msg,
761 const xmlChar *defpath,
762 val_value_t *edit_value,
763 yang_patch_op_t patch_op,
764 const xmlChar *insert_where,
765 const xmlChar *insert_point);
766
767
812extern status_t
814 rpc_msg_t *msg,
816 const xmlChar *defpath,
817 val_value_t *edit_value,
818 const xmlChar *edit_operation,
819 const xmlChar *insert_where,
820 const xmlChar *insert_point,
821 boolean skip_cb);
822
823
834extern val_value_t *
836 const xmlChar *defpath,
837 status_t *retres);
838
839
869extern boolean
871 agt_cfg_undo_rec_t *undo);
872
873
874
875
890extern status_t
892 xml_msg_hdr_t *msghdr,
893 val_value_t *startval,
894 val_value_t *curval,
895 val_value_t *root);
896
897
915extern status_t
917 rpc_msg_t *msg,
918 val_value_t *source_root,
919 cfg_template_t *target);
920
924#ifdef __cplusplus
925} /* end extern 'C' */
926#endif
927
928#endif /* _H_agt_val */
Multi-Protocol Network Management Server.
Manage Server configuration edit transactions.
@ brief NCX configuration database manager
status_t agt_val_add_edit(ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, const xmlChar *defpath, val_value_t *edit_value, op_editop_t editop)
Create new edit based on edit_value.
Definition: agt_val.c:16743
status_t agt_val_setup_remove_node(rpc_msg_t *msg, val_value_t *curnode, val_value_t *newnode_parent, boolean for_extra_delete, boolean for_commit_deletes, agt_cfg_undo_rec_t **ret_undo, agt_cfg_undo_rec_t **ret_parent_undo)
Setup an edit node for a node that needs to be removed because the module is being unloaded.
Definition: agt_val.c:16607
status_t agt_val_apply_commit(ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *source, cfg_template_t *target, boolean save_nvstore, boolean save_backup, const xmlChar *backup_source, boolean *save_backup_done, boolean *rootcheck_done, status_t *rootcheck_res)
Apply the requested commit operation.
Definition: agt_val.c:15767
void agt_val_clean_cached_results(void)
Clean cached results.
Definition: agt_val.c:16419
status_t agt_val_rpc_xpath_check(ses_cb_t *scb, rpc_msg_t *rpcmsg, xml_msg_hdr_t *msg, val_value_t *rpcinput, obj_template_t *rpcroot)
Check for any nodes which are present but have false when-stmts associated with the node.
Definition: agt_val.c:14882
status_t agt_val_add_edit_insert(ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, const xmlChar *defpath, val_value_t *edit_value, yang_patch_op_t patch_op, const xmlChar *insert_where, const xmlChar *insert_point)
Add Edit Insert function.
Definition: agt_val.c:17305
status_t agt_val_commit_delete_allowed(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *deleteval, boolean isfirst)
Check if the current session is allowed to delete the node found in the requested commit delete opera...
Definition: agt_val.c:16517
status_t agt_val_start_delete_dead_nodes(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *root)
Mark nodes deleted for each false when-stmt from <validate>
Definition: agt_val.c:16270
boolean agt_val_check_in_reverse_delete(val_value_t *useval, agt_cfg_undo_rec_t *undo)
Check if currently in reverse deletes.
Definition: agt_val.c:17846
void agt_val_init_commit_tests(void)
Initialize commit tests.
Definition: agt_val.c:16399
status_t agt_val_check_commit_edits(ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *source, cfg_template_t *target)
Check if the requested commit operation would cause any ACM or partial lock violations in the running...
Definition: agt_val.c:16058
status_t agt_val_root_check(ses_cb_t *scb, xml_msg_hdr_t *msghdr, agt_cfg_transaction_t *txcb, val_value_t *root)
Perform a YANG validation root-check.
Definition: agt_val.c:15025
status_t agt_val_apply_write(ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *target, val_value_t *pducfg, op_editop_t editop)
Apply the requested write operation.
Definition: agt_val.c:15506
val_value_t * agt_val_get_data(ncx_cfg_t cfg_id, const xmlChar *defpath, status_t *retres)
Invoke get data callback.
Definition: agt_val.c:17743
void agt_val_add_module_commit_tests(ncx_module_t *mod, boolean set_augment)
Invoke module commit tests.
Definition: agt_val.c:16346
status_t agt_val_add_edit_ex(ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, const xmlChar *defpath, val_value_t *edit_value, const xmlChar *edit_operation, const xmlChar *insert_where, const xmlChar *insert_point)
Create a new edit based on edit_value.
Definition: agt_val.c:16823
boolean agt_val_edit_was_deleted(agt_cfg_transaction_t *txcb, agt_cfg_undo_rec_t *undo, val_value_t *newnode, val_value_t *curnode, boolean find_real_edit)
Check if the edit in progress was deleted by delete_dead_nodes.
Definition: agt_val.c:16460
status_t agt_val_delete_def_dead_nodes(ses_cb_t *scb, xml_msg_hdr_t *msghdr, val_value_t *startval, val_value_t *curval, val_value_t *root)
Delete all the default nodes that have false when-stmt exprs.
Definition: agt_val.c:17913
status_t agt_val_validate_write(ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *target, val_value_t *valroot, op_editop_t editop, boolean with_sil_callbacks)
Validate the requested <edit-config> write operation.
Definition: agt_val.c:15156
status_t agt_val_add_edit_max(ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, const xmlChar *defpath, val_value_t *edit_value, const xmlChar *edit_operation, const xmlChar *insert_where, const xmlChar *insert_point, boolean skip_cb)
Create a new edit based on edit_value.
Definition: agt_val.c:17668
status_t agt_val_action_xpath_check(ses_cb_t *scb, rpc_msg_t *rpcmsg, xml_msg_hdr_t *msg, val_value_t *rpcinput, obj_template_t *rpcroot, val_value_t *action_val)
Check for any nodes which are present but have false when-stmts associated with the node.
Definition: agt_val.c:14906
status_t agt_val_delete_dead_nodes(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *root)
Mark nodes deleted for each false when-stmt from <validate>
Definition: agt_val.c:16216
status_t agt_val_instance_check(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *valset, val_value_t *valroot, ncx_layer_t layer)
Check for the proper number of object instances for the specified value struct.
Definition: agt_val.c:14961
status_t agt_val_check_validate_complete(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *source_root, cfg_template_t *target)
Check if the validate complete callbacks need to be invoked.
Definition: agt_val.c:18066
void agt_val_finish_delete_dead_nodes(rpc_msg_t *msg)
Finish deleting dead nodes.
Definition: agt_val.c:16309
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
yang_patch_op_t
YANG Patch operation type.
Definition: yang_patch.h:87
status_t
global error return code
Definition: status_enum.h:210
ncx_cfg_t
hardwire the 3 standard configs
Definition: ncxtypes.h:548
ncx_layer_t
Enumeration of NETCONF protocol layers.
Definition: ncxtypes.h:507
NETCONF protocol operations.
NETCONF protocol remote procedure call common definitions.
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
Transaction Control Block.
Definition: agt_cfg.h:235
struct of params to undo an edit operation.
Definition: agt_cfg.h:559
struct representing 1 configuration database
Definition: cfg.h:229
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
One YANG data-def-stmt.
Definition: obj.h:1229
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
Value Node Basic Support.
XML and JSON Message send and receive support.
YANG Patch Media Type.