diff --git a/src/ipmiblob/blob_handler.cpp b/src/ipmiblob/blob_handler.cpp
index 039b7e0..6adbe89 100644
--- a/src/ipmiblob/blob_handler.cpp
+++ b/src/ipmiblob/blob_handler.cpp
@@ -67,7 +67,7 @@
 
     try
     {
-        reply = ipmi->sendPacket(request);
+        reply = ipmi->sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, request);
     }
     catch (const IpmiException& e)
     {
diff --git a/src/ipmiblob/blob_handler.hpp b/src/ipmiblob/blob_handler.hpp
index 68708d8..c57b11d 100644
--- a/src/ipmiblob/blob_handler.hpp
+++ b/src/ipmiblob/blob_handler.hpp
@@ -130,4 +130,7 @@
     std::unique_ptr<IpmiInterface> ipmi;
 };
 
+constexpr int ipmiOEMNetFn = 46;
+constexpr int ipmiOEMBlobCmd = 128;
+
 } // namespace ipmiblob
diff --git a/src/ipmiblob/ipmi_handler.cpp b/src/ipmiblob/ipmi_handler.cpp
index 568b86c..682fe45 100644
--- a/src/ipmiblob/ipmi_handler.cpp
+++ b/src/ipmiblob/ipmi_handler.cpp
@@ -65,17 +65,15 @@
 }
 
 std::vector<std::uint8_t>
-    IpmiHandler::sendPacket(std::vector<std::uint8_t>& data)
+    IpmiHandler::sendPacket(std::uint8_t netfn, std::uint8_t cmd,
+                            std::vector<std::uint8_t>& data)
 {
     if (fd < 0)
     {
         open();
     }
 
-    constexpr int ipmiOEMNetFn = 46;
     constexpr int ipmiOEMLun = 0;
-    /* /openbmc/phosphor-host-ipmid/blob/master/host-ipmid/oemopenbmc.hpp */
-    constexpr int ipmiOEMBlobCmd = 128;
     constexpr int fifteenMs = 15 * 1000;
     constexpr int ipmiReadTimeout = fifteenMs;
     constexpr int ipmiResponseBufferLen = IPMI_MAX_MSG_LENGTH;
@@ -98,8 +96,8 @@
     request.msgid = sequence++;
     request.msg.data = reinterpret_cast<unsigned char*>(data.data());
     request.msg.data_len = data.size();
-    request.msg.netfn = ipmiOEMNetFn;
-    request.msg.cmd = ipmiOEMBlobCmd;
+    request.msg.netfn = netfn;
+    request.msg.cmd = cmd;
 
     struct ipmi_recv reply;
     reply.addr = reinterpret_cast<unsigned char*>(&systemAddress);
diff --git a/src/ipmiblob/ipmi_handler.hpp b/src/ipmiblob/ipmi_handler.hpp
index 34177ae..21d0fc7 100644
--- a/src/ipmiblob/ipmi_handler.hpp
+++ b/src/ipmiblob/ipmi_handler.hpp
@@ -37,7 +37,8 @@
      * @throws IpmiException on failure.
      */
     std::vector<std::uint8_t>
-        sendPacket(std::vector<std::uint8_t>& data) override;
+        sendPacket(std::uint8_t netfn, std::uint8_t cmd,
+                   std::vector<std::uint8_t>& data) override;
 
   private:
     const internal::Sys* sys;
diff --git a/src/ipmiblob/ipmi_interface.hpp b/src/ipmiblob/ipmi_interface.hpp
index bf7b448..4a62c2c 100644
--- a/src/ipmiblob/ipmi_interface.hpp
+++ b/src/ipmiblob/ipmi_interface.hpp
@@ -14,12 +14,15 @@
     /**
      * Send an IPMI packet to the BMC.
      *
+     * @param[in] netfn - the netfn for the IPMI packet.
+     * @param[in] cmd - the command.
      * @param[in] data - a vector of the IPMI packet contents.
      * @return the bytes returned.
      * @throws IpmiException on failure.
      */
     virtual std::vector<std::uint8_t>
-        sendPacket(std::vector<std::uint8_t>& data) = 0;
+        sendPacket(std::uint8_t netfn, std::uint8_t cmd,
+                   std::vector<std::uint8_t>& data) = 0;
 };
 
 } // namespace ipmiblob
diff --git a/src/ipmiblob/test/ipmi_interface_mock.hpp b/src/ipmiblob/test/ipmi_interface_mock.hpp
index c8324af..5f5514c 100644
--- a/src/ipmiblob/test/ipmi_interface_mock.hpp
+++ b/src/ipmiblob/test/ipmi_interface_mock.hpp
@@ -11,8 +11,9 @@
 {
   public:
     virtual ~IpmiInterfaceMock() = default;
-    MOCK_METHOD1(sendPacket,
-                 std::vector<std::uint8_t>(std::vector<std::uint8_t>&));
+    MOCK_METHOD3(sendPacket,
+                 std::vector<std::uint8_t>(std::uint8_t, std::uint8_t,
+                                           std::vector<std::uint8_t>&));
 };
 
 } // namespace ipmiblob
