add handler logic to handle SysGetEthDevice
Add a handler to handle code logic outside of the actual IPMI
processing.
Tested: Only ran unit-tests (added new ones).
Change-Id: Iadd8c4f2d9b3e2cfba24ae32cda2ef66177b1177
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/handler.hpp b/handler.hpp
new file mode 100644
index 0000000..cad2916
--- /dev/null
+++ b/handler.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <cstdint>
+#include <string>
+#include <tuple>
+
+namespace google
+{
+namespace ipmi
+{
+
+class HandlerInterface
+{
+ public:
+ virtual ~HandlerInterface() = default;
+
+ /**
+ * Return ethernet details (hard-coded).
+ *
+ * @return tuple of ethernet details (channel, if name).
+ */
+ virtual std::tuple<std::uint8_t, std::string> getEthDetails() const = 0;
+};
+
+class Handler : public HandlerInterface
+{
+ public:
+ Handler() = default;
+ ~Handler() = default;
+
+ std::tuple<std::uint8_t, std::string> getEthDetails() const override;
+};
+
+extern Handler handlerImpl;
+
+} // namespace ipmi
+} // namespace google