main: cleanup command handling

Change-Id: I7b07bb13948607b40365411c16510073d33ba57b
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/ipmi.hpp b/ipmi.hpp
index 5401108..a892300 100644
--- a/ipmi.hpp
+++ b/ipmi.hpp
@@ -1,9 +1,23 @@
 #pragma once
 
+#include <functional>
+
 #include "host-ipmid/ipmid-api.h"
 
 #include "flash-ipmi.hpp"
 
+using IpmiFlashHandler =
+    std::function<ipmi_ret_t(UpdateInterface* updater, const uint8_t* reqBuf,
+                             uint8_t* replyBuf, size_t* dataLen)>;
+
+/**
+ * Retrieve the IPMI command handler.
+ *
+ * @param[in] subcommand - the command
+ * @return the function to call or nullptr on error.
+ */
+IpmiFlashHandler getCommandHandler(FlashSubCmds command);
+
 /**
  * Validate the minimum request length if there is one.
  *