blob: f87b53ca5af74a06e8f315e2f0e2decba49b4f3e [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;
Alpana Kumari3ab26a72021-04-05 19:09:19 +000026using Value = std::variant<bool, size_t, int64_t, std::string, Binary>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060027using PropertyMap = std::map<Property, Value>;
Alpana Kumari3ab26a72021-04-05 19:09:19 +000028using kwdVpdValueTypes = std::variant<size_t, Binary>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060029
30using Interface = std::string;
31using InterfaceMap = std::map<Interface, PropertyMap>;
32
33using Object = sdbusplus::message::object_path;
34using ObjectMap = std::map<Object, InterfaceMap>;
35
SunnySrivastava1984de3c60d2020-02-03 10:34:33 -060036using VPDfilepath = std::string;
SunnySrivastava198443306542020-04-01 02:50:20 -050037using FruIsMotherboard = bool;
Santosh Puranika0b23912022-02-10 13:37:09 +053038using FrusMap =
39 std::multimap<Path, std::tuple<VPDfilepath, VPDfilepath, FruIsMotherboard>>;
SunnySrivastava1984bca5aaa2020-04-21 05:31:04 -050040using LocationCode = std::string;
SunnySrivastava19841356d7e2020-04-24 04:29:35 -050041using LocationCodeMap = std::unordered_multimap<LocationCode, Path>;
42using ListOfPaths = std::vector<sdbusplus::message::object_path>;
SunnySrivastava1984fb5815a2020-04-24 08:03:52 -050043using NodeNumber = uint16_t;
Deepak Kodihalli76794492017-02-16 23:48:18 -060044using namespace std::string_literals;
Alpana Kumari3ab26a72021-04-05 19:09:19 +000045using KeywordVpdMap = std::unordered_map<std::string, kwdVpdValueTypes>;
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>;
SunnySrivastava1984a20be8e2020-08-26 02:00:50 -050050using PelAdditionalData = std::map<std::string, std::string>;
SunnySrivastava19849094d4f2020-08-05 09:32:29 -050051using Keyword = std::string;
52using KeywordData = std::string;
53using DbusPropertyMap = std::unordered_map<Keyword, KeywordData>;
54using PelAdditionalData = std::map<std::string, std::string>;
55using Service = std::string;
56using MapperResponse =
57 std::map<Path, std::map<Service, std::vector<Interface>>>;
58using RestoredEeproms = std::tuple<Path, std::string, Keyword, Binary>;
SunnySrivastava19849a195542020-09-07 06:04:50 -050059using ReplaceableFrus = std::vector<VPDfilepath>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060060} // namespace inventory
61
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -060062} // namespace vpd
Alpana Kumari3ab26a72021-04-05 19:09:19 +000063} // namespace openpower