summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/bmcweb_config.h.in72
-rw-r--r--config/meson.build92
2 files changed, 118 insertions, 46 deletions
diff --git a/config/bmcweb_config.h.in b/config/bmcweb_config.h.in
index eb0c79c77a..81a61c8b17 100644
--- a/config/bmcweb_config.h.in
+++ b/config/bmcweb_config.h.in
@@ -1,29 +1,57 @@
#pragma once
#include <cstdint>
-#include <cstddef>
#include <string_view>
// clang-format off
-constexpr const bool bmcwebInsecureEnableQueryParams = @BMCWEB_INSECURE_ENABLE_QUERY_PARAMS@ == 1;
-
-constexpr const size_t bmcwebHttpReqBodyLimitMb = @BMCWEB_HTTP_REQ_BODY_LIMIT_MB@;
-
-constexpr const char* mesonInstallPrefix = "@MESON_INSTALL_PREFIX@";
-
-constexpr const bool bmcwebInsecureEnableHttpPushStyleEventing = @BMCWEB_INSECURE_ENABLE_HTTP_PUSH_STYLE_EVENTING@ == 1;
-
-constexpr const char* bmcwebLoggingLevel = "@BMCWEB_LOGGING_LEVEL@";
-
-constexpr const bool bmcwebEnableMultiHost = @BMCWEB_ENABLE_MULTI_HOST@ == 1;
-
-constexpr const bool bmcwebEnableHTTP2 = @BMCWEB_ENABLE_HTTP2@ == 1;
-
-constexpr const bool bmcwebEnableTLS = @BMCWEB_ENABLE_TLS@ == 1;
-
-constexpr const bool bmcwebMTLSCommonNameParsingMeta = @BMCWEB_ENABLE_MTLS_COMMON_NAME_PARSING_META@ == 1;
-
-constexpr const bool bmcwebNbdProxy = @BMCWEB_VIRTUAL_MEDIA_NBD@ == 1;
-
-constexpr const bool bmcwebVmWebsocket = @BMCWEB_VIRTUAL_MEDIA_VM@ == 1;
+// NOLINTBEGIN(readability-identifier-naming)
+
+// String params
+constexpr const std::string_view BMCWEB_LOGGING_LEVEL = "@LOGGING_LEVEL@";
+constexpr const std::string_view BMCWEB_MUTUAL_TLS_COMMON_NAME_PARSING = "@MUTUAL_TLS_COMMON_NAME_PARSING@";
+constexpr const std::string_view BMCWEB_DNS_RESOLVER = "@DNS_RESOLVER@";
+
+// Integer params
+constexpr const uint64_t BMCWEB_HTTP_BODY_LIMIT = @HTTP_BODY_LIMIT@;
+constexpr const uint16_t BMCWEB_HTTPS_PORT = @HTTPS_PORT@;
+
+// Feature Params
+constexpr const bool BMCWEB_BASIC_AUTH = @BASIC_AUTH@;
+constexpr const bool BMCWEB_COOKIE_AUTH = @COOKIE_AUTH@;
+constexpr const bool BMCWEB_EXPERIMENTAL_HTTP2 = @EXPERIMENTAL_HTTP2@;
+constexpr const bool BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM = @EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM@;
+constexpr const bool BMCWEB_HOST_SERIAL_SOCKET = @HOST_SERIAL_SOCKET@;
+constexpr const bool BMCWEB_INSECURE_DISABLE_AUTH = @INSECURE_DISABLE_AUTH@;
+constexpr const bool BMCWEB_INSECURE_DISABLE_CSRF = @INSECURE_DISABLE_CSRF@;
+constexpr const bool BMCWEB_INSECURE_DISABLE_SSL = @INSECURE_DISABLE_SSL@;
+constexpr const bool BMCWEB_INSECURE_ENABLE_REDFISH_QUERY = @INSECURE_ENABLE_REDFISH_QUERY@;
+constexpr const bool BMCWEB_INSECURE_IGNORE_CONTENT_TYPE = @INSECURE_IGNORE_CONTENT_TYPE@;
+constexpr const bool BMCWEB_INSECURE_PUSH_STYLE_NOTIFICATION = @INSECURE_PUSH_STYLE_NOTIFICATION@;
+constexpr const bool BMCWEB_INSECURE_TFTP_UPDATE = @INSECURE_TFTP_UPDATE@;
+constexpr const bool BMCWEB_KVM = @KVM@;
+constexpr const bool BMCWEB_MUTUAL_TLS_AUTH = @MUTUAL_TLS_AUTH@;
+constexpr const bool BMCWEB_REDFISH_AGGREGATION = @REDFISH_AGGREGATION@;
+constexpr const bool BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL = @REDFISH_ALLOW_DEPRECATED_POWER_THERMAL@;
+constexpr const bool BMCWEB_REDFISH_BMC_JOURNAL = @REDFISH_BMC_JOURNAL@;
+constexpr const bool BMCWEB_REDFISH_CPU_LOG = @REDFISH_CPU_LOG@;
+constexpr const bool BMCWEB_REDFISH_DBUS_LOG = @REDFISH_DBUS_LOG@;
+constexpr const bool BMCWEB_REDFISH_DUMP_LOG = @REDFISH_DUMP_LOG@;
+constexpr const bool BMCWEB_REDFISH_HOST_LOGGER = @REDFISH_HOST_LOGGER@;
+constexpr const bool BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM = @REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM@;
+constexpr const bool BMCWEB_REDFISH_OEM_MANAGER_FAN_DATA = @REDFISH_OEM_MANAGER_FAN_DATA@;
+constexpr const bool BMCWEB_REDFISH_PROVISIONING_FEATURE = @REDFISH_PROVISIONING_FEATURE@;
+constexpr const bool BMCWEB_REDFISH = @REDFISH@;
+constexpr const bool BMCWEB_REST = @REST@;
+constexpr const bool BMCWEB_SESSION_AUTH = @SESSION_AUTH@;
+constexpr const bool BMCWEB_STATIC_HOSTING = @STATIC_HOSTING@;
+constexpr const bool BMCWEB_TESTS = @TESTS@;
+constexpr const bool BMCWEB_VM_WEBSOCKET = @VM_WEBSOCKET@;
+constexpr const bool BMCWEB_VM_NBDPROXY = false;
+constexpr const bool BMCWEB_XTOKEN_AUTH = @XTOKEN_AUTH@;
+
+// Company specific params
+constexpr const bool BMCWEB_GOOGLE_API = @GOOGLE_API@;
+constexpr const bool BMCWEB_IBM_MANAGEMENT_CONSOLE = @IBM_MANAGEMENT_CONSOLE@;
+
+// NOLINTEND(readability-identifier-naming)
// clang-format on
diff --git a/config/meson.build b/config/meson.build
index 9533bd6b46..4b862b49eb 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -1,30 +1,74 @@
# Gather the Configuration data
conf_data = configuration_data()
-conf_data.set('BMCWEB_HTTP_REQ_BODY_LIMIT_MB', get_option('http-body-limit'))
-enable_redfish_query = get_option('insecure-enable-redfish-query')
-conf_data.set10('BMCWEB_INSECURE_ENABLE_QUERY_PARAMS', enable_redfish_query.allowed())
-# enable_redfish_aggregation = get_option('redfish-aggregation')
-# conf_data.set10('BMCWEB_ENABLE_REDFISH_AGGREGATION', enable_redfish_aggregation.allowed())
-insecure_push_style_notification = get_option('insecure-push-style-notification')
-conf_data.set10(
- 'BMCWEB_INSECURE_ENABLE_HTTP_PUSH_STYLE_EVENTING',
- insecure_push_style_notification.allowed(),
-)
-conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
-conf_data.set('HTTPS_PORT', get_option('https_port'))
-enable_multi_host = get_option('experimental-redfish-multi-computer-system')
-conf_data.set10('BMCWEB_ENABLE_MULTI_HOST', enable_multi_host.allowed())
-enable_http2 = get_option('experimental-http2')
-conf_data.set10('BMCWEB_ENABLE_HTTP2', enable_http2.allowed())
-enable_tls = get_option('insecure-disable-ssl')
-conf_data.set10('BMCWEB_ENABLE_TLS', enable_tls.disabled())
+feature_options = [
+ 'basic-auth',
+ 'cookie-auth',
+ 'dns-resolver',
+ 'experimental-http2',
+ 'experimental-redfish-multi-computer-system',
+ 'google-api',
+ 'host-serial-socket',
+ 'http-body-limit',
+ 'https_port',
+ 'ibm-management-console',
+ 'insecure-disable-auth',
+ 'insecure-disable-csrf',
+ 'insecure-disable-ssl',
+ 'insecure-enable-redfish-query',
+ 'insecure-ignore-content-type',
+ 'insecure-push-style-notification',
+ 'insecure-tftp-update',
+ 'kvm',
+ 'mutual-tls-auth',
+ 'mutual-tls-common-name-parsing',
+ 'redfish-aggregation',
+ 'redfish-allow-deprecated-power-thermal',
+ 'redfish-bmc-journal',
+ 'redfish-cpu-log',
+ 'redfish-dbus-log',
+ 'redfish-dump-log',
+ 'redfish-host-logger',
+ 'redfish-new-powersubsystem-thermalsubsystem',
+ 'redfish-oem-manager-fan-data',
+ 'redfish-provisioning-feature',
+ 'redfish',
+ 'rest',
+ 'session-auth',
+ 'static-hosting',
+ 'tests',
+ 'vm-websocket',
+ 'xtoken-auth',
+]
-conf_data.set10(
- 'BMCWEB_ENABLE_MTLS_COMMON_NAME_PARSING_META',
- get_option('mutual-tls-common-name-parsing') == 'meta',
-)
+string_options = [
+ 'dns-resolver',
+ 'mutual-tls-common-name-parsing',
+]
+
+int_options = [
+ 'http-body-limit',
+ 'https_port',
+]
+
+foreach option_key : feature_options
+
+ option_key_config = option_key.to_upper()
+ option_key_config = option_key_config.replace('-', '_')
+
+ message(option_key_config)
+ opt = get_option(option_key)
+ if string_options.contains(option_key)
+ elif int_options.contains(option_key)
+ else
+ opt = opt.allowed().to_string()
+ endif
+ conf_data.set(option_key_config, opt)
+ summary(option_key, opt, section: 'Features')
+endforeach
+
+conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed())
conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)
@@ -32,11 +76,11 @@ conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)
# Logging level
loglvlopt = get_option('bmcweb-logging')
if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
- # Override logging level as 'debug' if 'bmcweb-logging' is set as 'dsiabled'
+ # Override logging level as 'debug' if 'bmcweb-logging' is set as 'disabled'
loglvlopt = 'debug'
endif
loglvlopt = loglvlopt.to_upper()
-conf_data.set('BMCWEB_LOGGING_LEVEL', loglvlopt)
+conf_data.set('LOGGING_LEVEL', loglvlopt)
conf_h_dep = declare_dependency(
include_directories: include_directories('.'),