xref: /openbmc/ipmi-fru-parser/types.hpp (revision cfa96afa9a830d0fe9bd96816f8e91add8fd66e5)
1 #pragma once
2 
3 #include <sdbusplus/message.hpp>
4 
5 #include <map>
6 #include <string>
7 #include <variant>
8 
9 namespace ipmi
10 {
11 namespace vpd
12 {
13 
14 using Path = std::string;
15 
16 using Property = std::string;
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>;
29 using PropertyMap = std::map<Property, Value>;
30 
31 using Interface = std::string;
32 using InterfaceMap = std::map<Interface, PropertyMap>;
33 
34 using Object = sdbusplus::message::object_path;
35 using ObjectMap = std::map<Object, InterfaceMap>;
36 
37 } // namespace vpd
38 } // namespace ipmi
39