yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
agt_ncx.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#ifndef _H_agt_ncx
13#define _H_agt_ncx
14
15/* FILE: agt_ncx.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
28/*********************************************************************
29* *
30* C H A N G E H I S T O R Y *
31* *
32*********************************************************************
33
34date init comment
35----------------------------------------------------------------------
3604-feb-06 abb Begun
37
38*/
39
40#ifndef _H_cfg
41#include "cfg.h"
42#endif
43
44#ifndef _H_ncxtypes
45#include "ncxtypes.h"
46#endif
47
48#ifndef _H_ses
49#include "ses.h"
50#endif
51
52#ifndef _H_status
53#include "status.h"
54#endif
55
56#ifndef _H_val
57#include "val.h"
58#endif
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/********************************************************************
65* *
66* F U N C T I O N S *
67* *
68*********************************************************************/
69
88extern status_t
89 agt_ncx_init (void);
90
91
97extern void
98 agt_ncx_cleanup (void);
99
100
116extern status_t
118 cfg_location_t cfgloc,
119 const xmlChar *cfgparm);
120
121
131extern status_t
133 rpc_msg_t *msg,
134 cfg_template_t *cfg);
135
136
144extern status_t
146
147
156extern status_t
157 agt_ncx_cfg_save_inline (const xmlChar *source_url,
158 val_value_t *newroot);
159
160
177extern status_t
178 agt_ncx_load_backup (const xmlChar *filespec,
179 cfg_template_t *cfg,
180 ses_id_t use_sid,
181 dlq_hdr_t *errQ,
182 boolean do_config_change,
183 const rpc_msg_t *reqmsg);
184
185
186
194extern boolean
195 agt_ncx_cc_active (void);
196
197
203extern ses_id_t
204 agt_ncx_cc_ses_id (void);
205
206
213extern void
215
216
222extern const xmlChar *
224
225
232extern void
234
235
236#ifdef PTHREADS
244extern void
246
247#endif // PTHREADS
248
249
258extern status_t
260 ncx_confirm_event_t event);
261
262
274extern status_t
276 rpc_msg_t *msg,
277 xml_node_t *methnode,
278 ncx_confirm_event_t event);
279
280
304extern status_t
306 rpc_msg_t *msg,
307 boolean write_backup,
308 boolean save_nvstore,
309 ses_id_t rollback_sid,
310 xmlChar **backup_source,
311 boolean *errdone,
312 boolean *rootcheck_done,
313 status_t *rootcheck_res);
314
315
325extern status_t
326 agt_ncx_write_config (const xmlChar *filespec,
327 cfg_template_t *cfg);
328
329
341extern status_t
342 agt_ncx_force_write_config (const xmlChar *filespec,
343 cfg_template_t *cfg);
344
345
353extern status_t
355 ncx_module_t *mod);
356
357
371extern status_t
373 rpc_msg_t *msg,
374 boolean is_booting);
375
376
377
388extern status_t
389 agt_ncx_check_commit_parms (boolean confirmed,
390 uint32 confirm_timeout,
391 const xmlChar *persist,
392 const xmlChar *persist_id);
393
394
414extern status_t
416 rpc_msg_t *msg,
417 cfg_template_t *running,
418 const xmlChar *comment_str,
419 boolean confirmed,
420 uint32 confirm_timeout,
421 const xmlChar *persist,
422 const xmlChar *persist_id,
423 agt_ccparm_t *ret_ccparm,
424 boolean *errdone,
425 boolean *save_startup);
426
427
428
440extern status_t
442 rpc_msg_t *msg,
443 val_value_t *config_val,
445
446
453extern status_t
455
456
461#ifdef __cplusplus
462} /* end extern 'C' */
463#endif
464
465#endif /* _H_agt_ncx */
@ brief NCX configuration database manager
agt_ccparm_t
confirmed-commit parms
Definition: agt.h:780
status_t agt_ncx_do_lock_validate(cfg_template_t *cfg)
lock : validate params common callback
Definition: agt_ncx.c:7214
status_t agt_ncx_cfg_load(cfg_template_t *cfg, cfg_location_t cfgloc, const xmlChar *cfgparm)
Load the specifed config from the indicated source.
Definition: agt_ncx.c:5633
status_t agt_ncx_process_one_loaded_module(ses_cb_t *scb, ncx_module_t *mod)
process 1 modules just loaded with load or load-bundle
Definition: agt_ncx.c:6619
void agt_ncx_clear_cc_ses_id(void)
Clear the confirmed commit session ID.
Definition: agt_ncx.c:6008
status_t agt_ncx_cfg_save(cfg_template_t *cfg)
Save the specified cfg to the its startup source, which should be stored in the cfg struct.
Definition: agt_ncx.c:5831
status_t agt_ncx_cfg_save_inline(const xmlChar *source_url, val_value_t *newroot)
Save the specified cfg to the its startup source, which should be stored in the cfg struct.
status_t agt_ncx_cfg_save_ex(ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *cfg)
Save the specified cfg to the its startup source, which should be stored in the cfg struct and invoke...
Definition: agt_ncx.c:5715
void agt_ncx_check_restconf_cc_timeout(void)
Check if a confirmed-commit has timed out, and needs to be canceled.
Definition: agt_ncx.c:6080
status_t agt_ncx_write_config(const xmlChar *filespec, cfg_template_t *cfg)
Write the specified cfg->root to the the default backup source.
Definition: agt_ncx.c:6558
status_t agt_ncx_cancel_confirmed_commit(ses_cb_t *scb, ncx_confirm_event_t event)
Cancel the confirmed-commit in progress and rollback to the backup-cfg.xml file.
Definition: agt_ncx.c:6129
status_t agt_ncx_load_backup(const xmlChar *filespec, cfg_template_t *cfg, ses_id_t use_sid, dlq_hdr_t *errQ, boolean do_config_change, const rpc_msg_t *reqmsg)
Load a backup config into the specified config template.
Definition: agt_ncx.c:5943
const xmlChar * agt_ncx_cc_persist_id(void)
Get the confirmed commit persist ID.
Definition: agt_ncx.c:6025
ses_id_t agt_ncx_cc_ses_id(void)
Get the confirmed commit session ID.
Definition: agt_ncx.c:5991
void agt_ncx_check_cc_timeout(void)
Check if a confirmed-commit has timed out, and needs to be canceled.
Definition: agt_ncx.c:6040
status_t agt_ncx_cancel_confirmed_commit_withmsg(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *methnode, ncx_confirm_event_t event)
Cancel the confirmed-commit in progress and rollback to the backup-cfg.xml file.
Definition: agt_ncx.c:6163
status_t agt_ncx_internal_commit(ses_cb_t *scb, rpc_msg_t *msg, boolean write_backup, boolean save_nvstore, ses_id_t rollback_sid, xmlChar **backup_source, boolean *errdone, boolean *rootcheck_done, status_t *rootcheck_res)
Apply a commit from candidate to running.
Definition: agt_ncx.c:6358
status_t agt_ncx_init(void)
Initialize the NETCONF Server standard method routines.
Definition: agt_ncx.c:5570
status_t agt_ncx_final_process_loaded_modules(ses_cb_t *scb, rpc_msg_t *msg, boolean is_booting)
post-process all modules just loaded with load or load-bundle
Definition: agt_ncx.c:6714
status_t agt_ncx_force_write_config(const xmlChar *filespec, cfg_template_t *cfg)
Write the specified cfg->root to the the default backup source.
Definition: agt_ncx.c:6590
void agt_ncx_cleanup(void)
Cleanup the NETCONF Server standard method routines.
Definition: agt_ncx.c:5601
status_t agt_ncx_load_config_ha(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *config_val, ncx_transaction_id_t txid)
load-config : validate params callback
Definition: agt_ncx.c:7163
boolean agt_ncx_cc_active(void)
Check if a confirmed-commit is active, and the timeout may need to be processed.
Definition: agt_ncx.c:5974
status_t agt_ncx_commit_invoke(ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *running, const xmlChar *comment_str, boolean confirmed, uint32 confirm_timeout, const xmlChar *persist, const xmlChar *persist_id, agt_ccparm_t *ret_ccparm, boolean *errdone, boolean *save_startup)
commit : invoke commit or confirmed-commit API
Definition: agt_ncx.c:6867
status_t agt_ncx_check_commit_parms(boolean confirmed, uint32 confirm_timeout, const xmlChar *persist, const xmlChar *persist_id)
Check the commit parameters from a RESTCONF edit to see if they are valid for the current datastore s...
Definition: agt_ncx.c:6791
cfg_location_t
classify the config location
Definition: cfg.h:221
status_t
global error return code
Definition: status_enum.h:210
uint32 ses_id_t
Session ID.
Definition: ses.h:335
ncx_confirm_event_t
type of confirmEvent in the sysConfirmedCommit notification Used in confirmed-commit standard as well
Definition: ncxtypes.h:1515
uint64 ncx_transaction_id_t
transaction is scoped to single session write operation on a config
Definition: ncxtypes.h:728
YANG module data structures Many internal representations of YANG module constructs.
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
struct representing 1 configuration database
Definition: cfg.h:229
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
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
gather node data into a simple struct.
Definition: xml_util.h:207
Value Node Basic Support.