treewide: remove 'using namespace' from headers

Using namespace at global scope in a header file violates the cpp core
guidelines.  Quoting the guidelines:

  "Doing so takes away an #includer’s ability to effectively
disambiguate and to use alternatives. It also makes #included headers
order-dependent as they might have different meaning when included in
different orders."

For further reading:
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-using-directive

The guidelines don't call out using using namespace from namespace
scope, but it is only marginally less problematic and still unexpected,
so this patch removes those as well.

The process used to do the update is roughly:

1 - git grep 'using namespace' **.hpp
2 - For each instance, remove the offending 'using namespace' line
3 - build
4 - add 'using namespace' to cpp files or fully resolve types in hpp
  files until the project builds again.

Further cleanup is possible - for example cpp files could be scrubbed
for unnecessary namespace qualification - this was not done here to make
review as simple as possible.

Change-Id: I4931f5e78a1b5b74b4a4774c035a549f4d59b91a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/common/test/mocked_utils.hpp b/common/test/mocked_utils.hpp
index 9a1c87e..f8f3665 100644
--- a/common/test/mocked_utils.hpp
+++ b/common/test/mocked_utils.hpp
@@ -23,17 +23,17 @@
 } // namespace utils
 } // namespace pldm
 
-using namespace pldm::utils;
-
-class MockdBusHandler : public DBusHandler
+class MockdBusHandler : public pldm::utils::DBusHandler
 {
   public:
     MOCK_METHOD(std::string, getService, (const char*, const char*),
                 (const override));
 
     MOCK_METHOD(void, setDbusProperty,
-                (const DBusMapping&, const PropertyValue&), (const override));
+                (const pldm::utils::DBusMapping&,
+                 const pldm::utils::PropertyValue&),
+                (const override));
 
-    MOCK_METHOD(PropertyValue, getDbusPropertyVariant,
+    MOCK_METHOD(pldm::utils::PropertyValue, getDbusPropertyVariant,
                 (const char*, const char*, const char*), (const override));
 };
