blob: 5ff29593200847337163569e17e2ef6debfc5968 [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;
SunnySrivastava19841356d7e2020-04-24 04:29:35 -050040using LocationCodeMap = std::unordered_multimap<LocationCode, Path>;
41using ListOfPaths = std::vector<sdbusplus::message::object_path>;
SunnySrivastava1984fb5815a2020-04-24 08:03:52 -050042using NodeNumber = uint16_t;
Deepak Kodihalli76794492017-02-16 23:48:18 -060043using namespace std::string_literals;
Deepak Kodihalli193b2282017-06-07 08:34:30 -050044constexpr auto pimPath = "/xyz/openbmc_project/inventory";
45constexpr auto pimIntf = "xyz.openbmc_project.Inventory.Manager";
SunnySrivastava1984945a02d2020-05-06 01:55:41 -050046using KeywordVpdMap = std::unordered_map<std::string, Binary>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060047
48} // namespace inventory
49
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -060050} // namespace vpd
51} // namespace openpower