firmware: tie implementation of session into write

To demonstrate how session will work, implement the write command.
Everything isn't wired up with open(), therefore this code itself will
only work in isolation.

This requires wiring up the open command to verify write will use the
handler we specify.

Change-Id: Icf5cfad4ddb531bc271642e24d505cbb9abf8f22
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/firmware_handler.hpp b/firmware_handler.hpp
index 0c3092b..4dcbfb8 100644
--- a/firmware_handler.hpp
+++ b/firmware_handler.hpp
@@ -25,8 +25,16 @@
     /** Pointer to the correct image handler interface.  (nullptr on hash
      * blob_id) */
     ImageHandlerInterface* imageHandler;
+
+    /** The flags used to open the session. */
+    std::uint16_t flags;
 };
 
+struct ExtChunkHdr
+{
+    std::uint32_t length; /* Length of the data queued (little endian). */
+} __attribute__((packed));
+
 /**
  * Register only one firmware blob handler that will manage all sessions.
  */