yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
agt_action.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2024, 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
145 dlq_hdr_t subsysQ;
146
148
149
150/********************************************************************
151* *
152* F U N C T I O N S *
153* *
154*********************************************************************/
155
156
162extern status_t
163 agt_action_init (void);
164
165
171extern void
172 agt_action_cleanup (void);
173
174
187extern status_t
188 agt_action_register_action (const xmlChar *defpath,
189 agt_rpc_phase_t phase,
190 agt_action_cb_t action_cb);
191
192
199extern void
200 agt_action_unregister_action (const xmlChar *defpath);
201
202
208extern boolean
210
211
228extern status_t
230 rpc_msg_t *msg,
231 xml_node_t *method,
232 obj_template_t *rpcobj,
233 val_value_t **action_val);
234
242extern boolean
244
245
252
253
260extern boolean
262
263
264#ifdef WITH_YCONTROL
274extern status_t
275 agt_action_register_subsys_callback (const xmlChar *subsys_id,
276 const xmlChar *modname,
277 const xmlChar *revision,
278 const xmlChar *defpath);
279
280
289extern void
290 agt_action_unregister_subsys_callback (const xmlChar *subsys_id,
291 const xmlChar *modname,
292 const xmlChar *revision,
293 const xmlChar *defpath);
294
295#endif // WITH_YCONTROL
296
297
304extern val_value_t *
306
307
315extern void
317
318
322#ifdef __cplusplus
323} /* end extern 'C' */
324#endif
325
326#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:891
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:484
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:855
void agt_action_callback_regdone(obj_template_t *obj)
Set the ACTION as register done.
Definition: agt_action.c:517
boolean agt_action_is_action(obj_template_t *rpcobj)
Check if the specified node is the action.
Definition: agt_action.c:254
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:657
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:419
void agt_action_cleanup(void)
Cleanup the Action handler.
Definition: agt_action.c:230
void agt_action_unregister_action(const xmlChar *defpath)
remove a callback for all phases of action processing
Definition: agt_action.c:372
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:281
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:796
status_t agt_action_init(void)
Initialize the Action handler.
Definition: agt_action.c:180
#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:145
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
One YANG data-def-stmt.
Definition: obj.h:1229
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:185
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
gather node data into a simple struct.
Definition: xml_util.h:207
Value Node Basic Support.
XML Utilities.