blob: 46abfe02c1347a5135495a898c88ebe420cc5754 [file] [log] [blame]
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -06001#pragma once
2
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -06003#include <map>
Patrick Venture5b8b8ac2018-10-20 09:09:37 -07004#include <sdbusplus/message.hpp>
Patrick Venturec9508db2018-10-16 17:18:43 -07005#include <string>
Alexander Amelkinfcb1a252019-04-29 14:35:08 +03006#include <variant>
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -06007
8namespace ipmi
9{
10namespace vpd
11{
12
Patrick Venturec9508db2018-10-16 17:18:43 -070013using Path = std::string;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060014
Patrick Venturec9508db2018-10-16 17:18:43 -070015using Property = std::string;
Alexander Amelkinfcb1a252019-04-29 14:35:08 +030016/// The Value type represents all types that are possible for a FRU info.
17/// Most fields in a FRU info are boolean or string. There is also a
18/// 3-byte timestamp that, being converted to unix time, fits well into
19/// uint64_t.
20///
21/// However for multirecord area records, there may be other data types,
22/// not all of which are directly listed in IPMI FRU specification.
23///
24/// Hence, this type lists all types possible for sbdusplus except for
25/// unixfd, object_path, and signature.
26using Value = std::variant<bool, uint8_t, uint16_t, int16_t, uint32_t, int32_t,
27 uint64_t, int64_t, double, std::string>;
Patrick Venturec9508db2018-10-16 17:18:43 -070028using PropertyMap = std::map<Property, Value>;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060029
Patrick Venturec9508db2018-10-16 17:18:43 -070030using Interface = std::string;
31using InterfaceMap = std::map<Interface, PropertyMap>;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060032
Patrick Venturec9508db2018-10-16 17:18:43 -070033using Object = sdbusplus::message::object_path;
34using ObjectMap = std::map<Object, InterfaceMap>;
Deepak Kodihalli7c183ae2017-02-20 01:13:04 -060035
Patrick Venturec9508db2018-10-16 17:18:43 -070036} // namespace vpd
37} // namespace ipmi