move implementation to ipmi file
Move the entrance point for the IPMI OEM handling to a separate file and
pass in the handler pointer via binding.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I4371ebee1c252ab6e9d8a7ff2389583919ecc996
diff --git a/ipmi.hpp b/ipmi.hpp
new file mode 100644
index 0000000..0291949
--- /dev/null
+++ b/ipmi.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "handler.hpp"
+
+#include <ipmid/api.h>
+
+namespace google
+{
+namespace ipmi
+{
+
+enum SysOEMCommands
+{
+ // The Sys cable check command.
+ SysCableCheck = 0,
+ // The Sys cpld version over ipmi command.
+ SysCpldVersion = 1,
+ // The Sys get eth device command.
+ SysGetEthDevice = 2,
+ // The Sys psu hard reset command.
+ SysPsuHardReset = 3,
+ // The Sys pcie slot count command.
+ SysPcieSlotCount = 4,
+ // The Sys pcie slot to i2c bus mapping command.
+ SysPcieSlotI2cBusMapping = 5,
+ // The Sys "entity id:entity instance" to entity name mapping command.
+ SysEntityName = 6,
+};
+
+// Handle the google-ipmi-sys IPMI OEM commands.
+ipmi_ret_t handleSysCommand(HandlerInterface* handler, ipmi_cmd_t cmd,
+ const uint8_t* reqBuf, uint8_t* replyCmdBuf,
+ size_t* dataLen);
+
+} // namespace ipmi
+} // namespace google