root/include/crm/common/options_internal.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2006-2024 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PCMK__CRM_COMMON_OPTIONS_INTERNAL__H
  11 #define PCMK__CRM_COMMON_OPTIONS_INTERNAL__H
  12 
  13 #ifndef PCMK__CONFIG_H
  14 #define PCMK__CONFIG_H
  15 #include <config.h>   // _Noreturn
  16 #endif
  17 
  18 #include <glib.h>     // GHashTable
  19 #include <stdbool.h>  // bool
  20 
  21 #include <crm/common/strings.h>             // pcmk_parse_interval_spec()
  22 #include <crm/common/output_internal.h>     // pcmk__output_t
  23 
  24 #ifdef __cplusplus
  25 extern "C" {
  26 #endif
  27 
  28 _Noreturn void pcmk__cli_help(char cmd);
  29 
  30 
  31 /*
  32  * Environment variable option handling
  33  */
  34 
  35 const char *pcmk__env_option(const char *option);
  36 void pcmk__set_env_option(const char *option, const char *value, bool compat);
  37 bool pcmk__env_option_enabled(const char *daemon, const char *option);
  38 
  39 
  40 /*
  41  * Cluster option handling
  42  */
  43 
  44 /*!
  45  * \internal
  46  * \enum pcmk__opt_flags
  47  * \brief Option flags
  48  */
  49 enum pcmk__opt_flags {
  50     pcmk__opt_none       = 0U,          //!< No additional information
  51 
  52     /*!
  53      * \brief In CIB manager metadata
  54      *
  55      * \deprecated This flag will be removed with CIB manager metadata
  56      */
  57     pcmk__opt_based      = (1U << 0),
  58 
  59     /*!
  60      * \brief In controller metadata
  61      *
  62      * \deprecated This flag will be removed with controller metadata
  63      */
  64     pcmk__opt_controld   = (1U << 1),
  65 
  66     /*!
  67      * \brief In scheduler metadata
  68      *
  69      * \deprecated This flag will be removed with scheduler metadata
  70      */
  71     pcmk__opt_schedulerd = (1U << 2),
  72 
  73     pcmk__opt_advanced   = (1U << 3),   //!< Advanced use only
  74     pcmk__opt_generated  = (1U << 4),   //!< Generated by Pacemaker
  75     pcmk__opt_deprecated = (1U << 5),   //!< Option is deprecated
  76     pcmk__opt_fencing    = (1U << 6),   //!< Common fencing resource parameter
  77     pcmk__opt_primitive  = (1U << 7),   //!< Primitive resource meta-attribute
  78 };
  79 
  80 typedef struct pcmk__cluster_option_s {
  81     const char *name;
  82     const char *alt_name;
  83     const char *type;
  84     const char *values;
  85     const char *default_value;
  86 
  87     bool (*is_valid)(const char *);
  88 
  89     uint32_t flags;                 //!< Group of <tt>enum pcmk__opt_flags</tt>
  90 
  91     const char *description_short;
  92     const char *description_long;
  93 
  94 } pcmk__cluster_option_t;
  95 
  96 const char *pcmk__cluster_option(GHashTable *options, const char *name);
  97 
  98 int pcmk__output_cluster_options(pcmk__output_t *out, const char *name,
  99                                  const char *desc_short, const char *desc_long,
 100                                  uint32_t filter, bool all);
 101 int pcmk__output_fencing_params(pcmk__output_t *out, const char *name,
 102                                 const char *desc_short, const char *desc_long,
 103                                 bool all);
 104 int pcmk__output_primitive_meta(pcmk__output_t *out, const char *name,
 105                                 const char *desc_short, const char *desc_long,
 106                                 bool all);
 107 
 108 int pcmk__daemon_metadata(pcmk__output_t *out, const char *name,
 109                           const char *short_desc, const char *long_desc,
 110                           enum pcmk__opt_flags filter);
 111 
 112 void pcmk__validate_cluster_options(GHashTable *options);
 113 
 114 bool pcmk__valid_interval_spec(const char *value);
 115 bool pcmk__valid_boolean(const char *value);
 116 bool pcmk__valid_int(const char *value);
 117 bool pcmk__valid_positive_int(const char *value);
 118 bool pcmk__valid_no_quorum_policy(const char *value);
 119 bool pcmk__valid_percentage(const char *value);
 120 bool pcmk__valid_placement_strategy(const char *value);
 121 
 122 // from watchdog.c
 123 long pcmk__get_sbd_watchdog_timeout(void);
 124 bool pcmk__get_sbd_sync_resource_startup(void);
 125 long pcmk__auto_stonith_watchdog_timeout(void);
 126 bool pcmk__valid_stonith_watchdog_timeout(const char *value);
 127 
 128 // Constants for environment variable names
 129 #define PCMK__ENV_AUTHKEY_LOCATION          "authkey_location"
 130 #define PCMK__ENV_BLACKBOX                  "blackbox"
 131 #define PCMK__ENV_CA_FILE                   "ca_file"
 132 #define PCMK__ENV_CALLGRIND_ENABLED         "callgrind_enabled"
 133 #define PCMK__ENV_CERT_FILE                 "cert_file"
 134 #define PCMK__ENV_CLUSTER_TYPE              "cluster_type"
 135 #define PCMK__ENV_CRL_FILE                  "crl_file"
 136 #define PCMK__ENV_DEBUG                     "debug"
 137 #define PCMK__ENV_DH_MAX_BITS               "dh_max_bits"
 138 #define PCMK__ENV_FAIL_FAST                 "fail_fast"
 139 #define PCMK__ENV_IPC_BUFFER                "ipc_buffer"
 140 #define PCMK__ENV_IPC_TYPE                  "ipc_type"
 141 #define PCMK__ENV_KEY_FILE                  "key_file"
 142 #define PCMK__ENV_LOGFACILITY               "logfacility"
 143 #define PCMK__ENV_LOGFILE                   "logfile"
 144 #define PCMK__ENV_LOGFILE_MODE              "logfile_mode"
 145 #define PCMK__ENV_LOGPRIORITY               "logpriority"
 146 #define PCMK__ENV_NODE_ACTION_LIMIT         "node_action_limit"
 147 #define PCMK__ENV_NODE_START_STATE          "node_start_state"
 148 #define PCMK__ENV_PANIC_ACTION              "panic_action"
 149 #define PCMK__ENV_REMOTE_ADDRESS            "remote_address"
 150 #define PCMK__ENV_REMOTE_SCHEMA_DIRECTORY   "remote_schema_directory"
 151 #define PCMK__ENV_REMOTE_PID1               "remote_pid1"
 152 #define PCMK__ENV_REMOTE_PORT               "remote_port"
 153 #define PCMK__ENV_RESPAWNED                 "respawned"
 154 #define PCMK__ENV_SCHEMA_DIRECTORY          "schema_directory"
 155 #define PCMK__ENV_SERVICE                   "service"
 156 #define PCMK__ENV_STDERR                    "stderr"
 157 #define PCMK__ENV_TLS_PRIORITIES            "tls_priorities"
 158 #define PCMK__ENV_TRACE_BLACKBOX            "trace_blackbox"
 159 #define PCMK__ENV_TRACE_FILES               "trace_files"
 160 #define PCMK__ENV_TRACE_FORMATS             "trace_formats"
 161 #define PCMK__ENV_TRACE_FUNCTIONS           "trace_functions"
 162 #define PCMK__ENV_TRACE_TAGS                "trace_tags"
 163 #define PCMK__ENV_VALGRIND_ENABLED          "valgrind_enabled"
 164 
 165 // Constants for meta-attribute names
 166 #define PCMK__META_CLONE                    "clone"
 167 #define PCMK__META_CONTAINER                "container"
 168 #define PCMK__META_DIGESTS_ALL              "digests-all"
 169 #define PCMK__META_DIGESTS_SECURE           "digests-secure"
 170 #define PCMK__META_INTERNAL_RSC             "internal_rsc"
 171 #define PCMK__META_MIGRATE_SOURCE           "migrate_source"
 172 #define PCMK__META_MIGRATE_TARGET           "migrate_target"
 173 #define PCMK__META_ON_NODE                  "on_node"
 174 #define PCMK__META_ON_NODE_UUID             "on_node_uuid"
 175 #define PCMK__META_OP_NO_WAIT               "op_no_wait"
 176 #define PCMK__META_OP_TARGET_RC             "op_target_rc"
 177 #define PCMK__META_PHYSICAL_HOST            "physical-host"
 178 #define PCMK__META_STONITH_ACTION           "stonith_action"
 179 
 180 /* @TODO Plug these in. Currently, they're never set. These are op attrs for use
 181  * with https://projects.clusterlabs.org/T382.
 182  */
 183 #define PCMK__META_CLEAR_FAILURE_OP         "clear_failure_op"
 184 #define PCMK__META_CLEAR_FAILURE_INTERVAL   "clear_failure_interval"
 185 
 186 // @COMPAT Deprecated alias for PCMK__META_PROMOTED_MAX since 2.0.0
 187 #define PCMK__META_PROMOTED_MAX_LEGACY      "master-max"
 188 
 189 // @COMPAT Deprecated alias for PCMK__META_PROMOTED_NODE_MAX since 2.0.0
 190 #define PCMK__META_PROMOTED_NODE_MAX_LEGACY "master-node-max"
 191 
 192 // Constants for enumerated values
 193 #define PCMK__VALUE_ATTRD                   "attrd"
 194 #define PCMK__VALUE_BOLD                    "bold"
 195 #define PCMK__VALUE_BROADCAST               "broadcast"
 196 #define PCMK__VALUE_CIB                     "cib"
 197 #define PCMK__VALUE_CIB_DIFF_NOTIFY         "cib_diff_notify"
 198 #define PCMK__VALUE_CIB_NOTIFY              "cib_notify"
 199 #define PCMK__VALUE_CIB_POST_NOTIFY         "cib_post_notify"
 200 #define PCMK__VALUE_CIB_PRE_NOTIFY          "cib_pre_notify"
 201 #define PCMK__VALUE_CIB_UPDATE_CONFIRMATION "cib_update_confirmation"
 202 #define PCMK__VALUE_CLUSTER                 "cluster"
 203 #define PCMK__VALUE_CRMD                    "crmd"
 204 #define PCMK__VALUE_EN                      "en"
 205 #define PCMK__VALUE_EPOCH                   "epoch"
 206 #define PCMK__VALUE_HEALTH_RED              "health_red"
 207 #define PCMK__VALUE_HEALTH_YELLOW           "health_yellow"
 208 #define PCMK__VALUE_INIT                    "init"
 209 #define PCMK__VALUE_LOCAL                   "local"
 210 #define PCMK__VALUE_LOST                    "lost"
 211 #define PCMK__VALUE_LRMD                    "lrmd"
 212 #define PCMK__VALUE_MAINT                   "maint"
 213 #define PCMK__VALUE_OUTPUT                  "output"
 214 #define PCMK__VALUE_PASSWORD                "password"
 215 #define PCMK__VALUE_PRIMITIVE               "primitive"
 216 #define PCMK__VALUE_REFRESH                 "refresh"
 217 #define PCMK__VALUE_REQUEST                 "request"
 218 #define PCMK__VALUE_RESPONSE                "response"
 219 #define PCMK__VALUE_RSC_FAILED              "rsc-failed"
 220 #define PCMK__VALUE_RSC_FAILURE_IGNORED     "rsc-failure-ignored"
 221 #define PCMK__VALUE_RSC_MANAGED             "rsc-managed"
 222 #define PCMK__VALUE_RSC_MULTIPLE            "rsc-multiple"
 223 #define PCMK__VALUE_RSC_OK                  "rsc-ok"
 224 #define PCMK__VALUE_RUNNING                 "running"
 225 #define PCMK__VALUE_SCHEDULER               "scheduler"
 226 #define PCMK__VALUE_SHUTDOWN_COMPLETE       "shutdown_complete"
 227 #define PCMK__VALUE_SHUTTING_DOWN           "shutting_down"
 228 #define PCMK__VALUE_ST_ASYNC_TIMEOUT_VALUE  "st-async-timeout-value"
 229 #define PCMK__VALUE_ST_NOTIFY               "st_notify"
 230 #define PCMK__VALUE_ST_NOTIFY_DISCONNECT    "st_notify_disconnect"
 231 #define PCMK__VALUE_ST_NOTIFY_FENCE         "st_notify_fence"
 232 #define PCMK__VALUE_ST_NOTIFY_HISTORY       "st_notify_history"
 233 #define PCMK__VALUE_ST_NOTIFY_HISTORY_SYNCED    "st_notify_history_synced"
 234 #define PCMK__VALUE_STARTING_DAEMONS        "starting_daemons"
 235 #define PCMK__VALUE_STONITH_NG              "stonith-ng"
 236 #define PCMK__VALUE_WAIT_FOR_PING           "wait_for_ping"
 237 #define PCMK__VALUE_WARNING                 "warning"
 238 
 239 /* @COMPAT Deprecated since 2.1.7 (used with PCMK__XA_ORDERING attribute of
 240  * resource sets)
 241  */
 242 #define PCMK__VALUE_GROUP                   "group"
 243 
 244 // @COMPAT Drop when daemon metadata commands are dropped
 245 #define PCMK__VALUE_TIME                    "time"
 246 
 247 #ifdef __cplusplus
 248 }
 249 #endif
 250 
 251 #endif // PCMK__OPTIONS_INTERNAL__H

/* [previous][next][first][last][top][bottom][index][help] */