xref: /openbmc/openpower-vpd-parser/vpd-tool/include/tool_constants.hpp (revision 76eedb8eb2d59f751d537fde69445c72418c4395)
1 #pragma once
2 
3 #include <cstdint>
4 #include <string>
5 #include <vector>
6 
7 namespace vpd
8 {
9 namespace constants
10 {
11 static constexpr auto POUND_KW = '#';
12 static constexpr auto POUND_KW_PREFIX = "PD_";
13 static constexpr auto NUMERIC_KW_PREFIX = "N_";
14 
15 static constexpr auto KEYWORD_SIZE = 2;
16 static constexpr auto RECORD_SIZE = 4;
17 static constexpr auto INDENTATION = 4;
18 static constexpr auto SUCCESS = 0;
19 static constexpr auto FAILURE = -1;
20 
21 // To be explicitly used for string comparison.
22 static constexpr auto STR_CMP_SUCCESS = 0;
23 
24 constexpr auto inventoryManagerService =
25     "xyz.openbmc_project.Inventory.Manager";
26 constexpr auto baseInventoryPath = "/xyz/openbmc_project/inventory";
27 constexpr auto pimPersistPath = "/var/lib/phosphor-inventory-manager";
28 constexpr auto ipzVpdInfPrefix = "com.ibm.ipzvpd.";
29 
30 constexpr auto vpdManagerService = "com.ibm.VPD.Manager";
31 constexpr auto vpdManagerObjectPath = "/com/ibm/VPD/Manager";
32 constexpr auto vpdManagerInfName = "com.ibm.VPD.Manager";
33 constexpr auto inventoryItemInf = "xyz.openbmc_project.Inventory.Item";
34 constexpr auto viniInf = "com.ibm.ipzvpd.VINI";
35 constexpr auto xyzLocationCodeInf =
36     "xyz.openbmc_project.Inventory.Decorator.LocationCode";
37 constexpr auto assetInf = "xyz.openbmc_project.Inventory.Decorator.Asset";
38 constexpr auto objectMapperService = "xyz.openbmc_project.ObjectMapper";
39 constexpr auto objectMapperObjectPath = "/xyz/openbmc_project/object_mapper";
40 constexpr auto objectMapperInfName = "xyz.openbmc_project.ObjectMapper";
41 constexpr auto chassisStateManagerService = "xyz.openbmc_project.State.Chassis";
42 constexpr auto chassisStateManagerObjectPath =
43     "/xyz/openbmc_project/state/chassis0";
44 constexpr auto chassisStateManagerInfName = "xyz.openbmc_project.State.Chassis";
45 constexpr auto dbusService = "org.freedesktop.DBus";
46 constexpr auto dbusObjectPath = "/org/freedesktop/DBus";
47 constexpr auto dbusInterface = "org.freedesktop.DBus";
48 constexpr auto biosConfigMgrService = "xyz.openbmc_project.BIOSConfigManager";
49 constexpr auto networkInf =
50     "xyz.openbmc_project.Inventory.Item.NetworkInterface";
51 constexpr auto pcieSlotInf = "xyz.openbmc_project.Inventory.Item.PCIeSlot";
52 constexpr auto slotNumInf = "xyz.openbmc_project.Inventory.Decorator.Slot";
53 constexpr auto i2cDeviceInf =
54     "xyz.openbmc_project.Inventory.Decorator.I2CDevice";
55 constexpr auto vpdManagerProcessName = "vpd-manager";
56 constexpr auto biosConfigMgrObjPath =
57     "/xyz/openbmc_project/bios_config/manager";
58 constexpr auto biosConfigMgrInterface =
59     "xyz.openbmc_project.BIOSConfig.Manager";
60 constexpr auto waitVpdParserProcessName = "wait-vpd-parsers";
61 
62 constexpr auto KwdIM = "IM";
63 constexpr auto badVpdPath = "/var/lib/vpd/dumps";
64 
65 // Valid IM values list.
66 static std::vector<std::string> validImValues{
67     "0x50001000", "0x50001001", "0x50001002", "0x50003000", "0x50004000",
68     "0x60001000", "0x60001001", "0x60001002", "0x60002000", "0x60004000"};
69 
70 static constexpr auto VALUE_0 = 0;
71 static constexpr auto VALUE_1 = 1;
72 static constexpr auto VALUE_2 = 2;
73 static constexpr auto VALUE_3 = 3;
74 static constexpr auto VALUE_4 = 4;
75 static constexpr auto VALUE_5 = 5;
76 static constexpr auto VALUE_6 = 6;
77 static constexpr auto VALUE_7 = 7;
78 static constexpr auto VALUE_8 = 8;
79 static constexpr auto VALUE_32 = 32;
80 } // namespace constants
81 } // namespace vpd
82