diff --git a/test/tools_blob_unittest.cpp b/test/tools_blob_unittest.cpp
index 3afb61b..3fe7974 100644
--- a/test/tools_blob_unittest.cpp
+++ b/test/tools_blob_unittest.cpp
@@ -16,6 +16,7 @@
     return (crcIntf) ? crcIntf->generateCrc(data) : 0x00;
 }
 
+using ::testing::ContainerEq;
 using ::testing::Eq;
 using ::testing::Return;
 
@@ -52,9 +53,12 @@
                                       0x01, 0x00, 0x00, 0x00};
 
     std::vector<std::uint8_t> bytes = {0x01, 0x00, 0x00, 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(bytes))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(bytes)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
     EXPECT_EQ(1, blob.getBlobCount());
 }
 
@@ -79,10 +83,14 @@
 
     std::vector<std::uint8_t> bytes = {'a', 'b', 'c', 'd', 0x00};
     std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00, 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(bytes))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(bytes)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
     EXPECT_STREQ("abcd", blob.enumerateBlob(1).c_str());
 }
 
@@ -105,9 +113,12 @@
     std::vector<std::uint8_t> resp = {};
 
     std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00, 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
     EXPECT_STREQ("", blob.enumerateBlob(1).c_str());
 }
 
@@ -128,9 +139,12 @@
                                        0x01, 0x00, 0x00, 0x00};
 
     std::vector<std::uint8_t> bytes1 = {0x01, 0x00, 0x00, 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(bytes1))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(bytes1)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request1))).WillOnce(Return(resp1));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request1)))
+        .WillOnce(Return(resp1));
 
     std::vector<std::uint8_t> request2 = {
         0xcf, 0xc2,
@@ -145,10 +159,14 @@
 
     std::vector<std::uint8_t> reqCrc = {0x00, 0x00, 0x00, 0x00};
     std::vector<std::uint8_t> bytes2 = {'a', 'b', 'c', 'd', 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(bytes2))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(bytes2)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request2))).WillOnce(Return(resp2));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request2)))
+        .WillOnce(Return(resp2));
 
     /* A std::string is not nul-terminated by default. */
     std::vector<std::string> expectedList = {std::string{"abcd"}};
@@ -179,10 +197,14 @@
     std::vector<std::uint8_t> reqCrc = {'a', 'b', 'c', 'd', 0x00};
     std::vector<std::uint8_t> respCrc = {0xff, 0xff, 0x00, 0x00, 0x00,
                                          0x00, 0x02, 0x34, 0x45};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(respCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     auto meta = blob.getStat("abcd");
     EXPECT_EQ(meta.blob_state, 0xffff);
@@ -215,10 +237,14 @@
     std::vector<std::uint8_t> respCrc = {0xff, 0xff, 0x00, 0x00,
                                          0x00, 0x00, 0x00};
 
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(respCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     auto meta = blob.getStat("abcd");
     EXPECT_EQ(meta.blob_state, 0xffff);
@@ -249,10 +275,14 @@
     std::vector<std::uint8_t> respCrc = {0xff, 0xff, 0x00, 0x00,
                                          0x00, 0x00, 0x00};
 
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(respCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     auto meta = blob.getStat(0x0001);
     EXPECT_EQ(meta.blob_state, 0xffff);
@@ -282,10 +312,14 @@
 
     std::vector<std::uint8_t> reqCrc = {0x02, 0x04, 'a', 'b', 'c', 'd', 0x00};
     std::vector<std::uint8_t> respCrc = {0xfe, 0xed};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(respCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     const int writeBit = (1 << 1);
     const int lpcBit = (1 << 10);
@@ -309,9 +343,12 @@
         0x01, 0x00};
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00};
     std::vector<std::uint8_t> reqCrc = {0x01, 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     blob.closeBlob(0x0001);
 }
@@ -333,9 +370,12 @@
 
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00};
     std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     blob.commit(0x0001, {});
 }
@@ -362,9 +402,12 @@
     std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00};
     std::vector<std::uint8_t> reqCrc = {0x01, 0x00, 0x00, 0x00, 0x00,
                                         0x00, 'a',  'b',  'c',  'd'};
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     blob.writeBytes(0x0001, 0, bytes);
 }
@@ -394,10 +437,14 @@
                                         0x00, 0x04, 0x00, 0x00, 0x00};
     std::vector<std::uint8_t> respCrc = {'a', 'b', 'c', 'd'};
 
-    EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
-    EXPECT_CALL(crcMock, generateCrc(Eq(respCrc))).WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(reqCrc)))
+        .WillOnce(Return(0x00));
+    EXPECT_CALL(crcMock, generateCrc(ContainerEq(respCrc)))
+        .WillOnce(Return(0x00));
 
-    EXPECT_CALL(*ipmiMock, sendPacket(Eq(request))).WillOnce(Return(resp));
+    EXPECT_CALL(*ipmiMock,
+                sendPacket(ipmiOEMNetFn, ipmiOEMBlobCmd, ContainerEq(request)))
+        .WillOnce(Return(resp));
 
     EXPECT_EQ(blob.readBytes(0x0001, 0, 4), expectedBytes);
 }
