yumapro  20.10-12
YumaPro SDK
sil_call.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_sil_call
13 #define _H_sil_call
14 
15 /* FILE: sil_call.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
22 
30 /*********************************************************************
31 * *
32 * C H A N G E H I S T O R Y *
33 * *
34 *********************************************************************
35 
36 date init comment
37 ----------------------------------------------------------------------
38 30-apr-14 abb Begun
39 */
40 
41 #ifndef _H_agt
42 #include "agt.h"
43 #endif
44 
45 #ifndef _H_dlq
46 #include "dlq.h"
47 #endif
48 
49 #ifndef _H_sil_sa_types
50 #include "sil_sa_types.h"
51 #endif
52 
53 #ifndef _H_status_enum
54 #include "status_enum.h"
55 #endif
56 
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /********************************************************************
63 * *
64 * C O N S T A N T S *
65 * *
66 *********************************************************************/
67 
68 
69 /********************************************************************
70 * *
71 * T Y P E S *
72 * *
73 *********************************************************************/
74 
75 
76 /********************************************************************
77 * *
78 * F U N C T I O N S *
79 * *
80 *********************************************************************/
81 
105 extern status_t
106  sil_call_load_code (sil_sa_cb_t *cb);
107 
108 
117 extern status_t
118  sil_call_load_one (sil_sa_cb_t *cb,
119  const xmlChar *name,
120  boolean is_module);
121 
122 
131 extern status_t
132  sil_call_edit_phase (sil_sa_cb_t *cb,
133  agt_cbtyp_t cbtyp,
134  ses_cb_t *scb);
135 
136 
142 extern void
143  sil_call_clean_profile (sil_sa_cb_t *cb);
144 
145 
152 extern void
153  sil_call_init (void);
154 
155 
163 extern void
164  sil_call_cleanup (void);
165 
166 
172 extern void
173  sil_call_free_bundle_cb (sil_sa_bundle_t *buncb);
174 
175 
183 extern dlq_hdr_t *
185 
186 
194 boolean
195  sil_call_check_bundle_duplicate (sil_sa_cb_t *cb,
196  const xmlChar *modname);
197 
198 
202 #ifdef __cplusplus
203 } /* end extern 'C' */
204 #endif
205 
206 #endif /* _H_sil_call */
AGT_HOOK_TYPE_SETHOOK
@ AGT_HOOK_TYPE_SETHOOK
Set-Hook.
Definition: agt.h:712
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
AGT_HOOK_TYPE_NONE
@ AGT_HOOK_TYPE_NONE
not set
Definition: agt.h:711
sil_sa_any_library_parms
boolean sil_sa_any_library_parms(void)
Check if any library parms are set.
Definition: sil_sa.c:3616
AGT_SILTYP_MODULE
@ AGT_SILTYP_MODULE
SIL is a module.
Definition: agt_sil_lib.h:108
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
agt_cb_fn_t
status_t(* agt_cb_fn_t)(ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval)
Callback function for server object handler.
Definition: agt_cb.h:241
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
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
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.
VAL_UINT32
#define VAL_UINT32(V)
Access the value as an uint32 ONLY if NCX_BT_UINT32.
Definition: val.h:497
sil_call_load_one
status_t sil_call_load_one(sil_sa_cb_t *cb, const xmlChar *name, boolean is_module)
Load the SIL-SA library code for one module or bundle.
Definition: sil_call.c:1017
status_enum.h
global error status code enumerations
ncx_clean_backptrQ
void ncx_clean_backptrQ(dlq_hdr_t *backptrQ)
Clean an entire Q of ncx_backptr_t structs.
Definition: ncx.c:11470
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
ncx_next_backptr
ncx_backptr_t * ncx_next_backptr(ncx_backptr_t *curptr)
Get next back pointer struct.
Definition: ncx.c:11545
agt_hook_get_type_name
const xmlChar * agt_hook_get_type_name(agt_hook_type_t type)
Get the keyword for the specified agt_hook_type_t enumeration.
Definition: agt_hook_util.c:219
AGT_SILTYP_BUNDLE
@ AGT_SILTYP_BUNDLE
SIL is a bundle.
Definition: agt_sil_lib.h:109
ncxmod.h
NCX Module Load Manager.
ncx_clear_load_callback
void ncx_clear_load_callback(ncx_load_cbfn_t cbfn)
Clear the callback function for a load-module event.
Definition: ncx.c:8510
agt_cb.h
NETCONF Server Data Model callback handler.
OP_EDITOP_MERGE
@ OP_EDITOP_MERGE
edit op is merge
Definition: op.h:124
val_find_next_child
val_value_t * val_find_next_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname, const val_value_t *curchild)
Find the next instance of the specified child node.
Definition: val.c:8748
VAL_ENUM_NAME
#define VAL_ENUM_NAME(V)
Access the enum name in the value ONLY if BCX_NT_ENUM This is the macro used to check values in SIL c...
Definition: val.h:434
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
agt_cbtype_name
const xmlChar * agt_cbtype_name(agt_cbtyp_t cbtyp)
Get the string for the server callback phase.
Definition: agt.c:4247
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
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.
sil_sa.h
Server Instrumentation Library for Sub Agents (SIL-SA)
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xml_val.h
Utility functions for creating value structs.
AGT_HOOK_TYPE_TRANSACTION
@ AGT_HOOK_TYPE_TRANSACTION
Transaction Hook.
Definition: agt.h:713
xml_strndup
xmlChar * xml_strndup(const xmlChar *copyFrom, uint32 maxlen)
String duplicate for max N xmlChars.
Definition: xml_util.c:1663
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
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_AGT_TARG_CANDIDATE
@ NCX_AGT_TARG_CANDIDATE
target=candidate
Definition: ncxtypes.h:354
val_util.h
Value Node Utilities.
agt_get_savedevQ
dlq_hdr_t * agt_get_savedevQ(void)
Get the agt_savedevQ pointer.
Definition: agt.c:4747
ncx_set_load_callback
status_t ncx_set_load_callback(ncx_load_cbfn_t cbfn)
Set the callback function for a load-module event.
Definition: ncx.c:8472
agt_sil_lib.h
Server Instrumentation Library Support.
AGT_CB_VALIDATE
@ AGT_CB_VALIDATE
P1: write operation validate.
Definition: agt.h:620
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
sil_call_get_bundle_modQ
dlq_hdr_t * sil_call_get_bundle_modQ(void)
Get the bundle modQ.
val_child.h
Value Node Child Access Support.
sil_call_free_bundle_cb
void sil_call_free_bundle_cb(sil_sa_bundle_t *buncb)
Clean and free a bundle control block.
Definition: sil_call.c:1177
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
sil_sa_types.h
Data structures for the SIL-SA subsystem.
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.
load_SIL
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
sil_call_init
void sil_call_init(void)
Init the module.
Definition: sil_call.c:1147
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
agt.h
Multi-Protocol Network Management Server.
ERR_NCX_NOT_FOUND
@ ERR_NCX_NOT_FOUND
225
Definition: status_enum.h:264
sil_call_clean_profile
void sil_call_clean_profile(sil_sa_cb_t *cb)
Clean the module-specific data from the profile.
Definition: sil_call.c:1128
agt_hook_util.h
NETCONF Server Set/Transaction Hook utility functions.
sil_call_load_code
status_t sil_call_load_code(sil_sa_cb_t *cb)
Load the SIL-SA library code for the modules and bundles in the <register-repsonse> message.
Definition: sil_call.c:884
agt_cb_sa_hook_t
status_t(* agt_cb_sa_hook_t)(ses_cb_t *scb, rpc_msg_t *msg, op_editop_t editop, val_value_t *newval, val_value_t *curval, const xmlChar *transaction_id, boolean isvalidate, boolean isload, boolean isrunning)
Typedef of the SIL-SA version of agt_cb_hook_t callback.
Definition: agt_cb.h:619
ncx_first_backptr
ncx_backptr_t * ncx_first_backptr(dlq_hdr_t *que)
Get first back pointer struct.
Definition: ncx.c:11513
sil_call.h
Handles loading SIL-SA libraries and invoking callback functions. Handles both static SIL-SA and dyna...
agt_hook_get_type_enum
agt_hook_type_t agt_hook_get_type_enum(const xmlChar *type)
Get agt_hook_fmt_t enumeration structure from specified string.
Definition: agt_hook_util.c:248
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
log.h
NCX System Logging Manager.
rpc_new_msg
rpc_msg_t * rpc_new_msg(void)
Malloc and initialize a new rpc_msg_t struct.
Definition: rpc.c:84
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
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
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
rpc_free_msg
void rpc_free_msg(rpc_msg_t *msg)
Free all the memory used by the specified rpc_msg_t.
Definition: rpc.c:152
sil_call_check_bundle_duplicate
boolean sil_call_check_bundle_duplicate(sil_sa_cb_t *cb, const xmlChar *modname)
Check for a module already claimed in a bundle.
Definition: sil_call.c:1197
AGT_CB_ROLLBACK
@ AGT_CB_ROLLBACK
P3-neg: write operation rollback.
Definition: agt.h:623
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
sil_call_cleanup
void sil_call_cleanup(void)
Cleanup the module.
Definition: sil_call.c:1162
ncx_get_backptr_node
void * ncx_get_backptr_node(ncx_backptr_t *backptr)
Get the back pointer node pointer.
Definition: ncx.c:11577
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ncx.h
YANG module utility functions.
AGT_CB_COMMIT
@ AGT_CB_COMMIT
P3-pos: write operation commit.
Definition: agt.h:622
ncxmod_load_deviation
status_t ncxmod_load_deviation(const xmlChar *deviname, dlq_hdr_t *deviationQ)
Load a deviation module (special handling by compiler)
Definition: ncxmod.c:4744
obj.h
Data Object Support.
ycontrol.h
YumaPro Subsystem Control Protocol.
ERR_NCX_IN_USE
@ ERR_NCX_IN_USE
match netconf errors (257 - 275)
Definition: status_enum.h:298
sil_sa_find_library_parm
boolean sil_sa_find_library_parm(const xmlChar *libstr)
Find a library parm name in the library_parmQ.
Definition: sil_sa.c:3637
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
sil_call_edit_phase
status_t sil_call_edit_phase(sil_sa_cb_t *cb, agt_cbtyp_t cbtyp, ses_cb_t *scb)
Invoke 1 phase of the edit procedure.
Definition: sil_call.c:1084
val_child_next_same
val_value_t * val_child_next_same(val_value_t *curnode)
Get the next node of the same type.
Definition: val_child.c:2359
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
ncx_free_backptr
void ncx_free_backptr(ncx_backptr_t *ptr)
Free an ncx_backptr_t struct.
Definition: ncx.c:11433
AGT_HOOK_TYPE_POST_SETHOOK
@ AGT_HOOK_TYPE_POST_SETHOOK
Post Set-Hook.
Definition: agt.h:714
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:
op_editop_id
op_editop_t op_editop_id(const xmlChar *opstr)
Get the ID for the editop from its keyword.
Definition: op.c:146
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
AGT_CB_APPLY
@ AGT_CB_APPLY
P2: write operation apply.
Definition: agt.h:621