ipmi: start implementing flashAbort

Change-Id: I1a05ba7e9323046a09b8582351be987cdaab5a15
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/ipmi.cpp b/ipmi.cpp
index fc6092c..10ac2fe 100644
--- a/ipmi.cpp
+++ b/ipmi.cpp
@@ -31,6 +31,7 @@
             {FlashSubCmds::flashHashData, hashBlock},
             {FlashSubCmds::flashHashFinish, hashFinish},
             {FlashSubCmds::flashDataVerify, dataVerify},
+            {FlashSubCmds::flashAbort, abortUpdate},
         };
 
     auto results = subHandlers.find(command);
@@ -192,3 +193,20 @@
     (*dataLen) = 1;
     return IPMI_CC_OK;
 }
+
+ipmi_ret_t abortUpdate(UpdateInterface* updater, const uint8_t* reqBuf,
+                       uint8_t* replyBuf, size_t* dataLen)
+{
+    /* TODO: May make sense to work all the pass-through commands into one
+     * piece of code
+     */
+    if (!updater->abortUpdate())
+    {
+        return IPMI_CC_INVALID;
+    }
+
+    /* We were successful and set the response byte to 0. */
+    replyBuf[0] = 0x00;
+    (*dataLen) = 1;
+    return IPMI_CC_OK;
+}