ipmi: promote min length check to earlier
Most of the commands (if not all) require some minimum length for the
request. Therefore, to save on duplicating the request minimum length
check in every command, it's now checked ahead of calling into the
command handler.
Change-Id: I3710a6bf39a631b06547327b90610a38cb674d23
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/ipmi.hpp b/ipmi.hpp
index dcaf33e..0644ad8 100644
--- a/ipmi.hpp
+++ b/ipmi.hpp
@@ -5,6 +5,15 @@
#include "flash-ipmi.hpp"
/**
+ * Validate the minimum request length if there is one.
+ *
+ * @param[in] subcommand - the command
+ * @param[in] requestLength - the length of the request
+ * @return bool - true if valid.
+ */
+bool validateRequestLength(FlashSubCmds command, size_t requestLen);
+
+/**
* Prepare to receive a BMC image and then a signature.
*
* @param[in] updater - Pointer to Updater object.