yumapro  20.10-14
YumaPro SDK
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 - 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_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 
34 date init comment
35 ----------------------------------------------------------------------
36 20-may-06 abb Begun
37 30-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
87 extern "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 
170 extern 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 
201 extern status_t
203  xml_msg_hdr_t *msg,
204  val_value_t *valset,
205  val_value_t *valroot,
206  ncx_layer_t layer);
207 
208 
252 extern status_t
254  xml_msg_hdr_t *msghdr,
255  agt_cfg_transaction_t *txcb,
256  val_value_t *root);
257 
258 
294 extern status_t
296  rpc_msg_t *msg,
297  cfg_template_t *target,
298  val_value_t *valroot,
299  op_editop_t editop,
300  boolean with_sil_callbacks);
301 
302 
320 extern status_t
322  rpc_msg_t *msg,
323  cfg_template_t *target,
324  val_value_t *pducfg,
325  op_editop_t editop);
326 
327 
357 extern status_t
359  rpc_msg_t *msg,
360  cfg_template_t *source,
361  cfg_template_t *target,
362  boolean save_nvstore,
363  boolean save_backup,
364  const xmlChar *backup_source,
365  boolean *save_backup_done,
366  boolean *rootcheck_done,
367  status_t *rootcheck_res);
368 
369 
387 extern status_t
389  rpc_msg_t *msg,
390  cfg_template_t *source,
391  cfg_template_t *target);
392 
393 
404 extern status_t
406  rpc_msg_t *msg,
407  val_value_t *root);
408 
409 
429 extern void
431  boolean set_augment);
432 
433 
453 extern void
455 
456 
464 extern void
466 
467 
481 extern boolean
483  agt_cfg_undo_rec_t *undo,
484  val_value_t *newnode,
485  val_value_t *curnode,
486  boolean find_real_edit);
487 
488 
501 extern status_t
503  rpc_msg_t *msg,
504  val_value_t *deleteval,
505  boolean isfirst);
506 
507 
520 extern status_t
522  val_value_t *targval,
523  agt_cfg_undo_rec_t **ret_undo,
524  agt_cfg_undo_rec_t **ret_parent_undo);
525 
526 
543 extern status_t
545  rpc_msg_t *msg,
546  agt_cfg_transaction_t *txcb,
547  const xmlChar *defpath,
548  val_value_t *edit_value,
549  op_editop_t editop);
550 
551 
592 extern status_t
594  rpc_msg_t *msg,
595  agt_cfg_transaction_t *txcb,
596  const xmlChar *defpath,
597  val_value_t *edit_value,
598  const xmlChar *edit_operation,
599  const xmlChar *insert_where,
600  const xmlChar *insert_point);
601 
602 
603 
677 extern status_t
679  rpc_msg_t *msg,
680  agt_cfg_transaction_t *txcb,
681  const xmlChar *defpath,
682  val_value_t *edit_value,
683  yang_patch_op_t patch_op,
684  const xmlChar *insert_where,
685  const xmlChar *insert_point);
686 
687 
732 extern status_t
734  rpc_msg_t *msg,
735  agt_cfg_transaction_t *txcb,
736  const xmlChar *defpath,
737  val_value_t *edit_value,
738  const xmlChar *edit_operation,
739  const xmlChar *insert_where,
740  const xmlChar *insert_point,
741  boolean skip_cb);
742 
743 
753 extern val_value_t *
754  agt_val_get_data (ncx_cfg_t cfg_id,
755  const xmlChar *defpath,
756  status_t *retres);
757 
758 
788 extern boolean
790  agt_cfg_undo_rec_t *undo);
791 
792 
793 
794 
809 extern status_t
811  xml_msg_hdr_t *msghdr,
812  val_value_t *startval,
813  val_value_t *curval,
814  val_value_t *root);
815 
816 
820 #ifdef __cplusplus
821 } /* end extern 'C' */
822 #endif
823 
824 #endif /* _H_agt_val */
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:12884
Common Encoding Message Header No longer XML specific!! Used by JSON parsing as well!! Allows common ...
Definition: xml_msg.h:351
@ brief NCX configuration database manager
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
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:13929
yang_patch_op_t
YANG Patch operation type.
Definition: yang_patch.h:87
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:13189
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:15465
One YANG data-def-stmt.
Definition: obj.h:1057
NETCONF Session Common definitions module.
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:15021
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:900
Transaction Control Block.
Definition: agt_cfg.h:224
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:13634
void agt_val_init_commit_tests(void)
Initialize commit tests.
Definition: agt_val.c:14190
Value Node Basic Support.
struct representing 1 configuration database
Definition: cfg.h:225
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:14550
struct of params to undo an edit operation.
Definition: agt_cfg.h:497
void agt_val_clean_cached_results(void)
Clean cached results.
Definition: agt_val.c:14210
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:14251
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:14470
YANG Patch Media Type.
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
Manage Server configuration edit transactions.
XML and JSON Message send and receive support.
one value to match one type
Definition: val.h:860
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:13069
Session Control Block.
Definition: ses.h:542
status_t
global error return code
Definition: status_enum.h:186
Multi-Protocol Network Management Server.
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:13005
ncx_layer_t
Enumeration of NETCONF protocol layers.
Definition: ncxtypes.h:342
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:14088
NETCONF protocol remote procedure call common definitions.
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:15566
Global error messages for status code enumerations.
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:13435
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:15391
NETCONF protocol operations.
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:15633
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:14308
ncx_cfg_t
hardwire the 3 standard configs
Definition: ncxtypes.h:383
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:14389
void agt_val_add_module_commit_tests(ncx_module_t *mod, boolean set_augment)
Invoke module commit tests.
Definition: agt_val.c:14140