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; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame^] | 26 | using Value = std::variant<bool, size_t, int64_t, std::string, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 27 | using PropertyMap = std::map<Property, Value>; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame^] | 28 | using kwdVpdValueTypes = std::variant<size_t, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 29 | |
| 30 | using Interface = std::string; |
| 31 | using InterfaceMap = std::map<Interface, PropertyMap>; |
| 32 | |
| 33 | using Object = sdbusplus::message::object_path; |
| 34 | using ObjectMap = std::map<Object, InterfaceMap>; |
| 35 | |
SunnySrivastava1984 | de3c60d | 2020-02-03 10:34:33 -0600 | [diff] [blame] | 36 | using VPDfilepath = std::string; |
SunnySrivastava1984 | 4330654 | 2020-04-01 02:50:20 -0500 | [diff] [blame] | 37 | using FruIsMotherboard = bool; |
Alpana Kumari | 920408d | 2020-05-14 00:07:03 -0500 | [diff] [blame] | 38 | using FrusMap = std::multimap<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; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame^] | 44 | using KeywordVpdMap = std::unordered_map<std::string, kwdVpdValueTypes>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 45 | |
Alpana Kumari | 65b8360 | 2020-09-01 00:24:56 -0500 | [diff] [blame] | 46 | using systemType = std::string; |
| 47 | using deviceTree = std::string; |
| 48 | using deviceTreeMap = std::unordered_map<systemType, deviceTree>; |
SunnySrivastava1984 | a20be8e | 2020-08-26 02:00:50 -0500 | [diff] [blame] | 49 | using PelAdditionalData = std::map<std::string, std::string>; |
SunnySrivastava1984 | 9094d4f | 2020-08-05 09:32:29 -0500 | [diff] [blame] | 50 | using Keyword = std::string; |
| 51 | using KeywordData = std::string; |
| 52 | using DbusPropertyMap = std::unordered_map<Keyword, KeywordData>; |
| 53 | using PelAdditionalData = std::map<std::string, std::string>; |
| 54 | using Service = std::string; |
| 55 | using MapperResponse = |
| 56 | std::map<Path, std::map<Service, std::vector<Interface>>>; |
| 57 | using RestoredEeproms = std::tuple<Path, std::string, Keyword, Binary>; |
SunnySrivastava1984 | 9a19554 | 2020-09-07 06:04:50 -0500 | [diff] [blame] | 58 | using ReplaceableFrus = std::vector<VPDfilepath>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 59 | } // namespace inventory |
| 60 | |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 61 | } // namespace vpd |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame^] | 62 | } // namespace openpower |