yumapro  20.10-12
YumaPro SDK
agt.h File Reference

Multi-Protocol Network Management Server. More...

#include "agt_not.h"
#include "help.h"
#include "log.h"
#include "ncxtypes.h"
#include "status.h"
Include dependency graph for agt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  agt_replay_subsys_t_
 for the list of subsystems requesting or in progress for a config load or replay More...
struct  agt_profile_t_
 Multiple instances are not supported. More...
struct  agt_syslib_cb_t_
 struct to keep track of the dynamic external yp-system hooks library More...


 number of callbacks based on agt_cbtyp_t enumeration
#define AGT_MAX_PORTS   4
 maximum number of –port leaf-list values that will be saved
 number of seconds before timeout for subsystems to respond to an edit request
#define AGT_DEF_CONF_FILE   (const xmlChar *)"/etc/yumapro/netconfd-pro.conf"
 default etc config filespec
#define AGT_DEF_FACTORY_CONFIG_FILE   (const xmlChar *)"factory-startup-cfg.xml"
 default startup-factory-file value
#define AGT_DEF_CONF_DIR   (const xmlChar *)"/etc/yumapro/netconfd-pro.d"
 default –confdir value
#define AGT_DEF_FHS_LOG_FILE   (const xmlChar *)"/var/log/netconfd-pro/server.log"
 default FHS main log location
#define AGT_DEF_SYSLIB_FILE   (const xmlChar *)"libyp_system.so"
 hard-wired yp-startup full library name
#define AGT_SYSLIB_NAME   (const xmlChar *)"yp_system"
 hard-wired yp-startup library name
#define AGT_DEF_BACKUP_DIR   (const xmlChar *)"$HOME/.yumapro/backups"
 default server backups directory
#define AGT_DEF_BACKUPS_NAME   (const xmlChar *)"backups"
 hard-wired server backups dir name
#define AGT_DEF_FHS_BACKUP_DIR   (const xmlChar *)"/var/lib/netconfd-pro/backups"
 hardwired FHS backups dir location
 default default delete empty NP containers. More...
 this can be over-ridden by the –system-sorted CLI parameter THIS PARAMETER IGNORED SINCE val_child DOES NOT NEED SORTING
 default allow missing namespaces if element is unique
#define AGT_DEF_EVENTLOG_SIZE   1000
 default –eventlog-size value
#define AGT_DEF_MAX_BURST   10
 default –max-burst value
 default –hello-timeout value
#define AGT_DEF_IDLE_TIMEOUT   3600
 default idle timeout value
#define AGT_DEF_LINESIZE   72
 default line size
#define AGT_DEF_INDENT   1
 default –indent value
 default –message-indent value
 default –max-sessions value
 default –max-cli-sessions value
#define AGT_DEF_YANGAPI_SERVER_URL   (const xmlChar *)"http://localhost"
 default YANG-API URI start (obsolete)
#define AGT_DEF_RESTCONF_SERVER_URL   (const xmlChar *)"http://localhost"
 default RESTCONF URI start
 default –save-owners value
 default allow leaf-lists on 1 line in JSON
 default save config system
#define AGT_DEF_GETBULK_MAX   10
 default –getbulk-max value
 default with config-id value
 default –with-ocpattern value
 default –no-nvstore value
 default –with-callhome value
 default –callhome-retry-interval value
 default –callhome-retry-max value
 default SSH callhome port
 default TLS callhome port
 default RESTCONF callhome port (not implemented)
#define AGT_YUMAWORKS_CALLHOME_MODULE   (const xmlChar *)"yumaworks-callhome"
 yumaworks callhome module name to configure callhome connections
#define AGT_YUMAWORKS_CALLHOME_REVISION   (const xmlChar *)"2020-10-17"
 yumaworks callhome module revision to configure callhome connections
 default –no-auditlog value
#define AGT_DEF_CRYPT_HASH_PREFIX   (const xmlChar *)"$6$"
 default for crypt-hash is SHA-512 id=6 This prefix includes the just the <id> field The <salt> will be generated for each new password
 hard-wired minimum password length
 YP-HA service enabled.
 default –ha-sil-standby value
#define AGT_DEF_HA_PORT   8088
 default –ha-port value
 default –ha-standby-mode value
