yumapro  20.10-12
YumaPro SDK
agt_val_unload.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_unload
13 #define _H_agt_val_unload
14 
15 /* FILE: agt_val_unload.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 19-dec-15 abb Begun; split from agt_val.c
36 */
37 
38 #ifndef _H_cfg
39 #include "cfg.h"
40 #endif
41 
42 #ifndef _H_rpc
43 #include "rpc.h"
44 #endif
45 
46 #ifndef _H_ses
47 #include "ses.h"
48 #endif
49 
50 #ifndef _H_status_enum
51 #include "status_enum.h"
52 #endif
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 /********************************************************************
59 * *
60 * C O N S T A N T S *
61 * *
62 *********************************************************************/
63 
64 /********************************************************************
65 * *
66 * T Y P E S *
67 * *
68 *********************************************************************/
69 
70 /********************************************************************
71 * *
72 * F U N C T I O N S *
73 * *
74 *********************************************************************/
75 
109 extern status_t
110  agt_val_unload_mod_nodes (ses_cb_t *scb,
111  rpc_msg_t *msg,
112  xml_node_t *methnode,
113  ncx_module_t *mod);
114 
119 #ifdef __cplusplus
120 } /* end extern 'C' */
121 #endif
122 
123 #endif /* _H_agt_val_unload */
ses.h
NETCONF Session Common definitions module.
cfg.h
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
ERR_NCX_WRONG_NODETYP
@ ERR_NCX_WRONG_NODETYP
282
Definition: status_enum.h:325
agt_util.h
Utility Functions for NCX Server method routines.
xpath_first_resnode_valptr
val_value_t * xpath_first_resnode_valptr(xpath_resnode_t *resnode)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3982
agt_ncx_cfg_save
status_t agt_ncx_cfg_save(cfg_template_t *cfg)
Save the specified cfg to the its startup source, which should be stored in the cfg struct.
Definition: agt_ncx.c:5489
obj_is_abstract
boolean obj_is_abstract(const obj_template_t *obj)
Check if object is being used as an object identifier or error-info.
Definition: obj.c:14291
xpath_next_resnode_valptr
val_value_t * xpath_next_resnode_valptr(xpath_resnode_t *resnode, val_value_t *valptr)
Get the next node val pointer from a result node struct.
Definition: xpath.c:4017
ncx_find_backptr
ncx_backptr_t * ncx_find_backptr(const dlq_hdr_t *que, void *node)
Find the specified back pointer struct.
Definition: ncx.c:11609
ncx_get_mod_nsid
xmlns_id_t ncx_get_mod_nsid(const ncx_module_t *mod)
Get the main module namespace ID.
Definition: ncx.c:4850
agt_val_silcall_invoke
status_t agt_val_silcall_invoke(agt_cbtyp_t cbtyp, ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_undo_rec_t *undo)
Invoke the callbacks recorded in an undo record.
Definition: agt_val_silcall.c:3486
obj_get_leafrefQ
dlq_hdr_t * obj_get_leafrefQ(const obj_template_t *obj)
Get the leafrefQ for this obj.
Definition: obj.c:11358
val.h
Value Node Basic Support.
obj_get_leafref_targobj
obj_template_t * obj_get_leafref_targobj(obj_template_t *obj)
Get the target object for a leafref leaf or leaf-list.
Definition: obj.c:15884
xpath_new_pcb
xpath_pcb_t * xpath_new_pcb(const xmlChar *xpathstr, xpath_getvar_fn_t getvar_fn)
malloc a new XPath parser control block
Definition: xpath.c:2739
status_enum.h
global error status code enumerations
NCX_LAYER_OPERATION
@ NCX_LAYER_OPERATION
protocol operation layer
Definition: ncxtypes.h:346
obj_get_mod
ncx_module_t * obj_get_mod(obj_template_t *obj)
Get the module pointer for this object.
Definition: obj.c:12218
op.h
NETCONF protocol operations.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
agt_val_silcall_handle_remote_transaction
status_t agt_val_silcall_handle_remote_transaction(agt_cfg_transaction_t *txcb, ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, boolean is_reverse_edit)
Start a distributed transaction with the agt_sil module This function will not return until the entir...
Definition: agt_val_silcall.c:3299
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_cb.h
NETCONF Server Data Model callback handler.
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
agt_record_error
void agt_record_error(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
Generate an rpc_err_rec_t and save it in the msg.
Definition: agt_util.c:1942
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_val.h
NETCONF Server database callback handler.
xpath1.h
XPath 1.0 expression support.
obj_is_leafy
boolean obj_is_leafy(const obj_template_t *obj)
Check if object is a proper leaf or leaflist.
Definition: obj.c:13478
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
AGT_CFG_EDIT_TYPE_PARTIAL
@ AGT_CFG_EDIT_TYPE_PARTIAL
REPLACE = subtree replace.
Definition: agt_cfg.h:192
ncx_get_first_object_ex
obj_template_t * ncx_get_first_object_ex(ncx_module_t *mod, boolean augment_ok)
Get the first object in the datadefQs for the specified module.
Definition: ncx.c:4975
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
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.
agt_ncx.h
NETCONF Server standard method routines.
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
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
agt_val_apply_write
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:13229
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.
xpath1_eval_expr
xpath_result_t * xpath1_eval_expr(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, status_t *res)
Evaluate an XPath expression use if the prefixes are YANG: must/when.
Definition: xpath1.c:5293
obj_is_top
boolean obj_is_top(const obj_template_t *obj)
Check if the object is top-level object within the YANG module that defines it.
Definition: obj.c:14748
agt_val_unload_mod_nodes
status_t agt_val_unload_mod_nodes(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *methnode, ncx_module_t *mod)
Unload the module data nodes.
Definition: agt_val_unload.c:644
NCX_CFGID_CANDIDATE
@ NCX_CFGID_CANDIDATE
candidate datastore
Definition: ncxtypes.h:385
AGT_CB_VALIDATE
@ AGT_CB_VALIDATE
P1: write operation validate.
Definition: agt.h:620
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_child.h
Value Node Child Access Support.
obj_gen_object_id_xpath
status_t obj_gen_object_id_xpath(const obj_template_t *obj, xmlChar **buff)
Malloc and Generate the object ID for an object node.
Definition: obj.c:10143
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.
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
yangconst.h
Contains YANG constants separated to prevent H file include loops.
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
agt.h
Multi-Protocol Network Management Server.
xpath_yang.h
YANG-specific Xpath support.
xpath_get_next_resnode
xpath_resnode_t * xpath_get_next_resnode(xpath_resnode_t *resnode)
Get the next result in the renodeQ from a result struct.
Definition: xpath.c:3959
agt_val_silcall.h
NETCONF Server database callback handler. SIL callback code.
agt_val_setup_remove_node
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:14183
NCX_NT_OBJ
@ NCX_NT_OBJ
obj_template_t
Definition: ncxtypes.h:277
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
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
ncx_get_next_object_ex
obj_template_t * ncx_get_next_object_ex(ncx_module_t *mod, obj_template_t *curobj, boolean augment_ok)
Get the next object in the specified module.
Definition: ncx.c:5066
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_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
val_set_by_default
boolean val_set_by_default(const val_value_t *val)
Check if the value was set by val_add_defaults.
Definition: val.c:12571
obj_is_choice
boolean obj_is_choice(const obj_template_t *obj)
Check if object is a YANG choice.
Definition: obj.c:13425
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
obj_is_augment
boolean obj_is_augment(const obj_template_t *obj)
Check if the obj is an augment statement.
Definition: obj.c:13703
rpc_err.h
NETCONF protocol standard error definitions.
NCX_NT_VAL
@ NCX_NT_VAL
val_value_t
Definition: ncxtypes.h:276
agt_cfg.h
Manage Server configuration edit transactions.
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
obj_is_cli
boolean obj_is_cli(const obj_template_t *obj)
Check if object is marked as a CLI object.
Definition: obj.c:14222
NCX_NT_NONE
@ NCX_NT_NONE
not set
Definition: ncxtypes.h:273
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_val_commit_delete_allowed
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:14102
NCX_LAYER_CONTENT
@ NCX_LAYER_CONTENT
application layer
Definition: ncxtypes.h:347
agt_val_unload.h
Handle SIL and SIL-SA callbacks for a library unload.
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
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
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_val_silcall_has_subsys_callbacks
boolean agt_val_silcall_has_subsys_callbacks(agt_cfg_transaction_t *txcb)
Check if the transaction needs subsystem callbacks.
Definition: agt_val_silcall.c:2530
obj_is_data_db
boolean obj_is_data_db(const obj_template_t *obj)
Check if the object is some sort of data Constrained to only check the config DB objects,...
Definition: obj.c:13788
agt_val_silcall_setup
status_t agt_val_silcall_setup(agt_cbtyp_t cbtyp, op_editop_t editop, ses_cb_t *scb, rpc_msg_t *msg, val_value_t *newnode, val_value_t *curnode, boolean lookparent, boolean indelete, boolean in_reverse_delete, agt_cfg_undo_rec_t *undo)
Find the correct user callback function and invoke it.
Definition: agt_val_silcall.c:2582
ncx_free_backptr
void ncx_free_backptr(ncx_backptr_t *ptr)
Free an ncx_backptr_t struct.
Definition: ncx.c:11433
XP_RT_NODESET
@ XP_RT_NODESET
node-set result
Definition: xpath.h:347
xmlns.h
XML namespace support.
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.
dlq.h
dlq provides general double-linked list and queue support:
obj_get_augment_targobj
obj_template_t * obj_get_augment_targobj(obj_template_t *obj)
Get the target object for an augments object.
Definition: obj.c:15905