summaryrefslogtreecommitdiffstats
path: root/src/ipmiblob/crc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipmiblob/crc.hpp')
-rw-r--r--src/ipmiblob/crc.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ipmiblob/crc.hpp b/src/ipmiblob/crc.hpp
new file mode 100644
index 0000000..c335ed2
--- /dev/null
+++ b/src/ipmiblob/crc.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <cstdint>
+#include <vector>
+
+namespace host_tool
+{
+
+/**
+ * Generate the CRC for a payload (really any bytes).
+ *
+ * This is meant to only be called on the payload and not the CRC or the OEM
+ * header, etc.
+ *
+ * @param[in] data - the bytes against to run the CRC
+ * @return the CRC value
+ */
+std::uint16_t generateCrc(const std::vector<std::uint8_t>& data);
+
+} // namespace host_tool
OpenPOWER on IntegriCloud