yumapro  20.10-12
YumaPro SDK
sil_sa_hooks.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #ifndef _H_sil_sa_hooks
12 #define _H_sil_sa_hooks
13 
14 /* FILE: sil_sa_hooks.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 29-jun-20 am Begun
36 */
37 
38 #include <xmlstring.h>
39 
40 #ifndef _H_rpc
41 #include "rpc.h"
42 #endif
43 
44 #ifndef _H_val
45 #include "val.h"
46 #endif
47 
48 #ifndef _H_ycontrol_types
49 #include "ycontrol_types.h"
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /********************************************************************
57 * *
58 * C O N S T A N T S *
59 * *
60 *********************************************************************/
61 
62 
63 /********************************************************************
64 * *
65 * T Y P E S *
66 * *
67 *********************************************************************/
68 
69 
70 /********************************************************************
71 * *
72 * F U N C T I O N S *
73 * *
74 *********************************************************************/
75 
76 
96 extern void
97  sil_sa_hooks_clean_added_edits (dlq_hdr_t *added_editQ);
98 
99 
109 extern val_value_t *
110  sil_sa_hooks_make_added_edit_payload (sil_sa_cb_t *sacb,
111  status_t *res);
112 
113 
114 
115 
116 
168 extern status_t
169  sil_sa_hooks_add_edit (sil_sa_cb_t *sil_sa_cb,
170  const xmlChar *defpath,
171  val_value_t *edit_value,
172  const xmlChar *edit_operation,
173  const xmlChar *insert_where,
174  const xmlChar *insert_point,
175  boolean skip_cb);
176 
177 
193 extern status_t
194  sil_sa_hooks_send_get_request (sil_sa_cb_t *sil_sa_cb,
195  ncx_cfg_t cfg_id,
196  const xmlChar *defpath);
197 
198 
207 extern status_t
208  sil_sa_hook_handle_get_request (sil_sa_cb_t *sil_sa_cb,
209  val_value_t *msgbody,
210  ycontrol_msgbody_t msgbody_type);
211 
212 
217 #ifdef __cplusplus
218 } /* end extern 'C' */
219 #endif
220 
221 #endif /* _H_sil_sa_hooks */
agt_util.h
Utility Functions for NCX Server method routines.
sil_sa_hooks_send_get_request
status_t sil_sa_hooks_send_get_request(sil_sa_cb_t *sil_sa_cb, ncx_cfg_t cfg_id, const xmlChar *defpath)
Send the <hook-get-request> message.
Definition: sil_sa_hooks.c:650
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
sil_sa_hooks_clean_added_edits
void sil_sa_hooks_clean_added_edits(dlq_hdr_t *added_editQ)
Clean the added edits from the profile.
Definition: sil_sa_hooks.c:407
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_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
sil_sa_profile.h
Agent Profile handler for SIL-SA.
YCONTROL_MSGBODY_ERROR
@ YCONTROL_MSGBODY_ERROR
error message
Definition: ycontrol_types.h:96
YCONTROL_MSG_SUBSYS_REQUEST
@ YCONTROL_MSG_SUBSYS_REQUEST
subsystem-request sent from subsystem to server
Definition: ycontrol_types.h:81
sil_sa_hooks_add_edit
status_t sil_sa_hooks_add_edit(sil_sa_cb_t *sil_sa_cb, const xmlChar *defpath, val_value_t *edit_value, const xmlChar *edit_operation, const xmlChar *insert_where, const xmlChar *insert_point, boolean skip_cb)
Add an edit to the current transaction from SIL-SA.
Definition: sil_sa_hooks.c:566
op.h
NETCONF protocol operations.
ncxmod.h
NCX Module Load Manager.
agt_not.h
NETCONF Notifications DM module support.
sil_sa_hooks_make_added_edit_payload
val_value_t * sil_sa_hooks_make_added_edit_payload(sil_sa_cb_t *sacb, status_t *res)
Make the <transaction-response> message return-value.
Definition: sil_sa_hooks.c:438
agt_cb.h
NETCONF Server Data Model callback handler.
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
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
val_add_child
void val_add_child(val_value_t *child, val_value_t *parent)
Add a child (deprecated: use val_child_add instead)
Definition: val.c:8231
xml_val.h
Utility functions for creating value structs.
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
val_add_datapath_attr
status_t val_add_datapath_attr(val_value_t *val, obj_template_t *obj)
Add the ye:datapath attribute to a node that is tagged as an ywx:datapath node.
Definition: val_util.c:7041
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
val_util.h
Value Node Utilities.
agt_sil_lib.h
Server Instrumentation Library Support.
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_clone
val_value_t * val_clone(const val_value_t *val)
Clone a specified val_value_t struct and sub-trees.
Definition: val.c:7836
val_child.h
Value Node Child Access Support.
sil_sa_types.h
Data structures for the SIL-SA subsystem.
SIL_SA_ST_WAIT_HOOK_GETDATA
@ SIL_SA_ST_WAIT_HOOK_GETDATA
waiting for a Get-Data Hook response from the server, interrupting an edit transaction
Definition: sil_sa_types.h:143
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
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
ncx_nmda.h
NMDA Data Support.
ycontrol_send
status_t ycontrol_send(const xmlChar *service_id, uint32 *msgid, ycontrol_msgtype_t msgtype, val_value_t *service_payload, status_t msg_status)
Send a YControl message.
Definition: ycontrol.c:1116
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
sil_sa_hooks.h
SIL-SA Hooks Support.
sil_call.h
Handles loading SIL-SA libraries and invoking callback functions. Handles both static SIL-SA and dyna...
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
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
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
ycontrol.h
YumaPro Subsystem Control Protocol.
ycontrol_types.h
Some YControl data types.
sil_sa_hook_handle_get_request
status_t sil_sa_hook_handle_get_request(sil_sa_cb_t *sil_sa_cb, val_value_t *msgbody, ycontrol_msgbody_t msgbody_type)
Handles incoming <payload> from server for the <hook-get-request>
Definition: sil_sa_hooks.c:706
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
xpath_find_schema_target_int
status_t xpath_find_schema_target_int(const xmlChar *target, obj_template_t **targobj)
@
Definition: xpath.c:2475
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
agt_timer.h
Handle timer services for the server.
SIL_SA
#define SIL_SA
YControl service name.
Definition: sil_sa.h:95
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
status.h
Global error messages for status code enumerations.
dlq.h
dlq provides general double-linked list and queue support: