yumapro  23.10T-9
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 - 2023, 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
591extern status_t
593 val_value_t *targval,
594 agt_cfg_undo_rec_t **ret_undo,
595 agt_cfg_undo_rec_t **ret_parent_undo);
596
597
614extern status_t
616 rpc_msg_t *msg,
618 const xmlChar *defpath,
619 val_value_t *edit_value,
620 op_editop_t editop);
621
622
663extern status_t
665 rpc_msg_t *msg,
667 const xmlChar *defpath,
668 val_value_t *edit_value,
669 const xmlChar *edit_operation,
670 const xmlChar *insert_where,
671 const xmlChar *insert_point);
672
673
674
748extern status_t
750 rpc_msg_t *msg,
752 const xmlChar *defpath,
753 val_value_t *edit_value,
754 yang_patch_op_t patch_op,
755 const xmlChar *insert_where,
756 const xmlChar *insert_point);
757
758
803extern status_t
805 rpc_msg_t *msg,
807 const xmlChar *defpath,
808 val_value_t *edit_value,
809 const xmlChar *edit_operation,
810 const xmlChar *insert_where,
811 const xmlChar *insert_point,
812 boolean skip_cb);
813
814
825extern val_value_t *
827 const xmlChar *defpath,
828 status_t *retres);
829
830
860extern boolean
862 agt_cfg_undo_rec_t *undo);
863
864
865
866
881extern status_t
883 xml_msg_hdr_t *msghdr,
884 val_value_t *startval,
885 val_value_t *curval,
886 val_value_t *root);
887
888
906extern status_t
908 rpc_msg_t *msg,
909 val_value_t *source_root,
910 cfg_template_t *target);
911
915#ifdef __cplusplus
916} /* end extern 'C' */
917#endif
918
919#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:16662
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:15750
void agt_val_clean_cached_results(void)
Clean cached results.
Definition: agt_val.c:16402
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:14867
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:17208
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:16500
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:16253
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:17749
void agt_val_init_commit_tests(void)
Initialize commit tests.
Definition: agt_val.c:16382
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:16041
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:15010
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:15489
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:17646
void agt_val_add_module_commit_tests(ncx_module_t *mod, boolean set_augment)
Invoke module commit tests.
Definition: agt_val.c:16329
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:16742
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:16443
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:17816
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:15141
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:17571
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:14891
status_t agt_val_setup_remove_node(rpc_msg_t *msg, val_value_t *targval, 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:16581
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:16199
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:14946
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:17969
void agt_val_finish_delete_dead_nodes(rpc_msg_t *msg)
Finish deleting dead nodes.
Definition: agt_val.c:16292
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:548
struct representing 1 configuration database
Definition: cfg.h:229
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1134
One YANG data-def-stmt.
Definition: obj.h:1220
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:397
Value Node Basic Support.
XML and JSON Message send and receive support.
YANG Patch Media Type.