split the commands out
Split the commands out to avoid conflicts in multiple definitions of
IPMI_CC_OK, etc, in a different environment.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I1f3a0214b4f6f6417a5649b0fc2d297119f8ad88
diff --git a/cable.cpp b/cable.cpp
index aaf876e..464b812 100644
--- a/cable.cpp
+++ b/cable.cpp
@@ -16,9 +16,9 @@
#include "cable.hpp"
+#include "commands.hpp"
#include "errors.hpp"
#include "handler.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/commands.hpp b/commands.hpp
new file mode 100644
index 0000000..dfe8f29
--- /dev/null
+++ b/commands.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+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,
+};
+
+} // namespace ipmi
+} // namespace google
diff --git a/cpld.cpp b/cpld.cpp
index 5e4fede..4f01401 100644
--- a/cpld.cpp
+++ b/cpld.cpp
@@ -16,9 +16,9 @@
#include "cpld.hpp"
+#include "commands.hpp"
#include "errors.hpp"
#include "handler.hpp"
-#include "ipmi.hpp"
#include <cstring>
diff --git a/entity_name.cpp b/entity_name.cpp
index 8b03acd..6cc5b0d 100644
--- a/entity_name.cpp
+++ b/entity_name.cpp
@@ -16,9 +16,9 @@
#include "entity_name.hpp"
+#include "commands.hpp"
#include "errors.hpp"
#include "handler.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/eth.cpp b/eth.cpp
index 2b38939..51f303c 100644
--- a/eth.cpp
+++ b/eth.cpp
@@ -16,8 +16,8 @@
#include "eth.hpp"
+#include "commands.hpp"
#include "handler.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/ipmi.cpp b/ipmi.cpp
index 8ee9c42..09f7df4 100644
--- a/ipmi.cpp
+++ b/ipmi.cpp
@@ -17,6 +17,7 @@
#include "ipmi.hpp"
#include "cable.hpp"
+#include "commands.hpp"
#include "cpld.hpp"
#include "entity_name.hpp"
#include "eth.hpp"
diff --git a/ipmi.hpp b/ipmi.hpp
index 0291949..0657a5d 100644
--- a/ipmi.hpp
+++ b/ipmi.hpp
@@ -9,24 +9,6 @@
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,
diff --git a/pcie_i2c.cpp b/pcie_i2c.cpp
index 989ef41..c587c76 100644
--- a/pcie_i2c.cpp
+++ b/pcie_i2c.cpp
@@ -16,7 +16,7 @@
#include "pcie_i2c.hpp"
-#include "ipmi.hpp"
+#include "commands.hpp"
#include <cstdint>
#include <cstring>
diff --git a/psu.cpp b/psu.cpp
index 3876fcf..d3ded47 100644
--- a/psu.cpp
+++ b/psu.cpp
@@ -16,9 +16,9 @@
#include "psu.hpp"
+#include "commands.hpp"
#include "errors.hpp"
#include "handler.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/test/cable_unittest.cpp b/test/cable_unittest.cpp
index 39384f8..2eeb486 100644
--- a/test/cable_unittest.cpp
+++ b/test/cable_unittest.cpp
@@ -1,6 +1,6 @@
#include "cable.hpp"
+#include "commands.hpp"
#include "handler_mock.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/test/cpld_unittest.cpp b/test/cpld_unittest.cpp
index 8b22ff1..2054df7 100644
--- a/test/cpld_unittest.cpp
+++ b/test/cpld_unittest.cpp
@@ -1,6 +1,6 @@
+#include "commands.hpp"
#include "cpld.hpp"
#include "handler_mock.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <tuple>
diff --git a/test/entity_unittest.cpp b/test/entity_unittest.cpp
index 5ef6d82..7091cb1 100644
--- a/test/entity_unittest.cpp
+++ b/test/entity_unittest.cpp
@@ -1,6 +1,6 @@
+#include "commands.hpp"
#include "entity_name.hpp"
#include "handler_mock.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/test/eth_unittest.cpp b/test/eth_unittest.cpp
index 6c4b98a..1053d4b 100644
--- a/test/eth_unittest.cpp
+++ b/test/eth_unittest.cpp
@@ -1,6 +1,6 @@
+#include "commands.hpp"
#include "eth.hpp"
#include "handler_mock.hpp"
-#include "ipmi.hpp"
#include <cstdint>
#include <cstring>
diff --git a/test/pcie_unittest.cpp b/test/pcie_unittest.cpp
index 796d97a..5f7130f 100644
--- a/test/pcie_unittest.cpp
+++ b/test/pcie_unittest.cpp
@@ -1,5 +1,5 @@
+#include "commands.hpp"
#include "handler_mock.hpp"
-#include "ipmi.hpp"
#include "pcie_i2c.hpp"
#include <cstdint>
diff --git a/test/psu_unittest.cpp b/test/psu_unittest.cpp
index c2a7a53..7127c3d 100644
--- a/test/psu_unittest.cpp
+++ b/test/psu_unittest.cpp
@@ -1,5 +1,5 @@
+#include "commands.hpp"
#include "handler_mock.hpp"
-#include "ipmi.hpp"
#include "psu.hpp"
#include <cstdint>