summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2019-03-11 15:57:48 -0700
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-03-25 16:18:21 +0000
commit6a98fe7fd233813f3875d4a8c565234418a41f33 (patch)
treecb9f4c87577fa3814d39716253c58ca78ed736b0
parent4ec4e40a44d68efb7f70603aa5bda5a4f96f2de5 (diff)
downloadphosphor-host-ipmid-6a98fe7fd233813f3875d4a8c565234418a41f33.zip
phosphor-host-ipmid-6a98fe7fd233813f3875d4a8c565234418a41f33.tar.gz
Move util.cpp/util.hpp to libipmid
These are functions that are used widely by ipmid providers, so it makes sense to put them in libipmi.so (the library that all providers must link against). Tested-by: use nm to inspect the binaries to see that the symbols are in the expected library. arm-openbmc-linux-gnueabi-nm libipmid.so.0.0.0 \ | grep getDbusObject 0001063c T _ZN4ipmi13getDbusObjectERN9sdbusplus.... Change-Id: I1221f807f2711c5301c5574623564ea1ae48a437 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
-rw-r--r--Makefile.am4
-rw-r--r--app/channel.cpp2
-rw-r--r--app/watchdog_service.hpp3
-rw-r--r--apphandler.cpp2
-rw-r--r--chassishandler.cpp2
-rw-r--r--dcmihandler.cpp2
-rw-r--r--globalhandler.cpp3
-rw-r--r--host-cmd-manager.cpp2
-rw-r--r--host-interface.cpp2
-rw-r--r--include/Makefile.am1
-rw-r--r--include/ipmid/utils.hpp (renamed from utils.hpp)0
-rw-r--r--libipmid/Makefile.am3
-rw-r--r--libipmid/utils.cpp (renamed from utils.cpp)3
-rw-r--r--read_fru_data.cpp2
-rw-r--r--selutility.cpp2
-rw-r--r--sensordatahandler.cpp2
-rw-r--r--sensordatahandler.hpp2
-rw-r--r--sensorhandler.cpp2
-rw-r--r--settings.cpp3
-rw-r--r--softoff/Makefile.am2
-rw-r--r--softoff/softoff.cpp2
-rw-r--r--storagehandler.cpp2
-rw-r--r--transporthandler.cpp2
-rw-r--r--whitelist-filter.cpp2
24 files changed, 24 insertions, 28 deletions
diff --git a/Makefile.am b/Makefile.am
index 7f24377..492f452 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,8 +12,7 @@ sbin_PROGRAMS = \
ipmid_SOURCES = \
ipmid-new.cpp \
settings.cpp \
- host-cmd-manager.cpp \
- utils.cpp
+ host-cmd-manager.cpp
libipmi20_BUILT_LIST = \
sensor-gen.cpp \
@@ -91,7 +90,6 @@ libipmi20_la_SOURCES = \
transporthandler.cpp \
globalhandler.cpp \
groupext.cpp \
- utils.cpp \
selutility.cpp \
ipmi_fru_info_area.cpp \
read_fru_data.cpp \
diff --git a/app/channel.cpp b/app/channel.cpp
index 93fba24..e4532c5 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -3,12 +3,12 @@
#include "transporthandler.hpp"
#include "types.hpp"
#include "user_channel/channel_layer.hpp"
-#include "utils.hpp"
#include <arpa/inet.h>
#include <boost/process/child.hpp>
#include <fstream>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <set>
diff --git a/app/watchdog_service.hpp b/app/watchdog_service.hpp
index 75afc1e..0cf1c74 100644
--- a/app/watchdog_service.hpp
+++ b/app/watchdog_service.hpp
@@ -1,6 +1,5 @@
#pragma once
-#include "utils.hpp"
-
+#include <ipmid/utils.hpp>
#include <sdbusplus/bus.hpp>
#include <xyz/openbmc_project/State/Watchdog/server.hpp>
diff --git a/apphandler.cpp b/apphandler.cpp
index ac969e9..0993139 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -6,7 +6,6 @@
#include "sys_info_param.hpp"
#include "transporthandler.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <arpa/inet.h>
#include <ipmid/api.h>
@@ -19,6 +18,7 @@
#include <array>
#include <cstddef>
#include <fstream>
+#include <ipmid/utils.hpp>
#include <memory>
#include <nlohmann/json.hpp>
#include <phosphor-logging/elog-errors.hpp>
diff --git a/chassishandler.cpp b/chassishandler.cpp
index c955658..2a9057d 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -5,7 +5,6 @@
#include "ipmid.hpp"
#include "settings.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <arpa/inet.h>
#include <endian.h>
@@ -19,6 +18,7 @@
#include <cstring>
#include <fstream>
#include <future>
+#include <ipmid/utils.hpp>
#include <map>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index e9cc39a..e858416 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -3,13 +3,13 @@
#include "dcmihandler.hpp"
#include "user_channel/channel_layer.hpp"
-#include "utils.hpp"
#include <ipmid/api.h>
#include <bitset>
#include <cmath>
#include <fstream>
+#include <ipmid/utils.hpp>
#include <nlohmann/json.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
diff --git a/globalhandler.cpp b/globalhandler.cpp
index 04d57af..e268fd1 100644
--- a/globalhandler.cpp
+++ b/globalhandler.cpp
@@ -1,9 +1,8 @@
#include "globalhandler.hpp"
-#include "utils.hpp"
-
#include <ipmid/api.h>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <string>
diff --git a/host-cmd-manager.cpp b/host-cmd-manager.cpp
index 0a61e63..9efb787 100644
--- a/host-cmd-manager.cpp
+++ b/host-cmd-manager.cpp
@@ -5,11 +5,11 @@
#include "systemintfcmds.hpp"
#include <chrono>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
#include <sdbusplus/timer.hpp>
-#include <utils.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/State/Host/server.hpp>
diff --git a/host-interface.cpp b/host-interface.cpp
index 0b5f63c..69ab376 100644
--- a/host-interface.cpp
+++ b/host-interface.cpp
@@ -3,11 +3,11 @@
#include "host-interface.hpp"
#include "systemintfcmds.hpp"
-#include "utils.hpp"
#include <functional>
#include <ipmid-host/cmd-utils.hpp>
#include <ipmid-host/cmd.hpp>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/log.hpp>
namespace phosphor
diff --git a/include/Makefile.am b/include/Makefile.am
index 55b531c..f51e7d7 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -12,6 +12,7 @@ nobase_include_HEADERS = \
ipmid/oemopenbmc.hpp \
ipmid/oemrouter.hpp \
ipmid/utility.hpp \
+ ipmid/utils.hpp \
ipmid-host/cmd.hpp \
ipmid-host/cmd-utils.hpp
diff --git a/utils.hpp b/include/ipmid/utils.hpp
index 09bb1b4..09bb1b4 100644
--- a/utils.hpp
+++ b/include/ipmid/utils.hpp
diff --git a/libipmid/Makefile.am b/libipmid/Makefile.am
index e4899e1..189693f 100644
--- a/libipmid/Makefile.am
+++ b/libipmid/Makefile.am
@@ -14,7 +14,8 @@ lib_LTLIBRARIES = libipmid.la
libipmid_la_SOURCES = \
sdbus-asio.cpp \
signals.cpp \
- systemintf-sdbus.cpp
+ systemintf-sdbus.cpp \
+ utils.cpp
libipmid_la_LDFLAGS = \
$(SYSTEMD_LIBS) \
-version-info 0:0:0 -shared
diff --git a/utils.cpp b/libipmid/utils.cpp
index 7807e76..4fd219e 100644
--- a/utils.cpp
+++ b/libipmid/utils.cpp
@@ -1,11 +1,10 @@
-#include "utils.hpp"
-
#include <arpa/inet.h>
#include <dirent.h>
#include <net/if.h>
#include <algorithm>
#include <chrono>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
diff --git a/read_fru_data.cpp b/read_fru_data.cpp
index 94b2478..05b1b6e 100644
--- a/read_fru_data.cpp
+++ b/read_fru_data.cpp
@@ -2,11 +2,11 @@
#include "fruread.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <ipmid/api.h>
#include <algorithm>
+#include <ipmid/utils.hpp>
#include <map>
#include <phosphor-logging/elog-errors.hpp>
#include <sdbusplus/message/types.hpp>
diff --git a/selutility.cpp b/selutility.cpp
index b9bf7ed..b85bc40 100644
--- a/selutility.cpp
+++ b/selutility.cpp
@@ -3,11 +3,11 @@
#include "selutility.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <ipmid/api.h>
#include <chrono>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <vector>
#include <xyz/openbmc_project/Common/error.hpp>
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp
index 4f552a3..87c82b9 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -2,9 +2,9 @@
#include "sensorhandler.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <bitset>
+#include <ipmid/utils.hpp>
#include <optional>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp
index 9c32da9..82ed002 100644
--- a/sensordatahandler.hpp
+++ b/sensordatahandler.hpp
@@ -2,11 +2,11 @@
#include "sensorhandler.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <ipmid/api.h>
#include <cmath>
+#include <ipmid/utils.hpp>
#include <sdbusplus/message/types.hpp>
namespace ipmi
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 051c4fd..cb73e71 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -3,7 +3,6 @@
#include "fruread.hpp"
#include "ipmid.hpp"
#include "types.hpp"
-#include "utils.hpp"
#include <ipmid/api.h>
#include <mapper.h>
@@ -12,6 +11,7 @@
#include <bitset>
#include <cmath>
#include <cstring>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
diff --git a/settings.cpp b/settings.cpp
index 0ddd7a6..e8b8997 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -1,7 +1,6 @@
#include "settings.hpp"
-#include "utils.hpp"
-
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
diff --git a/softoff/Makefile.am b/softoff/Makefile.am
index e43cfbb..8383b68 100644
--- a/softoff/Makefile.am
+++ b/softoff/Makefile.am
@@ -7,7 +7,7 @@ phosphor_softpoweroff_SOURCES = \
softoff.cpp \
mainapp.cpp \
xyz/openbmc_project/Ipmi/Internal/SoftPowerOff/server.cpp \
- ../utils.cpp
+ ../libipmid/utils.cpp
BUILT_SOURCES = \
xyz/openbmc_project/Ipmi/Internal/SoftPowerOff/server.cpp \
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index 803efc0..e6ed0eb 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -18,8 +18,8 @@
#include "softoff.hpp"
#include <chrono>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/log.hpp>
-#include <utils.hpp>
#include <xyz/openbmc_project/Control/Host/server.hpp>
namespace phosphor
{
diff --git a/storagehandler.cpp b/storagehandler.cpp
index cff0d84..32bb088 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -5,7 +5,6 @@
#include "selutility.hpp"
#include "sensorhandler.hpp"
#include "storageaddsel.hpp"
-#include "utils.hpp"
#include <arpa/inet.h>
#include <ipmid/api.h>
@@ -16,6 +15,7 @@
#include <chrono>
#include <cstdio>
#include <cstring>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 24fea47..d56a064 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -3,13 +3,13 @@
#include "app/channel.hpp"
#include "ipmid.hpp"
#include "user_channel/channel_layer.hpp"
-#include "utils.hpp"
#include <arpa/inet.h>
#include <ipmid/api.h>
#include <chrono>
#include <fstream>
+#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
diff --git a/whitelist-filter.cpp b/whitelist-filter.cpp
index 3b45db8..1d486ca 100644
--- a/whitelist-filter.cpp
+++ b/whitelist-filter.cpp
@@ -2,11 +2,11 @@
#include <array>
#include <ipmid/api.hpp>
#include <ipmid/registration.hpp>
+#include <ipmid/utils.hpp>
#include <ipmiwhitelist.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <settings.hpp>
-#include <utils.hpp>
#include <xyz/openbmc_project/Control/Security/RestrictionMode/server.hpp>
using namespace phosphor::logging;
OpenPOWER on IntegriCloud