Refactor: Use hiomapd instead of mboxd

mbox service is renamed to hiomapd and provides "Suspend" and
"Resume" method calls, which is more appropriate for raw "cmd" calls.

Use the new methods to suspend and resume hiomapd.
Move "getService()" function into utils so it is shared by multiple
files.

Tested: Verify the reset works on Romulus

Change-Id: I8f89de134b13126697bfc69a21a3148a01c34cca
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/utils.hpp b/utils.hpp
index 90569bf..9d119b3 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -7,9 +7,41 @@
 
 #include <openssl/evp.h>
 
+#include <sdbusplus/bus.hpp>
+
 extern "C" {
 EVP_MD_CTX* EVP_MD_CTX_new(void);
 void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
 }
 
+namespace utils
+{
+
+/**
+ * @brief Gets the D-Bus Service name for the input D-Bus path
+ *
+ * @param[in] bus  -  Bus handler
+ * @param[in] path -  Object Path
+ * @param[in] intf -  Interface
+ *
+ * @return  Service name
+ * @error   InternalFailure exception thrown
+ */
+std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
+                       const std::string& intf);
+
+/** @brief Suspend hiomapd.
+ *
+ * @param[in] bus - The D-Bus bus object.
+ */
+void hiomapdSuspend(sdbusplus::bus::bus& bus);
+
+/** @brief Resume hiomapd.
+ *
+ * @param[in] bus - The D-Bus bus object.
+ */
+void hiomapdResume(sdbusplus::bus::bus& bus);
+
+} // namespace utils
+
 #endif // OPENSSL_VERSION_NUMBER < 0x10100000L