summaryrefslogtreecommitdiffstats
path: root/frup.hpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-16 17:18:43 -0700
committerPatrick Venture <venture@google.com>2018-10-17 10:50:20 -0700
commitc9508db8d33f4394e7c632b2c5cd15febaa8bf5e (patch)
treeb55c60c320363a9540da430725579910c43117fb /frup.hpp
parent0d963f5938e68e05389fb479370f5d5fe8626729 (diff)
downloadipmi-fru-parser-c9508db8d33f4394e7c632b2c5cd15febaa8bf5e.zip
ipmi-fru-parser-c9508db8d33f4394e7c632b2c5cd15febaa8bf5e.tar.gz
add clang-format
Add clang-format file. Change-Id: Ib99bbeb0ec59b5befb742dec38286c24a7f842ea Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'frup.hpp')
-rw-r--r--frup.hpp117
1 files changed, 59 insertions, 58 deletions
diff --git a/frup.hpp b/frup.hpp
index 3f68acd..0a0dd76 100644
--- a/frup.hpp
+++ b/frup.hpp
@@ -2,9 +2,10 @@
#define OPENBMC_IPMI_FRU_PARSER_H
#include <systemd/sd-bus.h>
+
#include <array>
-#include <string>
#include <map>
+#include <string>
#include <vector>
enum ipmi_fru_area_type
@@ -17,64 +18,63 @@ enum ipmi_fru_area_type
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,
+ 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>;
+using IPMIFruInfo =
+ std::array<std::pair<std::string, std::string>, OPENBMC_VPD_KEY_MAX>;
struct IPMIFruData
{
@@ -104,10 +104,11 @@ using FruInstanceVec = std::vector<FruInstance>;
using FruId = uint32_t;
using FruMap = std::map<FruId, FruInstanceVec>;
-/* 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);
+/* 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);
+int parse_fru_area(const uint8_t area, const void* msgbuf, const size_t len,
+ IPMIFruInfo& info);
#endif
OpenPOWER on IntegriCloud