root/include/crm/common/options_internal.h

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

INCLUDED FROM


   1 /*
   2  * Copyright 2006-2023 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__OPTIONS_INTERNAL__H
  11 #  define PCMK__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 _Noreturn void pcmk__cli_help(char cmd);
  22 
  23 
  24 /*
  25  * Environment variable option handling
  26  */
  27 
  28 const char *pcmk__env_option(const char *option);
  29 void pcmk__set_env_option(const char *option, const char *value, bool compat);
  30 bool pcmk__env_option_enabled(const char *daemon, const char *option);
  31 
  32 
  33 /*
  34  * Cluster option handling
  35  */
  36 
  37 typedef struct pcmk__cluster_option_s {
  38     const char *name;
  39     const char *alt_name;
  40     const char *type;
  41     const char *values;
  42     const char *default_value;
  43 
  44     bool (*is_valid)(const char *);
  45 
  46     const char *description_short;
  47     const char *description_long;
  48 
  49 } pcmk__cluster_option_t;
  50 
  51 const char *pcmk__cluster_option(GHashTable *options,
  52                                  const pcmk__cluster_option_t *option_list,
  53                                  int len, const char *name);
  54 
  55 gchar *pcmk__format_option_metadata(const char *name, const char *desc_short,
  56                                     const char *desc_long,
  57                                     pcmk__cluster_option_t *option_list,
  58                                     int len);
  59 
  60 void pcmk__validate_cluster_options(GHashTable *options,
  61                                     pcmk__cluster_option_t *option_list,
  62                                     int len);
  63 
  64 bool pcmk__valid_interval_spec(const char *value);
  65 bool pcmk__valid_boolean(const char *value);
  66 bool pcmk__valid_number(const char *value);
  67 bool pcmk__valid_positive_number(const char *value);
  68 bool pcmk__valid_quorum(const char *value);
  69 bool pcmk__valid_script(const char *value);
  70 bool pcmk__valid_percentage(const char *value);
  71 
  72 // from watchdog.c
  73 long pcmk__get_sbd_timeout(void);
  74 bool pcmk__get_sbd_sync_resource_startup(void);
  75 long pcmk__auto_watchdog_timeout(void);
  76 bool pcmk__valid_sbd_timeout(const char *value);
  77 
  78 // Constants for environment variable names
  79 #define PCMK__ENV_AUTHKEY_LOCATION          "authkey_location"
  80 #define PCMK__ENV_BLACKBOX                  "blackbox"
  81 #define PCMK__ENV_CALLGRIND_ENABLED         "callgrind_enabled"
  82 #define PCMK__ENV_CLUSTER_TYPE              "cluster_type"
  83 #define PCMK__ENV_DEBUG                     "debug"
  84 #define PCMK__ENV_DH_MAX_BITS               "dh_max_bits"
  85 #define PCMK__ENV_DH_MIN_BITS               "dh_min_bits"
  86 #define PCMK__ENV_FAIL_FAST                 "fail_fast"
  87 #define PCMK__ENV_IPC_BUFFER                "ipc_buffer"
  88 #define PCMK__ENV_IPC_TYPE                  "ipc_type"
  89 #define PCMK__ENV_LOGFACILITY               "logfacility"
  90 #define PCMK__ENV_LOGFILE                   "logfile"
  91 #define PCMK__ENV_LOGFILE_MODE              "logfile_mode"
  92 #define PCMK__ENV_LOGPRIORITY               "logpriority"
  93 #define PCMK__ENV_NODE_ACTION_LIMIT         "node_action_limit"
  94 #define PCMK__ENV_NODE_START_STATE          "node_start_state"
  95 #define PCMK__ENV_PANIC_ACTION              "panic_action"
  96 #define PCMK__ENV_PHYSICAL_HOST             "physical_host"
  97 #define PCMK__ENV_REMOTE_ADDRESS            "remote_address"
  98 #define PCMK__ENV_REMOTE_PID1               "remote_pid1"
  99 #define PCMK__ENV_REMOTE_PORT               "remote_port"
 100 #define PCMK__ENV_RESPAWNED                 "respawned"
 101 #define PCMK__ENV_SCHEMA_DIRECTORY          "schema_directory"
 102 #define PCMK__ENV_SERVICE                   "service"
 103 #define PCMK__ENV_STDERR                    "stderr"
 104 #define PCMK__ENV_TLS_PRIORITIES            "tls_priorities"
 105 #define PCMK__ENV_TRACE_BLACKBOX            "trace_blackbox"
 106 #define PCMK__ENV_TRACE_FILES               "trace_files"
 107 #define PCMK__ENV_TRACE_FORMATS             "trace_formats"
 108 #define PCMK__ENV_TRACE_FUNCTIONS           "trace_functions"
 109 #define PCMK__ENV_TRACE_TAGS                "trace_tags"
 110 #define PCMK__ENV_VALGRIND_ENABLED          "valgrind_enabled"
 111 
 112 // @COMPAT Drop at 3.0.0; default is plenty
 113 #define PCMK__ENV_CIB_TIMEOUT               "cib_timeout"
 114 
 115 // @COMPAT Drop at 3.0.0; likely last used in 1.1.24
 116 #define PCMK__ENV_MCP                       "mcp"
 117 
 118 // @COMPAT Drop at 3.0.0; added unused in 1.1.9
 119 #define PCMK__ENV_QUORUM_TYPE               "quorum_type"
 120 
 121 /* @COMPAT Drop at 3.0.0; added to debug shutdown issues when Pacemaker is
 122  * managed by systemd, but no longer useful.
 123  */
 124 #define PCMK__ENV_SHUTDOWN_DELAY            "shutdown_delay"
 125 
 126 // Constants for cluster option names
 127 #define PCMK__OPT_NODE_HEALTH_BASE          "node-health-base"
 128 #define PCMK__OPT_NODE_HEALTH_GREEN         "node-health-green"
 129 #define PCMK__OPT_NODE_HEALTH_RED           "node-health-red"
 130 #define PCMK__OPT_NODE_HEALTH_STRATEGY      "node-health-strategy"
 131 #define PCMK__OPT_NODE_HEALTH_YELLOW        "node-health-yellow"
 132 
 133 // Constants for meta-attribute names
 134 #define PCMK__META_ALLOW_UNHEALTHY_NODES    "allow-unhealthy-nodes"
 135 
 136 // Constants for enumerated values for various options
 137 #define PCMK__VALUE_CLUSTER                 "cluster"
 138 #define PCMK__VALUE_CUSTOM                  "custom"
 139 #define PCMK__VALUE_FENCING                 "fencing"
 140 #define PCMK__VALUE_GREEN                   "green"
 141 #define PCMK__VALUE_LOCAL                   "local"
 142 #define PCMK__VALUE_MIGRATE_ON_RED          "migrate-on-red"
 143 #define PCMK__VALUE_NONE                    "none"
 144 #define PCMK__VALUE_NOTHING                 "nothing"
 145 #define PCMK__VALUE_ONLY_GREEN              "only-green"
 146 #define PCMK__VALUE_PROGRESSIVE             "progressive"
 147 #define PCMK__VALUE_QUORUM                  "quorum"
 148 #define PCMK__VALUE_RED                     "red"
 149 #define PCMK__VALUE_UNFENCING               "unfencing"
 150 #define PCMK__VALUE_YELLOW                  "yellow"
 151 
 152 #endif // PCMK__OPTIONS_INTERNAL__H

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