[VOL-4676]:
Initial Framework for reading SFP capabilities by reading the EEPROM data.
Use the detected SFP data to derive the MAC and PON system mode.
Make the SFP EEPROM read mode configurable per platform through the
DYNAMIC_PON_TRX_SUPPORT '#define' defined in the platform vendor.h file.

Change-Id: I07d7763371d2f804a1e93ca38646b1a30198f8ee
diff --git a/agent/src/core_utils.cc b/agent/src/core_utils.cc
index af3f7ad..dafc68c 100644
--- a/agent/src/core_utils.cc
+++ b/agent/src/core_utils.cc
@@ -1979,3 +1979,27 @@
         return false;
     }
 }
+
+pair<string, bool> hex_to_ascii_string(unsigned char* ptr, int length) {
+    // initialize the ASCII code string as empty.
+    string ascii = "";
+    for (size_t i = 0; i < length; i ++)
+    {
+        string part = string(1,ptr[i]);
+        ascii += part;
+    }
+    return {ascii, true};
+}
+
+pair<uint32_t, bool> hex_to_uinteger(unsigned char *ptr, int length) {
+    if (length > 8) {
+        perror("invalid length of bytes for conversion to uint\n");
+        return {0, false};
+    }
+    uint32_t res = 0;
+    for (int i = 0; i < length; i++)
+    {
+        res = uint32_t(ptr[i]) * pow(2, (length - 1 - i) * 8) + res;
+    }
+    return {res, true};
+}