yumapro
23.10T-12
YumaPro SDK
|
Contains Library entry points and handles init and cleanup. More...
Functions | |
status_t | agt_init1 (int argc, char *argv[], boolean *showver, help_mode_t *showhelpmode) |
Initialize the Server Library: stage 1: CLI and profile. More... | |
status_t | agt_init1_ex (int argc, char *argv[], boolean factory_restart, boolean *showver, help_mode_t *showhelpmode) |
Initialize the Server Library: stage 1: CLI and profile Added factory_restart parameter. More... | |
status_t | agt_init1_sil_sa (void) |
Initialize the Server Library: stage 1: CLI and profile. More... | |
status_t | agt_init1_ypserver (int argc, char *argv[], boolean factory_restart, boolean *showver, help_mode_t *showhelpmode) |
Initialize the Server Library: stage 1: CLI and profile Added factory_restart parameter yp-controller is running. More... | |
status_t | agt_init2 (void) |
Initialize the Server Library (phase 2 init) More... | |
status_t | agt_init2_ex (boolean factory_restart) |
Initialize the Server Library (phase 2 init - extended) More... | |
status_t | agt_init2_sil_sa (void) |
Initialize the Server Library for SIL-SA. More... | |
void | agt_cleanup (void) |
Cleanup the Server Library. More... | |
void | agt_cleanup_sil_sa (void) |
Cleanup the Server Library for SIL-SA usage. More... | |
agt_profile_t * | agt_get_profile (void) |
Get the server profile struct. More... | |
void | agt_request_shutdown (ncx_shutdowntyp_t mode, int intnum) |
Request some sort of server shutdown. More... | |
boolean | agt_shutdown_requested (void) |
Check if some sort of server shutdown is in progress. More... | |
ncx_shutdowntyp_t | agt_shutdown_mode_requested (void) |
Check what shutdown mode was requested. More... | |
int | agt_shutdown_term_signal (void) |
Get the shutdown termination signal if any. More... | |
const xmlChar * | agt_cbtype_name (agt_cbtyp_t cbtyp) |
Get the string for the server callback phase. More... | |
boolean | agt_advertise_module_needed (const xmlChar *modname) |
Check if the module should be advertised or not. More... | |
void | agt_request_replay (void) |
Request replay of the running config to SIL modules because SIL hardware has reset somehow. More... | |
void | agt_request_replay_ex (void *cookie) |
Request replay of the running config to SIL modules because SIL hardware has reset somehow. More... | |
void * | agt_get_replay_cookie (void) |
Get the current replay cookie. More... | |
void | agt_request_replay_subsys (const xmlChar *subsys_id) |
Request replay of the running config to the SIL-SA modules on the specified subsystem. More... | |
boolean | agt_replay_requested (void) |
Check if config replay is pending. More... | |
void | agt_start_replay (void) |
Start replay of the running config to SIL modules. More... | |
void | agt_finish_replay (void) |
Finish replay of the running config to SIL modules. More... | |
status_t | agt_register_local_nv_handler (agt_nvload_fn_t load_fn, agt_nvsave_fn_t store_fn) |
Register a set of nvstore and nvload callback functions to handle the non-volatile storage of the configuration. More... | |
status_t | agt_check_save_external_config (ncx_display_mode_t encoding, const xmlChar *filespec) |
Check if an external NV handler needs to be used to save the config. More... | |
status_t | agt_add_allowed_user (const xmlChar *username) |
Add a backptr to the string in the val_value_t containing the username that is allowed. More... | |
void | agt_remove_allowed_user (const xmlChar *username) |
Remove an allowed-user name from the running system Does not change any config file allowed-user parameter. More... | |
status_t | agt_check_allowed_user (const xmlChar *username) |
Check a username in the allowed-user Q. More... | |
status_t | agt_add_superuser (const xmlChar *username) |
Add a backptr to the string in the val_value_t containing the username that is a superuser. More... | |
void | agt_remove_superuser (const xmlChar *username) |
Remove a superuser name from the running system Does not change any config file allowed-user parameter. More... | |
status_t | agt_check_superuser (const xmlChar *username) |
Check a username in the superuser Q. More... | |
void | agt_register_replay_callback (agt_replay_fn_t cbfn) |
Register a callback function for a replay config event. More... | |
const xmlChar * | agt_get_server_id (void) |
Get the server-id string. More... | |
const xmlChar * | agt_get_server_root (void) |
Get the server-root string. More... | |
const xmlChar * | agt_get_server_key (void) |
Get the ha-server-key string. More... | |
boolean | agt_is_sil_sa (void) |
Check if server running in SIL-SA mode. More... | |
dlq_hdr_t * | agt_get_savedevQ (void) |
Get the agt_savedevQ pointer. More... | |
boolean | agt_replay_subsys_is_active (const xmlChar *subsys_id) |
Find a subsys replay request struct in the activeQ. More... | |
boolean | agt_replay_main_is_active (void) |
Check if the replay in progress is for the main server or could be for a subsystem. More... | |
const xmlChar * | agt_ha_role_str (agt_ha_role_t ha_role) |
Get the string for the specified HA role enumeration. More... | |
agt_ha_role_t | agt_ha_role_enum (const xmlChar *ha_role) |
Get the enum for the specified HA role string. More... | |
boolean | agt_use_notifications (void) |
Check if notifications currently enabled. More... | |
status_t | agt_check_load_config (agt_ha_role_t ha_role) |
Check if the boot-time load-config should be done because it was deferred while waiting for the YP-HA role to be set. More... | |
boolean | agt_init2_done (void) |
Check if the init2 phase is complete. More... | |
boolean | agt_init2_load_done (void) |
Check if the init2 phase is complete and all modules loaded. More... | |
boolean | agt_advertise_yang11_module_needed (ncx_module_t *mod) |
Check whether the NETCONF hello message should conform to the standard and leave out YANG 1.1 modules. More... | |
void | agt_set_factory_restart (void) |
Set the flag so the server will restart with the factory config. More... | |
boolean | agt_in_factory_restart (void) |
Check if a factory restort is in progress. More... | |
status_t | agt_add_modcache (ncx_modcache_t *mc) |
Add a module to the modcache queue and hash table. More... | |
ncx_modcache_t * | agt_find_modcache (const xmlChar *modname) |
Find a module to the modcache queue and hash table. More... | |
status_t | agt_run_extloop (void) |
Run the agt_ncxserver in external loop mode. More... | |
status_t | agt_enter_maintenance_mode (boolean read_ok, boolean operation_ok) |
Set the server to mainenance mode to block client activity. More... | |
status_t | agt_exit_maintenance_mode (void) |
Exit the server from mainenance mode to unblock client activity. More... | |
boolean | agt_in_maintenance_mode (void) |
Return true if in mainenance mode now. More... | |
boolean | agt_maintenance_mode_read_ok (void) |
Return true if in maintenance mode reads OK;. More... | |
boolean | agt_maintenance_mode_operation_ok (void) |
Return true if in maintenance mode operations OK;. More... | |
boolean | agt_maintenance_mode_session_ok (void) |
Return true if in maintenance mode new sessions OK;. More... | |
void | agt_set_eventlog_size (uint32 eventlog_size) |
Set the eventlog-size parameter. More... | |
void | agt_set_max_burst (uint32 max_burst) |
Set the max-burst parameter. More... | |
void | agt_set_max_getbulk (uint32 max_getbulk) |
Set the max-getbulk parameter. More... | |
agt_not_msg_t * | agt_make_term_msg (const xmlChar *msg, status_t *res) |
Create a <term-msg> notification. More... | |
status_t | agt_init_term_msg_module (void) |
Init the term-msg module and object backptr. More... | |
boolean | agt_use_nmda (void) |
Check if NMDA is enabled. More... | |
boolean | agt_use_new_yanglib (void) |
Check if NMDA or use-new-yanglib is enabled. More... | |
boolean | agt_waiting_datastore_ready (void) |
Check if client sessions are blocked until the datastore is ready. More... | |
boolean | agt_use_yang_cbor (void) |
Check if YANG CBOR is enabled. More... | |
const char * | agt_get_aflocal_sockname (void) |
Get the AFLOCAL socket name to use for <ncx-connect> More... | |
const xmlChar * | agt_get_user_parm (void) |
Get the user-parm string (if any) More... | |
status_t | agt_add_maxuser_parm (const xmlChar *cliparm) |
Add a maxuser parameter value. More... | |
status_t | agt_get_maxuser_parm (const xmlChar *username, uint16 *retval) |
Get the maxuser max-sessions value for a specified user. More... | |
boolean | agt_protocol_enabled (const xmlChar *proto) |
Check if protocol sessions are enabled. More... | |
status_t | agt_enable_protocol (const xmlChar *proto) |
Enable the named protocol. More... | |
status_t | agt_disable_protocol (const xmlChar *proto) |
Disable the named protocol. More... | |
boolean | agt_yang_push_is_enabled (void) |
Check if agt_push is enabled. More... | |
Contains Library entry points and handles init and cleanup.
All server components are hard-wired intot he init and cleanup functions.
status_t agt_add_allowed_user | ( | const xmlChar * | username | ) |
Add a backptr to the string in the val_value_t containing the username that is allowed.
username | user to add to allowed-user list |
status_t agt_add_maxuser_parm | ( | const xmlChar * | cliparm | ) |
Add a maxuser parameter value.
cliparm | the CLI parameter string value to convert and add |
status_t agt_add_modcache | ( | ncx_modcache_t * | mc | ) |
Add a module to the modcache queue and hash table.
mc | modcache entry to add |
status_t agt_add_superuser | ( | const xmlChar * | username | ) |
Add a backptr to the string in the val_value_t containing the username that is a superuser.
username | user to add to superuser list |
boolean agt_advertise_module_needed | ( | const xmlChar * | modname | ) |
Check if the module should be advertised or not.
There is a hard-wired list plus "--hide-module" parameter values that need to be hidden from clients
modname | module name to check |
boolean agt_advertise_yang11_module_needed | ( | ncx_module_t * | mod | ) |
Check whether the NETCONF hello message should conform to the standard and leave out YANG 1.1 modules.
mod | module to check |
const xmlChar * agt_cbtype_name | ( | agt_cbtyp_t | cbtyp | ) |
Get the string for the server callback phase.
cbtyp | callback type enum |
status_t agt_check_allowed_user | ( | const xmlChar * | username | ) |
Check a username in the allowed-user Q.
username | user name string to check |
status_t agt_check_load_config | ( | agt_ha_role_t | ha_role | ) |
Check if the boot-time load-config should be done because it was deferred while waiting for the YP-HA role to be set.
ha_role | AGT_HA_ROLE_ACTIVE or AGT_HS_ROLE_STANDBY |
status_t agt_check_save_external_config | ( | ncx_display_mode_t | encoding, |
const xmlChar * | filespec | ||
) |
Check if an external NV handler needs to be used to save the config.
encoding | encoding of the config file may be NCX_DISPLAY_MODE_NONE if filespec is NULL |
filespec | filespec of config file to save to external NV-save may be NULL if external save does not need this file |
status_t agt_check_superuser | ( | const xmlChar * | username | ) |
Check a username in the superuser Q.
username | user name string to check |
void agt_cleanup | ( | void | ) |
Cleanup the Server Library.
This function will call ncx_cleanup. Sets up server ready to restart.
void agt_cleanup_sil_sa | ( | void | ) |
Cleanup the Server Library for SIL-SA usage.
TBD : put platform-specific server cleanup here
status_t agt_disable_protocol | ( | const xmlChar * | proto | ) |
Disable the named protocol.
Has no effect if "--with-foo" flag for protocol not true Does not check if protocol already disabled.
proto | protocol name that matches bit names in the "--disabled-protocols" field |
status_t agt_enable_protocol | ( | const xmlChar * | proto | ) |
Enable the named protocol.
Has no effect if "--with-foo" flag for protocol not true Does not check if already enabled.
proto | protocol name that matches bit names in the "--disabled-protocols" field |
status_t agt_enter_maintenance_mode | ( | boolean | read_ok, |
boolean | operation_ok | ||
) |
Set the server to mainenance mode to block client activity.
read_ok | client read sessions OK |
operation_ok | client non-datastore OPS session OK |
status_t agt_exit_maintenance_mode | ( | void | ) |
Exit the server from mainenance mode to unblock client activity.
ncx_modcache_t * agt_find_modcache | ( | const xmlChar * | modname | ) |
Find a module to the modcache queue and hash table.
modname | module name to find |
void agt_finish_replay | ( | void | ) |
Finish replay of the running config to SIL modules.
Called from the server to end the replay procedure.
const char * agt_get_aflocal_sockname | ( | void | ) |
Get the AFLOCAL socket name to use for <ncx-connect>
status_t agt_get_maxuser_parm | ( | const xmlChar * | username, |
uint16 * | retval | ||
) |
Get the maxuser max-sessions value for a specified user.
username | the username to find | |
[out] | retval | max-session value |
NO_ERR | the *retval is set |
ERR_NCX_SKIPPED | no entry found for this username |
agt_profile_t * agt_get_profile | ( | void | ) |
Get the server profile struct.
Always returns an address. Do not need to check for NULL.
void * agt_get_replay_cookie | ( | void | ) |
Get the current replay cookie.
dlq_hdr_t * agt_get_savedevQ | ( | void | ) |
Get the agt_savedevQ pointer.
const xmlChar * agt_get_server_id | ( | void | ) |
Get the server-id string.
const xmlChar * agt_get_server_key | ( | void | ) |
Get the ha-server-key string.
const xmlChar * agt_get_server_root | ( | void | ) |
Get the server-root string.
NULL | the server is running in Single-Instance Mode |
const xmlChar * agt_get_user_parm | ( | void | ) |
Get the user-parm string (if any)
agt_ha_role_t agt_ha_role_enum | ( | const xmlChar * | ha_role | ) |
Get the enum for the specified HA role string.
ha_role | HA role string |
const xmlChar * agt_ha_role_str | ( | agt_ha_role_t | ha_role | ) |
Get the string for the specified HA role enumeration.
ha_role | HA role enum |
boolean agt_in_factory_restart | ( | void | ) |
Check if a factory restort is in progress.
Set to TRUE when restart with factory config occurs Cleared (set to FALSE) when agt_init2 phase is complete
boolean agt_in_maintenance_mode | ( | void | ) |
Return true if in mainenance mode now.
status_t agt_init1 | ( | int | argc, |
char * | argv[], | ||
boolean * | showver, | ||
help_mode_t * | showhelpmode | ||
) |
Initialize the Server Library: stage 1: CLI and profile.
TBD : put platform-specific server init here
argc | command line argument count | |
argv | array of command line strings | |
[out] | showver | address of version return quick-exit status *showver TRUE if user requsted version quick-exit mode |
[out] | showhelpmode | address of help return quick-exit status *showhelpmode TRUE if user requsted help quick-exit mode |
status_t agt_init1_ex | ( | int | argc, |
char * | argv[], | ||
boolean | factory_restart, | ||
boolean * | showver, | ||
help_mode_t * | showhelpmode | ||
) |
Initialize the Server Library: stage 1: CLI and profile Added factory_restart parameter.
argc | command line argument count | |
argv | array of command line strings | |
factory_restart | TRUE if forced factory restart | |
[out] | showver | address of version return quick-exit status *showver TRUE if user requsted version quick-exit mode |
[out] | showhelpmode | address of help return quick-exit status *showhelpmode TRUE if user requsted help quick-exit mode |
status_t agt_init1_sil_sa | ( | void | ) |
Initialize the Server Library: stage 1: CLI and profile.
Used when SIL-SA module initializing the agt core
status_t agt_init1_ypserver | ( | int | argc, |
char * | argv[], | ||
boolean | factory_restart, | ||
boolean * | showver, | ||
help_mode_t * | showhelpmode | ||
) |
Initialize the Server Library: stage 1: CLI and profile Added factory_restart parameter yp-controller is running.
The server will be run in extloop mode
argc | command line argument count | |
argv | array of command line strings | |
factory_restart | TRUE if forced factory restart | |
[out] | showver | address of version return quick-exit status *showver TRUE if user requsted version quick-exit mode |
[out] | showhelpmode | address of help return quick-exit status *showhelpmode TRUE if user requsted help quick-exit mode |
status_t agt_init2 | ( | void | ) |
Initialize the Server Library (phase 2 init)
The agt_profile is set and the object database is ready to have YANG modules loaded
RPC and data node callbacks should be installed after the module is loaded, and before the running config is loaded.
boolean agt_init2_done | ( | void | ) |
Check if the init2 phase is complete.
This function actually indicates that INIT2 has started It could be in process and return TRUE!!
status_t agt_init2_ex | ( | boolean | factory_restart | ) |
Initialize the Server Library (phase 2 init - extended)
The agt_profile is set and the object database is ready to have YANG modules loaded
RPC and data node callbacks should be installed after the module is loaded, and before the running config is loaded.
factory_restart | TRUE if restart with factory-config in progress |
boolean agt_init2_load_done | ( | void | ) |
Check if the init2 phase is complete and all modules loaded.
This function indicates that INIT2 has completed
status_t agt_init2_sil_sa | ( | void | ) |
Initialize the Server Library for SIL-SA.
status_t agt_init_term_msg_module | ( | void | ) |
Init the term-msg module and object backptr.
boolean agt_is_sil_sa | ( | void | ) |
Check if server running in SIL-SA mode.
boolean agt_maintenance_mode_operation_ok | ( | void | ) |
Return true if in maintenance mode operations OK;.
Not relevant unless agt_in_mantenance_mode() return trus
boolean agt_maintenance_mode_read_ok | ( | void | ) |
Return true if in maintenance mode reads OK;.
Not relevant unless agt_in_mantenance_mode() return trus
boolean agt_maintenance_mode_session_ok | ( | void | ) |
Return true if in maintenance mode new sessions OK;.
agt_not_msg_t * agt_make_term_msg | ( | const xmlChar * | msg, |
status_t * | res | ||
) |
Create a <term-msg> notification.
msg | string to send as the data field | |
[out] | res | address of return status; *res return status |
boolean agt_protocol_enabled | ( | const xmlChar * | proto | ) |
Check if protocol sessions are enabled.
proto | protocol name that matches bit names in the "--disabled-protocols" field |
status_t agt_register_local_nv_handler | ( | agt_nvload_fn_t | load_fn, |
agt_nvsave_fn_t | store_fn | ||
) |
Register a set of nvstore and nvload callback functions to handle the non-volatile storage of the configuration.
load_fn | NV-load callback function |
store_fn | NV-save callback function |
void agt_register_replay_callback | ( | agt_replay_fn_t | cbfn | ) |
Register a callback function for a replay config event.
cbfn | replay function to use (==NULL to clear) |
void agt_remove_allowed_user | ( | const xmlChar * | username | ) |
Remove an allowed-user name from the running system Does not change any config file allowed-user parameter.
username | user name string to remove |
void agt_remove_superuser | ( | const xmlChar * | username | ) |
Remove a superuser name from the running system Does not change any config file allowed-user parameter.
username | user name string to remove |
boolean agt_replay_main_is_active | ( | void | ) |
Check if the replay in progress is for the main server or could be for a subsystem.
boolean agt_replay_requested | ( | void | ) |
Check if config replay is pending.
boolean agt_replay_subsys_is_active | ( | const xmlChar * | subsys_id | ) |
Find a subsys replay request struct in the activeQ.
subsys_id | subsystem to check |
void agt_request_replay | ( | void | ) |
Request replay of the running config to SIL modules because SIL hardware has reset somehow.
This is used by SIL code to force a complete replay attempt SIL-SA code will send a <trigger-replay> message to cause a subsystem replay.
void agt_request_replay_ex | ( | void * | cookie | ) |
Request replay of the running config to SIL modules because SIL hardware has reset somehow.
Use the function agt_get_replay_cookie() to retrieve the cookie from a SIL callback function
cookie | pointer to set as the replay_cookie. |
void agt_request_replay_subsys | ( | const xmlChar * | subsys_id | ) |
Request replay of the running config to the SIL-SA modules on the specified subsystem.
Could be for subsystem reset or initial load-config
This is called when a <trigger-replay> event is received for a subsystem.
subsys_id | subsystem ID requesting the replay |
void agt_request_shutdown | ( | ncx_shutdowntyp_t | mode, |
int | intnum | ||
) |
Request some sort of server shutdown.
mode | requested shutdown mode |
intnum | interrupt number if called from agt_signal_handler() 0 if not called from agt_ginal_handler() |
status_t agt_run_extloop | ( | void | ) |
Run the agt_ncxserver in external loop mode.
Internal API for server IO
void agt_set_eventlog_size | ( | uint32 | eventlog_size | ) |
Set the eventlog-size parameter.
eventlog_size | value to set |
void agt_set_factory_restart | ( | void | ) |
Set the flag so the server will restart with the factory config.
Internal API used during restart to support 'fallback' mode
void agt_set_max_burst | ( | uint32 | max_burst | ) |
Set the max-burst parameter.
max_burst | value to set |
void agt_set_max_getbulk | ( | uint32 | max_getbulk | ) |
Set the max-getbulk parameter.
If the provided value is 0, the internal limit is set to 512.
max_getbulk | value to set (0 will be interpreted as 512) |
ncx_shutdowntyp_t agt_shutdown_mode_requested | ( | void | ) |
Check what shutdown mode was requested.
boolean agt_shutdown_requested | ( | void | ) |
Check if some sort of server shutdown is in progress.
int agt_shutdown_term_signal | ( | void | ) |
Get the shutdown termination signal if any.
void agt_start_replay | ( | void | ) |
Start replay of the running config to SIL modules.
Called from the server to begin the replay procedure.
boolean agt_use_new_yanglib | ( | void | ) |
Check if NMDA or use-new-yanglib is enabled.
boolean agt_use_nmda | ( | void | ) |
Check if NMDA is enabled.
boolean agt_use_notifications | ( | void | ) |
Check if notifications currently enabled.
boolean agt_use_yang_cbor | ( | void | ) |
Check if YANG CBOR is enabled.
boolean agt_waiting_datastore_ready | ( | void | ) |
Check if client sessions are blocked until the datastore is ready.
If so, check if the running datastore is no ready to use
boolean agt_yang_push_is_enabled | ( | void | ) |
Check if agt_push is enabled.
could be false if –with-new-notifs is set to true and no yang-push bundle