for injection, add handler: add unit-tests

Add a handler to enable dependency injection for testing.  This is a
required step to use mocks.
Add the unit-tests.

Tested: Verified the new unit-tests ran.
Change-Id: I991849e6df2c3e74f59145a966048fc6825560db
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/ethstats.hpp b/ethstats.hpp
index bf6b707..984d46d 100644
--- a/ethstats.hpp
+++ b/ethstats.hpp
@@ -1,8 +1,11 @@
 #pragma once
 
+#include "handler.hpp"
+
 #include <ipmid/api.h>
 
 #include <cstdint>
+#include <string>
 
 namespace ethstats
 {
@@ -54,14 +57,24 @@
 /**
  * Handle the OEM IPMI EthStat Command.
  *
- * @param[in] cmd - the OEM command.
  * @param[in] reqBuf - the IPMI request buffer.
  * @param[in,out] replyCmdBuf - the IPMI reply buffer.
  * @param[in,out] dataLen - the length of the request and reply.
+ * @param[in] handler - pointer to ethstats implementation.
  * @return the IPMI result code.
  */
-ipmi_ret_t handleEthStatCommand(ipmi_cmd_t cmd __attribute__((unused)),
-                                const std::uint8_t* reqBuf,
-                                std::uint8_t* replyCmdBuf, size_t* dataLen);
+ipmi_ret_t handleEthStatCommand(const std::uint8_t* reqBuf,
+                                std::uint8_t* replyCmdBuf, size_t* dataLen,
+                                const EthStatsInterface* handler = &handler);
+
+/**
+ * Given an ethernet if_name and a field, build the full path.
+ *
+ * @param[in] ifName - the ethernet interface's name.
+ * @param[in] field - the name of the statistic
+ * @return the full path of the file to read for the statistic for that
+ * interface name.
+ */
+std::string buildPath(const std::string& ifName, const std::string& field);
 
 } // namespace ethstats