tools: remove phosphor-ipmi-blobs dependency

The host tool depended on the BMC header: firmware_handler.hpp because
it defined the flags.  This header depends on phosphor-ipmi-blobs,
therefore the host-tool depends on this.  Move the flags into a separate
common header file and snip this dependency.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Id2ad33a1611c02605a1ed5c695429d0451eb98d4
diff --git a/bmc/firmware_handler.cpp b/bmc/firmware_handler.cpp
index aaabe83..5f16846 100644
--- a/bmc/firmware_handler.cpp
+++ b/bmc/firmware_handler.cpp
@@ -16,6 +16,8 @@
 
 #include "firmware_handler.hpp"
 
+#include "data.hpp"
+#include "flags.hpp"
 #include "image_handler.hpp"
 #include "status.hpp"
 #include "util.hpp"
@@ -511,7 +513,7 @@
 
     std::vector<std::uint8_t> bytes;
 
-    if (item->second->flags & UpdateFlags::ipmi)
+    if (item->second->flags & FirmwareFlags::UpdateFlags::ipmi)
     {
         bytes = data;
     }
@@ -550,7 +552,7 @@
         return false;
     }
 
-    if (item->second->flags & UpdateFlags::ipmi)
+    if (item->second->flags & FirmwareFlags::UpdateFlags::ipmi)
     {
         return false;
     }
diff --git a/bmc/firmware_handler.hpp b/bmc/firmware_handler.hpp
index 8c7cb04..3dd4978 100644
--- a/bmc/firmware_handler.hpp
+++ b/bmc/firmware_handler.hpp
@@ -51,26 +51,12 @@
     std::string activePath;
 };
 
