yumapro
24.10-1
YumaPro SDK
|
Implements RFC 6241 protocol operations. More...
Functions | |
status_t | agt_ncx_init (void) |
Initialize the NETCONF Server standard method routines. More... | |
void | agt_ncx_cleanup (void) |
Cleanup the NETCONF Server standard method routines. More... | |
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. More... | |
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 the startup_hook callbacks. More... | |
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. More... | |
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. More... | |
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. More... | |
boolean | agt_ncx_cc_active (void) |
Check if a confirmed-commit is active, and the timeout may need to be processed. More... | |
ses_id_t | agt_ncx_cc_ses_id (void) |
Get the confirmed commit session ID. More... | |
void | agt_ncx_clear_cc_ses_id (void) |
Clear the confirmed commit session ID. More... | |
const xmlChar * | agt_ncx_cc_persist_id (void) |
Get the confirmed commit persist ID. More... | |
void | agt_ncx_check_cc_timeout (void) |
Check if a confirmed-commit has timed out, and needs to be canceled. More... | |
void | agt_ncx_check_restconf_cc_timeout (void) |
Check if a confirmed-commit has timed out, and needs to be canceled. More... | |
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. More... | |
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. More... | |
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. More... | |
status_t | agt_ncx_write_config (const xmlChar *filespec, cfg_template_t *cfg) |
Write the specified cfg->root to the the default backup source. More... | |
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. More... | |
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 More... | |
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 More... | |
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 state and server profile. More... | |
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 More... | |
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 More... | |
status_t | agt_ncx_do_lock_validate (cfg_template_t *cfg) |
lock : validate params common callback More... | |
Implements RFC 6241 protocol operations.
The yuma-netconf.yang module is used instead of ietf-netconf.yang. This supports extra data and metadata added to the module namespace by the yuma server.
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.
scb | session control block making this change, may be NULL |
event | confirmEvent enumeration value to use |
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.
INTERNAL API
scb | session control block making this change, may be NULL |
msg | incoming rpc_msg_t in progress |
event | confirmEvent enumeration value to use |
boolean agt_ncx_cc_active | ( | void | ) |
Check if a confirmed-commit is active, and the timeout may need to be processed.
const xmlChar * agt_ncx_cc_persist_id | ( | void | ) |
Get the confirmed commit persist ID.
ses_id_t agt_ncx_cc_ses_id | ( | void | ) |
Get the confirmed commit session ID.
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.
Called just once from agt.c at boot or reload time!
This function should only be used to load an empty config in CFG_ST_INIT state
cfg | Config template to load data into |
cfgloc | enum for the config source location |
cfgparm | string parameter used in different ways depending on the cfgloc value For cfgloc==CFG_LOC_FILE, this is a system-dependent filespec |
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.
cfg | Config template to save from |
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 the startup_hook callbacks.
cfg | Config template to save from |
scb | session control block |
msg | rpc message input |
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.
source_url | filespec where to save newroot |
newroot | value root to save |
void agt_ncx_check_cc_timeout | ( | void | ) |
Check if a confirmed-commit has timed out, and needs to be canceled.
Called by the server after a CC procedure has been started by a client.
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 state and server profile.
confirmed | confirmed=1 query param; TRUE if set |
confirm_timeout | confirm-timeout query param or default |
persist | persist questry parameter |
persist_id | persist-id questry parameter |
void agt_ncx_check_restconf_cc_timeout | ( | void | ) |
Check if a confirmed-commit has timed out, and needs to be canceled.
RESTCONF sessionless check. It's getting called only from CC background thread, the only thread that is available after restconf session is gone for CC.
void agt_ncx_cleanup | ( | void | ) |
Cleanup the NETCONF Server standard method routines.
Called by the server during shutdown.
void agt_ncx_clear_cc_ses_id | ( | void | ) |
Clear the confirmed commit session ID.
This will be called by agt_ses when the current session exits during a persistent confirmed-commit
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
scb | session doing commit | |
msg | message in progress | |
running | running datastore | |
comment_str | commit comment (NULL if not used) | |
confirmed | confirmed parameter for ccommit | |
confirm_timeout | confirm-timeout parameter for ccommit | |
persist | persist parameter for ccommit | |
persist_id | persist-id parameter for ccommit | |
[out] | ret_ccparm | address of return error parameter *ret_ccparm return error parameter (if any) |
[out] | errdone | address of return errdone flag *errdone erdone flag |
[out] | save_startup | address of return save startup flag *save_startup TRUE if need to save startup |
status_t agt_ncx_do_lock_validate | ( | cfg_template_t * | cfg | ) |
lock : validate params common callback
cfg | config to check |
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
Thew msg->rpc_txcb needs to be allocated
scb | session to use |
msg | message in progress (will be dummy msg for agt_sil) |
is_booting | when is this function being called
|
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.
Do not use this function to save the running config to startup Used to save backup-cfg.xml. Will ignore the no-startup and no-nvstore parameters
filespec | complete path for the output file |
cfg | config template to write to XML file |
status_t agt_ncx_init | ( | void | ) |
Initialize the NETCONF Server standard method routines.
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.
Internal access for YANG-API. All validation should have already been done
scb | session control block doing commit | |
msg | RPC message in progress | |
write_backup | TRUE to save the backup config first | |
save_nvstore | TRUE to write the ruinning config to NV-storage | |
rollback_sid | session ID to use for the load-backup in case the commit fails and the undo fails | |
[out] | backup_source | address of backup filename string var *backup_source set to malloced file spec if it was NULL or else the string already set will be used for the backup target |
[out] | errdone | address of return error done flag *errdone TRUE if errors were already recorded |
[out] | rootcheck_done | address of root-check done flag *rootcheck_done root-check done flag |
[out] | rootcheck_res | address of rootcheck status *rootcheck_res rootcheck status |
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.
This is an internal function only used within agt_ncx.c
filespec | complete path for the input file |
cfg | config template to load |
use_sid | session ID of user to use |
errQ | optional Q of rpc_err_rec_t for error reporting if NULL then use the cfg->load_errQ |
do_config_change | TRUE if netconf-config-change events should be generated; FALSE to ignore (e.g., rollback) |
reqmsg | request message if from <restore>;
|
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
Loading a full config in YP-HA Standby mode
scb | session control block (from YP-HA YControl) |
msg | contructed RPC message for load-config |
config_val | <config> to load |
txid | config ID to use for a rerun transaction |
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
scb | session to use |
mod | module to process |
status_t agt_ncx_write_config | ( | const xmlChar * | filespec, |
cfg_template_t * | cfg | ||
) |
Write the specified cfg->root to the the default backup source.
Do not use this function to save the running config to startup
filespec | complete path for the output file |
cfg | config template to write to XML file |