process: add IPMI error return mechanism and update errors

The IPMI packet validation code must return specific IPMI errors
corresponding to what error has occurred instead of the invalid command
error.

Update all IPMI handler pieces to return more specific errors.

Change-Id: I8d21e92015d84cc0880e3b83991aed7288e19eab
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/main.cpp b/main.cpp
index dda9dec..4328567 100644
--- a/main.cpp
+++ b/main.cpp
@@ -47,15 +47,17 @@
      */
     if ((*dataLen) < 1)
     {
-        return IPMI_CC_INVALID;
+        return IPMI_CC_REQ_DATA_LEN_INVALID;
     }
 
+    /* on failure rc is set to the corresponding IPMI error. */
+    ipmi_ret_t rc = IPMI_CC_OK;
     Crc16 crc;
     IpmiBlobHandler command =
-        validateBlobCommand(&crc, reqBuf, replyCmdBuf, dataLen);
+        validateBlobCommand(&crc, reqBuf, replyCmdBuf, dataLen, &rc);
     if (command == nullptr)
     {
-        return IPMI_CC_INVALID;
+        return rc;
     }
 
     return processBlobCommand(command, getBlobManager(), &crc, reqBuf,