Message parser changes to support Integrity Algo

The unflatten logic of IPMI 2.0 parser is modified to support
verification of integrity data and flatten logic is modified
to support adding integrity data.

Resolves openbmc/openbmc#869

Change-Id: I0553b12bcd17075d72e46120eeec5e524a5be420
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/message_parsers.hpp b/message_parsers.hpp
index 1b5a693..7d46a88 100644
--- a/message_parsers.hpp
+++ b/message_parsers.hpp
@@ -19,6 +19,9 @@
 // RMCP Message Class 7h is for IPMI
 constexpr size_t RMCP_MESSAGE_CLASS_IPMI = 7;
 
+// RMCP Session Header Size
+constexpr size_t RMCP_SESSION_HEADER_SIZE = 4;
+
 enum class SessionHeader
 {
     IPMI15 = 0x00,
@@ -166,6 +169,26 @@
  */
 void addSequenceNumber(std::vector<uint8_t>& packet, session::Session& session);
 
+/*
+ * @brief Verify the integrity data of the incoming IPMI packet
+ *
+ * @param[in] packet - Incoming IPMI packet
+ * @param[in] inMessage - IPMI Message populated from the incoming packet
+ *
+ */
+bool verifyPacketIntegrity(const std::vector<uint8_t>& packet,
+                           const Message& message);
+
+/*
+ * @brief Add Integrity data to the outgoing IPMI packet
+ *
+ * @param[in] packet - Outgoing IPMI packet
+ * @param[in] message - IPMI Message populated from the incoming packet
+ *
+ */
+void addIntegrityData(std::vector<uint8_t>& packet, const Message& message);
+
+
 } // namespace internal
 
 } // namespace ipmi20parser