Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <climits> |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 4 | #include <map> |
| 5 | #include <sdbusplus/server.hpp> |
Patrick Venture | c83c4dc | 2018-11-01 16:29:18 -0700 | [diff] [blame] | 6 | #include <string> |
SunnySrivastava1984 | de3c60d | 2020-02-03 10:34:33 -0600 | [diff] [blame] | 7 | #include <unordered_map> |
Patrick Venture | c83c4dc | 2018-11-01 16:29:18 -0700 | [diff] [blame] | 8 | #include <vector> |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 9 | |
| 10 | namespace openpower |
| 11 | { |
| 12 | namespace vpd |
| 13 | { |
| 14 | |
| 15 | /** @brief The OpenPOWER VPD, in binary, is specified as a |
| 16 | * sequence of characters */ |
| 17 | static_assert((8 == CHAR_BIT), "A byte is not 8 bits!"); |
| 18 | using Byte = uint8_t; |
| 19 | using Binary = std::vector<Byte>; |
| 20 | |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 21 | namespace inventory |
| 22 | { |
| 23 | |
| 24 | using Path = std::string; |
| 25 | using Property = std::string; |
Patrick Williams | bd07008 | 2020-06-02 14:34:03 -0500 | [diff] [blame] | 26 | using Value = std::variant<bool, int64_t, std::string, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 27 | using PropertyMap = std::map<Property, Value>; |
| 28 | |
| 29 | using Interface = std::string; |
| 30 | using InterfaceMap = std::map<Interface, PropertyMap>; |
| 31 | |
| 32 | using Object = sdbusplus::message::object_path; |
| 33 | using ObjectMap = std::map<Object, InterfaceMap>; |
| 34 | |
SunnySrivastava1984 | de3c60d | 2020-02-03 10:34:33 -0600 | [diff] [blame] | 35 | using VPDfilepath = std::string; |
SunnySrivastava1984 | 4330654 | 2020-04-01 02:50:20 -0500 | [diff] [blame] | 36 | using FruIsMotherboard = bool; |
| 37 | using FrusMap = |
| 38 | std::unordered_map<Path, std::pair<VPDfilepath, FruIsMotherboard>>; |
SunnySrivastava1984 | bca5aaa | 2020-04-21 05:31:04 -0500 | [diff] [blame] | 39 | using LocationCode = std::string; |
SunnySrivastava1984 | 1356d7e | 2020-04-24 04:29:35 -0500 | [diff] [blame] | 40 | using LocationCodeMap = std::unordered_multimap<LocationCode, Path>; |
| 41 | using ListOfPaths = std::vector<sdbusplus::message::object_path>; |
SunnySrivastava1984 | fb5815a | 2020-04-24 08:03:52 -0500 | [diff] [blame] | 42 | using NodeNumber = uint16_t; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 43 | using namespace std::string_literals; |
Deepak Kodihalli | 193b228 | 2017-06-07 08:34:30 -0500 | [diff] [blame] | 44 | constexpr auto pimPath = "/xyz/openbmc_project/inventory"; |
| 45 | constexpr auto pimIntf = "xyz.openbmc_project.Inventory.Manager"; |
SunnySrivastava1984 | 945a02d | 2020-05-06 01:55:41 -0500 | [diff] [blame] | 46 | using KeywordVpdMap = std::unordered_map<std::string, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 47 | |
| 48 | } // namespace inventory |
| 49 | |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 50 | } // namespace vpd |
| 51 | } // namespace openpower |