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>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 0c12cd3..702ca26 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 1225cdf..87780ee 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 56ebc00..cb7b355 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 4ad29a6..3cbca3b 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 9fa4db1..1e5a34f 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 54d93cb..36f2334 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 ad07d1c..18d1380 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 7e840d2..84bf37a 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 9ea886e..a6101a2 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 df4043f..14f8ecf 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 b948ed5..66a43d7 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 ba84d30..bd114a3 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>