blob: c80af32338a78f20b5652838d4daa9c31585798f [file] [log] [blame]
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -06001#pragma once
2
3#include <climits>
Deepak Kodihalli76794492017-02-16 23:48:18 -06004#include <map>
5#include <sdbusplus/server.hpp>
Patrick Venturec83c4dc2018-11-01 16:29:18 -07006#include <string>
SunnySrivastava1984de3c60d2020-02-03 10:34:33 -06007#include <unordered_map>
Patrick Venturec83c4dc2018-11-01 16:29:18 -07008#include <vector>
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -06009
10namespace openpower
11{
12namespace vpd
13{
14
15/** @brief The OpenPOWER VPD, in binary, is specified as a
16 * sequence of characters */
17static_assert((8 == CHAR_BIT), "A byte is not 8 bits!");
18using Byte = uint8_t;
19using Binary = std::vector<Byte>;
20
Deepak Kodihalli76794492017-02-16 23:48:18 -060021namespace inventory
22{
23
24using Path = std::string;
25using Property = std::string;
Patrick Williamsbd070082020-06-02 14:34:03 -050026using Value = std::variant<bool, int64_t, std::string, Binary>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060027using PropertyMap = std::map<Property, Value>;
28
29using Interface = std::string;
30using InterfaceMap = std::map<Interface, PropertyMap>;
31
32using Object = sdbusplus::message::object_path;
33using ObjectMap = std::map<Object, InterfaceMap>;
34
SunnySrivastava1984de3c60d2020-02-03 10:34:33 -060035using VPDfilepath = std::string;
SunnySrivastava198443306542020-04-01 02:50:20 -050036using FruIsMotherboard = bool;
Alpana Kumari920408d2020-05-14 00:07:03 -050037using FrusMap = std::multimap<Path, std::pair<VPDfilepath, FruIsMotherboard>>;
SunnySrivastava1984bca5aaa2020-04-21 05:31:04 -050038using LocationCode = std::string;
SunnySrivastava19841356d7e2020-04-24 04:29:35 -050039using LocationCodeMap = std::unordered_multimap<LocationCode, Path>;
40using ListOfPaths = std::vector<sdbusplus::message::object_path>;
SunnySrivastava1984fb5815a2020-04-24 08:03:52 -050041using NodeNumber = uint16_t;
Deepak Kodihalli76794492017-02-16 23:48:18 -060042using namespace std::string_literals;
Deepak Kodihalli193b2282017-06-07 08:34:30 -050043constexpr auto pimPath = "/xyz/openbmc_project/inventory";
44constexpr auto pimIntf = "xyz.openbmc_project.Inventory.Manager";
SunnySrivastava1984945a02d2020-05-06 01:55:41 -050045using KeywordVpdMap = std::unordered_map<std::string, Binary>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060046
Alpana Kumari65b83602020-09-01 00:24:56 -050047using systemType = std::string;
48using deviceTree = std::string;
49using deviceTreeMap = std::unordered_map<systemType, deviceTree>;
50
Deepak Kodihalli76794492017-02-16 23:48:18 -060051} // namespace inventory
52
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -060053} // namespace vpd
54} // namespace openpower