#define AGT_DEF_YPCOAP_PORT   5683
 default agt_ypcoap_port value
 YP-CoAP over DTLS port number (not implemented)
#define AGT_DEF_YPCOAP_ADDRESS   (const xmlChar *)""
 YP-CoAP over DTLS IPv4 address (not implemented)
 default RESTCONF encoding when no Accept header
#define AGT_DEF_TLS_PORT   6513
 port assignment for netconf-tls in RFC 7589
#define AGT_DEF_DB_LOCK_RETRY   500
 db-lock default retry interval (milli-seconds)
 db-lock default timeout (seconds )
 allow netconf-config-change to include data that changed
 allow yumaworks-callhome module to be present
 allow yumaworks-callhome module to be present
 enable NMDA modules and standard datastores
 enable skip startup validation at boot-time
 return status to the shell on exit or not
 do not wait for datastore startup to allow sessions This is the only behavior before this parameter
 number of seconds for each select timeout
 number of microseconds for each select timeout set to 1/100th sec

#define AGT_USER_VAR   (const xmlChar *)"user"
 identify a user variable
#define AGT_URL_SCHEME_LIST   (const xmlChar *)"file"
 hard-wired schema list for –with-url
#define AGT_URL_SCHEME_LIST_TFTP   (const xmlChar *)"file,tftp"
 hard-wired schema list for –with-url and –with-url-tftp
#define AGT_FILE_SCHEME   (const xmlChar *)"file:///"
 hard-wired start of file schem URL
#define AGT_TOASTER_MOD   (const xmlChar *)"toaster"
 name of the toaster module
#define AGT_TEST_MOD   (const xmlChar *)"test"
 name of the test module
#define AGT_SIL_SA   (const xmlChar *)"sil-sa"
 SIL-SA service name for YControl.
#define AGT_DB_API   (const xmlChar *)"db-api"
 DB-API service name for YControl.
#define AGT_YP_HA   (const xmlChar *)"yp-ha"
 YP-HA service name for YControl.
#define AGT_YP_GNMI   (const xmlChar *)"yp-gnmi"
 YP-GNMI service name for YControl.
#define AGT_YCONTROL_MOD   (const xmlChar *)"yumaworks-ycontrol"
 YANG module used for subsystem message transport.
#define AGT_DB_API_MOD   (const xmlChar *)"yumaworks-db-api"
 YANG module used for DB-API service messages.
#define AGT_SIL_SA_MOD   (const xmlChar *)"yumaworks-sil-sa"
 YANG module used for SIL-SA service messages.
#define AGT_PROFILE_MOD   (const xmlChar *)"yumaworks-agt-profile"
 YANG module for the agent profile.
#define AGT_ACTION_MOD   (const xmlChar *)"yang-attributes"
 YANG attributes module name.
#define AGT_YP_HA_MOD   (const xmlChar *)"yumaworks-yp-ha"
 YANG module used for YP-HA service messages.
#define AGT_TEMPLATES_MOD   (const xmlChar *)"yumaworks-templates"
 YANG module foryumaworks templates.
#define AGT_YP_GNMI_MOD   (const xmlChar *)"yumaworks-yp-gnmi"
 YANG module used for YP-GNMI service messages.
#define AGT_DEF_SERVER_ID   (const xmlChar *)"server1"
 default –server-id value
#define AGT_WITHDEF_MOD   (const xmlChar *)"ietf-netconf-with-defaults"
 YANG module for with-defaults definitions.
#define AGT_TEST_FL_MIN_ELEMS   bit0
 begin tests for agt_commit_test_t flags field test min-elements
#define AGT_TEST_FL_MAX_ELEMS   bit1
 test max-elements
#define AGT_TEST_FL_MANDATORY   bit2
 test mandatory
#define AGT_TEST_FL_MUST   bit3
 test must-stmt
#define AGT_TEST_FL_UNIQUE   bit4
 test unique-stmt
#define AGT_TEST_FL_XPATH_TYPE   bit5
 test xpath leaf path-stmt
#define AGT_TEST_FL_CHOICE   bit6
 test a choice
#define AGT_TEST_FL_WHEN   bit7
 not really a commit test; done during delete_dead_nodes()
#define AGT_TEST_ALL_COMMIT_MASK   (bit0|bit1|bit2|bit3|bit4|bit5|bit6)
 mask for all the commit tests
