yumapro  23.10T-7
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 - 2021, 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
257extern void
259 ncx_confirm_event_t event);
260
261
262
286extern status_t
288 rpc_msg_t *msg,
289 boolean write_backup,
290 boolean save_nvstore,
291 ses_id_t rollback_sid,
292 xmlChar **backup_source,
293 boolean *errdone,
294 boolean *rootcheck_done,
295 status_t *rootcheck_res);
296
297
307extern status_t
308 agt_ncx_write_config (const xmlChar *filespec,
309 cfg_template_t *cfg);
310
311
323extern status_t
324 agt_ncx_force_write_config (const xmlChar *filespec,
325 cfg_template_t *cfg);
326
327
335extern status_t
337 ncx_module_t *mod);
338
339
353extern status_t
355 rpc_msg_t *msg,
356 boolean is_booting);
357
358
359
370extern status_t
371 agt_ncx_check_commit_parms (boolean confirmed,
372 uint32 confirm_timeout,
373 const xmlChar *persist,
374 const xmlChar *persist_id);
375
376
396extern status_t
398 rpc_msg_t *msg,
399 cfg_template_t *running,
400 const xmlChar *comment_str,
401 boolean confirmed,
402 uint32 confirm_timeout,
403 const xmlChar *persist,
404 const xmlChar *persist_id,
405 agt_ccparm_t *ret_ccparm,
406 boolean *errdone,
407 boolean *save_startup);
408
409
410
422extern status_t
424 rpc_msg_t *msg,
425 val_value_t *config_val,
427
428
435extern status_t
437
438
443#ifdef __cplusplus
444} /* end extern 'C' */
445#endif
446
447#endif /* _H_agt_ncx */
@ brief NCX configuration database manager
agt_ccparm_t
confirmed-commit parms
Definition: agt.h:765
status_t agt_ncx_do_lock_validate(cfg_template_t *cfg)
lock : validate params common callback
Definition: agt_ncx.c:6934
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:5451
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:6359
void agt_ncx_clear_cc_ses_id(void)
Clear the confirmed commit session ID.
Definition: agt_ncx.c:5826
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:5649
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:5533
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:5898
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:6298
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:5761
const xmlChar * agt_ncx_cc_persist_id(void)
Get the confirmed commit persist ID.
Definition: agt_ncx.c:5843
ses_id_t agt_ncx_cc_ses_id(void)
Get the confirmed commit session ID.
Definition: agt_ncx.c:5809
void agt_ncx_check_cc_timeout(void)
Check if a confirmed-commit has timed out, and needs to be canceled.
Definition: agt_ncx.c:5858
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:6103
status_t agt_ncx_init(void)
Initialize the NETCONF Server standard method routines.
Definition: agt_ncx.c:5388
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:6454
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:6330
void agt_ncx_cleanup(void)
Cleanup the NETCONF Server standard method routines.
Definition: agt_ncx.c:5419
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:6883
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:5792
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:6607
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:6531
void 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:5944
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:1511
uint64 ncx_transaction_id_t
transaction is scoped to single session write operation on a config
Definition: ncxtypes.h:724
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:1134
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
Value Node Basic Support.