-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.
  */
 class FirmwareBlobHandler : public blobs::GenericBlobInterface
 {
   public:
-    enum UpdateFlags : std::uint16_t
-    {
-        openRead = (1 << 0),  /* Flag for reading. */
-        openWrite = (1 << 1), /* Flag for writing. */
-        ipmi = (1 << 8), /* Expect to send contents over IPMI BlockTransfer. */
-        p2a = (1 << 9),  /* Expect to send contents over P2A bridge. */
-        lpc = (1 << 10), /* Expect to send contents over LPC bridge. */
-    };
-
     /** The state of the firmware update process. */
     enum class UpdateState
     {
diff --git a/bmc/main.cpp b/bmc/main.cpp
index 2dd9531..ea27b3d 100644
--- a/bmc/main.cpp
+++ b/bmc/main.cpp
@@ -18,6 +18,7 @@
 
 #include "file_handler.hpp"
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_handler.hpp"
 #include "lpc_aspeed.hpp"
 #include "lpc_handler.hpp"
@@ -80,12 +81,12 @@
 };
 
 std::vector<DataHandlerPack> supportedTransports = {
-    {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+    {FirmwareFlags::UpdateFlags::ipmi, nullptr},
 #ifdef ENABLE_PCI_BRIDGE
-    {FirmwareBlobHandler::UpdateFlags::p2a, &pciDataHandler},
+    {FirmwareFlags::UpdateFlags::p2a, &pciDataHandler},
 #endif
 #ifdef ENABLE_LPC_BRIDGE
-    {FirmwareBlobHandler::UpdateFlags::lpc, &lpcDataHandler},
+    {FirmwareFlags::UpdateFlags::lpc, &lpcDataHandler},
 #endif
 };
 
diff --git a/bmc/pci_handler.cpp b/bmc/pci_handler.cpp
index 436c63e..1b6b7ff 100644
--- a/bmc/pci_handler.cpp
+++ b/bmc/pci_handler.cpp
@@ -16,6 +16,8 @@
 
 #include "pci_handler.hpp"
 
+#include "data.hpp"
+
 #include <fcntl.h>
 #include <linux/aspeed-p2a-ctrl.h>
 
diff --git a/bmc/pci_handler.hpp b/bmc/pci_handler.hpp
index 1cafc32..9b2c5b6 100644
--- a/bmc/pci_handler.hpp
+++ b/bmc/pci_handler.hpp
@@ -10,12 +10,6 @@
 namespace ipmi_flash
 {
 
-/** P2A configuration response. */
-struct PciConfigResponse
-{
-    std::uint32_t address;
-} __attribute__((packed));
-
 /**
  * Data handler for reading and writing data via the P2A bridge.
  *
diff --git a/bmc/test/firmware_canhandle_unittest.cpp b/bmc/test/firmware_canhandle_unittest.cpp
index dabf8ef..13bf943 100644
--- a/bmc/test/firmware_canhandle_unittest.cpp
+++ b/bmc/test/firmware_canhandle_unittest.cpp
@@ -1,5 +1,6 @@
 #include "data_mock.hpp"
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_mock.hpp"
 #include "triggerable_mock.hpp"
 #include "util.hpp"
@@ -29,7 +30,7 @@
         {"bcdf", &imageMock},
     };
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr},
     };
 
     auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
diff --git a/bmc/test/firmware_close_unittest.cpp b/bmc/test/firmware_close_unittest.cpp
index 66b9c83..d4e7cf8 100644
--- a/bmc/test/firmware_close_unittest.cpp
+++ b/bmc/test/firmware_close_unittest.cpp
@@ -33,7 +33,7 @@
     EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc,
         hashBlobId));
 
     /* The active hash blob_id was added. */
@@ -60,7 +60,7 @@
     EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi,
         hashBlobId));
 
     /* The active hash blob_id was added. */
diff --git a/bmc/test/firmware_commit_unittest.cpp b/bmc/test/firmware_commit_unittest.cpp
index b8c651e..a6ab172 100644
--- a/bmc/test/firmware_commit_unittest.cpp
+++ b/bmc/test/firmware_commit_unittest.cpp
@@ -1,5 +1,6 @@
 #include "data_mock.hpp"
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_mock.hpp"
 #include "triggerable_mock.hpp"
 #include "util.hpp"
@@ -33,7 +34,7 @@
         };
 
         data = {
-            {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+            {FirmwareFlags::UpdateFlags::ipmi, nullptr},
         };
     }
 };
@@ -55,8 +56,7 @@
     EXPECT_CALL(imageMock2, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
 
     EXPECT_FALSE(handler->commit(0, {}));
 }
@@ -78,7 +78,7 @@
     EXPECT_CALL(imageMock1, open(StrEq(hashBlobId))).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi,
         hashBlobId));
 
     EXPECT_FALSE(handler->commit(0, {}));
diff --git a/bmc/test/firmware_createhandler_unittest.cpp b/bmc/test/firmware_createhandler_unittest.cpp
index dd09cbe..d7b99a6 100644
--- a/bmc/test/firmware_createhandler_unittest.cpp
+++ b/bmc/test/firmware_createhandler_unittest.cpp
@@ -1,5 +1,6 @@
 #include "data_mock.hpp"
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_mock.hpp"
 #include "triggerable_mock.hpp"
 #include "util.hpp"
@@ -26,8 +27,8 @@
     };
 
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
-        {FirmwareBlobHandler::UpdateFlags::lpc, &dataMock},
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr},
+        {FirmwareFlags::UpdateFlags::lpc, &dataMock},
     };
 
     auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
diff --git a/bmc/test/firmware_handler_unittest.cpp b/bmc/test/firmware_handler_unittest.cpp
index 27bd517..7ab224d 100644
--- a/bmc/test/firmware_handler_unittest.cpp
+++ b/bmc/test/firmware_handler_unittest.cpp
@@ -1,4 +1,5 @@
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_mock.hpp"
 #include "triggerable_mock.hpp"
 #include "util.hpp"