diff --git a/host-bmc/dbus_to_event_handler.cpp b/host-bmc/dbus_to_event_handler.cpp
index bb38cb8..69faa1a 100644
--- a/host-bmc/dbus_to_event_handler.cpp
+++ b/host-bmc/dbus_to_event_handler.cpp
@@ -7,7 +7,10 @@
 namespace pldm
 {
 
+using namespace pldm::dbus_api;
+using namespace pldm::responder;
 using namespace pldm::responder::pdr;
+using namespace pldm::responder::pdr_utils;
 using namespace pldm::utils;
 using namespace sdbusplus::bus::match::rules;
 
diff --git a/host-bmc/dbus_to_event_handler.hpp b/host-bmc/dbus_to_event_handler.hpp
index 2a25243..8818d67 100644
--- a/host-bmc/dbus_to_event_handler.hpp
+++ b/host-bmc/dbus_to_event_handler.hpp
@@ -8,16 +8,13 @@
 
 #include <map>
 
-using namespace pldm::dbus_api;
-using namespace pldm::responder;
-
 namespace pldm
 {
 
 using SensorId = uint16_t;
 using DbusObjMaps =
-    std::map<SensorId,
-             std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps>>;
+    std::map<SensorId, std::tuple<pldm::responder::pdr_utils::DbusMappings,
+                                  pldm::responder::pdr_utils::DbusValMaps>>;
 using sensorEvent =
     std::function<void(SensorId sensorId, const DbusObjMaps& dbusMaps)>;
 
@@ -44,7 +41,7 @@
      *  @param[in] handler - PLDM request handler
      */
     explicit DbusToPLDMEvent(
-        int mctp_fd, uint8_t mctp_eid, Requester& requester,
+        int mctp_fd, uint8_t mctp_eid, pldm::dbus_api::Requester& requester,
         pldm::requester::Handler<pldm::requester::Request>* handler);
 
   public:
@@ -52,7 +49,7 @@
      *  @param[in] repo - pdr utils repo object
      *  @param[in] dbusMaps - The map of D-Bus mapping and value
      */
-    void listenSensorEvent(const pdr_utils::Repo& repo,
+    void listenSensorEvent(const pldm::responder::pdr_utils::Repo& repo,
                            const DbusObjMaps& dbusMaps);
 
   private:
@@ -77,7 +74,7 @@
     /** @brief reference to Requester object, primarily used to access API to
      *  obtain PLDM instance id.
      */
-    Requester& requester;
+    pldm::dbus_api::Requester& requester;
 
     /** @brief D-Bus property changed signal match */
     std::vector<std::unique_ptr<sdbusplus::bus::match::match>>
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index 6dff8af..ff74788 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -10,6 +10,8 @@
 #include <fstream>
 #include <iostream>
 
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace host_effecters
diff --git a/host-bmc/dbus_to_host_effecters.hpp b/host-bmc/dbus_to_host_effecters.hpp
index 9c0314d..e274540 100644
--- a/host-bmc/dbus_to_host_effecters.hpp
+++ b/host-bmc/dbus_to_host_effecters.hpp
@@ -12,13 +12,11 @@
 namespace pldm
 {
 
-using namespace utils;
-using namespace dbus_api;
-
 namespace host_effecters
 {
 
-using DbusChgHostEffecterProps = std::map<dbus::Property, PropertyValue>;
+using DbusChgHostEffecterProps =
+    std::map<dbus::Property, pldm::utils::PropertyValue>;
 
 /** @struct State
  *  Contains the state set id and the possible states for
@@ -35,8 +33,9 @@
  */
 struct DBusEffecterMapping
 {
-    DBusMapping dbusMap;
-    std::vector<PropertyValue> propertyValues; //!< D-Bus property values
+    pldm::utils::DBusMapping dbusMap;
+    std::vector<pldm::utils::PropertyValue>
+        propertyValues;  //!< D-Bus property values
     PossibleState state; //!< Corresponding effecter states
 };
 
@@ -80,8 +79,9 @@
      *  @param[in] verbose - verbosity
      */
     explicit HostEffecterParser(
-        Requester* requester, int fd, const pldm_pdr* repo,
-        DBusHandler* const dbusHandler, const std::string& jsonPath,
+        pldm::dbus_api::Requester* requester, int fd, const pldm_pdr* repo,
+        pldm::utils::DBusHandler* const dbusHandler,
+        const std::string& jsonPath,
         pldm::requester::Handler<pldm::requester::Request>* handler,
         bool verbose = false) :
         requester(requester),
@@ -125,9 +125,10 @@
      * @param[in] propertyType - type of the D-Bus property
      * @return - none
      */
-    void populatePropVals(const Json& dBusValues,
-                          std::vector<PropertyValue>& propertyValues,
-                          const std::string& propertyType);
+    void populatePropVals(
+        const pldm::utils::Json& dBusValues,
+        std::vector<pldm::utils::PropertyValue>& propertyValues,
+        const std::string& propertyType);
 
     /* @brief Set a host state effecter
      *
@@ -151,7 +152,7 @@
      * @return - the new state value
      */
     uint8_t findNewStateValue(size_t effecterInfoIndex, size_t dbusInfoIndex,
-                              const PropertyValue& propertyValue);
+                              const pldm::utils::PropertyValue& propertyValue);
 
     /* @brief Subscribes for D-Bus property change signal on the specified
      * object
@@ -170,14 +171,15 @@
                                          uint16_t effecterId);
 
   protected:
-    Requester* requester;    //!< Reference to Requester to obtain instance id
+    pldm::dbus_api::Requester*
+        requester;           //!< Reference to Requester to obtain instance id
     int sockFd;              //!< Socket fd to send message to host
     const pldm_pdr* pdrRepo; //!< Reference to PDR repo
     std::vector<EffecterInfo> hostEffecterInfo; //!< Parsed effecter information
     std::vector<std::unique_ptr<sdbusplus::bus::match::match>>
         effecterInfoMatch; //!< vector to catch the D-Bus property change
                            //!< signals for the effecters
-    const DBusHandler* dbusHandler; //!< D-bus Handler
+    const pldm::utils::DBusHandler* dbusHandler; //!< D-bus Handler
     /** @brief PLDM request handler */
     pldm::requester::Handler<pldm::requester::Request>* handler;
     bool verbose; //!< verbose flag
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 8941d94..d5df188 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -17,6 +17,8 @@
 namespace pldm
 {
 
+using namespace pldm::dbus_api;
+using namespace pldm::responder::events;
 using namespace pldm::utils;
 using namespace sdbusplus::bus::match::rules;
 using Json = nlohmann::json;
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index dc539ce..4629f5a 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -18,9 +18,6 @@
 #include <memory>
 #include <vector>
 
-using namespace pldm::dbus_api;
-using namespace pldm::responder::events;
-
 namespace pldm
 {
 
@@ -104,7 +101,8 @@
         int mctp_fd, uint8_t mctp_eid, sdeventplus::Event& event,
         pldm_pdr* repo, const std::string& eventsJsonsDir,
         pldm_entity_association_tree* entityTree,
-        pldm_entity_association_tree* bmcEntityTree, Requester& requester,
+        pldm_entity_association_tree* bmcEntityTree,
+        pldm::dbus_api::Requester& requester,
         pldm::requester::Handler<pldm::requester::Request>* handler,
         bool verbose = false);
 
@@ -143,8 +141,9 @@
      *
      *  @return PLDM completion code
      */
-    int handleStateSensorEvent(const StateSensorEntry& entry,
-                               pdr::EventState state);
+    int handleStateSensorEvent(
+        const pldm::responder::events::StateSensorEntry& entry,
+        pdr::EventState state);
 
     /** @brief Parse state sensor PDRs and populate the sensorMap lookup data
      *         structure
@@ -232,7 +231,7 @@
     /** @brief pointer to BMC's primary PDR repo, host PDRs are added here */
     pldm_pdr* repo;
 
-    StateSensorHandler stateSensorHandler;
+    pldm::responder::events::StateSensorHandler stateSensorHandler;
     /** @brief Pointer to BMC's and Host's entity association tree */
     pldm_entity_association_tree* entityTree;
 
@@ -242,7 +241,7 @@
     /** @brief reference to Requester object, primarily used to access API to
      *  obtain PLDM instance id.
      */
-    Requester& requester;
+    pldm::dbus_api::Requester& requester;
 
     /** @brief PLDM request handler */
     pldm::requester::Handler<pldm::requester::Request>* handler;
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index e7d4c5e..221a62b 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -13,6 +13,8 @@
 #include <variant>
 #include <vector>
 
+using namespace pldm::utils;
+
 namespace pldm
 {
 
diff --git a/libpldmresponder/bios_attribute.cpp b/libpldmresponder/bios_attribute.cpp
index d090a28..bc646ca 100644
--- a/libpldmresponder/bios_attribute.cpp
+++ b/libpldmresponder/bios_attribute.cpp
@@ -8,6 +8,8 @@
 #include <iostream>
 #include <variant>
 
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/libpldmresponder/bios_attribute.hpp b/libpldmresponder/bios_attribute.hpp
index ebdf1dc..ca4ae70 100644
--- a/libpldmresponder/bios_attribute.hpp
+++ b/libpldmresponder/bios_attribute.hpp
@@ -22,7 +22,6 @@
 {
 
 using Json = nlohmann::json;
-using namespace pldm::utils;
 
 /** @class BIOSAttribute
  *  @brief Provide interfaces to implement specific types of attributes
@@ -34,7 +33,8 @@
      *  @param[in] entry - Json Object
      *  @param[in] dbusHandler - Dbus Handler
      */
-    BIOSAttribute(const Json& entry, DBusHandler* const dbusHandler);
+    BIOSAttribute(const Json& entry,
+                  pldm::utils::DBusHandler* const dbusHandler);
 
     /** Virtual destructor
      */
@@ -75,7 +75,7 @@
      */
     virtual int updateAttrVal(Table& newValue, uint16_t attrHdl,
                               uint8_t attrType,
-                              const PropertyValue& newPropVal) = 0;
+                              const pldm::utils::PropertyValue& newPropVal) = 0;
 
     /** @brief Generate attribute entry by the spec DSP0247_1.0.0 Table 14
      *  @param[in] attributevalue - attribute value(Enumeration, String and
@@ -87,7 +87,7 @@
         Table& attrValueEntry) = 0;
 
     /** @brief Method to return the D-Bus map */
-    std::optional<DBusMapping> getDBusMap();
+    std::optional<pldm::utils::DBusMapping> getDBusMap();
 
     /** @brief Name of this attribute */
     const std::string name;
@@ -101,10 +101,10 @@
 
   protected:
     /** @brief dbus backend, nullopt if this attribute is read-only*/
-    std::optional<DBusMapping> dBusMap;
+    std::optional<pldm::utils::DBusMapping> dBusMap;
 
     /** @brief dbus handler */
-    DBusHandler* const dbusHandler;
+    pldm::utils::DBusHandler* const dbusHandler;
 };
 
 } // namespace bios
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index b538cf1..10ec89c 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -15,6 +15,9 @@
 #include "oem/ibm/libpldmresponder/platform_oem_ibm.hpp"
 #endif
 
+using namespace pldm::dbus_api;
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index 8477628..18e13b0 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -77,7 +77,7 @@
      */
     explicit BIOSConfig(
         const char* jsonDir, const char* tableDir,
-        DBusHandler* const dbusHandler, int fd, uint8_t eid,
+        pldm::utils::DBusHandler* const dbusHandler, int fd, uint8_t eid,
         dbus_api::Requester* requester,
         pldm::requester::Handler<pldm::requester::Request>* handler);
 
@@ -134,7 +134,7 @@
 
     const fs::path jsonDir;
     const fs::path tableDir;
-    DBusHandler* const dbusHandler;
+    pldm::utils::DBusHandler* const dbusHandler;
     BaseBIOSTable baseBIOSTableMaps;
 
     /** @brief socket descriptor to communicate to host */
@@ -156,7 +156,7 @@
     BIOSAttributes biosAttributes;
 
     using propName = std::string;
-    using DbusChObjProperties = std::map<propName, PropertyValue>;
+    using DbusChObjProperties = std::map<propName, pldm::utils::PropertyValue>;
 
     // vector to catch the D-Bus property change signals for BIOS attributes
     std::vector<std::unique_ptr<sdbusplus::bus::match::match>> biosAttrMatch;
diff --git a/libpldmresponder/bios_enum_attribute.cpp b/libpldmresponder/bios_enum_attribute.cpp
index f1f22c5..2ce2909 100644
--- a/libpldmresponder/bios_enum_attribute.cpp
+++ b/libpldmresponder/bios_enum_attribute.cpp
@@ -6,6 +6,8 @@
 
 #include <iostream>
 
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/libpldmresponder/bios_enum_attribute.hpp b/libpldmresponder/bios_enum_attribute.hpp
index 48492cc..a798804 100644
--- a/libpldmresponder/bios_enum_attribute.hpp
+++ b/libpldmresponder/bios_enum_attribute.hpp
@@ -28,7 +28,8 @@
      *  @param[in] entry - Json Object
      *  @param[in] dbusHandler - Dbus Handler
      */
-    BIOSEnumAttribute(const Json& entry, DBusHandler* const dbusHandler);
+    BIOSEnumAttribute(const Json& entry,
+                      pldm::utils::DBusHandler* const dbusHandler);
 
     /** @brief Set Attribute value On Dbus according to the attribute value
      *         entry
@@ -64,7 +65,7 @@
         Table& attrValueEntry) override;
 
     int updateAttrVal(Table& newValue, uint16_t attrHdl, uint8_t attrType,
-                      const PropertyValue& newPropVal);
+                      const pldm::utils::PropertyValue& newPropVal);
 
   private:
     std::vector<std::string> possibleValues;
@@ -87,7 +88,7 @@
         getPossibleValuesHandle(const BIOSStringTable& stringTable,
                                 const std::vector<std::string>& pVs);
 
-    using ValMap = std::map<PropertyValue, std::string>;
+    using ValMap = std::map<pldm::utils::PropertyValue, std::string>;
 
     /** @brief Map of value on dbus and pldm */
     ValMap valMap;
@@ -107,7 +108,7 @@
      *
      *  @return The index of the property value in possible values
      */
-    uint8_t getAttrValueIndex(const PropertyValue& propValue);
+    uint8_t getAttrValueIndex(const pldm::utils::PropertyValue& propValue);
 };
 
 } // namespace bios
diff --git a/libpldmresponder/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index 9753ef8..6bfdde0 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -2,6 +2,8 @@
 
 #include "common/utils.hpp"
 
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/libpldmresponder/bios_integer_attribute.hpp b/libpldmresponder/bios_integer_attribute.hpp
index 033c18f..5d342c6 100644
--- a/libpldmresponder/bios_integer_attribute.hpp
+++ b/libpldmresponder/bios_integer_attribute.hpp
@@ -24,7 +24,8 @@
      *  @param[in] entry - Json Object
      *  @param[in] dbusHandler - Dbus Handler
      */
-    BIOSIntegerAttribute(const Json& entry, DBusHandler* const dbusHandler);
+    BIOSIntegerAttribute(const Json& entry,
+                         pldm::utils::DBusHandler* const dbusHandler);
 
     /** @brief Set Attribute value On Dbus according to the attribute value
      *         entry
@@ -60,14 +61,14 @@
         Table& attrValueEntry) override;
 
     int updateAttrVal(Table& newValue, uint16_t attrHdl, uint8_t attrType,
-                      const PropertyValue& newPropVal);
+                      const pldm::utils::PropertyValue& newPropVal);
 
   private:
     /** @brief Integer field from json */
     table::attribute::IntegerField integerInfo;
 
     /** @brief Get pldm value from dbus propertyValue */
-    uint64_t getAttrValue(const PropertyValue& value);
+    uint64_t getAttrValue(const pldm::utils::PropertyValue& value);
 
     /** @brief Get value on dbus */
     uint64_t getAttrValue();
diff --git a/libpldmresponder/bios_string_attribute.cpp b/libpldmresponder/bios_string_attribute.cpp
index 4f9bc4f..6aa3dc5 100644
--- a/libpldmresponder/bios_string_attribute.cpp
+++ b/libpldmresponder/bios_string_attribute.cpp
@@ -6,6 +6,8 @@
 #include <tuple>
 #include <variant>
 
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/libpldmresponder/bios_string_attribute.hpp b/libpldmresponder/bios_string_attribute.hpp
index ff364ec..5132841 100644
--- a/libpldmresponder/bios_string_attribute.hpp
+++ b/libpldmresponder/bios_string_attribute.hpp
@@ -47,7 +47,8 @@
      *  @param[in] entry - Json Object
      *  @param[in] dbusHandler - Dbus Handler
      */
-    BIOSStringAttribute(const Json& entry, DBusHandler* const dbusHandler);
+    BIOSStringAttribute(const Json& entry,
+                        pldm::utils::DBusHandler* const dbusHandler);
 
     /** @brief Set Attribute value On Dbus according to the attribute value
      *         entry
@@ -83,7 +84,7 @@
         Table& attrValueEntry) override;
 
     int updateAttrVal(Table& newValue, uint16_t attrHdl, uint8_t attrType,
-                      const PropertyValue& newPropVal);
+                      const pldm::utils::PropertyValue& newPropVal);
 
   private:
     /** @brief string field from json */
diff --git a/libpldmresponder/fru_parser.cpp b/libpldmresponder/fru_parser.cpp
index 28f48a7..8c7ff86 100644
--- a/libpldmresponder/fru_parser.cpp
+++ b/libpldmresponder/fru_parser.cpp
@@ -7,6 +7,8 @@
 #include <fstream>
 #include <iostream>
 
+using namespace pldm::responder::dbus;
+
 namespace pldm
 {
 
diff --git a/libpldmresponder/fru_parser.hpp b/libpldmresponder/fru_parser.hpp
index fc3234e..ce6f619 100644
--- a/libpldmresponder/fru_parser.hpp
+++ b/libpldmresponder/fru_parser.hpp
@@ -40,17 +40,20 @@
 {
 
 namespace fs = std::filesystem;
-using namespace dbus;
-using namespace fru;
 
 // DBusLookupInfo contains info to lookup in the D-Bus inventory, D-Bus
 // inventory service bus name, root path of the inventory D-Bus objects and list
 //  of xyz.openbmc_project.Inventory.Item.* interface names.
-using DBusLookupInfo = std::tuple<Service, RootPath, Interfaces>;
-using FieldInfo = std::tuple<Interface, Property, PropertyType, FieldType>;
+using DBusLookupInfo =
+    std::tuple<pldm::responder::dbus::Service, pldm::responder::dbus::RootPath,
+               pldm::responder::dbus::Interfaces>;
+using FieldInfo = std::tuple<
+    pldm::responder::dbus::Interface, pldm::responder::dbus::Property,
+    pldm::responder::dbus::PropertyType, pldm::responder::fru::FieldType>;
 
 using FruRecordInfo =
-    std::tuple<RecordType, EncodingType, std::vector<FieldInfo>>;
+    std::tuple<pldm::responder::fru::RecordType,
+               pldm::responder::fru::EncodingType, std::vector<FieldInfo>>;
 using FruRecordInfos = std::vector<FruRecordInfo>;
 
 using ItemIntfName = std::string;
@@ -94,12 +97,14 @@
      *  @return return the info create the PLDM FRU records from inventory D-Bus
      *          objects
      */
-    const FruRecordInfos& getRecordInfo(const Interface& intf) const
+    const FruRecordInfos&
+        getRecordInfo(const pldm::responder::dbus::Interface& intf) const
     {
         return recordMap.at(intf);
     }
 
-    EntityType getEntityType(const Interface& intf) const
+    pldm::responder::dbus::EntityType
+        getEntityType(const pldm::responder::dbus::Interface& intf) const
     {
         return intfToEntityType.at(intf);
     }
@@ -134,7 +139,9 @@
 
     std::optional<DBusLookupInfo> lookupInfo;
     FruRecordMap recordMap;
-    std::map<Interface, EntityType> intfToEntityType;
+    std::map<pldm::responder::dbus::Interface,
+             pldm::responder::dbus::EntityType>
+        intfToEntityType;
 };
 
 } // namespace fru_parser
diff --git a/libpldmresponder/oem_handler.hpp b/libpldmresponder/oem_handler.hpp
index ba0077f..fcf844b 100644
--- a/libpldmresponder/oem_handler.hpp
+++ b/libpldmresponder/oem_handler.hpp
@@ -7,8 +7,6 @@
 namespace pldm
 {
 
-using namespace pdr;
-
 namespace responder
 {
 
@@ -37,8 +35,9 @@
      *            fails
      */
     virtual int getOemStateSensorReadingsHandler(
-        EntityType entityType, EntityInstance entityInstance,
-        StateSetId stateSetId, CompositeCount compSensorCnt,
+        EntityType entityType, pldm::pdr::EntityInstance entityInstance,
+        pldm::pdr::StateSetId stateSetId,
+        pldm::pdr::CompositeCount compSensorCnt,
         std::vector<get_sensor_state_field>& stateField) = 0;
 
     /** @brief Interface to set the effecter requested by pldm requester
diff --git a/libpldmresponder/pdr.hpp b/libpldmresponder/pdr.hpp
index 0745384..4870c4a 100644
--- a/libpldmresponder/pdr.hpp
+++ b/libpldmresponder/pdr.hpp
@@ -5,8 +5,6 @@
 
 #include <stdint.h>
 
-using namespace pldm::responder::pdr_utils;
-
 namespace pldm
 {
 
@@ -27,7 +25,9 @@
  *
  *  @return Repo - Instance of pdr::Repo
  */
-void getRepoByType(const Repo& inRepo, Repo& outRepo, Type pdrType);
+void getRepoByType(const pldm::responder::pdr_utils::Repo& inRepo,
+                   pldm::responder::pdr_utils::Repo& outRepo,
+                   pldm::responder::pdr_utils::Type pdrType);
 
 /** @brief Get the record of PDR by the record handle
  *
@@ -38,9 +38,10 @@
  *
  *  @return pldm_pdr_record - Instance of pdr::RepoInterface
  */
-const pldm_pdr_record* getRecordByHandle(const RepoInterface& pdrRepo,
-                                         RecordHandle recordHandle,
-                                         PdrEntry& pdrEntry);
+const pldm_pdr_record*
+    getRecordByHandle(const pldm::responder::pdr_utils::RepoInterface& pdrRepo,
+                      pldm::responder::pdr_utils::RecordHandle recordHandle,
+                      pldm::responder::pdr_utils::PdrEntry& pdrEntry);
 
 } // namespace pdr
 } // namespace responder
diff --git a/libpldmresponder/pdr_numeric_effecter.hpp b/libpldmresponder/pdr_numeric_effecter.hpp
index ca6e5ad..6e85642 100644
--- a/libpldmresponder/pdr_numeric_effecter.hpp
+++ b/libpldmresponder/pdr_numeric_effecter.hpp
@@ -197,8 +197,8 @@
         auto propertyName = dbusEntry.value("property_name", "");
         auto propertyType = dbusEntry.value("property_type", "");
 
-        DbusMappings dbusMappings{};
-        DbusValMaps dbusValMaps{};
+        pldm::responder::pdr_utils::DbusMappings dbusMappings{};
+        pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
         pldm::utils::DBusMapping dbusMapping{};
         try
         {
diff --git a/libpldmresponder/pdr_state_effecter.hpp b/libpldmresponder/pdr_state_effecter.hpp
index 0ddfdfa..7307898 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -104,8 +104,8 @@
         pdr->has_description_pdr = false;
         pdr->composite_effecter_count = effecters.size();
 
-        DbusMappings dbusMappings{};
-        DbusValMaps dbusValMaps{};
+        pldm::responder::pdr_utils::DbusMappings dbusMappings{};
+        pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
         uint8_t* start =
             entry.data() + sizeof(pldm_state_effecter_pdr) - sizeof(uint8_t);
         for (const auto& effecter : effecters)
@@ -119,7 +119,7 @@
             start += sizeof(possibleStates->state_set_id) +
                      sizeof(possibleStates->possible_states_size);
             static const std::vector<uint8_t> emptyStates{};
-            PossibleValues stateValues;
+            pldm::responder::pdr_utils::PossibleValues stateValues;
             auto states = set.value("states", emptyStates);
             for (const auto& state : states)
             {
@@ -137,7 +137,7 @@
             auto propertyName = dbusEntry.value("property_name", "");
             auto propertyType = dbusEntry.value("property_type", "");
 
-            StatestoDbusVal dbusIdToValMap{};
+            pldm::responder::pdr_utils::StatestoDbusVal dbusIdToValMap{};
             pldm::utils::DBusMapping dbusMapping{};
             try
             {
@@ -146,7 +146,7 @@
 
                 dbusMapping = pldm::utils::DBusMapping{
                     objectPath, interface, propertyName, propertyType};
-                dbusIdToValMap = populateMapping(
+                dbusIdToValMap = pldm::responder::pdr_utils::populateMapping(
                     propertyType, dbusEntry["property_values"], stateValues);
             }
             catch (const std::exception& e)
@@ -161,7 +161,7 @@
         handler.addDbusObjMaps(
             pdr->effecter_id,
             std::make_tuple(std::move(dbusMappings), std::move(dbusValMaps)));
-        PdrEntry pdrEntry{};
+        pldm::responder::pdr_utils::PdrEntry pdrEntry{};
         pdrEntry.data = entry.data();
         pdrEntry.size = pdrSize;
         repo.addRecord(pdrEntry);
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index 5093dcf..a7842df 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -116,8 +116,8 @@
         HTOLE16(pdr->entity_instance);
         HTOLE16(pdr->container_id);
 
-        DbusMappings dbusMappings{};
-        DbusValMaps dbusValMaps{};
+        pldm::responder::pdr_utils::DbusMappings dbusMappings{};
+        pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
         uint8_t* start =
             entry.data() + sizeof(pldm_state_sensor_pdr) - sizeof(uint8_t);
         for (const auto& sensor : sensors)
@@ -132,7 +132,7 @@
             start += sizeof(possibleStates->state_set_id) +
                      sizeof(possibleStates->possible_states_size);
             static const std::vector<uint8_t> emptyStates{};
-            PossibleValues stateValues;
+            pldm::responder::pdr_utils::PossibleValues stateValues;
             auto states = set.value("states", emptyStates);
             for (const auto& state : states)
             {
@@ -149,7 +149,7 @@
             auto propertyName = dbusEntry.value("property_name", "");
             auto propertyType = dbusEntry.value("property_type", "");
 
-            StatestoDbusVal dbusIdToValMap{};
+            pldm::responder::pdr_utils::StatestoDbusVal dbusIdToValMap{};
             pldm::utils::DBusMapping dbusMapping{};
             try
             {
@@ -158,7 +158,7 @@
 
                 dbusMapping = pldm::utils::DBusMapping{
                     objectPath, interface, propertyName, propertyType};
-                dbusIdToValMap = populateMapping(
+                dbusIdToValMap = pldm::responder::pdr_utils::populateMapping(
                     propertyType, dbusEntry["property_values"], stateValues);
             }
             catch (const std::exception& e)
@@ -174,8 +174,8 @@
         handler.addDbusObjMaps(
             pdr->sensor_id,
             std::make_tuple(std::move(dbusMappings), std::move(dbusValMaps)),
-            TypeId::PLDM_SENSOR_ID);
-        PdrEntry pdrEntry{};
+            pldm::responder::pdr_utils::TypeId::PLDM_SENSOR_ID);
+        pldm::responder::pdr_utils::PdrEntry pdrEntry{};
         pdrEntry.data = entry.data();
         pdrEntry.size = pdrSize;
         repo.addRecord(pdrEntry);
diff --git a/libpldmresponder/pdr_utils.cpp b/libpldmresponder/pdr_utils.cpp
index 0769ace..d097b26 100644
--- a/libpldmresponder/pdr_utils.cpp
+++ b/libpldmresponder/pdr_utils.cpp
@@ -4,6 +4,8 @@
 
 #include <climits>
 
+using namespace pldm::pdr;
+
 namespace pldm
 {
 
diff --git a/libpldmresponder/pdr_utils.hpp b/libpldmresponder/pdr_utils.hpp
index c463f1f..13d1cbb 100644
--- a/libpldmresponder/pdr_utils.hpp
+++ b/libpldmresponder/pdr_utils.hpp
@@ -204,7 +204,6 @@
     bool empty() override;
 };
 
-using namespace pldm::pdr;
 /** @brief Parse the State Sensor PDR and return the parsed sensor info which
  *         will be used to lookup the sensor info in the PlatformEventMessage
  *         command of sensorEvent type.
@@ -213,7 +212,8 @@
  *
  *  @return terminus handle, sensor ID and parsed sensor info
  */
-std::tuple<TerminusHandle, SensorID, SensorInfo>
+std::tuple<pldm::pdr::TerminusHandle, pldm::pdr::SensorID,
+           pldm::pdr::SensorInfo>
     parseStateSensorPDR(const std::vector<uint8_t>& stateSensorPdr);
 
 } // namespace pdr_utils
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 779a0cd..319c22e 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -16,6 +16,10 @@
 #include "platform_state_effecter.hpp"
 #include "platform_state_sensor.hpp"
 
+using namespace pldm::utils;
+using namespace pldm::responder::pdr;
+using namespace pldm::responder::pdr_utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index 397eb75..13ea461 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -27,13 +27,9 @@
 namespace platform
 {
 
-using namespace pldm::utils;
-using namespace pldm::responder::pdr_utils;
-using namespace pldm::state_sensor;
-
-using generatePDR =
-    std::function<void(const pldm::utils::DBusHandler& dBusIntf,
-                       const Json& json, pdr_utils::RepoInterface& repo)>;
+using generatePDR = std::function<void(const pldm::utils::DBusHandler& dBusIntf,
+                                       const pldm::utils::Json& json,
+                                       pdr_utils::RepoInterface& repo)>;
 
 using EffecterId = uint16_t;
 using DbusObjMaps =
@@ -55,7 +51,8 @@
     Handler(const pldm::utils::DBusHandler* dBusIntf,
             const std::string& pdrJsonsDir, pldm_pdr* repo,
             HostPDRHandler* hostPDRHandler,
-            DbusToPLDMEvent* dbusToPLDMEventHandler, fru::Handler* fruHandler,
+            pldm::state_sensor::DbusToPLDMEvent* dbusToPLDMEventHandler,
+            fru::Handler* fruHandler,
             pldm::responder::oem_platform::Handler* oemPlatformHandler,
             sdeventplus::Event& event, bool buildPDRLazily = false,
             const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
@@ -152,7 +149,8 @@
     void addDbusObjMaps(
         uint16_t id,
         std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps> dbusObj,
-        TypeId typeId = TypeId::PLDM_EFFECTER_ID);
+        pldm::responder::pdr_utils::TypeId typeId =
+            pldm::responder::pdr_utils::TypeId::PLDM_EFFECTER_ID);
 
     /** @brief Retrieve an id -> D-Bus objects mapping
      *
@@ -164,8 +162,10 @@
      *          to attribute value
      */
     const std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps>&
-        getDbusObjMaps(uint16_t id,
-                       TypeId typeId = TypeId::PLDM_EFFECTER_ID) const;
+        getDbusObjMaps(
+            uint16_t id,
+            pldm::responder::pdr_utils::TypeId typeId =
+                pldm::responder::pdr_utils::TypeId::PLDM_EFFECTER_ID) const;
 
     uint16_t getNextEffecterId()
     {
@@ -184,14 +184,16 @@
      *  @param[in] repo - instance of concrete implementation of Repo
      */
     void generate(const pldm::utils::DBusHandler& dBusIntf,
-                  const std::string& dir, Repo& repo);
+                  const std::string& dir,
+                  pldm::responder::pdr_utils::Repo& repo);
 
     /** @brief Parse PDR JSONs and build state effecter PDR repository
      *
      *  @param[in] json - platform specific PDR JSON files
      *  @param[in] repo - instance of state effecter implementation of Repo
      */
-    void generateStateEffecterRepo(const Json& json, Repo& repo);
+    void generateStateEffecterRepo(const pldm::utils::Json& json,
+                                   pldm::responder::pdr_utils::Repo& repo);
 
     /** @brief map of PLDM event type to EventHandlers
      *
@@ -307,7 +309,8 @@
 
         std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)>
             stateEffecterPdrRepo(pldm_pdr_init(), pldm_pdr_destroy);
-        Repo stateEffecterPDRs(stateEffecterPdrRepo.get());
+        pldm::responder::pdr_utils::Repo stateEffecterPDRs(
+            stateEffecterPdrRepo.get());
         getRepoByType(pdrRepo, stateEffecterPDRs, PLDM_STATE_EFFECTER_PDR);
         if (stateEffecterPDRs.empty())
         {
@@ -315,7 +318,7 @@
             return PLDM_PLATFORM_INVALID_EFFECTER_ID;
         }
 
-        PdrEntry pdrEntry{};
+        pldm::responder::pdr_utils::PdrEntry pdrEntry{};
         auto pdrRecord = stateEffecterPDRs.getFirstRecord(pdrEntry);
         while (pdrRecord)
         {
@@ -375,7 +378,8 @@
                     break;
                 }
                 const DBusMapping& dbusMapping = dbusMappings[currState];
-                const StatestoDbusVal& dbusValToMap = dbusValMaps[currState];
+                const pldm::responder::pdr_utils::StatestoDbusVal&
+                    dbusValToMap = dbusValMaps[currState];
 
                 if (stateField[currState].set_request == PLDM_REQUEST_SET)
                 {
@@ -419,7 +423,7 @@
      *
      *  @param[in] repo - instance of concrete implementation of Repo
      */
-    void generateTerminusLocatorPDR(Repo& repo);
+    void generateTerminusLocatorPDR(pldm::responder::pdr_utils::Repo& repo);
 
     /** @brief Get std::map associated with the entity
      *         key: object path
@@ -449,7 +453,7 @@
     DbusObjMaps effecterDbusObjMaps{};
     DbusObjMaps sensorDbusObjMaps{};
     HostPDRHandler* hostPDRHandler;
-    DbusToPLDMEvent* dbusToPLDMEventHandler;
+    pldm::state_sensor::DbusToPLDMEvent* dbusToPLDMEventHandler;
     fru::Handler* fruHandler;
     const pldm::utils::DBusHandler* dBusIntf;
     pldm::responder::oem_platform::Handler* oemPlatformHandler;
diff --git a/libpldmresponder/platform_numeric_effecter.hpp b/libpldmresponder/platform_numeric_effecter.hpp
index eea53e6..b919516 100644
--- a/libpldmresponder/platform_numeric_effecter.hpp
+++ b/libpldmresponder/platform_numeric_effecter.hpp
@@ -16,9 +16,6 @@
 #include <map>
 #include <optional>
 
-using namespace pldm::responder::pdr;
-using namespace pldm::utils;
-
 namespace pldm
 {
 namespace responder
@@ -35,14 +32,14 @@
  *          failure, PropertyValue: The value to be set
  */
 template <typename T>
-std::pair<int, std::optional<PropertyValue>>
+std::pair<int, std::optional<pldm::utils::PropertyValue>>
     getEffecterRawValue(const pldm_numeric_effecter_value_pdr* pdr,
                         T& effecterValue, std::string propertyType)
 {
     // X = Round [ (Y - B) / m ]
     // refer to DSP0248_1.2.0 27.8
     int rc = 0;
-    PropertyValue value;
+    pldm::utils::PropertyValue value;
     switch (pdr->effecter_data_size)
     {
         case PLDM_EFFECTER_DATA_SIZE_UINT8:
@@ -164,7 +161,7 @@
  *  @return std::pair<int, std::optional<PropertyValue>> - rc:Success or
  *          failure, PropertyValue: The value to be set
  */
-std::pair<int, std::optional<PropertyValue>>
+std::pair<int, std::optional<pldm::utils::PropertyValue>>
     convertToDbusValue(const pldm_numeric_effecter_value_pdr* pdr,
                        uint8_t effecterDataSize, uint8_t* effecterValue,
                        std::string propertyType)
@@ -236,9 +233,10 @@
 
     std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)>
         numericEffecterPdrRepo(pldm_pdr_init(), pldm_pdr_destroy);
-    Repo numericEffecterPDRs(numericEffecterPdrRepo.get());
-    getRepoByType(handler.getRepo(), numericEffecterPDRs,
-                  PLDM_NUMERIC_EFFECTER_PDR);
+    pldm::responder::pdr_utils::Repo numericEffecterPDRs(
+        numericEffecterPdrRepo.get());
+    pldm::responder::pdr::getRepoByType(handler.getRepo(), numericEffecterPDRs,
+                                        PLDM_NUMERIC_EFFECTER_PDR);
     if (numericEffecterPDRs.empty())
     {
         std::cerr << "The Numeric Effecter PDR repo is empty." << std::endl;
@@ -247,7 +245,7 @@
 
     // Get the pdr structure of pldm_numeric_effecter_value_pdr according
     // to the effecterId
-    PdrEntry pdrEntry{};
+    pldm::responder::pdr_utils::PdrEntry pdrEntry{};
     auto pdrRecord = numericEffecterPDRs.getFirstRecord(pdrEntry);
     while (pdrRecord)
     {
@@ -277,7 +275,7 @@
     {
         const auto& [dbusMappings, dbusValMaps] =
             handler.getDbusObjMaps(effecterId);
-        DBusMapping dbusMapping{
+        pldm::utils::DBusMapping dbusMapping{
             dbusMappings[0].objectPath, dbusMappings[0].interface,
             dbusMappings[0].propertyName, dbusMappings[0].propertyType};
 
diff --git a/libpldmresponder/platform_state_effecter.hpp b/libpldmresponder/platform_state_effecter.hpp
index 5875f13..1d8ce63 100644
--- a/libpldmresponder/platform_state_effecter.hpp
+++ b/libpldmresponder/platform_state_effecter.hpp
@@ -13,8 +13,6 @@
 #include <cstdint>
 #include <map>
 
-using namespace pldm::responder::pdr;
-
 namespace pldm
 {
 namespace responder
@@ -49,7 +47,8 @@
 
     std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)> stateEffecterPdrRepo(
         pldm_pdr_init(), pldm_pdr_destroy);
-    Repo stateEffecterPDRs(stateEffecterPdrRepo.get());
+    pldm::responder::pdr_utils::Repo stateEffecterPDRs(
+        stateEffecterPdrRepo.get());
     getRepoByType(handler.getRepo(), stateEffecterPDRs,
                   PLDM_STATE_EFFECTER_PDR);
     if (stateEffecterPDRs.empty())
@@ -58,7 +57,7 @@
         return PLDM_PLATFORM_INVALID_EFFECTER_ID;
     }
 
-    PdrEntry pdrEntry{};
+    pldm::responder::pdr_utils::PdrEntry pdrEntry{};
     auto pdrRecord = stateEffecterPDRs.getFirstRecord(pdrEntry);
     while (pdrRecord)
     {
@@ -112,7 +111,8 @@
                 break;
             }
             const DBusMapping& dbusMapping = dbusMappings[currState];
-            const StatestoDbusVal& dbusValToMap = dbusValMaps[currState];
+            const pldm::responder::pdr_utils::StatestoDbusVal& dbusValToMap =
+                dbusValMaps[currState];
 
             if (stateField[currState].set_request == PLDM_REQUEST_SET)
             {
diff --git a/libpldmresponder/platform_state_sensor.hpp b/libpldmresponder/platform_state_sensor.hpp
index 48a750a..53477ff 100644
--- a/libpldmresponder/platform_state_sensor.hpp
+++ b/libpldmresponder/platform_state_sensor.hpp
@@ -13,8 +13,6 @@
 #include <cstdint>
 #include <map>
 
-using namespace pldm::responder::pdr;
-
 namespace pldm
 {
 namespace responder
@@ -34,8 +32,9 @@
 template <class DBusInterface>
 uint8_t getStateSensorEventState(
     const DBusInterface& dBusIntf,
-    const std::map<State, pldm::utils::PropertyValue>& stateToDbusValue,
-    const DBusMapping& dbusMapping)
+    const std::map<pldm::responder::pdr_utils::State,
+                   pldm::utils::PropertyValue>& stateToDbusValue,
+    const pldm::utils::DBusMapping& dbusMapping)
 {
     try
     {
@@ -88,7 +87,7 @@
 
     std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)> stateSensorPdrRepo(
         pldm_pdr_init(), pldm_pdr_destroy);
-    Repo stateSensorPDRs(stateSensorPdrRepo.get());
+    pldm::responder::pdr_utils::Repo stateSensorPDRs(stateSensorPdrRepo.get());
     getRepoByType(handler.getRepo(), stateSensorPDRs, PLDM_STATE_SENSOR_PDR);
     if (stateSensorPDRs.empty())
     {
@@ -96,7 +95,7 @@
         return PLDM_PLATFORM_INVALID_SENSOR_ID;
     }
 
-    PdrEntry pdrEntry{};
+    pldm::responder::pdr_utils::PdrEntry pdrEntry{};
     auto pdrRecord = stateSensorPDRs.getFirstRecord(pdrEntry);
     while (pdrRecord)
     {
@@ -135,8 +134,8 @@
     int rc = PLDM_SUCCESS;
     try
     {
-        const auto& [dbusMappings, dbusValMaps] =
-            handler.getDbusObjMaps(sensorId, TypeId::PLDM_SENSOR_ID);
+        const auto& [dbusMappings, dbusValMaps] = handler.getDbusObjMaps(
+            sensorId, pldm::responder::pdr_utils::TypeId::PLDM_SENSOR_ID);
 
         stateField.clear();
         for (size_t i = 0; i < sensorRearmCnt; i++)
diff --git a/libpldmresponder/test/libpldmresponder_bios_attribute_test.cpp b/libpldmresponder/test/libpldmresponder_bios_attribute_test.cpp
index f7b9d50..305e7be 100644
--- a/libpldmresponder/test/libpldmresponder_bios_attribute_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_attribute_test.cpp
@@ -4,6 +4,7 @@
 
 #include <gtest/gtest.h>
 
+using namespace pldm::utils;
 using namespace pldm::responder::bios;
 
 class TestAttribute : public BIOSAttribute
diff --git a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
index 00ec927..da90689 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -13,6 +13,8 @@
 #include <gtest/gtest.h>
 
 using namespace pldm::bios::utils;
+using namespace pldm::responder::bios;
+using namespace pldm::utils;
 
 using ::testing::_;
 using ::testing::ElementsAreArray;
diff --git a/libpldmresponder/test/libpldmresponder_bios_enum_attribute_test.cpp b/libpldmresponder/test/libpldmresponder_bios_enum_attribute_test.cpp
index 08d960d..bb0f652 100644
--- a/libpldmresponder/test/libpldmresponder_bios_enum_attribute_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_enum_attribute_test.cpp
@@ -9,6 +9,9 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+using namespace pldm::responder::bios;
+using namespace pldm::utils;
+
 using ::testing::_;
 using ::testing::ElementsAreArray;
 using ::testing::Return;
diff --git a/libpldmresponder/test/libpldmresponder_bios_integer_attribute_test.cpp b/libpldmresponder/test/libpldmresponder_bios_integer_attribute_test.cpp
index fe1d6a8..5301c77 100644
--- a/libpldmresponder/test/libpldmresponder_bios_integer_attribute_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_integer_attribute_test.cpp
@@ -9,6 +9,9 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+using namespace pldm::utils;
+using namespace pldm::responder::bios;
+
 using ::testing::_;
 using ::testing::ElementsAreArray;
 using ::testing::Return;
diff --git a/libpldmresponder/test/libpldmresponder_bios_string_attribute_test.cpp b/libpldmresponder/test/libpldmresponder_bios_string_attribute_test.cpp
index d1c1703..c945a68 100644
--- a/libpldmresponder/test/libpldmresponder_bios_string_attribute_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_string_attribute_test.cpp
@@ -10,6 +10,7 @@
 #include <gtest/gtest.h>
 
 using namespace pldm::responder::bios;
+using namespace pldm::utils;
 using ::testing::_;
 using ::testing::ElementsAreArray;
 using ::testing::Return;
diff --git a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
index 4f3df87..cefda3a 100644
--- a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
@@ -13,6 +13,7 @@
 using namespace pldm::responder::platform;
 using namespace pldm::responder::pdr;
 using namespace pldm::responder::pdr_utils;
+using namespace pldm::utils;
 
 using ::testing::_;
 using ::testing::Return;
diff --git a/libpldmresponder/test/libpldmresponder_platform_test.cpp b/libpldmresponder/test/libpldmresponder_platform_test.cpp
index accdb60..0fb88a1 100644
--- a/libpldmresponder/test/libpldmresponder_platform_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_platform_test.cpp
@@ -13,6 +13,7 @@
 
 #include <iostream>
 
+using namespace pldm::pdr;
 using namespace pldm::utils;
 using namespace pldm::responder;
 using namespace pldm::responder::platform;
diff --git a/libpldmresponder/test/mocked_bios.hpp b/libpldmresponder/test/mocked_bios.hpp
index 6741306..c93d788 100644
--- a/libpldmresponder/test/mocked_bios.hpp
+++ b/libpldmresponder/test/mocked_bios.hpp
@@ -4,9 +4,8 @@
 #include <gtest/gtest.h>
 
 using testing::ElementsAreArray;
-using namespace pldm::responder::bios;
 
-class MockBIOSStringTable : public BIOSStringTable
+class MockBIOSStringTable : public pldm::responder::bios::BIOSStringTable
 {
   public:
     MockBIOSStringTable() : BIOSStringTable({})
@@ -17,18 +16,21 @@
     MOCK_METHOD(std::string, findString, (const uint16_t), (const override));
 };
 
-void checkHeader(const Table& attrEntry, const Table& attrValueEntry)
+void checkHeader(const pldm::responder::bios::Table& attrEntry,
+                 const pldm::responder::bios::Table& attrValueEntry)
 {
-    auto attrHeader = table::attribute::decodeHeader(
+    auto attrHeader = pldm::responder::bios::table::attribute::decodeHeader(
         reinterpret_cast<const pldm_bios_attr_table_entry*>(attrEntry.data()));
-    auto attrValueHeader = table::attribute_value::decodeHeader(
-        reinterpret_cast<const pldm_bios_attr_val_table_entry*>(
-            attrValueEntry.data()));
+    auto attrValueHeader =
+        pldm::responder::bios::table::attribute_value::decodeHeader(
+            reinterpret_cast<const pldm_bios_attr_val_table_entry*>(
+                attrValueEntry.data()));
 
     EXPECT_EQ(attrHeader.attrHandle, attrValueHeader.attrHandle);
 }
 
-void checkEntry(Table& entry, Table& expectedEntry)
+void checkEntry(pldm::responder::bios::Table& entry,
+                pldm::responder::bios::Table& expectedEntry)
 {
     /** backup the attr handle */
     auto attr0 = entry[0], eAttr0 = expectedEntry[0];
@@ -45,11 +47,12 @@
     entry[1] = attr1, expectedEntry[1] = eAttr1;
 }
 
-void checkConstructEntry(BIOSAttribute& attribute, BIOSStringTable& stringTable,
-                         Table& expectedAttrEntry,
-                         Table& expectedAttrValueEntry)
+void checkConstructEntry(pldm::responder::bios::BIOSAttribute& attribute,
+                         pldm::responder::bios::BIOSStringTable& stringTable,
+                         pldm::responder::bios::Table& expectedAttrEntry,
+                         pldm::responder::bios::Table& expectedAttrValueEntry)
 {
-    Table attrEntry, attrValueEntry;
+    pldm::responder::bios::Table attrEntry, attrValueEntry;
     attribute.constructEntry(stringTable, attrEntry, attrValueEntry);
 
     checkHeader(attrEntry, attrValueEntry);
diff --git a/oem/ibm/libpldmresponder/file_io_type_cert.cpp b/oem/ibm/libpldmresponder/file_io_type_cert.cpp
index 3fe123e..03f577a 100644
--- a/oem/ibm/libpldmresponder/file_io_type_cert.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_cert.cpp
@@ -11,6 +11,8 @@
 
 namespace pldm
 {
+using namespace utils;
+
 namespace responder
 {
 
diff --git a/oem/ibm/libpldmresponder/file_io_type_lid.hpp b/oem/ibm/libpldmresponder/file_io_type_lid.hpp
index 841099c..0853d48 100644
--- a/oem/ibm/libpldmresponder/file_io_type_lid.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_lid.hpp
@@ -13,7 +13,6 @@
 namespace responder
 {
 
-using namespace pldm::responder::dma;
 namespace fs = std::filesystem;
 
 using MarkerLIDremainingSize = uint64_t;
diff --git a/oem/ibm/libpldmresponder/file_io_type_pel.hpp b/oem/ibm/libpldmresponder/file_io_type_pel.hpp
index d495185..043454d 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pel.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pel.hpp
@@ -7,8 +7,6 @@
 namespace responder
 {
 
-using namespace pldm::responder::dma;
-
 /** @class PelHandler
  *
  *  @brief Inherits and implements FileHandler. This class is used
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index 27ce945..fe7fde0 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -15,6 +15,8 @@
 #include <fstream>
 namespace pldm
 {
+using namespace utils;
+
 namespace responder
 {
 using namespace oem_ibm_platform;
diff --git a/oem/ibm/libpldmresponder/inband_code_update.hpp b/oem/ibm/libpldmresponder/inband_code_update.hpp
index 2bd02f4..7dbc735 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.hpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.hpp
@@ -6,7 +6,6 @@
 
 #include <string>
 
-using namespace pldm::utils;
 namespace pldm
 {
 namespace responder
@@ -200,8 +199,8 @@
      * @param[in] chProperties - list of properties which have changed
      * @return - none
      */
-    void
-        processPriorityChangeNotification(const DbusChangedProps& chProperties);
+    void processPriorityChangeNotification(
+        const pldm::utils::DbusChangedProps& chProperties);
 };
 
 /* @brief Method to fetch current or next boot side
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 9b64bd9..71393cb 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -6,6 +6,10 @@
 #include "file_io_type_lid.hpp"
 #include "libpldmresponder/file_io.hpp"
 #include "libpldmresponder/pdr_utils.hpp"
+
+using namespace pldm::pdr;
+using namespace pldm::utils;
+
 namespace pldm
 {
 namespace responder
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index a713980..4a91dcc 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -52,7 +52,8 @@
   public:
     Handler(const pldm::utils::DBusHandler* dBusIntf,
             pldm::responder::CodeUpdate* codeUpdate, int mctp_fd,
-            uint8_t mctp_eid, Requester& requester, sdeventplus::Event& event,
+            uint8_t mctp_eid, pldm::dbus_api::Requester& requester,
+            sdeventplus::Event& event,
             pldm::requester::Handler<pldm::requester::Request>* handler) :
         oem_platform::Handler(dBusIntf),
         codeUpdate(codeUpdate), platformHandler(nullptr), mctp_fd(mctp_fd),
@@ -62,8 +63,9 @@
     }
 
     int getOemStateSensorReadingsHandler(
-        EntityType entityType, EntityInstance entityInstance,
-        StateSetId stateSetId, CompositeCount compSensorCnt,
+        EntityType entityType, pldm::pdr::EntityInstance entityInstance,
+        pldm::pdr::StateSetId stateSetId,
+        pldm::pdr::CompositeCount compSensorCnt,
         std::vector<get_sensor_state_field>& stateField);
 
     int oemSetStateEffecterStatesHandler(
@@ -159,7 +161,7 @@
     /** @brief reference to Requester object, primarily used to access API to
      *  obtain PLDM instance id.
      */
-    Requester& requester;
+    pldm::dbus_api::Requester& requester;
     /** @brief sdeventplus event source */
     std::unique_ptr<sdeventplus::source::Defer> assembleImageEvent;
     std::unique_ptr<sdeventplus::source::Defer> startUpdateEvent;
diff --git a/oem/ibm/requester/dbus_to_file_handler.hpp b/oem/ibm/requester/dbus_to_file_handler.hpp
index 739e864..d415d1d 100644
--- a/oem/ibm/requester/dbus_to_file_handler.hpp
+++ b/oem/ibm/requester/dbus_to_file_handler.hpp
@@ -9,8 +9,6 @@
 #include <fstream>
 #include <map>
 
-using namespace pldm::dbus_api;
-
 namespace pldm
 {
 namespace requester
diff --git a/oem/ibm/test/libpldmresponder_oem_platform_test.cpp b/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
index 8108713..b2eec24 100644
--- a/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
+++ b/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
@@ -13,6 +13,7 @@
 
 #include <iostream>
 
+using namespace pldm::dbus_api;
 using namespace pldm::utils;
 using namespace pldm::responder;
 using namespace pldm::responder::pdr;
diff --git a/pldmtool/oem/ibm/oem_ibm_state_set.hpp b/pldmtool/oem/ibm/oem_ibm_state_set.hpp
index a804ba1..74fe895 100644
--- a/pldmtool/oem/ibm/oem_ibm_state_set.hpp
+++ b/pldmtool/oem/ibm/oem_ibm_state_set.hpp
@@ -1,7 +1,5 @@
 #include "oem/ibm/libpldmresponder/oem_ibm_handler.hpp"
 
-using namespace pldm::responder::oem_ibm_platform;
-
 /** @brief PLDM OEM State Set range as per DSP0249_1.1.0 specification
  */
 enum pldm_oem_state_set_id_codes
@@ -51,7 +49,8 @@
 /** @brief Map for PLDM OEM IBM Entity Types
  */
 extern const std::map<uint8_t, std::string> OemIBMEntityType{
-    {PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE, "OEM IBM Firmware Update"},
+    {pldm::responder::oem_ibm_platform::PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE,
+     "OEM IBM Firmware Update"},
     {PLDM_OEM_ENTITY_TYPE_START, "OEM IBM Entity Type Start"},
     {PLDM_OEM_ENTITY_TYPE_END, "OEM IBM Entity Type End"},
 };
@@ -61,7 +60,8 @@
 extern const std::map<uint16_t, std::string> OemIBMstateSet{
     {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, "OEM IBM Firmware Update State"},
     {PLDM_OEM_IBM_BOOT_STATE, "OEM IBM Boot State"},
-    {PLDM_OEM_IBM_VERIFICATION_STATE, "OEM IBM Verification State"},
+    {pldm::responder::oem_ibm_platform::PLDM_OEM_IBM_VERIFICATION_STATE,
+     "OEM IBM Verification State"},
     {PLDM_OEM_IBM_SYSTEM_POWER_STATE, "OEM IBM System Power State"}};
 
 /** @brief Map for PLDM OEM IBM firmware update possible state values
@@ -98,7 +98,8 @@
  */
 extern const std::map<uint16_t, const std::map<uint8_t, std::string>>
     populateOemIBMStateMaps{
-        {PLDM_OEM_IBM_VERIFICATION_STATE, SetOemIBMVerStateValues},
+        {pldm::responder::oem_ibm_platform::PLDM_OEM_IBM_VERIFICATION_STATE,
+         SetOemIBMVerStateValues},
         {PLDM_OEM_IBM_SYSTEM_POWER_STATE, SetOemIBMSysPowerStatesValues},
         {PLDM_OEM_IBM_BOOT_STATE, SetOemIBMBootStateValues},
         {PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE, SetOemIBMFWUpdateStateValues},
diff --git a/pldmtool/pldm_bios_cmd.cpp b/pldmtool/pldm_bios_cmd.cpp
index 45d8f6e..b47a1b5 100644
--- a/pldmtool/pldm_bios_cmd.cpp
+++ b/pldmtool/pldm_bios_cmd.cpp
@@ -21,6 +21,7 @@
 
 using namespace pldmtool::helper;
 using namespace pldm::bios::utils;
+using namespace pldm::utils;
 
 std::vector<std::unique_ptr<CommandInterface>> commands;
 
diff --git a/pldmtool/pldm_cmd_helper.cpp b/pldmtool/pldm_cmd_helper.cpp
index 10e051f..0bb2941 100644
--- a/pldmtool/pldm_cmd_helper.cpp
+++ b/pldmtool/pldm_cmd_helper.cpp
@@ -11,6 +11,8 @@
 
 #include <exception>
 
+using namespace pldm::utils;
+
 namespace pldmtool
 {
 
diff --git a/pldmtool/pldm_cmd_helper.hpp b/pldmtool/pldm_cmd_helper.hpp
index bd890d9..51dcd12 100644
--- a/pldmtool/pldm_cmd_helper.hpp
+++ b/pldmtool/pldm_cmd_helper.hpp
@@ -26,7 +26,6 @@
 namespace helper
 {
 
-using namespace pldm::utils;
 constexpr uint8_t PLDM_ENTITY_ID = 8;
 constexpr uint8_t MCTP_MSG_TYPE_PLDM = 1;
 using ordered_json = nlohmann::ordered_json;
diff --git a/pldmtool/pldm_platform_cmd.cpp b/pldmtool/pldm_platform_cmd.cpp
index ce9c39f..76d8c8b 100644
--- a/pldmtool/pldm_platform_cmd.cpp
+++ b/pldmtool/pldm_platform_cmd.cpp
@@ -8,6 +8,8 @@
 #include "oem/ibm/oem_ibm_state_set.hpp"
 #endif
 
+using namespace pldm::utils;
+
 namespace pldmtool
 {
 
diff --git a/requester/handler.hpp b/requester/handler.hpp
index 1bb9cc4..2af4ade 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -62,11 +62,6 @@
 
 using ResponseHandler = fu2::unique_function<void(
     mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen)>;
-using namespace std::chrono;
-using namespace sdeventplus;
-using namespace sdeventplus::source;
-using namespace pldm::dbus_api;
-using namespace phosphor;
 
 /** @class Handler
  *
@@ -101,11 +96,12 @@
      *  @param[in] responseTimeOut - time to wait between each retry
      */
     explicit Handler(
-        int fd, Event& event, Requester& requester,
-        seconds instanceIdExpiryInterval =
-            seconds(INSTANCE_ID_EXPIRATION_INTERVAL),
+        int fd, sdeventplus::Event& event, pldm::dbus_api::Requester& requester,
+        std::chrono::seconds instanceIdExpiryInterval =
+            std::chrono::seconds(INSTANCE_ID_EXPIRATION_INTERVAL),
         uint8_t numRetries = static_cast<uint8_t>(NUMBER_OF_REQUEST_RETRIES),
-        milliseconds responseTimeOut = milliseconds(RESPONSE_TIME_OUT)) :
+        std::chrono::milliseconds responseTimeOut =
+            std::chrono::milliseconds(RESPONSE_TIME_OUT)) :
         fd(fd),
         event(event), requester(requester),
         instanceIdExpiryInterval(instanceIdExpiryInterval),
@@ -181,7 +177,8 @@
 
         try
         {
-            timer->start(duration_cast<microseconds>(instanceIdExpiryInterval));
+            timer->start(duration_cast<std::chrono::microseconds>(
+                instanceIdExpiryInterval));
         }
         catch (const std::runtime_error& e)
         {
@@ -237,19 +234,22 @@
     }
 
   private:
-    int fd;               //!< file descriptor of MCTP communications socket
-    Event& event;         //!< reference to PLDM daemon's main event loop
-    Requester& requester; //!< reference to Requester object
-    seconds instanceIdExpiryInterval; //!< Instance ID expiration interval
-    uint8_t numRetries;               //!< number of request retries
-    milliseconds responseTimeOut;     //!< time to wait between each retry
+    int fd; //!< file descriptor of MCTP communications socket
+    sdeventplus::Event& event; //!< reference to PLDM daemon's main event loop
+    pldm::dbus_api::Requester& requester; //!< reference to Requester object
+    std::chrono::seconds
+        instanceIdExpiryInterval; //!< Instance ID expiration interval
+    uint8_t numRetries;           //!< number of request retries
+    std::chrono::milliseconds
+        responseTimeOut; //!< time to wait between each retry
 
     /** @brief Container for storing the details of the PLDM request message,
      *         handler for the corresponding PLDM response and the timer object
      *         for the Instance ID expiration
      */
-    using RequestValue = std::tuple<std::unique_ptr<RequestInterface>,
-                                    ResponseHandler, std::unique_ptr<Timer>>;
+    using RequestValue =
+        std::tuple<std::unique_ptr<RequestInterface>, ResponseHandler,
+                   std::unique_ptr<phosphor::Timer>>;
 
     /** @brief Container for storing the PLDM request entries */
     std::unordered_map<RequestKey, RequestValue, RequestKeyHasher> handlers;
@@ -257,7 +257,8 @@
     /** @brief Container to store information about the request entries to be
      *         removed after the instance ID timer expires
      */
-    std::unordered_map<RequestKey, std::unique_ptr<Defer>, RequestKeyHasher>
+    std::unordered_map<RequestKey, std::unique_ptr<sdeventplus::source::Defer>,
+                       RequestKeyHasher>
         removeRequestContainer;
 
     /** @brief Remove request entry for which the instance ID expired
diff --git a/requester/request.hpp b/requester/request.hpp
index 6bb016d..f1a91d7 100644
--- a/requester/request.hpp
+++ b/requester/request.hpp
@@ -18,8 +18,6 @@
 namespace requester
 {
 
-using namespace std::chrono;
-
 /** @class RequestRetryTimer
  *
  *  The abstract base class for implementing the PLDM request retry logic. This
@@ -44,7 +42,7 @@
      *  @param[in] timeout - time to wait between each retry in milliseconds
      */
     explicit RequestRetryTimer(sdeventplus::Event& event, uint8_t numRetries,
-                               milliseconds timeout) :
+                               std::chrono::milliseconds timeout) :
 
         event(event),
         numRetries(numRetries), timeout(timeout),
@@ -67,7 +65,8 @@
         {
             if (numRetries)
             {
-                timer.start(duration_cast<microseconds>(timeout), true);
+                timer.start(duration_cast<std::chrono::microseconds>(timeout),
+                            true);
             }
         }
         catch (const std::runtime_error& e)
@@ -94,7 +93,8 @@
   protected:
     sdeventplus::Event& event; //!< reference to PLDM daemon's main event loop
     uint8_t numRetries;        //!< number of request retries
-    milliseconds timeout;  //!< time to wait between each retry in milliseconds
+    std::chrono::milliseconds
+        timeout;           //!< time to wait between each retry in milliseconds
     phosphor::Timer timer; //!< manages starting timers and handling timeouts
 
     /** @brief Sends the PLDM request message
@@ -147,7 +147,7 @@
      */
     explicit Request(int fd, mctp_eid_t eid, sdeventplus::Event& event,
                      pldm::Request&& requestMsg, uint8_t numRetries,
-                     milliseconds timeout) :
+                     std::chrono::milliseconds timeout) :
         RequestRetryTimer(event, numRetries, timeout),
         fd(fd), eid(eid), requestMsg(std::move(requestMsg))
     {}
diff --git a/requester/test/mock_request.hpp b/requester/test/mock_request.hpp
index b8e9efb..8b51a03 100644
--- a/requester/test/mock_request.hpp
+++ b/requester/test/mock_request.hpp
@@ -11,14 +11,12 @@
 namespace requester
 {
 
-using namespace std::chrono;
-
 class MockRequest : public RequestRetryTimer
 {
   public:
     MockRequest(int /*fd*/, mctp_eid_t /*eid*/, sdeventplus::Event& event,
                 pldm::Request&& /*requestMsg*/, uint8_t numRetries,
-                milliseconds responseTimeOut) :
+                std::chrono::milliseconds responseTimeOut) :
         RequestRetryTimer(event, numRetries, responseTimeOut)
     {}