yumapro  20.10-12
YumaPro SDK
support_save.h
Go to the documentation of this file.
1 #ifdef WITH_SUPPORT_SAVE
2 /*
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_support_save
13 #define _H_support_save
14 
15 /* FILE: support_save.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
29 /*********************************************************************
30 * *
31 * C H A N G E H I S T O R Y *
32 * *
33 *********************************************************************
34 
35 date init comment
36 ----------------------------------------------------------------------
37 27-jul-17 abb Begun
38 
39 */
40 
41 #include <xmlstring.h>
42 
43 #ifndef _H_dlq
44 #include "dlq.h"
45 #endif
46 
47 #ifndef _H_obj
48 #include "obj.h"
49 #endif
50 
51 #ifndef _H_ses
52 #include "ses.h"
53 #endif
54 
55 #ifndef _H_status_enum
56 #include "status_enum.h"
57 #endif
58 
59 #ifndef _H_xml_msg
60 #include "xml_msg.h"
61 #endif
62 
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 /********************************************************************
69 * *
70 * T Y P E S *
71 * *
72 *********************************************************************/
73 
74 
92 typedef status_t
93  (*support_save_cbfn_t) (ses_cb_t *scb,
94  xml_msg_hdr_t *mhdr,
95  xmlns_id_t parent_nsid,
96  const xmlChar *subtree_name,
97  int32 indent,
98  int32 startindent);
99 
100 
106 extern status_t
107  support_save_init (void);
108 
109 
115 extern status_t
116  support_save_init2 (void);
117 
118 
123 extern void
124  support_save_cleanup (void);
125 
126 
137 extern status_t
138  support_save_register_cbfn (const xmlChar *subtree_name,
139  support_save_cbfn_t subtree_cbfn);
140 
141 
152 status_t
153  support_save_write (ses_cb_t *scb,
154  xml_msg_hdr_t *mhdr,
155  int32 indent,
156  int32 startindent);
157 
158 
164 extern boolean
165  support_save_is_active (void);
166 
167 
173 extern obj_template_t *
175 
176 
180 #ifdef __cplusplus
181 } /* end extern 'C' */
182 #endif
183 
184 #endif /* _H_support_save */
185 #endif // WITH_SUPPORT_SAVE
ses.h
NETCONF Session Common definitions module.
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
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
support_save_is_active
boolean support_save_is_active(void)
Check if a support-save is in progress.
Definition: support_save.c:479
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
status_enum.h
global error status code enumerations
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
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
op.h
NETCONF protocol operations.
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
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
support_save_cbfn_t
status_t(* support_save_cbfn_t)(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, const xmlChar *subtree_name, int32 indent, int32 startindent)
Support Save Callback Function Used to add info to the support-save report.
Definition: support_save.h:93
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.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
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.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ncx_find_object
obj_template_t * ncx_find_object(ncx_module_t *mod, const xmlChar *objname)
Find a top level module object.
Definition: ncx.c:4345
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
ncx_get_progname
const char * ncx_get_progname(void)
Get the progname buffer.
Definition: ncx.c:13993
val_util.h
Value Node Utilities.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
support_save.h
Support Save operation handler.
val_child.h
Value Node Child Access Support.
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
ERR_INTERNAL_INIT_SEQ
@ ERR_INTERNAL_INIT_SEQ
007
Definition: status_enum.h:197
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
support_save_init2
status_t support_save_init2(void)
Load the yumaworks-support-save module (phase 2)
Definition: support_save.c:250
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
support_save_init
status_t support_save_init(void)
Load the yumaworks-support-save module.
Definition: support_save.c:210
xml_msg.h
XML and JSON Message send and receive support.
support_save_get_object
obj_template_t * support_save_get_object(void)
Get the support-save-data object template.
Definition: support_save.c:500
ncx_netconfd_running
boolean ncx_netconfd_running(void)
Check if netconfd running.
Definition: ncx.c:11805
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
ncxmod_load_module
status_t ncxmod_load_module(const xmlChar *modname, const xmlChar *revision, dlq_hdr_t *savedevQ, ncx_module_t **retmod)
Determine the location of the specified module and then load it into the system, if not already loade...
Definition: ncxmod.c:4342
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
ERR_NCX_IN_USE
@ ERR_NCX_IN_USE
match netconf errors (257 - 275)
Definition: status_enum.h:298
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
support_save_cleanup
void support_save_cleanup(void)
Cleanup the support_save module.
Definition: support_save.c:295
status.h
Global error messages for status code enumerations.
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support: