blob: bab4569b1589e7da147eed81545c736bd4668c19 [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;
37using FrusMap =
38 std::unordered_map<Path, std::pair<VPDfilepath, FruIsMotherboard>>;
SunnySrivastava1984bca5aaa2020-04-21 05:31:04 -050039using LocationCode = std::string;
40using LocationCodeMap = std::unordered_map<Path, LocationCode>;
SunnySrivastava1984de3c60d2020-02-03 10:34:33 -060041
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";
Deepak Kodihalli76794492017-02-16 23:48:18 -060045
46} // namespace inventory
47
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -060048} // namespace vpd
49} // namespace openpower