#define AGT_TEST_INSTANCE_MASK   (bit0|bit1|bit2|bit4|bit6)
 mask for the subset of instance tests
#define AGT_CLI_NOSTARTUP   (const xmlChar *)"no-startup"
 name of no-startup case
#define AGT_CLI_STARTUP   (const xmlChar *)"startup"
 name of startup case
#define AGT_CLI_FACTORY_STARTUP   (const xmlChar *)"factory-startup"
 name of factory-startup case
#define AGT_CLI_STARTUP_FACTORY_FILE   (const xmlChar *)"startup-factory-file"
 name of startup factory file parameter
 max. More...
#define AGT_MAX_OWNER_ID   255
 max. More...
#define AGT_WATCHER   (const xmlChar *)"ypwatcher"
 name of YP-watcher program
 default watcher check interval in seconds
#define AGT_DEF_SSHD_COMMAND   (const xmlChar *)"/usr/sbin/sshd"
 default SSH command for callhome use
#define AGT_DEF_SUBSYS_COMMAND   (const xmlChar *)"/usr/sbin/netconf-subsystem-pro"
 default subsystem command for callhome use
 internal SNMP priority
 edit-running events are generated when an edit or commit to <running> is completed.
 update-startup events are generated when a copy to <startup> is completed.
 client session start and end events
 YControl session start and end events.
 NACM write violation events.
 NACM exec violation events.
 RPC summary events are generated after every RPC is handled.
#define AGT_FL_AUDIT_EDIT_DATA   bit8
 Add edit data to the audit log for an edit transaction log entry.
 default bits set for audit-log-events parameter
#define AGT_DEF_CRL_MISSING_OK   false
 default CRL missing for TLS
 default CRL mode for TLS
 default convert subtree to XPath parameter
 YANG Push Periodic Subscription: units centiseconds min period 1 second.
 YANG Push min dampening 1 second.
 default max number of periodic subscriptions
 default max number of operational subscriptions
 default simulated operational mode
 default simop period is 5 seconds
 default simop message mode (patch or update)


typedef void(* agt_system_init_profile_fn_t) (agt_profile_t *profile)
 system init server profile callback More...
typedef status_t(* agt_system_init1_fn_t) (boolean pre_cli)
 system init1 callback More...
typedef status_t(* agt_system_init2_fn_t) (boolean pre_load)
 system init2 callback More...
typedef void(* agt_system_cleanup_fn_t) (void)
 system cleanup callback More...
typedef status_t(* agt_nvsave_fn_t) (ncx_display_mode_t encoding, const xmlChar *filespec)
 brief nvsave callback More...
typedef status_t(* agt_nvload_fn_t) (ncx_display_mode_t *encoding, xmlChar **filespec)
 nvload callback More...
typedef void(* agt_replay_fn_t) (boolean is_start)
 replay callback (agt_replay_fn_t) More...


enum  agt_acmode_t_ {
 matches access-control enumeration in netconfd.yang More...
enum  agt_cbtyp_t_ {
 enumeration of the different server EDIT callback types These are used as array indices so there is no dummy zero enum AGT_CB_TEST_APPLY has been replaced by AGT_CB_APPLY during the edit-config procedure AGT_CB_COMMIT_CHECK has been replaced by AGT_CB_VALIDATE during the commit procedure More...
enum  agt_acm_model_t_ {
 select the YANG module for the access control model More...
enum  agt_transaction_model_t_ {
 not used yet in YANG-API or NETCONF! More...
enum  agt_commit_type_t_ {
 NETCONF commit types. More...
enum  agt_exit_mode_t_ {
 exit reasons for YControl IO loop More...
enum  agt_tx_type_t_ {
 YControl transaction type. More...
enum  agt_ccparm_t_ {
 confirmed-commit parms More...
enum  agt_ha_role_t_ {
 server HA mode mode More...
enum  agt_ch_proto_t_ {
 server callhome protocol More...
enum  agt_crl_mode_t_ {
 server TLS CRL mode More...
enum  agt_hook_type_t_ {
 Hook types enumeration to specify Hook type. More...


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...
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_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_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_waiting_datastore_ready (void)
 Check if client sessions are blocked until the datastore is ready. More...

Detailed Description

Multi-Protocol Network Management Server.