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>; |
Santosh Puranik | f2d3b53 | 2022-04-19 06:44:07 -0500 | [diff] [blame] | 20 | using BIOSAttrValueType = std::variant<int64_t, std::string>; |
| 21 | using PendingBIOSAttrItemType = |
| 22 | std::pair<std::string, std::tuple<std::string, BIOSAttrValueType>>; |
| 23 | using PendingBIOSAttrsType = std::vector<PendingBIOSAttrItemType>; |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 24 | |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 25 | namespace inventory |
| 26 | { |
| 27 | |
| 28 | using Path = std::string; |
| 29 | using Property = std::string; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 30 | using Value = std::variant<bool, size_t, int64_t, std::string, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 31 | using PropertyMap = std::map<Property, Value>; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 32 | using kwdVpdValueTypes = std::variant<size_t, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 33 | |
| 34 | using Interface = std::string; |
| 35 | using InterfaceMap = std::map<Interface, PropertyMap>; |
| 36 | |
| 37 | using Object = sdbusplus::message::object_path; |
| 38 | using ObjectMap = std::map<Object, InterfaceMap>; |
| 39 | |
SunnySrivastava1984 | de3c60d | 2020-02-03 10:34:33 -0600 | [diff] [blame] | 40 | using VPDfilepath = std::string; |
SunnySrivastava1984 | 4330654 | 2020-04-01 02:50:20 -0500 | [diff] [blame] | 41 | using FruIsMotherboard = bool; |
Santosh Puranik | a0b2391 | 2022-02-10 13:37:09 +0530 | [diff] [blame] | 42 | using FrusMap = |
| 43 | std::multimap<Path, std::tuple<VPDfilepath, VPDfilepath, FruIsMotherboard>>; |
SunnySrivastava1984 | bca5aaa | 2020-04-21 05:31:04 -0500 | [diff] [blame] | 44 | using LocationCode = std::string; |
SunnySrivastava1984 | 1356d7e | 2020-04-24 04:29:35 -0500 | [diff] [blame] | 45 | using LocationCodeMap = std::unordered_multimap<LocationCode, Path>; |
| 46 | using ListOfPaths = std::vector<sdbusplus::message::object_path>; |
SunnySrivastava1984 | fb5815a | 2020-04-24 08:03:52 -0500 | [diff] [blame] | 47 | using NodeNumber = uint16_t; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 48 | using namespace std::string_literals; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 49 | using KeywordVpdMap = std::unordered_map<std::string, kwdVpdValueTypes>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 50 | |
Alpana Kumari | 65b8360 | 2020-09-01 00:24:56 -0500 | [diff] [blame] | 51 | using systemType = std::string; |
| 52 | using deviceTree = std::string; |
| 53 | using deviceTreeMap = std::unordered_map<systemType, deviceTree>; |
SunnySrivastava1984 | a20be8e | 2020-08-26 02:00:50 -0500 | [diff] [blame] | 54 | using PelAdditionalData = std::map<std::string, std::string>; |
SunnySrivastava1984 | 9094d4f | 2020-08-05 09:32:29 -0500 | [diff] [blame] | 55 | using Keyword = std::string; |
| 56 | using KeywordData = std::string; |
| 57 | using DbusPropertyMap = std::unordered_map<Keyword, KeywordData>; |
| 58 | using PelAdditionalData = std::map<std::string, std::string>; |
| 59 | using Service = std::string; |
| 60 | using MapperResponse = |
| 61 | std::map<Path, std::map<Service, std::vector<Interface>>>; |
| 62 | using RestoredEeproms = std::tuple<Path, std::string, Keyword, Binary>; |
SunnySrivastava1984 | 9a19554 | 2020-09-07 06:04:50 -0500 | [diff] [blame] | 63 | using ReplaceableFrus = std::vector<VPDfilepath>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 64 | } // namespace inventory |
| 65 | |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 66 | } // namespace vpd |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 67 | } // namespace openpower |