blob: 2b6dd0612bc16431968c4e21a8ac56d3d6a4e472 [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>>;
SunnySrivastava1984de3c60d2020-02-03 10:34:33 -060039
Deepak Kodihalli76794492017-02-16 23:48:18 -060040using namespace std::string_literals;
Deepak Kodihalli193b2282017-06-07 08:34:30 -050041constexpr auto pimPath = "/xyz/openbmc_project/inventory";
42constexpr auto pimIntf = "xyz.openbmc_project.Inventory.Manager";
Deepak Kodihalli76794492017-02-16 23:48:18 -060043
44} // namespace inventory
45
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -060046} // namespace vpd
47} // namespace openpower