summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ibm/locks.hpp2
-rw-r--r--include/ibm/management_console_rest.hpp34
-rw-r--r--redfish-core/include/event_service_manager.hpp2
-rw-r--r--redfish-core/include/resource_messages.hpp6
-rw-r--r--src/webserver_main.cpp7
5 files changed, 24 insertions, 27 deletions
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index cb9191f252..162abeeefa 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -303,7 +303,7 @@ inline RcGetLockList Lock::getLockList(const ListOfSessionIds& listSessionId)
// we may have found at least one entry with the given session id
// return the json list of lock records pertaining to the given
// session id, or send an empty list if lock table is empty
- return lockList;
+ return {lockList};
}
inline RcReleaseLockApi Lock::releaseLock(const ListOfTransactionIds& p,
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index 61a4b84d75..e789bda235 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -39,7 +39,7 @@ constexpr size_t maxSaveareaFileSize =
constexpr size_t maxBroadcastMsgSize =
1000; // Allow Broadcast message size upto 1KB
-bool createSaveAreaPath(crow::Response& res)
+inline bool createSaveAreaPath(crow::Response& res)
{
// The path /var/lib/obmc will be created by initrdscripts
// Create the directories for the save-area files, when we get
@@ -76,8 +76,9 @@ bool createSaveAreaPath(crow::Response& res)
}
return true;
}
-void handleFilePut(const crow::Request& req, crow::Response& res,
- const std::string& fileID)
+
+inline void handleFilePut(const crow::Request& req, crow::Response& res,
+ const std::string& fileID)
{
// Check the content-type of the request
std::string_view contentType = req.getHeaderValue("content-type");
@@ -156,7 +157,7 @@ void handleFilePut(const crow::Request& req, crow::Response& res,
}
}
-void handleConfigFileList(crow::Response& res)
+inline void handleConfigFileList(crow::Response& res)
{
std::vector<std::string> pathObjList;
std::filesystem::path loc("/var/lib/obmc/bmc-console-mgmt/save-area");
@@ -181,7 +182,7 @@ void handleConfigFileList(crow::Response& res)
res.end();
}
-void deleteConfigFiles(crow::Response& res)
+inline void deleteConfigFiles(crow::Response& res)
{
std::vector<std::string> pathObjList;
std::error_code ec;
@@ -201,7 +202,7 @@ void deleteConfigFiles(crow::Response& res)
res.end();
}
-void getLockServiceData(crow::Response& res)
+inline void getLockServiceData(crow::Response& res)
{
res.jsonValue["@odata.type"] = "#LockService.v1_0_0.LockService";
res.jsonValue["@odata.id"] = "/ibm/v1/HMC/LockService/";
@@ -217,7 +218,7 @@ void getLockServiceData(crow::Response& res)
res.end();
}
-void handleFileGet(crow::Response& res, const std::string& fileID)
+inline void handleFileGet(crow::Response& res, const std::string& fileID)
{
BMCWEB_LOG_DEBUG << "HandleGet on SaveArea files on path: " << fileID;
std::filesystem::path loc("/var/lib/obmc/bmc-console-mgmt/save-area/" +
@@ -249,7 +250,7 @@ void handleFileGet(crow::Response& res, const std::string& fileID)
return;
}
-void handleFileDelete(crow::Response& res, const std::string& fileID)
+inline void handleFileDelete(crow::Response& res, const std::string& fileID)
{
std::string filePath("/var/lib/obmc/bmc-console-mgmt/save-area/" + fileID);
BMCWEB_LOG_DEBUG << "Removing the file : " << filePath << "\n";
@@ -321,8 +322,8 @@ inline void handleFileUrl(const crow::Request& req, crow::Response& res,
}
}
-void handleAcquireLockAPI(const crow::Request& req, crow::Response& res,
- std::vector<nlohmann::json> body)
+inline void handleAcquireLockAPI(const crow::Request& req, crow::Response& res,
+ std::vector<nlohmann::json> body)
{
LockRequests lockRequestStructure;
for (auto& element : body)
@@ -457,7 +458,7 @@ void handleAcquireLockAPI(const crow::Request& req, crow::Response& res,
}
}
}
-void handleRelaseAllAPI(const crow::Request& req, crow::Response& res)
+inline void handleRelaseAllAPI(const crow::Request& req, crow::Response& res)
{
crow::ibm_mc_lock::Lock::getInstance().releaseLock(req.session->uniqueId);
res.result(boost::beast::http::status::ok);
@@ -465,8 +466,9 @@ void handleRelaseAllAPI(const crow::Request& req, crow::Response& res)
return;
}
-void handleReleaseLockAPI(const crow::Request& req, crow::Response& res,
- const std::vector<uint32_t>& listTransactionIds)
+inline void
+ handleReleaseLockAPI(const crow::Request& req, crow::Response& res,
+ const std::vector<uint32_t>& listTransactionIds)
{
BMCWEB_LOG_DEBUG << listTransactionIds.size();
BMCWEB_LOG_DEBUG << "Data is present";
@@ -531,8 +533,8 @@ void handleReleaseLockAPI(const crow::Request& req, crow::Response& res,
}
}
-void handleGetLockListAPI(crow::Response& res,
- const ListOfSessionIds& listSessionIds)
+inline void handleGetLockListAPI(crow::Response& res,
+ const ListOfSessionIds& listSessionIds)
{
BMCWEB_LOG_DEBUG << listSessionIds.size();
@@ -573,7 +575,7 @@ void handleGetLockListAPI(crow::Response& res,
res.end();
}
-void requestRoutes(App& app)
+inline void requestRoutes(App& app)
{
// allowed only for admin
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index c909a904ba..ded8dbc890 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -1088,7 +1088,6 @@ class EventServiceManager
}
}
}
-#ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE
void sendBroadcastMsg(const std::string& broadcastMsg)
{
for (const auto& it : this->subscriptionsMap)
@@ -1102,7 +1101,6 @@ class EventServiceManager
entry->sendEvent(msgJson.dump());
}
}
-#endif
#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
void cacheLastEventTimestamp()
diff --git a/redfish-core/include/resource_messages.hpp b/redfish-core/include/resource_messages.hpp
index 4ff1c86967..9826566e27 100644
--- a/redfish-core/include/resource_messages.hpp
+++ b/redfish-core/include/resource_messages.hpp
@@ -5,7 +5,7 @@ namespace redfish
namespace messages
{
-nlohmann::json ResourceChanged(void)
+inline nlohmann::json ResourceChanged(void)
{
return nlohmann::json{
{"EventType", "ResourceChanged"},
@@ -16,7 +16,7 @@ nlohmann::json ResourceChanged(void)
{"MessageSeverity", "OK"}};
}
-nlohmann::json ResourceCreated(void)
+inline nlohmann::json ResourceCreated(void)
{
return nlohmann::json{
{"EventType", "ResourceAdded"},
@@ -27,7 +27,7 @@ nlohmann::json ResourceCreated(void)
{"MessageSeverity", "OK"}};
}
-nlohmann::json ResourceRemoved(void)
+inline nlohmann::json ResourceRemoved(void)
{
return nlohmann::json{
{"EventType", "ResourceRemoved"},
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index 922ac47659..0694b19517 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -4,16 +4,12 @@
#include <boost/asio/io_context.hpp>
#include <dbus_monitor.hpp>
#include <dbus_singleton.hpp>
+#include <ibm/management_console_rest.hpp>
#include <image_upload.hpp>
#include <kvm_websocket.hpp>
#include <login_routes.hpp>
#include <obmc_console.hpp>
#include <openbmc_dbus_rest.hpp>
-
-#include <memory>
-#ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE
-#include <ibm/management_console_rest.hpp>
-#endif
#include <redfish.hpp>
#include <redfish_v1.hpp>
#include <sdbusplus/asio/connection.hpp>
@@ -24,6 +20,7 @@
#include <vm_websocket.hpp>
#include <webassets.hpp>
+#include <memory>
#include <string>
#ifdef BMCWEB_ENABLE_VM_NBDPROXY