yumapro  20.10-12
YumaPro SDK
agt_support_save.h
Go to the documentation of this file.
1 #ifdef WITH_SUPPORT_SAVE
2 /*
3  * Copyright (c) 2017 - 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_support_save
13 #define _H_agt_support_save
14 
15 /* FILE: agt_support_save.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 29-jul-17 abb Begun
37 
38 */
39 
40 #ifndef _H_status_enum
41 #include "status_enum.h"
42 #endif
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
61 /********************************************************************
62 * *
63 * F U N C T I O N S *
64 * *
65 *********************************************************************/
66 
74 extern status_t
75  agt_support_save_init (void);
76 
77 
83 extern void
85 
86 
90 #ifdef __cplusplus
91 } /* end extern 'C' */
92 #endif
93 
94 #endif /* _H_agt_support_save */
95 #endif // WITH_SUPPORT_SAVE
ses.h
NETCONF Session Common definitions module.
cfg.h
support_save_write
status_t support_save_write(ses_cb_t *scb, xml_msg_hdr_t *mhdr, int32 indent, int32 startindent)
Write the support save information to the specified session Use the registered callbacks in the order...
Definition: support_save.c:387
agt_util.h
Utility Functions for NCX Server method routines.
ses_new_indent_count
int32 ses_new_indent_count(boolean indent_in, int32 indent, int32 indent_amount)
Get the new indent count from the current and indent_amount.
Definition: ses.c:4148
agt_rpc_register_method
status_t agt_rpc_register_method(const xmlChar *module, const xmlChar *method_name, agt_rpc_phase_t phase, agt_rpc_method_t method)
add callback for 1 phase of RPC processing
Definition: agt_rpc.c:2557
support_save_is_active
boolean support_save_is_active(void)
Check if a support-save is in progress.
Definition: support_save.c:479
tstamp.h
Timestamp utilities.
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
agt_state.h
NETCONF State Monitoring Data Model Module support.
val.h
Value Node Basic Support.
xml_wr_full_check_val2
void xml_wr_full_check_val2(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean force_xmlns, boolean expand_varexpr, xmlns_id_t parent_nsid)
Generate entire val_value_t *w/filter)
Definition: xml_wr.c:3561
ncx_get_first_module
ncx_module_t * ncx_get_first_module(void)
Get the first module in the ncx_modQ.
Definition: ncx.c:4729
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
AGT_RPC_PH_VALIDATE
@ AGT_RPC_PH_VALIDATE
(2) cb after the input is parsed
Definition: agt_rpc.h:115
status_enum.h
global error status code enumerations
NCX_LAYER_OPERATION
@ NCX_LAYER_OPERATION
protocol operation layer
Definition: ncxtypes.h:346
xml_wr.h
XML Write functions.
support_save_register_cbfn
status_t support_save_register_cbfn(const xmlChar *subtree_name, support_save_cbfn_t subtree_cbfn)
Register a support-save callback function.
Definition: support_save.c:330
RPC_DATA_YANG
@ RPC_DATA_YANG
STD is used by YANG rpc or action stmts; no extra <data> container will be added to the <rpc-reply> c...
Definition: rpc.h:167
ncxmod.h
NCX Module Load Manager.
xml_wr_begin_elem
void xml_wr_begin_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write a start XML tag to the specified session without attributes.
Definition: xml_wr.c:3040
cfg_get_root
val_value_t * cfg_get_root(ncx_cfg_t cfgid)
Get the config root for the specified config.
Definition: cfg.c:3240
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
agt_rpc_unregister_method
void agt_rpc_unregister_method(const xmlChar *module, const xmlChar *method_name)
remove the callback functions for all phases of RPC or Action processing for the specified RPC method...
Definition: agt_rpc.c:2759
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.
ncx_first_deviation_module
ncx_module_t * ncx_first_deviation_module(void)
Get the first deviation module.
Definition: ncx.c:14008
agt_sys_get_system_node
val_value_t * agt_sys_get_system_node(void)
Get the /yuma-system:system container.
Definition: agt_sys.c:1737
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
agt_support_save.h
Implement <get-support-save> RPC function.
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ses_message_indent_count
int32 ses_message_indent_count(const ses_cb_t *scb)
Get the message indent count for this session.
Definition: ses.c:2822
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
ncx_get_progname
const char * ncx_get_progname(void)
Get the progname buffer.
Definition: ncx.c:13993
ses_putcstr
void ses_putcstr(ses_cb_t *scb, const xmlChar *str, int32 indent)
write XML element safe content string Write a zero-terminated element content string to the session
Definition: ses.c:2522
NCX_CFGID_CANDIDATE
@ NCX_CFGID_CANDIDATE
candidate datastore
Definition: ncxtypes.h:385
agt_sil_lib.h
Server Instrumentation Library Support.
NCX_CFGID_STARTUP
@ NCX_CFGID_STARTUP
startup datastore
Definition: ncxtypes.h:386
agt_sil_lib_support_save
void agt_sil_lib_support_save(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, int32 indent, int32 startindent)
Dump the XML support-save info for the <sils> container.
Definition: agt_sil_lib.c:900
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
support_save.h
Support Save operation handler.
xml_wr_end_elem
void xml_wr_end_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write an end tag to the specified session.
Definition: xml_wr.c:3114
support_save_init2
status_t support_save_init2(void)
Load the yumaworks-support-save module (phase 2)
Definition: support_save.c:250
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
xml_wr_full_val
void xml_wr_full_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent)
Generate entire val_value_t.
Definition: xml_wr.c:3650
agt.h
Multi-Protocol Network Management Server.
ERR_NCX_RESOURCE_DENIED
@ ERR_NCX_RESOURCE_DENIED
269
Definition: status_enum.h:310
NCX_MAX_LINELEN
#define NCX_MAX_LINELEN
Internal buffer max line length.
Definition: ncxconst.h:310
agt_state_get_capabilities
val_value_t * agt_state_get_capabilities(void)
Get a const back pointer to current /netconf-state/capabilities.
Definition: agt_state.c:2778
agt_support_save_init
status_t agt_support_save_init(void)
Initialize the NETCONF Server support save method routines.
Definition: agt_support_save.c:1021
xml_wr_string_elem
void xml_wr_string_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *str, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent)
Write a start tag, simple string content, and an end tag to the specified session.
Definition: xml_wr.c:3235
agt_ncx_load.h
NETCONF Server load and unload operations.
agt_sys.h
NETCONF system.yang DM module support.
xml_wr_empty_elem
void xml_wr_empty_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write an empty XML tag to the specified session without attributes.
Definition: xml_wr.c:3076
rpc_err.h
NETCONF protocol standard error definitions.
agt_state_get_sessions
val_value_t * agt_state_get_sessions(void)
Get a const back pointer to current /etconf-state/sessions tree.
Definition: agt_state.c:2746
NCX_NT_NONE
@ NCX_NT_NONE
not set
Definition: ncxtypes.h:273
thd.h
Thread support (for now limited to netconfd)
agt_support_save_cleanup
void agt_support_save_cleanup(void)
Cleanup the NETCONF Server support save method routines.
Definition: agt_support_save.c:1063
agt_ncx_load_dump_bundles
void agt_ncx_load_dump_bundles(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, int32 indent, int32 startindent)
Generate XML <bundle> records for the support-save output.
Definition: agt_ncx_load.c:2955
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
obj.h
Data Object Support.
ncx_file_close
void ncx_file_close(FILE *fp)
Close a file; check result.
Definition: ncx.c:13235
ncx_next_deviation_module
ncx_module_t * ncx_next_deviation_module(ncx_module_t *curmod)
Get the next deviation module after curmod.
Definition: ncx.c:14027
ncx_get_next_module
ncx_module_t * ncx_get_next_module(const ncx_module_t *mod)
Get the next module in the ncx_modQ.
Definition: ncx.c:4751
ses_putstr
void ses_putstr(ses_cb_t *scb, const xmlChar *str)
Write a zero-terminated string to the session.
Definition: ses.c:2460
cfg_get_config_name
const xmlChar * cfg_get_config_name(ncx_cfg_t cfgid)
Get the config name from its ID.
Definition: cfg.c:1493
ERR_FIL_OPEN
@ ERR_FIL_OPEN
system errors start at 100
Definition: status_enum.h:212
agt_state_get_datastores
val_value_t * agt_state_get_datastores(void)
Get a const back pointer to current /netconf-state/datastores.
Definition: agt_state.c:2794
status.h
Global error messages for status code enumerations.
agt_check_save
boolean agt_check_save(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
Used by agt_ncx_cfg_save function to filter just what is supposed to be saved in the <startup> config...
Definition: agt_util.c:2788
ncx_get_version
status_t ncx_get_version(xmlChar *buffer, uint32 buffsize)
Get the the Yuma version ID string.
Definition: ncx.c:9577