8  agt_profile Structure

The following structure is used to represent the agt_profile:

 

 

typedef struct agt_profile_t_ {

    /*** BEGIN DATA SENT TO SUBSYSTEMS ***/

    ncx_agttarg_t       agt_targ;

    ncx_agtstart_t      agt_start;

    log_debug_t         agt_log_level;

    log_debug_t         agt_syslog_log_level;

 

    log_debug_t         agt_pthread_log_level;

    boolean             agt_session_sync_mutex;

 

    boolean             agt_log_acm_reads;

    boolean             agt_log_acm_writes;

    boolean             agt_validate_all;

    boolean             agt_has_startup;

    boolean             agt_usestartup;   /* --no-startup flag */

    boolean             agt_factorystartup;   /* --factory-startup flag */

 

    /* --startup-error parameter: stop, continue enums only */

    boolean             agt_startup_error;  /* T: stop, F: check fallback */

 

    /* --running-error parameter: stop, continue enums only */

    boolean             agt_running_error;  /* T: stop, F: check fallback */

 

    boolean             agt_logappend;

    boolean             agt_xmlorder;

 

    boolean             agt_list_deleteall_ok;

    boolean             agt_leaflist_deleteall_ok;

 

    boolean             agt_stream_output;   /* d:true; no CLI support yet */

    boolean             agt_delete_empty_npcontainers;     /* d: false */

    boolean             agt_notif_sequence_id;  /* d: false */

    boolean             agt_yuma_system_notifs;  /* d: false */

    boolean             agt_ietf_system_notifs;  /* d: true */

    boolean             agt_yumaworks_system;  /* d: true */

    boolean             agt_yumaworks_templates;  /* d: true */

 

    /* d: true (needs WITH_SUPPORT_SAVE=1) */

    boolean             agt_support_save;

 

    /* d: true for <term-msg> notification */

    boolean             agt_term_msg;

 

    /* Yuma REST-API urlselect extra parameters */

    boolean             agt_alt_names;

    boolean             agt_wildcards;

    ncx_name_match_t    agt_match_names;

    agt_transaction_model_t agt_transaction_model;

 

    const xmlChar      *agt_accesscontrol;

 

    /* config file: default: /etc/yumapro/netconfd-pro.conf */

    const xmlChar      *agt_conffile;

 

    /* config dir: default: /etc/yumapro/netconfd-pro.d */

    const xmlChar      *agt_confdir;

 

    const xmlChar      *agt_logfile;

    const xmlChar      *agt_startup;

    const xmlChar      *agt_startup_factory_file;

    const xmlChar      *agt_defaultStyle;

    const xmlChar      *agt_superuser;

    const xmlChar      *agt_extern_libspec;

    const xmlChar      *agt_backup_dir;

    const xmlChar      *agt_server_id;

 

    uint32              agt_eventlog_size;

    uint32              agt_maxburst;

    uint32              agt_hello_timeout;

    uint32              agt_idle_timeout;

    uint32              agt_linesize;

    int32               agt_indent;

    int32               agt_message_indent;

    boolean             agt_usevalidate;          /* --with-validate */

    boolean             agt_useurl;                    /* --with-url */

    boolean             agt_use_ccommit;  /* enable confirmed-comiit */

    boolean             agt_use_yangapi;

    boolean             agt_use_restconf;

    boolean             agt_use_cli;

    boolean             agt_use_netconf;

    boolean             agt_use_local_transport;

    boolean             agt_use_notifications;

    boolean             agt_system_sorted;

    boolean             agt_lax_namespaces;

    agt_acm_model_t     agt_acm_model;

    ncx_withdefaults_t  agt_defaultStyleEnum;

    agt_acmode_t        agt_accesscontrol_enum;

    uint16              agt_max_sessions;

    uint16              agt_max_cli_sessions;

    uint16              agt_subsys_timeout;

 

    /* these port numbers are for the NETCONF-over-SSH protocol */

    uint16              agt_ports[AGT_MAX_PORTS];

 

    /* the CoAP port number used only if WITH_COAP and agt_use_coap set */

    uint16              agt_coap_port;

    uint16              agt_coap_dtls_port;

    const xmlChar      *agt_coap_address;

 

    const xmlChar      *agt_yangapi_server_url;

    const xmlChar      *agt_restconf_server_url;

 

    boolean             agt_use_yuma_proc;

    boolean             agt_use_yuma_arp;

    boolean             agt_use_yuma_if;

    boolean             agt_use_yuma_mysession;

    boolean             agt_use_yumaworks_event_filter;

    boolean             agt_use_yuma_system;

    boolean             agt_use_rollback_on_error;

    boolean             agt_use_ycontrol;

    boolean             agt_sil_skip_load;

    boolean             agt_log_event_drops;

 

    /* treat missing SIL libraries as an error, not warning */

    boolean             agt_sil_missing_error;

 

    /* do not invoke the SIL callback for a key leaf */

    boolean             agt_sil_skip_keys;

 

    /* save running config for a commit, in case the rollback fails */

    boolean             agt_use_rollback_failed_backup;

 

    /* allow a TCP socket instead of an AF_LOCAL socket for connections */

    boolean             agt_allow_tcp_socket;

 

    /* use a TCP socket instead of an AF_LOCAL socket for connections */

    boolean             agt_use_tcp_socket;

 

    /* location of subsys info file */

    const xmlChar      *agt_subsys_info_file;

 

    /* flag to save owner strings in the database */

    boolean             agt_save_owners;

 

    /* flag to print JSON leaf-list value on 1 line */

    boolean             agt_json_leaf_list_1line;

 

    /* flag to skip generation of the startup XML file when

     * a save_config is done by the server.  Used with the

     * external config mode where the external system database

     * is already up to date so the XML file is not used

     *  Default is false.  Set in yp_system_init_profile.

     */

    boolean             agt_save_config_system;

 

    /* bitmask of the with-defaults enumerations that should be

     * enabled in the server

     *    explicit: bit0

     *    trim: bit1

     *    report-all: bit2

     *    report-all-tagged: bit3

     */

    uint8               agt_withdef_enabled;

 

    /* Specifies the number of seconds the YPWatcher process

     * will sleep before checking if the netconfd-pro process

     * has died.  Ignored if --no-watcher CLI parameter was used

     */

    uint32              agt_watcher_interval;

 

    /* If true, then transactions to the candidate datastore

     * will be recorded in the audit log.

     * If false, then transactions to the candidate datastore

     * will not be recorded in the audit log.";

     */

    boolean             agt_audit_log_candidate;

 

    /* If true, the server will invoke the VALIDATE phase

     *  for SIL and SIL-SA callbacks when each edit is made

     *  to the candidate datastore.

     */

    boolean             agt_sil_validate_candidate;

 

    /* If 'true' the server will only accept requests with

     * normative Accept header entries specified in the draft

     */

    boolean             agt_restconf_strict_headers;

 

    /* If 'true' the server will treat edit-config auto-delete because

     * of false when-stmts as an error instead of silent delete

     */

    boolean             agt_autodelete_pdu_error;

 

    /* Specifies the maximum number of getbulk entries to

     * request from a GET2 callback. This value will be used

     * in the get2cb 'max_entries' field.

     * The value 0 is used to indicate there is no max and

     * the GET2 callback can return as many getbulk entries

     * as desired.  This is the default for leaf-list GET2 callbacks

     */

    uint32 agt_sil_getbulk_max;

 

    /* specifies the string that will be pre-pended to

     * the password before calling crypt_r to generate

     * the hash for the crypt-hash leaf passed with $0$cleartext

     */

    const xmlChar *agt_crypt_hash_prefix;

 

    /* minimum password length when setting crypt-hash variables */

    uint8 agt_min_passwd_len;

 

    /* If 'true' then the corresponding protocol will be

     * enabled. Otherwise, the protocol will not be enabled.

     * The incoming connection will be

     * droped if the protocol is disabled.

     */

    boolean             agt_with_netconf;

    boolean             agt_with_restconf;

    boolean             agt_with_yang_api;

    boolean             agt_with_yp_shell;

    boolean             agt_with_yp_coap;

    boolean             agt_with_yp_coap_dtls;

    boolean             agt_with_netconf_tls;

 

    log_debug_t         agt_audit_log_console_level;

    log_debug_t         agt_audit_log_level;

 

    boolean             agt_ha_enabled;

    boolean             agt_ha_sil_standby;

    uint16              agt_ha_port;

    const xmlChar      *agt_ha_server_key;

    const xmlChar      *agt_ha_initial_active;

 

    // leaf-list ha-server not stored here; not sent to subsys

 

    boolean             agt_simple_json_names;

    boolean             agt_create_empty_npcontainers; /* d: true */

 

    /*** END DATA SENT TO SUBSYSTEMS ***/

 

    /* TBD: add this data to subsystems in the near future */

 

    /* this field indicates if agt_record_warning will

     * be allowed to set the error-severity field to warning

     */

    boolean             agt_with_warnings;

 

    /* this field indicates the server is operating in library mode

     * It will look for YANG modules but only load them into its

     * library.

     */

    boolean             agt_library_mode;

 

    /* this field indicates if the :config-id capability is enabled

     * or not. This is an enterprise URI and at least 1 opensource

     * tool complains it is not a valid YANG module URI

     */

    boolean             agt_with_config_id;

 

    /* this field indicates that the server should not load or save

     * using the normal APIs during transaction management.

     * The 'start' choice will be ignored (e.g., --no-startup))

     * and the server will not attempt to load a startup-cfg.xml

     * file.  Transactions will not be saved to NV-storage

     * at all.  Any external NV-storage callbacks will be ignored.

     *

     * Use this mode if NV-load and NV-storage are handled

     * internally and not via the startup-cfg.xml file.

     */

    boolean             agt_no_nvstore;

 

    /* this field indicates whether the NETCONF hello message should

     * conform to the standard and leave out YANG 1.1 modules.

     */

    boolean             agt_with_yang11_hello;      /* d: false */

 

    /* this field indicates that the IETF Callhome feature is enabled

     * if true and WITH_CALLHOME is built into the image, then

     * the server will attempt to connect to the callhome client servers

     * specified in the callhome config (ietf-server module TBD)

     */

    boolean             agt_with_callhome;

 

    /* this field specifies the number of seconds to wait after

     * a connect attempt to the callhome server has failed.

     */

    uint16              agt_callhome_retry_interval;

 

    /* this field specifies the number of retry attempts the server

     * should attempt to the callhome server before giving up.

     * The value 0 indicates the server should never give up.

     */

    uint16             agt_callhome_retry_max;

 

    /* the callhome-server parameter is handled by agt_callhome */

 

    /* set the sshd exectuable path for callhome

     * default is /usr/sbin/sshd

     * only set by vendor in agt_init1 phase

     */

    const xmlChar     *agt_sshd_path;

 

    /* set the netconf subsystem for sshd exectuable path for callhome

     * default is /usr/sbin/netconf-subsystem-pro

     * only set by vendor in agt_init1 phase

     */

    const xmlChar     *agt_subsys_path;

 

    /* set the sshd_config file to use for sshd exectuable for callhome

     * default is $HOME/.yumapro/ch_sshd_config.<ch-server-name>

     * only set by vendor in agt_init1 phase

     */

    const xmlChar     *agt_sshd_config;

 

 

    /* this flag enables/disables the special OpenConfig usage of

     * the YANG pattern-statement. If true then modules named

     * openconfig-* will be checked as POSIX patterns,

     * not YANG XSD patterns

     */

    boolean             agt_with_ocpattern;

 

    /* this flag enables FHS file locations for server data files */

    boolean             agt_fileloc_fhs;

 

    /* this flag indicates the --no-audit-log CLI parameter */

    boolean             agt_no_audit_log;

 

    /* this enum indicates the --restconf-default-encoding CLI parameter */

    ncx_msg_encoding_t  agt_restconf_default_encoding;

 

    /* this flag indicates the --startup-error parm is set to fallback */

    boolean             agt_startup_fallback;  /* T: restart, F: continue */

 

    /* this flag indicates the --running-error parm is set to fallback */

    boolean             agt_running_fallback;  /* T: restart, F: continue */

 

 

    /* the SNMP agent parameters */

 

    /* this flag indicates that the snmp agent should be enabled */

    boolean             agt_with_snmp;

 

    /* identify the SNMP agent native mode master|subagent */

    ncx_snmp_agt_role_t agt_snmp_agent_role;

 

    /* identify the SNMP subagent priority, what priority

     * will be used for OID callbacks registration

     */

    uint16              agt_snmp_subagent_priority;

 

    /* the libcurl variables */

    boolean             agt_useurl_tftp;           /* --with-url-tftp */

    boolean             agt_useurl_ftp;            /* --with-url-ftp */

 

    /* --sil-delete-children-first CLI parameter */

    boolean             agt_sil_delete_children_first;

 

    /* --trim-whitespace CLI parameter */

    boolean             agt_trim_whitespace;

 

    /* --netconf-tls-address parameter */

    const xmlChar       *agt_netconf_tls_address;

 

    /* --netconf-tls-cerificate parameter */

    const xmlChar       *agt_netconf_tls_certificate;

 

    /* --netconf-tls-key parameter */

    const xmlChar       *agt_netconf_tls_key;

 

    /* --netconf-tls-port parameter */

    uint16              agt_netconf_tls_port;

 

    /* --netconf-tls-trust-store parameter */

    const xmlChar       *agt_netconf_tls_trust_store;

 

    /* --insecure-ok parameter */

    boolean              agt_insecure_ok;

 

    /* --cert-default-user parameter */

    const xmlChar        *agt_cert_default_user;

 

    /* --errmsg-lang parameter */

    const xmlChar       *agt_errmsg_lang;

 

    /* --startup-prune-ok parameter */

    boolean              agt_startup_prune_ok;

 

    /* no CLI parameter!! set to TRUE!

     * change in yp-system library or agt_profile.c

     */

    boolean              agt_startup_create_ok;

 

    /* --with-canonical parameter */

    boolean              agt_with_canonical;

 

    /* --with-modtags parameter */

    boolean              agt_with_modtags;

 

    /* --sil-invoke-for-defaults parameter */

    boolean              agt_sil_invoke_for_defaults;

 

    /* this flag indicates that the gNMI support should be enabled */

    boolean             agt_with_gnmi;

 

    /* this flag indicates the server is rnning as yp-controller

     * and not netconfd-pro

     */

    boolean             agt_ypserver_mode;

 

    /* --sil-prio-reverse-for-deletes parameter */

    boolean              agt_sil_prio_reverse_for_deletes;

 

    /* --audit-log-events to control audit log content */

    uint32                 agt_audit_log_events;

 

    /* --sil-root-check-first to do root check in edit-config

     * before the SIL validate callbacks are invoked

     * the old (only) behavior is 'false'

     */

    boolean             agt_sil_root_check_first;

 

    /* No CLI parameter!! Set to TRUE in agt_profile.c

     * the load-config will wait if agt_ncx_load_any_waiting()

     * is true and this parameter is also true

     */

    boolean              agt_sil_wait_sa;

 

    /* allow maintenance mode to be used */

    boolean              agt_with_maint_mode;

 

    /* CLI parameter --callhome-reconnect */

    boolean              agt_callhome_reconnect;

 

    /* enable config=false when-stmt checking for GET1 and GET2

     * callback functions; if false then the callback is expected

     * to check the when-stmt itself and return ERR_NCX_NO_INSTANCE

     * if the when-stmts for the node are false; default is true

     */

    boolean              agt_sil_test_get_when;

 

    /* use the yuma-time-filter module */

    boolean              agt_yuma_time_filter;

 

    /* use the yumaworks-getbulk module */

    boolean              agt_yumaworks_getbulk;

 

    /* use the yumaworks-ids module */

    boolean              agt_yumaworks_ids;

 

    /* db-lock used only if WITH_YCONTROL=1 and CLI set */

    boolean              agt_use_db_lock;

 

    /* max-strlen parameter */

    int32                agt_max_strlen;

 

    /* with-yumaworks-config-change */

    boolean              agt_with_yumaworks_config_change;

 

    /* tls-crl-mode parameter */

    agt_crl_mode_t       agt_crl_mode;

 

    /* tls-crl-missing-ok parameter */

    boolean              agt_crl_missing_ok;

 

    /* with-nmda */

    boolean              agt_with_nmda;

 

    /* startup-skip-validation */

    boolean              agt_startup_skip_validation;

 

    /* convert-subtree-filterparameter */

    boolean              agt_cvt_subtree_filter;

 

    /* import-version-bestmatch parameter */

    boolean              agt_import_version_bestmatch;

 

    /* with-yang-patch-running parameter */

    boolean              agt_with_yang_patch_running;

 

 

    /****** state variables; TBD: move out of profile ******/

 

    /* root commit descendant test flags */

    obj_testflags_t     agt_rootflags;

 

    /* server load-config flags */

    boolean             agt_load_done;

    boolean             agt_load_validate_errors;

    boolean             agt_load_rootcheck_errors;

    boolean             agt_load_top_rootcheck_errors;

    boolean             agt_load_apply_errors;

    boolean             agt_load_factory_fallback;

    boolean             agt_load_def_startup_factory;

 

    /* Q of malloced ncx_save_deviations_t */

    dlq_hdr_t           agt_savedevQ;

 

    /* Q of malloced agt_commit_test_t */

    dlq_hdr_t           agt_commit_testQ;

 

    /* cached location of startup transaction ID file */

    xmlChar            *agt_startup_txid_file;

 

    /* strdup of socket-address CLI parameter */

    xmlChar            *agt_socket_address;

 

    /* listen on this TCP port if TCP socket is enabled */

    uint16              agt_socket_port;

 

    /* malloced string indicating the confdir pathspec in use */

    xmlChar            *agt_conf_dirspec;

    boolean             agt_confdir_skipped;

 

    /* saved HA role */

    agt_ha_role_t      agt_ha_role;

 

    /* saved defer load config flag */

    boolean            agt_defer_load;

 

} agt_profile_t;