oem-meta: Add OEM Meta handler

Add OEM Meta class.

Change-Id: Id069d7d491819e446368d78da28a6590bfc6faa9
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Sora Su <baxiche@gmail.com>
diff --git a/meson.build b/meson.build
index 9b5b00b..d0ec1c1 100644
--- a/meson.build
+++ b/meson.build
@@ -204,6 +204,10 @@
     add_project_arguments('-DOEM_AMPERE', language: 'cpp')
 endif
 
+if get_option('oem-meta').allowed()
+    add_project_arguments('-DOEM_META', language: 'cpp')
+endif
+
 libpldmutils_headers = ['.']
 libpldmutils = library(
     'pldmutils',
@@ -242,6 +246,10 @@
     subdir('oem/ampere')
 endif
 
+if get_option('oem-meta').allowed()
+    subdir('oem/meta')
+endif
+
 if get_option('libpldmresponder').allowed()
     subdir('libpldmresponder')
     deps += [libpldmresponder_dep]
diff --git a/meson.options b/meson.options
index f49ffc0..92ba928 100644
--- a/meson.options
+++ b/meson.options
@@ -190,6 +190,14 @@
     value: 'enabled',
 )
 
+## OEM META Options
+option(
+    'oem-meta',
+    type: 'feature',
+    description: 'Enable META OEM PLDM',
+    value: 'enabled',
+)
+
 ## Default Sensor Update Interval Options
 option(
     'default-sensor-update-interval',
diff --git a/oem/meta/meson.build b/oem/meta/meson.build
new file mode 100644
index 0000000..e0b0da2
--- /dev/null
+++ b/oem/meta/meson.build
@@ -0,0 +1 @@
+oem_files += files('utils.cpp')
diff --git a/oem/meta/oem_meta.hpp b/oem/meta/oem_meta.hpp
new file mode 100644
index 0000000..dfcf4aa
--- /dev/null
+++ b/oem/meta/oem_meta.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+namespace pldm::oem_meta
+{
+
+/**
+ * @class OemMETA
+ *
+ * @brief class for creating all the OEM META handlers. Only in case
+ *        of OEM_META this class object will be instantiated
+ */
+
+class OemMETA
+{
+  public:
+    OemMETA() = default;
+    OemMETA(const OemMETA&) = delete;
+    OemMETA& operator=(const OemMETA&) = delete;
+    OemMETA(OemMETA&&) = delete;
+    OemMETA& operator=(OemMETA&&) = delete;
+};
+
+} // namespace pldm::oem_meta
diff --git a/oem/meta/utils.cpp b/oem/meta/utils.cpp
new file mode 100644
index 0000000..702cbd3
--- /dev/null
+++ b/oem/meta/utils.cpp
@@ -0,0 +1,34 @@
+#include "utils.hpp"
+
+#include "common/types.hpp"
+
+namespace pldm::oem_meta
+{
+
+namespace
+{
+
+/* @brief map PLDM TID to MCTP EID; currently, they have a one-to-one
+ *        correspondence
+ */
+eid mapTIDtoEID(const pldm_tid_t& tid)
+{
+    eid EID = static_cast<eid>(tid);
+    return EID;
+}
+
+} // namespace
+
+bool checkMetaIana(const pldm_tid_t& tid)
+{
+    [[maybe_unused]] const eid& EID = mapTIDtoEID(tid);
+    return true;
+}
+
+std::string getSlotNumberStringByTID(const pldm_tid_t& tid)
+{
+    [[maybe_unused]] const eid& EID = mapTIDtoEID(tid);
+    return std::string{"0"};
+}
+
+} // namespace pldm::oem_meta
diff --git a/oem/meta/utils.hpp b/oem/meta/utils.hpp
new file mode 100644
index 0000000..b8674e9
--- /dev/null
+++ b/oem/meta/utils.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <libpldm/base.h>
+
+#include <string>
+
+namespace pldm::oem_meta
+{
+
+/**
+ * @brief Check the IANA of the MCTP endpoint device that sent the OEM message.
+ *
+ * @param[in] tid - PLDM TID of the sender.
+ * @param[out] bool - True if the endpoint used META IANA, false otherwise.
+ */
+bool checkMetaIana(const pldm_tid_t& tid);
+
+/**
+ * @brief Get the slot number from D-Bus for the given sender tid.
+ *
+ *        - If no configurations available, it will return std::string("0").
+ *        - If any error or exception occurs during the process, it
+ *          will fall back to a hardcoded slot number based on the TID.
+ *
+ *        This function does not throw exceptions.
+ *
+ * @param[in] tid - PLDM TID of the sender.
+ * @param[out] std::string - Corresponding slot number.
+ */
+std::string getSlotNumberStringByTID(const pldm_tid_t& tid);
+
+} // namespace pldm::oem_meta