summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-04-16 21:10:17 +0300
committerEd Tanous <ed@tanous.net>2024-04-19 21:53:34 +0300
commit5b90429a75c58797ec29ac9a8ed18c2dcd7d4950 (patch)
treecd7bbbe751cb9eef3bdf51abf372d1790aadce24
parent211cfa49d10cb251b6504bacb13d8e87b4d9c1e4 (diff)
downloadbmcweb-5b90429a75c58797ec29ac9a8ed18c2dcd7d4950.tar.xz
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit: When that's done, these missing headers become compile errors. We should just fix them. In addition, this allows us to enable automatic header checking in clang-tidy using misc-header-cleaner. Because the compiler can now "see" all the defines, it no longer tries to remove headers that it thinks are unused. [1] https://github.com/openbmc/bmcweb/commit/4fdee9e39e9f03122ee16a6fb251a380681f56ac Tested: Code compiles. Change-Id: Ifa27ac4a512362b7ded7cc3068648dc4aea6ad7b Signed-off-by: Ed Tanous <ed@tanous.net>
-rw-r--r--.clang-tidy2
-rw-r--r--http/http_client.hpp1
-rw-r--r--include/nbd_proxy.hpp1
-rw-r--r--include/openbmc_dbus_rest.hpp1
-rw-r--r--include/pam_authenticate.hpp3
-rw-r--r--redfish-core/include/event_service_manager.hpp1
-rw-r--r--redfish-core/include/privileges.hpp1
-rw-r--r--redfish-core/include/task_messages.hpp1
-rw-r--r--redfish-core/lib/eventservice_sse.hpp6
-rw-r--r--redfish-core/lib/log_services.hpp2
-rw-r--r--redfish-core/lib/metric_report_definition.hpp1
-rw-r--r--redfish-core/lib/power.hpp1
-rw-r--r--redfish-core/lib/thermal.hpp1
-rw-r--r--redfish-core/lib/trigger.hpp1
-rw-r--r--redfish-core/lib/update_service.hpp3
-rw-r--r--redfish-core/src/redfish.cpp3
-rw-r--r--redfish-core/src/utils/dbus_utils.cpp7
-rw-r--r--src/webserver_main.cpp2
-rw-r--r--src/webserver_run.cpp7
-rw-r--r--test/http/http2_connection_test.cpp1
-rw-r--r--test/redfish-core/include/utils/dbus_utils.cpp10
-rw-r--r--test/redfish-core/lib/update_service_test.cpp2
22 files changed, 37 insertions, 21 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 41643f5fcd..b44f227da6 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -358,4 +358,4 @@ CheckOptions:
- { key: readability-identifier-naming.StructIgnoredRegexp, value: (BMCWEB_LOG_DEBUG|BMCWEB_LOG_INFO|BMCWEB_LOG_WARNING|BMCWEB_LOG_ERROR|BMCWEB_LOG_CRITICAL) }
- { key: cppcoreguidelines-macro-usage.AllowedRegexp, value: DEBUG*|NLOHMANN_JSON_SERIALIZE_ENUM }
- { key: cppcoreguidelines-rvalue-reference-param-not-moved.IgnoreUnnamedParams, value: true }
- - { key: misc-include-cleaner.IgnoreHeaders, value: ((nlohmann/json_fwd.hpp)|(boost/.*/src.hpp)|(boost/.*/detail/.*)|(nlohmann/detail/.*)|(stdio.h)|(ranges)|(bits/chrono.h)|(boost/system/error_code.hpp)) }
+ - { key: misc-include-cleaner.IgnoreHeaders, value: ((nlohmann/json_fwd.hpp)|(boost/.*/src.hpp)|(boost/.*/detail/.*)|(nlohmann/detail/.*)|(stdio.h)|(ranges)|(bits/.*)|(boost/system/error_code.hpp)) }
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 6a20453b82..f44107b69f 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -36,7 +36,6 @@
#include <boost/beast/http/read.hpp>
#include <boost/beast/http/write.hpp>
#include <boost/beast/ssl/ssl_stream.hpp>
-#include <boost/beast/version.hpp>
#include <boost/container/devector.hpp>
#include <boost/system/error_code.hpp>
#include <boost/url/format.hpp>
diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp
index 9607ddfb10..adc51a85ef 100644
--- a/include/nbd_proxy.hpp
+++ b/include/nbd_proxy.hpp
@@ -20,7 +20,6 @@
#include "websocket.hpp"
#include <boost/asio/local/stream_protocol.hpp>
-#include <boost/asio/write.hpp>
#include <boost/beast/core/buffers_to_string.hpp>
#include <boost/container/flat_map.hpp>
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index e1d66f56e9..17b5931199 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -32,7 +32,6 @@
#include <boost/beast/http/verb.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/vector.hpp>
-#include <boost/iterator/iterator_facade.hpp>
#include <boost/system/error_code.hpp>
#include <nlohmann/json.hpp>
#include <sdbusplus/asio/connection.hpp>
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index c06b7e9681..9854df6150 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -2,11 +2,10 @@
#include <security/pam_appl.h>
-#include <boost/utility/string_view.hpp>
-
#include <cstring>
#include <memory>
#include <span>
+#include <string_view>
// function used to get user input
inline int pamFunctionConversation(int numMsg, const struct pam_message** msg,
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 0c12cd31ea..702ca268fd 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -26,6 +26,7 @@
#include "str_utility.hpp"
#include "utility.hpp"
#include "utils/json_utils.hpp"
+#include "utils/time_utils.hpp"
#include <sys/inotify.h>
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index 1225cdf806..87780ee84f 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -21,7 +21,6 @@
#include <boost/beast/http/verb.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/vector.hpp>
-#include <boost/move/algo/move.hpp>
#include <array>
#include <bitset>
diff --git a/redfish-core/include/task_messages.hpp b/redfish-core/include/task_messages.hpp
index 56ebc00681..cb7b355912 100644
--- a/redfish-core/include/task_messages.hpp
+++ b/redfish-core/include/task_messages.hpp
@@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
*/
+#pragma once
#include "registries/task_event_message_registry.hpp"
#include <nlohmann/json.hpp>
diff --git a/redfish-core/lib/eventservice_sse.hpp b/redfish-core/lib/eventservice_sse.hpp
index 4ad29a6707..3cbca3bc8b 100644
--- a/redfish-core/lib/eventservice_sse.hpp
+++ b/redfish-core/lib/eventservice_sse.hpp
@@ -1,8 +1,14 @@
#pragma once
+#include "privileges.hpp"
+#include "registries/privilege_registry.hpp"
+
#include <app.hpp>
#include <event_service_manager.hpp>
+#include <memory>
+#include <string>
+
namespace redfish
{
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 9fa4db1af4..1e5a34f15b 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -28,7 +28,9 @@
#include "registries/openbmc_message_registry.hpp"
#include "registries/privilege_registry.hpp"
#include "task.hpp"
+#include "task_messages.hpp"
#include "utils/dbus_utils.hpp"
+#include "utils/json_utils.hpp"
#include "utils/time_utils.hpp"
#include <systemd/sd-id128.h>
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index 54d93cb326..36f2334638 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -8,6 +8,7 @@
#include "sensors.hpp"
#include "utils/collection.hpp"
#include "utils/dbus_utils.hpp"
+#include "utils/json_utils.hpp"
#include "utils/telemetry_utils.hpp"
#include "utils/time_utils.hpp"
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index ad07d1cb9a..18d13808dc 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -22,6 +22,7 @@
#include "registries/privilege_registry.hpp"
#include "sensors.hpp"
#include "utils/chassis_utils.hpp"
+#include "utils/json_utils.hpp"
#include <sdbusplus/asio/property.hpp>
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 7e840d2b66..84bf37a04e 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -19,6 +19,7 @@
#include "query.hpp"
#include "registries/privilege_registry.hpp"
#include "sensors.hpp"
+#include "utils/json_utils.hpp"
namespace redfish
{
diff --git a/redfish-core/lib/trigger.hpp b/redfish-core/lib/trigger.hpp
index 9ea886e641..a6101a2a1d 100644
--- a/redfish-core/lib/trigger.hpp
+++ b/redfish-core/lib/trigger.hpp
@@ -9,6 +9,7 @@
#include "utility.hpp"
#include "utils/collection.hpp"
#include "utils/dbus_utils.hpp"
+#include "utils/json_utils.hpp"
#include "utils/telemetry_utils.hpp"
#include "utils/time_utils.hpp"
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index df4043f369..14f8ecfd61 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -19,14 +19,17 @@
#include "app.hpp"
#include "dbus_utility.hpp"
+#include "error_messages.hpp"
#include "generated/enums/update_service.hpp"
#include "multipart_parser.hpp"
#include "ossl_random.hpp"
#include "query.hpp"
#include "registries/privilege_registry.hpp"
#include "task.hpp"
+#include "task_messages.hpp"
#include "utils/collection.hpp"
#include "utils/dbus_utils.hpp"
+#include "utils/json_utils.hpp"
#include "utils/sw_utils.hpp"
#include <boost/system/error_code.hpp>
diff --git a/redfish-core/src/redfish.cpp b/redfish-core/src/redfish.cpp
index b948ed5dac..66a43d76f0 100644
--- a/redfish-core/src/redfish.cpp
+++ b/redfish-core/src/redfish.cpp
@@ -1,5 +1,7 @@
#include "redfish.hpp"
+#include "bmcweb_config.h"
+
#include "account_service.hpp"
#include "aggregation_service.hpp"
#include "app.hpp"
@@ -23,7 +25,6 @@
#include "metric_report_definition.hpp"
#include "network_protocol.hpp"
#include "pcie.hpp"
-#include "pcie_slots.hpp"
#include "power.hpp"
#include "power_subsystem.hpp"
#include "power_supply.hpp"
diff --git a/redfish-core/src/utils/dbus_utils.cpp b/redfish-core/src/utils/dbus_utils.cpp
index ba84d3063e..bd114a3d74 100644
--- a/redfish-core/src/utils/dbus_utils.cpp
+++ b/redfish-core/src/utils/dbus_utils.cpp
@@ -1,9 +1,14 @@
#include "utils/dbus_utils.hpp"
#include "async_resp.hpp"
+#include "error_messages.hpp"
+#include "logging.hpp"
+#include <systemd/sd-bus.h>
+
+#include <boost/asio/error.hpp>
+#include <boost/beast/http/status.hpp>
#include <boost/system/error_code.hpp>
-#include <nlohmann/json.hpp>
#include <sdbusplus/message.hpp>
#include <memory>
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index ee752b0239..c7c7fb479a 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -4,8 +4,6 @@
#include "webserver_run.hpp"
#include <exception>
-#include <memory>
-#include <string>
int main(int /*argc*/, char** /*argv*/)
{
diff --git a/src/webserver_run.cpp b/src/webserver_run.cpp
index 3c1c615539..bb037232aa 100644
--- a/src/webserver_run.cpp
+++ b/src/webserver_run.cpp
@@ -12,22 +12,21 @@
#include "ibm/management_console_rest.hpp"
#include "image_upload.hpp"
#include "kvm_websocket.hpp"
+#include "logging.hpp"
#include "login_routes.hpp"
#include "nbd_proxy.hpp"
#include "obmc_console.hpp"
#include "openbmc_dbus_rest.hpp"
#include "redfish.hpp"
#include "redfish_aggregator.hpp"
-#include "security_headers.hpp"
-#include "ssl_key_handler.hpp"
#include "user_monitor.hpp"
#include "vm_websocket.hpp"
#include "webassets.hpp"
#include <boost/asio/io_context.hpp>
#include <sdbusplus/asio/connection.hpp>
-#include <sdbusplus/bus.hpp>
-#include <sdbusplus/server.hpp>
+
+#include <memory>
int run()
{
diff --git a/test/http/http2_connection_test.cpp b/test/http/http2_connection_test.cpp
index dc71ef3d73..81c78a9a60 100644
--- a/test/http/http2_connection_test.cpp
+++ b/test/http/http2_connection_test.cpp
@@ -2,6 +2,7 @@
#include "http/http2_connection.hpp"
#include "http/http_request.hpp"
#include "http/http_response.hpp"
+#include "nghttp2_adapters.hpp"
#include <nghttp2/nghttp2.h>
#include <unistd.h>
diff --git a/test/redfish-core/include/utils/dbus_utils.cpp b/test/redfish-core/include/utils/dbus_utils.cpp
index 00c53dec7f..3256c94fa1 100644
--- a/test/redfish-core/include/utils/dbus_utils.cpp
+++ b/test/redfish-core/include/utils/dbus_utils.cpp
@@ -1,19 +1,17 @@
#include "utils/dbus_utils.hpp"
-#include "http_request.hpp"
+#include "async_resp.hpp"
#include "http_response.hpp"
#include <boost/beast/http/status.hpp>
+#include <boost/system/errc.hpp>
#include <nlohmann/json.hpp>
+#include <sdbusplus/message.hpp>
-#include <cstdint>
-#include <optional>
+#include <memory>
#include <string>
-#include <system_error>
-#include <vector>
-#include <gmock/gmock.h>
#include <gtest/gtest.h>
namespace redfish::details
diff --git a/test/redfish-core/lib/update_service_test.cpp b/test/redfish-core/lib/update_service_test.cpp
index 540313154f..87af3f116a 100644
--- a/test/redfish-core/lib/update_service_test.cpp
+++ b/test/redfish-core/lib/update_service_test.cpp
@@ -2,6 +2,8 @@
#include "http_response.hpp"
#include "update_service.hpp"
+#include <boost/url/url.hpp>
+
#include <optional>
#include <gtest/gtest.h>