Bring consistency to config options

The configuration options that exist in bmcweb are an amalgimation of
CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms
and meson options using a config file.  This history has led to a lot of
different ways to configure code in the codebase itself, which has led
to problems, and issues in consistency.

ifdef options do no compile time checking of code not within the branch.
This is good when you have optional dependencies, but not great when
you're trying to ensure both options compile.

This commit moves all internal configuration options to:
1. A namespace called bmcweb
2. A naming scheme matching the meson option.  hyphens are replaced with
   underscores, and the option is uppercased.  This consistent transform
   allows matching up option keys with their code counterparts, without
   naming changes.
3. All options are bool true = enabled, and any options with _ENABLED or
   _DISABLED postfixes have those postfixes removed.  (note, there are
   still some options with disable in the name, those are left as-is)
4. All options are now constexpr booleans, without an explicit compare.

To accomplish this, unfortunately an option list in config/meson.build
is required, given that meson doesn't provide a way to dump all options,
as is a manual entry in bmcweb_config.h.in, in addition to the
meson_options.  This obsoletes the map in the main meson.build, which
helps some of the complexity.

Now that we've done this, we have some rules that will be documented.
1. Runtime behavior changes should be added as a constexpr bool to
   bmcweb_config.h
2. Options that require optionally pulling in a dependency shall use an
   ifdef, defined in the primary meson.build.  (note, there are no
   options that currently meet this class, but it's included for
   completeness.)

Note, that this consolidation means that at configure time, all options
are printed.  This is a good thing and allows direct comparison of
configs in log files.

Tested: Code compiles
Server boots, and shows options configured in the default build. (HTTPS,
log level, etc)

Change-Id: I94e79a56bcdc01755036e4e7278c7e69e25809ce
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/app.hpp b/http/app.hpp
index 01ad755..eea1305 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -35,8 +35,8 @@
     using ssl_socket_t = boost::asio::ssl::stream<boost::asio::ip::tcp::socket>;
     using raw_socket_t = boost::asio::ip::tcp::socket;
 
-    using socket_type =
-        std::conditional_t<bmcwebEnableTLS, ssl_socket_t, raw_socket_t>;
+    using socket_type = std::conditional_t<BMCWEB_INSECURE_DISABLE_SSL,
+                                           raw_socket_t, ssl_socket_t>;
     using server_type = Server<App, socket_type>;
 
     explicit App(std::shared_ptr<boost::asio::io_context> ioIn =
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 860a7d4..ac231b4 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -149,11 +149,9 @@
 
     boost::asio::io_context& ioc;
 
-#ifdef BMCWEB_DBUS_DNS_RESOLVER
-    using Resolver = async_resolve::Resolver;
-#else
-    using Resolver = boost::asio::ip::tcp::resolver;
-#endif
+    using Resolver = std::conditional_t<BMCWEB_DNS_RESOLVER == "systemd-dbus",
+                                        async_resolve::Resolver,
+                                        boost::asio::ip::tcp::resolver>;
     Resolver resolver;
 
     boost::asio::ip::tcp::socket conn;
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index d0aa5d5..e02c518 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -38,9 +38,8 @@
 // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
 static int connectionCount = 0;
 
-// request body limit size set by the bmcwebHttpReqBodyLimitMb option
-constexpr uint64_t httpReqBodyLimit = 1024UL * 1024UL *
-                                      bmcwebHttpReqBodyLimitMb;
+// request body limit size set by the BMCWEB_HTTP_BODY_LIMIT option
+constexpr uint64_t httpReqBodyLimit = 1024UL * 1024UL * BMCWEB_HTTP_BODY_LIMIT;
 
 constexpr uint64_t loggedOutPostBodyLimit = 4096U;
 
@@ -70,9 +69,10 @@
     {
         initParser();
 
-#ifdef BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION
-        prepareMutualTls();
-#endif // BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION
+        if constexpr (BMCWEB_MUTUAL_TLS_AUTH)
+        {
+            prepareMutualTls();
+        }
 
         connectionCount++;
 
@@ -187,7 +187,7 @@
     void afterSslHandshake()
     {
         // If http2 is enabled, negotiate the protocol
-        if constexpr (bmcwebEnableHTTP2)
+        if constexpr (BMCWEB_EXPERIMENTAL_HTTP2)
         {
             const unsigned char* alpn = nullptr;
             unsigned int alpnlen = 0;
diff --git a/http/http_server.hpp b/http/http_server.hpp
index a370894..206a0d1 100644
--- a/http/http_server.hpp
+++ b/http/http_server.hpp
@@ -74,7 +74,7 @@
 
     void loadCertificate()
     {
-        if constexpr (!bmcwebEnableTLS)
+        if constexpr (BMCWEB_INSECURE_DISABLE_SSL)
         {
             return;
         }
diff --git a/http/logging.hpp b/http/logging.hpp
index 9b1a36b..cf90877 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -54,7 +54,7 @@
 
 // configured bmcweb LogLevel
 constexpr crow::LogLevel bmcwebCurrentLoggingLevel =
-    getLogLevelFromName(bmcwebLoggingLevel);
+    getLogLevelFromName(BMCWEB_LOGGING_LEVEL);
 
 template <typename T>
 const void* logPtr(T p)
diff --git a/http/mutual_tls.hpp b/http/mutual_tls.hpp
index 9f9f82b..5392549 100644
--- a/http/mutual_tls.hpp
+++ b/http/mutual_tls.hpp
@@ -94,7 +94,7 @@
     sslUser.resize(lastChar);
 
     // Meta Inc. CommonName parsing
-    if (bmcwebMTLSCommonNameParsingMeta)
+    if constexpr (BMCWEB_MUTUAL_TLS_COMMON_NAME_PARSING == "meta")
     {
         std::optional<std::string_view> sslUserMeta =
             mtlsMetaParseSslUser(sslUser);
diff --git a/http/utility.hpp b/http/utility.hpp
index 1d67500..da174e5 100644
--- a/http/utility.hpp
+++ b/http/utility.hpp
@@ -497,7 +497,7 @@
         }
         if (url.port_number() == 80)
         {
-            if (bmcwebInsecureEnableHttpPushStyleEventing)
+            if constexpr (BMCWEB_INSECURE_PUSH_STYLE_NOTIFICATION)
             {
                 url.set_scheme("http");
             }