@@ -18,7 +19,7 @@
 TEST(FirmwareHandlerTest, CreateEmptyListVerifyFails)
 {
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr},
     };
 
     auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
@@ -49,7 +50,7 @@
         {"asdf", &imageMock},
     };
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr},
     };
 
     auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
diff --git a/bmc/test/firmware_sessionstat_unittest.cpp b/bmc/test/firmware_sessionstat_unittest.cpp
index d2d1896..dcb16d9 100644
--- a/bmc/test/firmware_sessionstat_unittest.cpp
+++ b/bmc/test/firmware_sessionstat_unittest.cpp
@@ -30,8 +30,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
 
     int size = 512;
     EXPECT_CALL(imageMock, getSize()).WillOnce(Return(size));
@@ -39,7 +38,7 @@
     blobs::BlobMeta meta;
     EXPECT_TRUE(handler->stat(0, &meta));
     EXPECT_EQ(meta.blobState,
-              blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi);
+              blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi);
     EXPECT_EQ(meta.size, size);
     EXPECT_EQ(meta.metadata.size(), 0);
 }
@@ -54,8 +53,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
 
     int size = 512;
     EXPECT_CALL(imageMock, getSize()).WillOnce(Return(size));
@@ -65,7 +63,7 @@
     blobs::BlobMeta meta;
     EXPECT_TRUE(handler->stat(0, &meta));
     EXPECT_EQ(meta.blobState,
-              blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc);
+              blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc);
     EXPECT_EQ(meta.size, size);
     EXPECT_EQ(meta.metadata.size(), mBytes.size());
     EXPECT_EQ(meta.metadata[0], mBytes[0]);
diff --git a/bmc/test/firmware_stat_unittest.cpp b/bmc/test/firmware_stat_unittest.cpp
index 99ae770..021dca8 100644
--- a/bmc/test/firmware_stat_unittest.cpp
+++ b/bmc/test/firmware_stat_unittest.cpp
@@ -1,4 +1,5 @@
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_mock.hpp"
 #include "triggerable_mock.hpp"
 #include "util.hpp"
@@ -25,7 +26,7 @@
         {"asdf", &imageMock},
     };
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr},
     };
 
     auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
@@ -34,7 +35,7 @@
 
     blobs::BlobMeta meta;
     EXPECT_TRUE(handler->stat("asdf", &meta));
-    EXPECT_EQ(FirmwareBlobHandler::UpdateFlags::ipmi, meta.blobState);
+    EXPECT_EQ(FirmwareFlags::UpdateFlags::ipmi, meta.blobState);
 }
 
 } // namespace ipmi_flash
diff --git a/bmc/test/firmware_state_notyetstarted_tarball_unittest.cpp b/bmc/test/firmware_state_notyetstarted_tarball_unittest.cpp
index 275763c..bdf6046 100644
--- a/bmc/test/firmware_state_notyetstarted_tarball_unittest.cpp
+++ b/bmc/test/firmware_state_notyetstarted_tarball_unittest.cpp
@@ -56,14 +56,14 @@
     ImageHandlerMock imageMock;
     std::vector<HandlerPack> blobs;
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr}};
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr}};
     std::unique_ptr<blobs::GenericBlobInterface> handler;
     TriggerMock* verifyMockPtr;
     TriggerMock* updateMockPtr;
 
     std::uint16_t session = 1;
     std::uint16_t flags =
