Make host command manager accessible by OpenPower OEM

Since OpenPower Host IPMI OEM also needs to use the Host
Command manager, need to place the files in appropriate
directories and make needed changes.

Change-Id: I7536a0ff1e53a844ec05f73c4e0605cbf4341465
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 2f76317..2c78f79 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -89,7 +89,9 @@
                              $(SDBUSPLUS_CFLAGS)
 
 nobase_include_HEADERS = \
-	host-ipmid/ipmid-api.h
+	host-ipmid/ipmid-api.h \
+	host-ipmid/ipmid-host-cmd.hpp \
+	host-ipmid/ipmid-host-cmd-utils.hpp
 
 # Forcing the build of self and then subdir
 SUBDIRS = . test softoff
diff --git a/configure.ac b/configure.ac
index dd6a194..7de620d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,7 @@
 PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
     AC_MSG_ERROR(["Requires sdbusplus package."]))
 
+
 AS_IF([test "x$enable_softoff" != "xno"],
     # Check for sdbusplus
     PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])])
diff --git a/host-cmd-manager.cpp b/host-cmd-manager.cpp
index 329e606..500e57d 100644
--- a/host-cmd-manager.cpp
+++ b/host-cmd-manager.cpp
@@ -6,6 +6,8 @@
 #include <utils.hpp>
 #include <config.h>
 #include <host-cmd-manager.hpp>
+#include <timer.hpp>
+
 namespace phosphor
 {
 namespace host
@@ -22,6 +24,13 @@
 using InternalFailure = sdbusplus::xyz::openbmc_project::Common::
                             Error::InternalFailure;
 
+Manager::Manager(sdbusplus::bus::bus& bus, sd_event* event) :
+            bus(bus),
+            timer(event, std::bind(&Manager::hostTimeout, this))
+{
+    // Nothing to do here.
+}
+
 // Called as part of READ_MSG_DATA command
 IpmiCmdData Manager::getNextCommand()
 {
diff --git a/host-cmd-manager.hpp b/host-cmd-manager.hpp
index 0c938e5..06ac5fa 100644
--- a/host-cmd-manager.hpp
+++ b/host-cmd-manager.hpp
@@ -4,7 +4,7 @@
 #include <queue>
 #include <sdbusplus/bus.hpp>
 #include <timer.hpp>
-#include <host-cmd-utils.hpp>
+#include <host-ipmid/ipmid-host-cmd-utils.hpp>
 
 namespace phosphor
 {
@@ -31,12 +31,7 @@
          *  @param[in] bus   - dbus handler
          *  @param[in] event - pointer to sd_event
          */
-        Manager(sdbusplus::bus::bus& bus, sd_event* event) :
-            bus(bus),
-            timer(event, std::bind(&Manager::hostTimeout, this))
-        {
-            // Nothing to do here.
-        }
+        Manager(sdbusplus::bus::bus& bus, sd_event* event);
 
         /** @brief  Extracts the next entry in the queue and returns
          *          Command and data part of it.
diff --git a/host-interface.cpp b/host-interface.cpp
index 1de2629..5cd5a35 100644
--- a/host-interface.cpp
+++ b/host-interface.cpp
@@ -1,6 +1,7 @@
 #include <functional>
 #include <systemintfcmds.h>
-#include <ipmid-host-cmd.hpp>
+#include <host-ipmid/ipmid-host-cmd.hpp>
+#include <host-ipmid/ipmid-host-cmd-utils.hpp>
 #include <utils.hpp>
 #include <phosphor-logging/log.hpp>
 #include <config.h>
diff --git a/host-cmd-utils.hpp b/host-ipmid/ipmid-host-cmd-utils.hpp
similarity index 100%
rename from host-cmd-utils.hpp
rename to host-ipmid/ipmid-host-cmd-utils.hpp
diff --git a/ipmid-host-cmd.hpp b/host-ipmid/ipmid-host-cmd.hpp
similarity index 89%
rename from ipmid-host-cmd.hpp
rename to host-ipmid/ipmid-host-cmd.hpp
index 7ef8b39..6541bae 100644
--- a/ipmid-host-cmd.hpp
+++ b/host-ipmid/ipmid-host-cmd.hpp
@@ -1,6 +1,6 @@
 #include <memory>
 #include <sdbusplus/bus.hpp>
-#include <host-cmd-utils.hpp>
+#include "ipmid-host-cmd-utils.hpp"
 
 // Need this to use new sdbusplus compatible interfaces
 using sdbusPtr =  std::unique_ptr<sdbusplus::bus::bus>;
diff --git a/ipmid.cpp b/ipmid.cpp
index f41e27f..1f61ce2 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -26,7 +26,8 @@
 #include "ipmid.hpp"
 #include "settings.hpp"
 #include <host-cmd-manager.hpp>
-#include <ipmid-host-cmd.hpp>
+#include <host-ipmid/ipmid-host-cmd.hpp>
+#include <timer.hpp>
 
 using namespace phosphor::logging;
 namespace sdbusRule = sdbusplus::bus::match::rules;
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index 2258630..b98ac12 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -1,6 +1,6 @@
 #include "systemintfcmds.h"
 #include "host-ipmid/ipmid-api.h"
-#include "ipmid-host-cmd.hpp"
+#include "host-ipmid/ipmid-host-cmd.hpp"
 #include "config.h"
 #include "host-cmd-manager.hpp"
 #include "host-interface.hpp"