yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
agt_sil.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2024, 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#ifdef WITH_YCONTROL
13#ifndef _H_agt_sil
14#define _H_agt_sil
15
16/* FILE: agt_sil.h
17*********************************************************************
18* *
19* P U R P O S E *
20* *
21*********************************************************************/
22
29/*********************************************************************
30* *
31* C H A N G E H I S T O R Y *
32* *
33*********************************************************************
34
35date init comment
36----------------------------------------------------------------------
3718-feb-14 abb Begun
38*/
39
40#ifndef _H_agt
41#include "agt.h"
42#endif
43
44#ifndef _H_agt_cfg
45#include "agt_cfg.h"
46#endif
47
48#ifndef _H_ncxtypes
49#include "ncxtypes.h"
50#endif
51
52#ifndef _H_dlq
53#include "dlq.h"
54#endif
55
56#ifndef _H_getcb
57#include "getcb.h"
58#endif
59
60#ifndef _H_status
61#include "status.h"
62#endif
63
64#ifdef __cplusplus
65extern "C" {
66#endif
67
80/********************************************************************
81* *
82* C O N S T A N T S *
83* *
84*********************************************************************/
85
86/********************************************************************
87* *
88* T Y P E S *
89* *
90*********************************************************************/
91
93typedef struct agt_sil_added_edit_t_ {
95 dlq_hdr_t qhdr;
96
98 xmlChar *path;
99
102
104 xmlChar *editop;
105
107 xmlChar *where;
108
110 xmlChar *point;
111
113 boolean skipcb;
115
116
126typedef void
128 const xmlChar *subsys_id,
129 status_t get_status,
130 val_value_t *return_val);
131
132
143typedef status_t
144 (*agt_sil_rpc_walker_fn_t) (const xmlChar *subsys_id,
145 status_t rpc_status,
146 val_value_t *return_val,
147 dlq_hdr_t *saveQ);
148
149
165typedef status_t
167 rpc_msg_t *msg,
169 const xmlChar *subsys_id,
170 status_t tx_status,
171 dlq_hdr_t *edded_editQ);
172
173
174
175/********************************************************************
176* *
177* F U N C T I O N S *
178* *
179*********************************************************************/
180
181
187extern status_t
188 agt_sil_init (void);
189
190
196extern void
197 agt_sil_cleanup (void);
198
199
221extern status_t
223 const xmlChar *user_id,
224 const xmlChar *client_addr,
225 const xmlChar *target,
226 boolean is_validate,
227 boolean is_replay,
228 boolean is_reverse_edit,
229 boolean is_load_config,
230 boolean is_hook_load,
231 boolean is_hook_validate,
232 dlq_hdr_t *editQ);
233
234
249extern status_t
251 const xmlChar *user_id,
252 const xmlChar *client_addr,
253 const xmlChar *target,
254 boolean is_replay,
255 dlq_hdr_t *editQ);
256
257
265extern status_t
266 agt_sil_continue_transaction (const xmlChar *txid_str,
267 agt_cbtyp_t cur_phase);
268
269
275extern void
276 agt_sil_end_transaction (const xmlChar *txid_str);
277
278
286extern void
287 agt_sil_cancel_transaction (const xmlChar *txid_str);
288
289
300extern status_t
301 agt_sil_send_load_event (const xmlChar *name,
302 boolean is_bundle,
303 boolean is_load);
304
305
316extern status_t
317 agt_sil_send_stream_callback_event (const xmlChar *subsys_id,
318 const xmlChar *modname,
319 const xmlChar *stream_name,
320 boolean all_streams,
321 agt_not_subevent_t subevent);
322
323
329extern boolean
331
332
338extern void
340
341
342
353extern status_t
355 getcb_get2_t *get2cb,
356 xml_msg_hdr_t *msg,
357 const xmlChar **txid_str);
358
359
368extern status_t
369 agt_sil_get_transaction_status (const xmlChar *txid_str);
370
371
381extern void
382 agt_sil_walk_get_results (const xmlChar *txid_str,
383 agt_sil_get_walker_fn_t get_walker_fn);
384
385
397extern status_t
398 agt_sil_walk_rpc_results (const xmlChar *txid_str,
399 agt_sil_rpc_walker_fn_t rpc_walker_fn,
400 dlq_hdr_t *saveQ);
401
402
416extern status_t
418 rpc_msg_t *msg,
420 const xmlChar *txid_str,
421 agt_sil_shook_walker_fn_t shook_walker_fn);
422
423
429extern void
430 agt_sil_end_get_transaction (const xmlChar *txid_str);
431
432
438extern void
439 agt_sil_set_subsys_timeout (uint32 val);
440
441
453extern status_t
455 rpc_msg_t *msg,
456 obj_template_t *obj,
457 val_value_t *actionval,
458 const xmlChar **txid_str);
459
460
469extern status_t
470 agt_sil_rpc_transaction_status (const xmlChar *txid_str);
471
472
478extern void
479 agt_sil_end_rpc_transaction (const xmlChar *txid_str);
480
481
492extern status_t
494 const xmlChar *client_txid,
495 boolean isvalidate,
496 boolean isrollback,
497 boolean isrunning);
498
499
505extern status_t
506 agt_sil_transaction_complete_cb (const xmlChar *txid_str);
507
508
534extern status_t
535 agt_sil_get_exit_mode_edit (const xmlChar *txid_str,
536 agt_tx_type_t tx_type,
537 val_value_t **error_val,
538 xmlChar **error_path,
539 xmlChar **error_msg,
540 boolean *need_reverse_edit);
541
542
562extern status_t
563 agt_sil_get_exit_mode (const xmlChar *txid_str,
564 agt_tx_type_t tx_type);
565
566
582extern boolean
583 agt_sil_last_in_transaction (const xmlChar *txid_str,
584 ses_id_t sid);
585
586
593extern void
594 agt_sil_unload_module (const xmlChar *modname);
595
596
604extern status_t
605 agt_sil_bundle_walker (const xmlChar *name,
606 void *cookie);
607
608
616extern status_t
617 agt_sil_module_walker (const xmlChar *name,
618 void *cookie);
619
632extern status_t
634 const xmlChar *client_txid,
635 agt_cbtyp_t cbtyp,
636 agt_commit_type_t commit_type);
637
638
647extern boolean
648 agt_sil_subsys_registered (const xmlChar *subsys_id);
649
650
660extern boolean
662
663
673extern boolean
675
676
686extern boolean
688
689
699extern boolean
701
702
712extern boolean
714
715
725extern boolean
727
728
738extern boolean
740
741
749extern xmlChar *
751
752
755#ifdef __cplusplus
756} /* end extern 'C' */
757#endif
758
759#endif /* _H_agt_sil */
760#endif // WITH_YCONTROL
Multi-Protocol Network Management Server.
Manage Server configuration edit transactions.
dlq provides general double-linked list and queue support:
GET1 and GET2 Callback Support.
status_t agt_sil_continue_transaction(const xmlChar *txid_str, agt_cbtyp_t cur_phase)
Continue a transaction to apply or commit phase.
Definition: agt_sil.c:9712
boolean agt_sil_has_subsys_glob_edit3(void)
Check if there is Global EDIT3 callback in subsystem
Definition: agt_sil.c:11803
void agt_sil_end_transaction(const xmlChar *txid_str)
End a transaction.
Definition: agt_sil.c:9842
boolean agt_sil_has_subsys_glob_edit(void)
Check if there any EDIT2/3 Global callbacks in subsystem.
Definition: agt_sil.c:11915
status_t agt_sil_start_transaction(agt_cfg_transaction_t *txcb, const xmlChar *user_id, const xmlChar *client_addr, const xmlChar *target, boolean is_validate, boolean is_replay, boolean is_reverse_edit, boolean is_load_config, boolean is_hook_load, boolean is_hook_validate, dlq_hdr_t *editQ)
Start Transaction Handler.
Definition: agt_sil.c:9178
status_t agt_sil_walk_shook_results(ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, const xmlChar *txid_str, agt_sil_shook_walker_fn_t shook_walker_fn)
Walk the Set Hook results.
Definition: agt_sil.c:10698
boolean agt_sil_has_subsys_glob_action(void)
Check if there is Global Action callback in subsystem
Definition: agt_sil.c:11751
status_t(* agt_sil_shook_walker_fn_t)(ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, const xmlChar *subsys_id, status_t tx_status, dlq_hdr_t *edded_editQ)
Set Hook walker function.
Definition: agt_sil.h:166
status_t agt_sil_walk_rpc_results(const xmlChar *txid_str, agt_sil_rpc_walker_fn_t rpc_walker_fn, dlq_hdr_t *saveQ)
Walk the RPC transaction results.
Definition: agt_sil.c:10638
boolean agt_sil_edit_transaction_in_progress(void)
Check if a SIL-SA transaction is in progress.
Definition: agt_sil.c:10201
status_t agt_sil_transaction_complete_cb(const xmlChar *txid_str)
SIL transaction complete callback.
Definition: agt_sil.c:11145
status_t agt_sil_send_stream_callback_event(const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *stream_name, boolean all_streams, agt_not_subevent_t subevent)
Send a "<stream-callback-event>" message to one subsystem.
Definition: agt_sil.c:10045
void(* agt_sil_get_walker_fn_t)(getcb_get2_t *get2cb, const xmlChar *subsys_id, status_t get_status, val_value_t *return_val)
get walker function for processing results from remote GET transaction from 1 or more subsystems
Definition: agt_sil.h:127
boolean agt_sil_has_subsys_glob_edit2(void)
Check if there is Global EDIT2 callback in subsystem
Definition: agt_sil.c:11777
status_t agt_sil_handle_remote_commit_completeness(ses_cb_t *client_scb, const xmlChar *client_txid, agt_cbtyp_t cbtyp, agt_commit_type_t commit_type)
Handle remote SIL-SA subsytem Commit Completeness callbacks.
Definition: agt_sil.c:11651
status_t agt_sil_init(void)
Initialize the SIL features module (phase 2)
Definition: agt_sil.c:9051
status_t agt_sil_handle_remote_trans_start(ses_cb_t *client_scb, const xmlChar *client_txid, boolean isvalidate, boolean isrollback, boolean isrunning)
Handle a remote transaction.
Definition: agt_sil.c:11362
boolean agt_sil_has_subsys_glob_rpc(void)
Check if there is Global RPC callback in subsystem
Definition: agt_sil.c:11855
boolean agt_sil_has_subsys_glob_get(void)
Check if there is Global GET2 callback in subsystem
Definition: agt_sil.c:11829
status_t agt_sil_rpc_transaction_status(const xmlChar *txid_str)
Get RPC transaction status.
Definition: agt_sil.c:11094
status_t agt_sil_get_exit_mode_edit(const xmlChar *txid_str, agt_tx_type_t tx_type, val_value_t **error_val, xmlChar **error_path, xmlChar **error_msg, boolean *need_reverse_edit)
Get the transaction exit code.
Definition: agt_sil.c:11215
boolean agt_sil_has_subsys_glob_any(void)
Check if there any any Global callbacks in subsystem.
Definition: agt_sil.c:11881
status_t agt_sil_continue_start_transaction(agt_cfg_transaction_t *txcb, const xmlChar *user_id, const xmlChar *client_addr, const xmlChar *target, boolean is_replay, dlq_hdr_t *editQ)
Continue already existed Start Transaction.
Definition: agt_sil.c:9450
void agt_sil_unload_module(const xmlChar *modname)
Unload a module from the subsystem register messages so the cleanup is not attempted again during sys...
Definition: agt_sil.c:11538
void agt_sil_end_rpc_transaction(const xmlChar *txid_str)
End an RPC transaction.
Definition: agt_sil.c:11125
status_t(* agt_sil_rpc_walker_fn_t)(const xmlChar *subsys_id, status_t rpc_status, val_value_t *return_val, dlq_hdr_t *saveQ)
RPC walker function for processing results from remote GET transaction from 1 or more subsystems.
Definition: agt_sil.h:144
status_t agt_sil_start_rpc_transaction(ses_cb_t *client_scb, rpc_msg_t *msg, obj_template_t *obj, val_value_t *actionval, const xmlChar **txid_str)
Start an RPC transaction.
Definition: agt_sil.c:10810
status_t agt_sil_send_load_event(const xmlChar *name, boolean is_bundle, boolean is_load)
Send a <load-event> to all subsystems.
Definition: agt_sil.c:9964
boolean agt_sil_subsys_registered(const xmlChar *subsys_id)
Check if the subsystem has a SIL-SA service registered.
Definition: agt_sil.c:11726
void agt_sil_cancel_transaction(const xmlChar *txid_str)
Cancel and delete the transaction.
Definition: agt_sil.c:9864
void agt_sil_check_deleted_edits(agt_cfg_transaction_t *txcb)
Check for deleted edits.
Definition: agt_sil.c:10217
status_t agt_sil_module_walker(const xmlChar *name, void *cookie)
Callback for dynamically loaded modules.
Definition: agt_sil.c:11603
status_t agt_sil_start_get_transaction(ses_cb_t *client_scb, getcb_get2_t *get2cb, xml_msg_hdr_t *msg, const xmlChar **txid_str)
Start a GET2 transaction.
Definition: agt_sil.c:10268
boolean agt_sil_last_in_transaction(const xmlChar *txid_str, ses_id_t sid)
Check if the session is the last in the current transaction.
Definition: agt_sil.c:11442
void agt_sil_cleanup(void)
Cleanup the SIL Features Module.
Definition: agt_sil.c:9105
status_t agt_sil_get_transaction_status(const xmlChar *txid_str)
Get the GET2 transaction status.
Definition: agt_sil.c:10556
void agt_sil_walk_get_results(const xmlChar *txid_str, agt_sil_get_walker_fn_t get_walker_fn)
Walk the GET2 results.
Definition: agt_sil.c:10589
void agt_sil_set_subsys_timeout(uint32 val)
Set the subsys-timeout parameter.
Definition: agt_sil.c:10783
status_t agt_sil_get_exit_mode(const xmlChar *txid_str, agt_tx_type_t tx_type)
Get the transaction exit code.
Definition: agt_sil.c:11295
void agt_sil_end_get_transaction(const xmlChar *txid_str)
End a GET2 transaction.
Definition: agt_sil.c:10762
xmlChar * agt_sil_get_edit_subsys_id(void)
Get the subsystem ID that holds Global EDIT callback.
Definition: agt_sil.c:11941
status_t agt_sil_bundle_walker(const xmlChar *name, void *cookie)
Callback for bundles.
Definition: agt_sil.c:11563
agt_commit_type_t
NETCONF commit types.
Definition: agt.h:752
agt_tx_type_t
YControl transaction type.
Definition: agt.h:770
agt_cbtyp_t
enumeration of the different server EDIT callback types These are used as array indices so there is n...
Definition: agt.h:726
agt_not_subevent_t
event-stream sub-event types
Definition: agt_not.h:127
status_t
global error return code
Definition: status_enum.h:210
uint32 ses_id_t
Session ID.
Definition: ses.h:335
YANG module data structures Many internal representations of YANG module constructs.
Global error messages for status code enumerations.
Transaction Control Block.
Definition: agt_cfg.h:235
Set Hook added edits from subsystem(s)
Definition: agt_sil.h:93
xmlChar * point
point parameter string
Definition: agt_sil.h:110
val_value_t * editval
edit value being added
Definition: agt_sil.h:101
xmlChar * editop
edit operation string
Definition: agt_sil.h:104
dlq_hdr_t qhdr
queue header
Definition: agt_sil.h:95
boolean skipcb
skip callback flag
Definition: agt_sil.h:113
xmlChar * path
absolute path for the editval
Definition: agt_sil.h:98
xmlChar * where
where parameter string
Definition: agt_sil.h:107
GET2 control block.
Definition: getcb.h:357
One YANG data-def-stmt.
Definition: obj.h:1229
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:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404