diff options
Diffstat (limited to 'include/ipmid/types.hpp')
-rw-r--r-- | include/ipmid/types.hpp | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp index 57c5873..3e64cb4 100644 --- a/include/ipmid/types.hpp +++ b/include/ipmid/types.hpp @@ -5,6 +5,7 @@ #include <map> #include <sdbusplus/server.hpp> #include <string> +#include <variant> namespace ipmi { @@ -15,9 +16,8 @@ using DbusInterface = std::string; using DbusObjectInfo = std::pair<DbusObjectPath, DbusService>; using DbusProperty = std::string; -using Value = sdbusplus::message::variant<bool, uint8_t, int16_t, uint16_t, - int32_t, uint32_t, int64_t, uint64_t, - double, std::string>; +using Value = std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t, + int64_t, uint64_t, double, std::string>; using PropertyMap = std::map<DbusProperty, Value>; @@ -100,7 +100,15 @@ struct GetReadingResponse constexpr auto inventoryRoot = "/xyz/openbmc_project/inventory"; -using GetSensorResponse = std::array<uint8_t, sizeof(GetReadingResponse)>; +struct GetSensorResponse +{ + uint8_t reading; // sensor reading + bool readingOrStateUnavailable; // 1 = reading/state unavailable + bool scanningEnabled; // 0 = sensor scanning disabled + bool allEventMessagesEnabled; // 0 = All Event Messages disabled + uint8_t thresholdLevelsStates; // threshold/discrete sensor states + uint8_t discreteReadingSensorStates; // discrete-only, optional states +}; using OffsetValueMap = std::map<Offset, Values>; @@ -215,12 +223,7 @@ using EntityInfoMap = std::map<Id, EntityInfo>; namespace network { -using ChannelEthMap = std::map<int, std::string>; - constexpr auto MAC_ADDRESS_FORMAT = "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"; -constexpr auto IP_ADDRESS_FORMAT = "%u.%u.%u.%u"; -constexpr auto PREFIX_FORMAT = "%hhd"; -constexpr auto ADDR_TYPE_FORMAT = "%hhx"; constexpr auto IPV4_ADDRESS_SIZE_BYTE = 4; constexpr auto IPV6_ADDRESS_SIZE_BYTE = 16; @@ -228,20 +231,6 @@ constexpr auto IPV6_ADDRESS_SIZE_BYTE = 16; constexpr auto DEFAULT_MAC_ADDRESS = "00:00:00:00:00:00"; constexpr auto DEFAULT_ADDRESS = "0.0.0.0"; -constexpr auto MAC_ADDRESS_SIZE_BYTE = 6; -constexpr auto VLAN_SIZE_BYTE = 2; -constexpr auto IPSRC_SIZE_BYTE = 1; -constexpr auto BITS_32 = 32; -constexpr auto MASK_32_BIT = 0xFFFFFFFF; -constexpr auto VLAN_ID_MASK = 0x00000FFF; -constexpr auto VLAN_ENABLE_MASK = 0x8000; - -enum class IPOrigin : uint8_t -{ - UNSPECIFIED = 0, - STATIC = 1, - DHCP = 2, -}; - } // namespace network + } // namespace ipmi |