summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-05-10 10:43:03 -0500
committerMatt Spinler <spinler@us.ibm.com>2018-05-10 11:22:04 -0500
commitcfbb1ffbfbc76d2bd695cba540efaa08b007aeab (patch)
tree251e9e72a2c2aaaa2c941d0376e15e168ec1398e
parent7b9c205f3e4c8237ebf85951a597de2682b8bd93 (diff)
downloadopenpower-vpd-parser-cfbb1ffbfbc76d2bd695cba540efaa08b007aeab.tar.gz
openpower-vpd-parser-cfbb1ffbfbc76d2bd695cba540efaa08b007aeab.zip
Add support for new keywords
Add support for the VS and VP keywords. These are the serial number and part number keywords for OpenPower systems. Change-Id: If22c99b3e6c36649e6a2d4afffe8318cf8fc493c Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--defines.hpp16
-rw-r--r--impl.cpp4
2 files changed, 18 insertions, 2 deletions
diff --git a/defines.hpp b/defines.hpp
index 84ddae3..dda0530 100644
--- a/defines.hpp
+++ b/defines.hpp
@@ -53,7 +53,9 @@ enum class Keyword
VN, /**< FRU manufacturer name */
MB, /**< FRU manufacture date */
MM, /**< FRU model */
- UD /**< System UUID */
+ UD, /**< System UUID */
+ VS, /**< OpenPower serial number */
+ VP /**< OpenPower part number */
};
/** @brief Convert VPD Keyword name from enum to string
@@ -123,6 +125,18 @@ constexpr const char* getKeyword<Keyword::UD>()
return "UD";
}
+template<>
+constexpr const char* getKeyword<Keyword::VS>()
+{
+ return "VS";
+}
+
+template<>
+constexpr const char* getKeyword<Keyword::VP>()
+{
+ return "VP";
+}
+
} // namespace record
/** @brief FRUs whose VPD we're interested in
diff --git a/impl.cpp b/impl.cpp
index 7ac147d..925b693 100644
--- a/impl.cpp
+++ b/impl.cpp
@@ -43,7 +43,9 @@ static const std::unordered_map<std::string,
{"VN", std::make_tuple(record::Keyword::VN, keyword::Encoding::ASCII)},
{"MB", std::make_tuple(record::Keyword::MB, keyword::Encoding::RAW)},
{"MM", std::make_tuple(record::Keyword::MM, keyword::Encoding::ASCII)},
- {"UD", std::make_tuple(record::Keyword::UD, keyword::Encoding::UD)}
+ {"UD", std::make_tuple(record::Keyword::UD, keyword::Encoding::UD)},
+ {"VP", std::make_tuple(record::Keyword::VP, keyword::Encoding::ASCII)},
+ {"VS", std::make_tuple(record::Keyword::VS, keyword::Encoding::ASCII)},
};
namespace
OpenPOWER on IntegriCloud