Identify cable and flett cards

Some pcieslots support both cable and flett cards. To expose
the ports corresponding to the card a list of CCINs is added
to each port's inventory path in the VPD json files. Merging
this commit will expose ports belongs to the card.

Testing:
Verified the ports corresponding to the installed card are exposed.
Here is an example output from
'busctl tree xyz.openbmc_project.Inventory.Manager':
/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10
    └─/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10
    ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector1
    ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector2
    ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector3
    └─/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector4

JSON change- https://github.ibm.com/openbmc/openbmc/pull/1577

Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com>
Change-Id: Iff011ec8244f69153a2ff987b7fe7cf354a87768
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index e71218f..cb842fa 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -957,6 +957,7 @@
     inventory::InterfaceMap interfaces;
     inventory::ObjectMap objects;
     inventory::PropertyMap prop;
+    string ccinFromVpd;
 
     // map to hold all the keywords whose value has been changed at standby
     vector<RestoredEeproms> updatedEeproms = {};
@@ -964,6 +965,10 @@
     bool isSystemVpd = (filePath == systemVpdFilePath);
     if constexpr (is_same<T, Parsed>::value)
     {
+        ccinFromVpd = getKwVal(vpdMap, "VINI", "CC");
+        transform(ccinFromVpd.begin(), ccinFromVpd.end(), ccinFromVpd.begin(),
+                  ::toupper);
+
         if (isSystemVpd)
         {
             std::vector<std::string> interfaces = {motherBoardInterface};
@@ -1009,6 +1014,24 @@
         const auto& objectPath = item["inventoryPath"];
         sdbusplus::message::object_path object(objectPath);
 
+        vector<string> ccinList;
+        if (item.find("ccin") != item.end())
+        {
+            for (const auto& cc : item["ccin"])
+            {
+                string ccin = cc;
+                transform(ccin.begin(), ccin.end(), ccin.begin(), ::toupper);
+                ccinList.push_back(ccin);
+            }
+        }
+
+        if (!ccinFromVpd.empty() && !ccinList.empty() &&
+            (find(ccinList.begin(), ccinList.end(), ccinFromVpd) ==
+             ccinList.end()))
+        {
+            continue;
+        }
+
         if (isSystemVpd)
         {
             // Populate one time properties for the system VPD and its sub-frus.