blob: 933024fa6e28aeed9f20712a6ff6141014a4a60c [file] [log] [blame]
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -06001#pragma once
2
Patrick Venture5b8b8ac2018-10-20 09:09:37 -07003#include <sdbusplus/message.hpp>
Patrick Williamscfa96af2023-05-10 07:50:26 -05004
5#include <map>
Patrick Venturec9508db2018-10-16 17:18:43 -07006#include <string>
Alexander Amelkinfcb1a252019-04-29 14:35:08 +03007#include <variant>
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -06008
9namespace ipmi
10{
11namespace vpd
12{
13
Patrick Venturec9508db2018-10-16 17:18:43 -070014using Path = std::string;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060015
Patrick Venturec9508db2018-10-16 17:18:43 -070016using Property = std::string;
Alexander Amelkinfcb1a252019-04-29 14:35:08 +030017/// 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.
27using Value = std::variant<bool, uint8_t, uint16_t, int16_t, uint32_t, int32_t,
28 uint64_t, int64_t, double, std::string>;
Patrick Venturec9508db2018-10-16 17:18:43 -070029using PropertyMap = std::map<Property, Value>;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060030
Patrick Venturec9508db2018-10-16 17:18:43 -070031using Interface = std::string;
32using InterfaceMap = std::map<Interface, PropertyMap>;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060033
Patrick Venturec9508db2018-10-16 17:18:43 -070034using Object = sdbusplus::message::object_path;
35using ObjectMap = std::map<Object, InterfaceMap>;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060036
Patrick Venturec9508db2018-10-16 17:18:43 -070037} // namespace vpd
38} // namespace ipmi