yumapro  21.10T-9
YumaPro SDK
agt_sil_lib.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_sil_lib
13 #define _H_agt_sil_lib
14 
15 /* FILE: agt_sil_lib.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
22 
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 00-may-14 abb Begun; split out from agt.h
38 */
39 
40 #include <xmlstring.h>
41 
42 #ifndef _H_dlq
43 #include "dlq.h"
44 #endif
45 
46 #ifndef _H_ncxtypes
47 #include "ncxtypes.h"
48 #endif
49 
50 #ifndef _H_ses
51 #include "ses.h"
52 #endif
53 
54 #ifndef _H_status_enum
55 #include "status_enum.h"
56 #endif
57 
58 #ifndef _H_xml_msg
59 #include "xml_msg.h"
60 #endif
61 
62 #ifndef _H_xmlns
63 #include "xmlns.h"
64 #endif
65 
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 
88 /********************************************************************
89 * *
90 * C O N S T A N T S *
91 * *
92 *********************************************************************/
93 #define SA_NAME_EXT (const xmlChar *)"_sa"
94 
95 /********************************************************************
96 * *
97 * T Y P E S *
98 * *
99 *********************************************************************/
100 
102 typedef enum agt_siltype_t_ {
106 } agt_siltype_t;
107 
108 
109 /********* Server Instrumentation Library Callbacks ***********/
110 
111 
121 typedef status_t (*agt_sil_init_fn_t)(const xmlChar *modname,
122  const xmlChar *revision);
123 
124 
125 
133 typedef status_t (*agt_sil_init2_fn_t)(void);
134 
135 
141 typedef void (*agt_sil_cleanup_fn_t)(void);
142 
143 
144 
145 /* Example: N=test2
146 extern status_t y_test2_init(const xmlChar *modname, const xmlChar *revision);
147 extern status_t y_test2_init2(void);
148 extern void y_test2_cleanup(void);
149 */
150 
151 #define AGT_SIL_LIB_EXTERN(N) \
152  extern status_t y_##N##_init (const xmlChar *modname, const xmlChar *revision);\
153  extern status_t y_##N##_init2 (void);\
154  extern void y_##N##_cleanup (void);
155 
156 
157 /********************************************************************
158 * *
159 * F U N C T I O N S *
160 * *
161 *********************************************************************/
162 
163 
175 extern status_t
176  agt_load_sil_code (const xmlChar *modname,
177  const xmlChar *revision,
178  boolean cfgloaded,
179  agt_siltype_t siltyp,
180  boolean is_sil_sa);
181 
182 
195 extern status_t
196  agt_unload_sil_code (const xmlChar *modname);
197 
198 
205 extern boolean
206  agt_dynlib_loaded (const xmlChar *name);
207 
208 
214 extern void
215  agt_sil_lib_init (void);
216 
217 
223 extern void
224  agt_sil_lib_cleanup (void);
225 
226 
236 extern status_t load_SIL (const xmlChar *modname,
237  const xmlChar *revision,
238  agt_siltype_t siltyp,
239  boolean is_sil_sa);
240 
241 
253 extern status_t
254  load_SIL_loadpath (const xmlChar *modname,
255  const xmlChar *revision,
256  agt_siltype_t siltyp,
257  boolean is_sil_sa,
258  boolean is_loadpath);
259 
260 
266 extern status_t
267  agt_sil_lib_call_init2 (void);
268 
269 
281 extern void
283  xml_msg_hdr_t *mhdr,
284  xmlns_id_t parent_nsid,
285  int32 indent,
286  int32 startindent);
287 
288 
301 extern status_t
302  agt_sil_lib_register_statlib (const xmlChar *modname,
303  agt_sil_init_fn_t init_fn,
304  agt_sil_init2_fn_t init2_fn,
305  agt_sil_cleanup_fn_t cleanup_fn);
306 
307 
308 
312 #ifdef __cplusplus
313 } /* end extern 'C' */
314 #endif
315 
316 #endif /* _H_agt */
status_t(* agt_sil_init_fn_t)(const xmlChar *modname, const xmlChar *revision)
SIL init function template.
Definition: agt_sil_lib.h:121
dlq provides general double-linked list and queue support:
Common Encoding Message Header No longer XML specific!! Used by JSON parsing as well!! Allows common ...
Definition: xml_msg.h:351
void agt_sil_lib_cleanup(void)
Cleanup the module.
Definition: agt_sil_lib.c:785
not set
Definition: agt_sil_lib.h:103
agt_siltype_t
SIL types.
Definition: agt_sil_lib.h:102
SIL is a bundle.
Definition: agt_sil_lib.h:105
status_t agt_unload_sil_code(const xmlChar *modname)
Unload the Server Instrumentation Library for the specified module.
Definition: agt_sil_lib.c:681
NETCONF Session Common definitions module.
void(* agt_sil_cleanup_fn_t)(void)
SIL cleanup function template.
Definition: agt_sil_lib.h:141
status_t load_SIL_loadpath(const xmlChar *modname, const xmlChar *revision, agt_siltype_t siltyp, boolean is_sil_sa, boolean is_loadpath)
Load the SIL code or load the YANG module.
Definition: agt_sil_lib.c:288
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
void agt_sil_lib_init(void)
Initialize the module.
Definition: agt_sil_lib.c:768
status_t load_SIL(const xmlChar *modname, const xmlChar *revision, agt_siltype_t siltyp, boolean is_sil_sa)
Load the SIL code or load the YANG module.
Definition: agt_sil_lib.c:260
YANG module data structures Many internal representations of YANG module constructs.
XML and JSON Message send and receive support.
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
status_t(* agt_sil_init2_fn_t)(void)
SIL init2 function template.
Definition: agt_sil_lib.h:133
Session Control Block.
Definition: ses.h:542
status_t
global error return code
Definition: status_enum.h:186
status_t agt_sil_lib_register_statlib(const xmlChar *modname, agt_sil_init_fn_t init_fn, agt_sil_init2_fn_t init2_fn, agt_sil_cleanup_fn_t cleanup_fn)
Register a static SIL or SIL-SA library for a module or a bundle.
Definition: agt_sil_lib.c:1001
status_t agt_load_sil_code(const xmlChar *modname, const xmlChar *revision, boolean cfgloaded, agt_siltype_t siltyp, boolean is_sil_sa)
Load the Server Instrumentation Library for the specified module.
Definition: agt_sil_lib.c:435
SIL is a module.
Definition: agt_sil_lib.h:104
XML namespace support.
boolean agt_dynlib_loaded(const xmlChar *name)
Check a module of bundle name is in the dynlibQ.
Definition: agt_sil_lib.c:745
status_t agt_sil_lib_call_init2(void)
Call the available SIL init2 callbacks.
Definition: agt_sil_lib.c:844
global error status code enumerations