blob: 080a976b1dcf9c6e7cb384c645947aef73c4e831 [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;
Alpana Kumari920408d2020-05-14 00:07:03 -050038using FrusMap = std::multimap<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;
Alpana Kumari3ab26a72021-04-05 19:09:19 +000044using KeywordVpdMap = std::unordered_map<std::string, kwdVpdValueTypes>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060045
Alpana Kumari65b83602020-09-01 00:24:56 -050046using systemType = std::string;
47using deviceTree = std::string;
48using deviceTreeMap = std::unordered_map<systemType, deviceTree>;
SunnySrivastava1984a20be8e2020-08-26 02:00:50 -050049using PelAdditionalData = std::map<std::string, std::string>;
SunnySrivastava19849094d4f2020-08-05 09:32:29 -050050using Keyword = std::string;
51using KeywordData = std::string;
52using DbusPropertyMap = std::unordered_map<Keyword, KeywordData>;
53using PelAdditionalData = std::map<std::string, std::string>;
54using Service = std::string;
55using MapperResponse =
56 std::map<Path, std::map<Service, std::vector<Interface>>>;
57using RestoredEeproms = std::tuple<Path, std::string, Keyword, Binary>;
SunnySrivastava19849a195542020-09-07 06:04:50 -050058using ReplaceableFrus = std::vector<VPDfilepath>;
Deepak Kodihalli76794492017-02-16 23:48:18 -060059} // namespace inventory
60
Deepak Kodihalli35c7fb12016-11-21 04:32:44 -060061} // namespace vpd
Alpana Kumari3ab26a72021-04-05 19:09:19 +000062} // namespace openpower