yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
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
33date init comment
34----------------------------------------------------------------------
3503-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
64extern "C" {
65#endif
66
67
68/********************************************************************
69* *
70* T Y P E S *
71* *
72*********************************************************************/
73
74
127typedef status_t
128 (*agt_action_cb_t) (ses_cb_t *scb,
129 rpc_msg_t *msg,
130 xml_node_t *methnode,
131 val_value_t *actionval);
132
133
135typedef struct agt_action_cbset_t_ {
138
140 boolean regdone;
141
142#ifdef WITH_YCONTROL
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
164extern status_t
165 agt_action_init (void);
166
167
173extern void
174 agt_action_cleanup (void);
175
176
189extern 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
201extern void
202 agt_action_unregister_action (const xmlChar *defpath);
203
204
210extern boolean
212
213
230extern status_t
232 rpc_msg_t *msg,
233 xml_node_t *method,
234 obj_template_t *rpcobj,
235 val_value_t **action_val);
236
244extern boolean
246
247
254
255
262extern boolean
264
265
266#ifdef WITH_YCONTROL
276extern status_t
277 agt_action_register_subsys_callback (const xmlChar *subsys_id,
278 const xmlChar *modname,
279 const xmlChar *revision,
280 const xmlChar *defpath);
281
282
291extern void
292 agt_action_unregister_subsys_callback (const xmlChar *subsys_id,
293 const xmlChar *modname,
294 const xmlChar *revision,
295 const xmlChar *defpath);
296
297#endif // WITH_YCONTROL
298
299
306extern val_value_t *
308
309
317extern void
319
320
324#ifdef __cplusplus
325} /* end extern 'C' */
326#endif
327
328#endif /* _H_agt_action */
NETCONF protocol remote procedure call server-side definitions.
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:889
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
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:486
boolean agt_action_callback_is_regdone(obj_template_t *obj)
Set the ACTION as register done.
Definition: agt_action.c:547
val_value_t * agt_action_find_node(val_value_t *val)
Find the nested node that is an action.
Definition: agt_action.c:853
void agt_action_callback_regdone(obj_template_t *obj)
Set the ACTION as register done.
Definition: agt_action.c:518
boolean agt_action_is_action(obj_template_t *rpcobj)
Check if the specified node is the action.
Definition: agt_action.c:256
status_t agt_action_register_subsys_callback(const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *revision, const xmlChar *defpath)
Register an object specific ACTION callback function.
Definition: agt_action.c:656
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 'action'.
Definition: agt_action.c:421
void agt_action_cleanup(void)
Cleanup the Action handler.
Definition: agt_action.c:232
void agt_action_unregister_action(const xmlChar *defpath)
remove a callback for all phases of action processing
Definition: agt_action.c:374
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:283
void agt_action_unregister_subsys_callback(const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *revision, const xmlChar *defpath)
Unregister an object specific ACTION callback function.
Definition: agt_action.c:794
status_t agt_action_init(void)
Initialize the Action handler.
Definition: agt_action.c:182
#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
agt_rpc_phase_t
There are 3 different callbacks possible in the server processing chain.
Definition: agt_rpc.h:109
status_t
global error return code
Definition: status_enum.h:210
NETCONF protocol remote procedure call common definitions.
NETCONF Session Common definitions module.
global error status code enumerations
the agt_rpc module stores a set of callbacks for each RPC
Definition: agt_action.h:135
boolean regdone
flag registration done
Definition: agt_action.h:140
dlq_hdr_t subsysQ
Q of agt_rpc_subsys_t for transaction handling to 0 or more subsystem handlers for this action.
Definition: agt_action.h:146
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1134
One YANG data-def-stmt.
Definition: obj.h:1209
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:911
gather node data into a simple struct.
Definition: xml_util.h:207
Value Node Basic Support.
XML Utilities.