yumapro  21.10T-8
YumaPro SDK
agt_action.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 - 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_agt_action
12 #define _H_agt_action
13 
14 /* FILE: agt_action.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 03-jan-16 abb Begun
36 
37 */
38 
39 #ifndef _H_agt_rpc
40 #include "agt_rpc.h"
41 #endif
42 
43 #ifndef _H_rpc
44 #include "rpc.h"
45 #endif
46 
47 #ifndef _H_ses
48 #include "ses.h"
49 #endif
50 
51 #ifndef _H_status_enum
52 #include "status_enum.h"
53 #endif
54 
55 #ifndef _H_val
56 #include "val.h"
57 #endif
58 
59 #ifndef _H_xml_util
60 #include "xml_util.h"
61 #endif
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 
68 /********************************************************************
69 * *
70 * T Y P E S *
71 * *
72 *********************************************************************/
73 
74 
127 typedef status_t
129  rpc_msg_t *msg,
130  xml_node_t *methnode,
131  val_value_t *actionval);
132 
133 
135 typedef struct agt_action_cbset_t_ {
138 
140  boolean regdone;
141 
142 #ifdef WITH_YCONTROL
143 
146  dlq_hdr_t subsysQ;
147 #endif
148 
150 
151 
152 /********************************************************************
153 * *
154 * F U N C T I O N S *
155 * *
156 *********************************************************************/
157 
158 
164 extern status_t
165  agt_action_init (void);
166 
167 
173 extern void
174  agt_action_cleanup (void);
175 
176 
189 extern status_t
190  agt_action_register_action (const xmlChar *defpath,
191  agt_rpc_phase_t phase,
192  agt_action_cb_t action_cb);
193 
194 
201 extern void
202  agt_action_unregister_action (const xmlChar *defpath);
203 
204 
210 extern boolean
212 
213 
230 extern status_t
232  rpc_msg_t *msg,
233  xml_node_t *method,
234  obj_template_t *rpcobj,
235  val_value_t **action_val);
236 
244 extern boolean
246 
247 
254 
255 
262 extern boolean
264 
265 
266 #ifdef WITH_YCONTROL
267 
274 extern status_t
275  agt_action_register_subsys_callback (const xmlChar *subsys_id,
276  const xmlChar *defpath);
277 
278 
285 extern void
286  agt_action_unregister_subsys_callback (const xmlChar *subsys_id,
287  const xmlChar *defpath);
288 
289 #endif // WITH_YCONTROL
290 
291 
298 extern val_value_t *
300 
301 
309 extern void
311 
312 
316 #ifdef __cplusplus
317 } /* end extern 'C' */
318 #endif
319 
320 #endif /* _H_agt_action */
NETCONF protocol remote procedure call server-side definitions.
gather node data into a simple struct.
Definition: xml_util.h:204
void agt_action_callback_regdone(obj_template_t *obj)
Set the ACTION as register done.
Definition: agt_action.c:511
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
status_t agt_action_register_action(const xmlChar *defpath, agt_rpc_phase_t phase, agt_action_cb_t action_cb)
add callback for 1 phase of action processing
Definition: agt_action.c:280
status_t(* agt_action_cb_t)(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *methnode, val_value_t *actionval)
Template for Action server callbacks.
Definition: agt_action.h:128
One YANG data-def-stmt.
Definition: obj.h:1140
NETCONF Session Common definitions module.
void agt_action_cleanup(void)
Cleanup the Action handler.
Definition: agt_action.c:232
agt_rpc_phase_t
There are 3 different callbacks possible in the server processing chain.
Definition: agt_rpc.h:109
void agt_action_unload_module(ncx_module_t *mod)
Check all the action objects from this module and clean any callbacks because the module is being unl...
Definition: agt_action.c:766
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1052
boolean agt_action_callback_set(obj_template_t *obj)
Check if an ACTION callback is registered for this object for SIL-SA usage.
Definition: agt_action.c:479
#define AGT_RPC_NUM_CALLBACK_PHASES
this constant is for the number of callback slots allocated in a 'cbset', and only includes the RPC p...
Definition: agt_rpc.h:89
Value Node Basic Support.
the agt_rpc module stores a set of callbacks for each RPC
Definition: agt_action.h:135
XML Utilities.
one value to match one type
Definition: val.h:870
boolean agt_action_callback_is_regdone(obj_template_t *obj)
Set the ACTION as register done.
Definition: agt_action.c:540
Session Control Block.
Definition: ses.h:542
boolean agt_action_is_action(obj_template_t *rpcobj)
Check if the specified node is the action.
Definition: agt_action.c:256
status_t
global error return code
Definition: status_enum.h:186
status_t agt_action_register_subsys_callback(const xmlChar *subsys_id, const xmlChar *defpath)
Register an object specific ACTION callback function.
Definition: agt_action.c:573
NETCONF protocol remote procedure call common definitions.
boolean regdone
flag registration done
Definition: agt_action.h:140
void agt_action_unregister_action(const xmlChar *defpath)
remove a callback for all phases of action processing
Definition: agt_action.c:369
void agt_action_unregister_subsys_callback(const xmlChar *subsys_id, const xmlChar *defpath)
Unregister an object specific ACTION callback function.
Definition: agt_action.c:654
val_value_t * agt_action_find_node(val_value_t *val)
Find the nested node that is an action.
Definition: agt_action.c:730
status_t agt_action_init(void)
Initialize the Action handler.
Definition: agt_action.c:182
global error status code enumerations
status_t agt_action_parse_input(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *method, obj_template_t *rpcobj, val_value_t **action_val)
RPC "<action>" received, parse parameters against anydata &#39;action&#39;.
Definition: agt_action.c:412