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/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);