-        blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi;
+        blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
 };
 
 TEST_F(FirmwareHandlerNotYetStartedUbitTest,
diff --git a/bmc/test/firmware_state_notyetstarted_unittest.cpp b/bmc/test/firmware_state_notyetstarted_unittest.cpp
index 54ab7f8..8681064 100644
--- a/bmc/test/firmware_state_notyetstarted_unittest.cpp
+++ b/bmc/test/firmware_state_notyetstarted_unittest.cpp
@@ -76,7 +76,7 @@
      * transported supported.
      */
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     auto blobs = handler->getBlobIds();
diff --git a/bmc/test/firmware_state_updatecompleted_unittest.cpp b/bmc/test/firmware_state_updatecompleted_unittest.cpp
index 9e43edb..fd7f583 100644
--- a/bmc/test/firmware_state_updatecompleted_unittest.cpp
+++ b/bmc/test/firmware_state_updatecompleted_unittest.cpp
@@ -123,7 +123,7 @@
     getToUpdateCompleted(ActionStatus::success);
 
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     std::vector<std::string> testBlobs = {staticLayoutBlobId, hashBlobId};
diff --git a/bmc/test/firmware_state_updatepending_unittest.cpp b/bmc/test/firmware_state_updatepending_unittest.cpp
index d09c820..6f5162f 100644
--- a/bmc/test/firmware_state_updatepending_unittest.cpp
+++ b/bmc/test/firmware_state_updatepending_unittest.cpp
@@ -164,7 +164,7 @@
     getToUpdatePending();
 
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     for (const auto& blob : startingBlobs)
diff --git a/bmc/test/firmware_state_updatestarted_unittest.cpp b/bmc/test/firmware_state_updatestarted_unittest.cpp
index 237e0e9..2e4f020 100644
--- a/bmc/test/firmware_state_updatestarted_unittest.cpp
+++ b/bmc/test/firmware_state_updatestarted_unittest.cpp
@@ -114,7 +114,7 @@
     getToUpdateStarted();
 
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     std::vector<std::string> testBlobs = {staticLayoutBlobId, hashBlobId};
diff --git a/bmc/test/firmware_state_uploadinprogress_unittest.cpp b/bmc/test/firmware_state_uploadinprogress_unittest.cpp
index 005ca3f..be3269e 100644
--- a/bmc/test/firmware_state_uploadinprogress_unittest.cpp
+++ b/bmc/test/firmware_state_uploadinprogress_unittest.cpp
@@ -96,7 +96,7 @@
      * return the same information as in the notYetStarted state.
      */
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     openToInProgress(staticLayoutBlobId);
@@ -126,7 +126,7 @@
     blobs::BlobMeta meta, expectedMeta = {};
     expectedMeta.size = 32;
     expectedMeta.blobState =
-        blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi;
+        blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
     EXPECT_TRUE(handler->stat(session, &meta));
     EXPECT_EQ(expectedMeta, meta);
 }
diff --git a/bmc/test/firmware_state_verificationcompleted_unittest.cpp b/bmc/test/firmware_state_verificationcompleted_unittest.cpp
index 8754e15..85f1895 100644
--- a/bmc/test/firmware_state_verificationcompleted_unittest.cpp
+++ b/bmc/test/firmware_state_verificationcompleted_unittest.cpp
@@ -142,7 +142,7 @@
     getToVerificationCompleted(ActionStatus::success);
 
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     std::vector<std::string> testBlobs = {staticLayoutBlobId, hashBlobId};
diff --git a/bmc/test/firmware_state_verificationpending_unittest.cpp b/bmc/test/firmware_state_verificationpending_unittest.cpp
index dd2df27..fbcd73d 100644
--- a/bmc/test/firmware_state_verificationpending_unittest.cpp
+++ b/bmc/test/firmware_state_verificationpending_unittest.cpp
@@ -165,7 +165,7 @@
     getToVerificationPending(staticLayoutBlobId);
 
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     std::vector<std::string> testBlobs = {staticLayoutBlobId, hashBlobId};
diff --git a/bmc/test/firmware_state_verificationstarted_unittest.cpp b/bmc/test/firmware_state_verificationstarted_unittest.cpp
index 74e24b2..b183db0 100644
--- a/bmc/test/firmware_state_verificationstarted_unittest.cpp
+++ b/bmc/test/firmware_state_verificationstarted_unittest.cpp
@@ -195,7 +195,7 @@
     getToVerificationStarted(staticLayoutBlobId);
 
     blobs::BlobMeta expected;
