yumapro  24.10-1
YumaPro SDK
Loading...
Searching...
No Matches
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 - 2022, 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
35date init comment
36----------------------------------------------------------------------
3700-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
68extern "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
102typedef enum agt_siltype_t_ {
107
108
109/********* Server Instrumentation Library Callbacks ***********/
110
111
121typedef status_t (*agt_sil_init_fn_t)(const xmlChar *modname,
122 const xmlChar *revision);
123
124
125
134
135
141typedef void (*agt_sil_cleanup_fn_t)(void);
142
143
144
145/* Example: N=test2
146extern status_t y_test2_init(const xmlChar *modname, const xmlChar *revision);
147extern status_t y_test2_init2(void);
148extern 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
175extern 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
195extern status_t
196 agt_unload_sil_code (const xmlChar *modname);
197
198
205extern boolean
206 agt_dynlib_loaded (const xmlChar *name);
207
208
214extern void
215 agt_sil_lib_init (void);
216
217
223extern void
224 agt_sil_lib_cleanup (void);
225
226
236extern status_t load_SIL (const xmlChar *modname,
237 const xmlChar *revision,
238 agt_siltype_t siltyp,
239 boolean is_sil_sa);
240
241
253extern 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
266extern status_t
268
269
281extern void
283 xml_msg_hdr_t *mhdr,
284 xmlns_id_t parent_nsid,
285 int32 indent,
286 int32 startindent);
287
288
301extern 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
311#ifdef __cplusplus
312} /* end extern 'C' */
313#endif
314
315#endif /* _H_agt */
dlq provides general double-linked list and queue support:
status_t(* agt_sil_init_fn_t)(const xmlChar *modname, const xmlChar *revision)
SIL init function template.
Definition: agt_sil_lib.h:121
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:439
status_t agt_sil_lib_call_init2(void)
Call the available SIL init2 callbacks.
Definition: agt_sil_lib.c:875
status_t(* agt_sil_init2_fn_t)(void)
SIL init2 function template.
Definition: agt_sil_lib.h:133
agt_siltype_t
SIL types.
Definition: agt_sil_lib.h:102
boolean agt_dynlib_loaded(const xmlChar *name)
Check a module of bundle name is in the dynlibQ.
Definition: agt_sil_lib.c:774
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:1041
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:261
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:940
void agt_sil_lib_cleanup(void)
Cleanup the module.
Definition: agt_sil_lib.c:816
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:289
void(* agt_sil_cleanup_fn_t)(void)
SIL cleanup function template.
Definition: agt_sil_lib.h:141
void agt_sil_lib_init(void)
Initialize the module.
Definition: agt_sil_lib.c:799
status_t agt_unload_sil_code(const xmlChar *modname)
Unload the Server Instrumentation Library for the specified module.
Definition: agt_sil_lib.c:713
@ AGT_SILTYP_BUNDLE
SIL is a bundle.
Definition: agt_sil_lib.h:105
@ AGT_SILTYP_NONE
not set
Definition: agt_sil_lib.h:103
@ AGT_SILTYP_MODULE
SIL is a module.
Definition: agt_sil_lib.h:104
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
YANG module data structures Many internal representations of YANG module constructs.
NETCONF Session Common definitions module.
global error status code enumerations
Session Control Block.
Definition: ses.h:573
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
XML and JSON Message send and receive support.
XML namespace support.