summaryrefslogtreecommitdiffstats
path: root/frup.hpp
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2017-02-10 15:39:40 +0530
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-02-11 01:38:14 -0600
commit19c617b7dbbcb065b1a283e184310f60096ff180 (patch)
tree985c167d998d2f9eebd5a3b8264e88d05adcb52d /frup.hpp
parent3d0ce84bdfb68dedd1344e8ced509db49dd1a4d5 (diff)
downloadipmi-fru-parser-19c617b7dbbcb065b1a283e184310f60096ff180.zip
ipmi-fru-parser-19c617b7dbbcb065b1a283e184310f60096ff180.tar.gz
rename frup.h -> frup.hpp
This header contains c++ code. Change-Id: I4bc6cf0ddfbdc6ac4d93580a5203bb59537bbb04 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'frup.hpp')
-rw-r--r--frup.hpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/frup.hpp b/frup.hpp
new file mode 100644
index 0000000..ca5fa96
--- /dev/null
+++ b/frup.hpp
@@ -0,0 +1,84 @@
+#ifndef OPENBMC_IPMI_FRU_PARSER_H
+#define OPENBMC_IPMI_FRU_PARSER_H
+
+#include <systemd/sd-bus.h>
+#include <array>
+
+
+enum ipmi_fru_area_type
+{
+ IPMI_FRU_AREA_INTERNAL_USE = 0x00,
+ IPMI_FRU_AREA_CHASSIS_INFO,
+ IPMI_FRU_AREA_BOARD_INFO,
+ IPMI_FRU_AREA_PRODUCT_INFO,
+ IPMI_FRU_AREA_MULTI_RECORD,
+ IPMI_FRU_AREA_TYPE_MAX
+};
+
+
+enum openbmc_vpd_key_id
+{
+ OPENBMC_VPD_KEY_CHASSIS_TYPE = 1, /* not a type/len */
+ OPENBMC_VPD_KEY_CHASSIS_PART_NUM,
+ OPENBMC_VPD_KEY_CHASSIS_SERIAL_NUM,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM1,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM2,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM3,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM4,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM5,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM6,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM7,
+ OPENBMC_VPD_KEY_CHASSIS_CUSTOM8,
+ OPENBMC_VPD_KEY_CHASSIS_MAX = OPENBMC_VPD_KEY_CHASSIS_CUSTOM8,
+ /* TODO: chassis_custom_fields */
+
+ OPENBMC_VPD_KEY_BOARD_MFG_DATE, /* not a type/len */
+ OPENBMC_VPD_KEY_BOARD_MFR,
+ OPENBMC_VPD_KEY_BOARD_NAME,
+ OPENBMC_VPD_KEY_BOARD_SERIAL_NUM,
+ OPENBMC_VPD_KEY_BOARD_PART_NUM,
+ OPENBMC_VPD_KEY_BOARD_FRU_FILE_ID,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM1,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM2,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM3,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM4,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM5,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM6,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM7,
+ OPENBMC_VPD_KEY_BOARD_CUSTOM8,
+ OPENBMC_VPD_KEY_BOARD_MAX = OPENBMC_VPD_KEY_BOARD_CUSTOM8,
+ /* TODO: board_custom_fields */
+
+ OPENBMC_VPD_KEY_PRODUCT_MFR,
+ OPENBMC_VPD_KEY_PRODUCT_NAME,
+ OPENBMC_VPD_KEY_PRODUCT_PART_MODEL_NUM,
+ OPENBMC_VPD_KEY_PRODUCT_VER,
+ OPENBMC_VPD_KEY_PRODUCT_SERIAL_NUM,
+ OPENBMC_VPD_KEY_PRODUCT_ASSET_TAG,
+ OPENBMC_VPD_KEY_PRODUCT_FRU_FILE_ID,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM1,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM2,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM3,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM4,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM5,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM6,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM7,
+ OPENBMC_VPD_KEY_PRODUCT_CUSTOM8,
+ OPENBMC_VPD_KEY_PRODUCT_MAX = OPENBMC_VPD_KEY_PRODUCT_CUSTOM8,
+
+ OPENBMC_VPD_KEY_MAX,
+ OPENBMC_VPD_KEY_CUSTOM_FIELDS_MAX=8,
+
+};
+
+using IPMIFruInfo = std::array<std::pair<std::string,std::string>,
+ OPENBMC_VPD_KEY_MAX>;
+
+
+/* Parse an IPMI write fru data message into a dictionary containing name value pair of VPD entries.*/
+int parse_fru (const void* msgbuf, sd_bus_message* vpdtbl);
+
+int parse_fru_area (const uint8_t area, const void* msgbuf,
+ const size_t len, IPMIFruInfo& info);
+
+#endif
OpenPOWER on IntegriCloud