Deepak Kodihalli | 7c183ae | 2017-02-20 01:13:04 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 5b8b8ac | 2018-10-20 09:09:37 -0700 | [diff] [blame] | 3 | #include <sdbusplus/message.hpp> |
Patrick Williams | cfa96af | 2023-05-10 07:50:26 -0500 | [diff] [blame] | 4 | |
| 5 | #include <map> |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 6 | #include <string> |
Alexander Amelkin | fcb1a25 | 2019-04-29 14:35:08 +0300 | [diff] [blame] | 7 | #include <variant> |
Deepak Kodihalli | 7c183ae | 2017-02-20 01:13:04 -0600 | [diff] [blame] | 8 | |
| 9 | namespace ipmi |
| 10 | { |
| 11 | namespace vpd |
| 12 | { |
| 13 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 14 | using Path = std::string; |
Deepak Kodihalli | 7c183ae | 2017-02-20 01:13:04 -0600 | [diff] [blame] | 15 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 16 | using Property = std::string; |
Alexander Amelkin | fcb1a25 | 2019-04-29 14:35:08 +0300 | [diff] [blame] | 17 | /// The Value type represents all types that are possible for a FRU info. |
| 18 | /// Most fields in a FRU info are boolean or string. There is also a |
| 19 | /// 3-byte timestamp that, being converted to unix time, fits well into |
| 20 | /// uint64_t. |
| 21 | /// |
| 22 | /// However for multirecord area records, there may be other data types, |
| 23 | /// not all of which are directly listed in IPMI FRU specification. |
| 24 | /// |
| 25 | /// Hence, this type lists all types possible for sbdusplus except for |
| 26 | /// unixfd, object_path, and signature. |
| 27 | using Value = std::variant<bool, uint8_t, uint16_t, int16_t, uint32_t, int32_t, |
| 28 | uint64_t, int64_t, double, std::string>; |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 29 | using PropertyMap = std::map<Property, Value>; |
Deepak Kodihalli | 7c183ae | 2017-02-20 01:13:04 -0600 | [diff] [blame] | 30 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 31 | using Interface = std::string; |
| 32 | using InterfaceMap = std::map<Interface, PropertyMap>; |
Deepak Kodihalli | 7c183ae | 2017-02-20 01:13:04 -0600 | [diff] [blame] | 33 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 34 | using Object = sdbusplus::message::object_path; |
| 35 | using ObjectMap = std::map<Object, InterfaceMap>; |
Deepak Kodihalli | 7c183ae | 2017-02-20 01:13:04 -0600 | [diff] [blame] | 36 | |
Patrick Venture | c9508db | 2018-10-16 17:18:43 -0700 | [diff] [blame] | 37 | } // namespace vpd |
| 38 | } // namespace ipmi |