-    expected.blobState = FirmwareBlobHandler::UpdateFlags::ipmi;
+    expected.blobState = FirmwareFlags::UpdateFlags::ipmi;
     expected.size = 0;
 
     std::vector<std::string> testBlobs = {staticLayoutBlobId, hashBlobId};
diff --git a/bmc/test/firmware_unittest.hpp b/bmc/test/firmware_unittest.hpp
index 8d92fe8..6b97289 100644
--- a/bmc/test/firmware_unittest.hpp
+++ b/bmc/test/firmware_unittest.hpp
@@ -2,6 +2,7 @@
 
 #include "data_mock.hpp"
 #include "firmware_handler.hpp"
+#include "flags.hpp"
 #include "image_mock.hpp"
 #include "triggerable_mock.hpp"
 
@@ -121,7 +122,7 @@
     ImageHandlerMock imageMock;
     std::vector<HandlerPack> blobs;
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr}};
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr}};
     std::unique_ptr<blobs::GenericBlobInterface> handler;
     TriggerMock* prepareMockPtr;
     TriggerMock* verifyMockPtr;
@@ -129,7 +130,7 @@
 
     std::uint16_t session = 1;
     std::uint16_t flags =
-        blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi;
+        blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
 
     std::vector<std::string> startingBlobs = {staticLayoutBlobId, hashBlobId};
 };
@@ -140,7 +141,7 @@
     ImageHandlerMock imageMock;
     std::vector<HandlerPack> blobs;
     std::vector<DataHandlerPack> data = {
-        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr}};
+        {FirmwareFlags::UpdateFlags::ipmi, nullptr}};
     std::unique_ptr<blobs::GenericBlobInterface> handler;
 
     void SetUp() override
@@ -171,8 +172,8 @@
             {"asdf", &imageMock},
         };
         data = {
-            {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
-            {FirmwareBlobHandler::UpdateFlags::lpc, &dataMock},
+            {FirmwareFlags::UpdateFlags::ipmi, nullptr},
+            {FirmwareFlags::UpdateFlags::lpc, &dataMock},
         };
         handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
             blobs, data, CreateTriggerMock(), CreateTriggerMock(),
diff --git a/bmc/test/firmware_write_unittest.cpp b/bmc/test/firmware_write_unittest.cpp
index d74f3c8..b3353c9 100644
--- a/bmc/test/firmware_write_unittest.cpp
+++ b/bmc/test/firmware_write_unittest.cpp
@@ -1,3 +1,4 @@
+#include "data.hpp"
 #include "data_mock.hpp"
 #include "firmware_handler.hpp"
 #include "firmware_unittest.hpp"
@@ -30,8 +31,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
 
     std::vector<std::uint8_t> bytes = {0xaa, 0x55};
 
@@ -46,8 +46,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
 
     struct ExtChunkHdr request;
     request.length = 4; /* number of bytes to read. */
@@ -70,8 +69,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
 
     struct ExtChunkHdr request;
     request.length = 4; /* number of bytes to read. */
diff --git a/bmc/test/firmware_writemeta_unittest.cpp b/bmc/test/firmware_writemeta_unittest.cpp
index 491d669..cb1c965 100644
--- a/bmc/test/firmware_writemeta_unittest.cpp
+++ b/bmc/test/firmware_writemeta_unittest.cpp
@@ -24,8 +24,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
 
     std::vector<std::uint8_t> bytes = {0xaa, 0x55};
 
@@ -38,8 +37,7 @@
     EXPECT_CALL(imageMock, open("asdf")).WillOnce(Return(true));
 
     EXPECT_TRUE(handler->open(
-        0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
-        "asdf"));
+        0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
 
     std::vector<std::uint8_t> bytes = {0x01, 0x02, 0x03, 0x04};