bios: Implement an iterator for bios attribute table
Traversing bios attribute table should be platform-independent, so
implement a c-version bios attribute table iterator in libpldm, also
implement a c++ auxiliary function to traverse a bios table.
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I2afcaac306603410e711aa4772ba35b5e0b131d5
diff --git a/libpldmresponder/bios.hpp b/libpldmresponder/bios.hpp
index 9bb7d23..412e07a 100644
--- a/libpldmresponder/bios.hpp
+++ b/libpldmresponder/bios.hpp
@@ -7,10 +7,12 @@
#include <stdint.h>
+#include <functional>
#include <map>
#include <vector>
#include "libpldm/bios.h"
+#include "libpldm/bios_table.h"
namespace pldm
{
@@ -23,6 +25,12 @@
namespace responder
{
+using AttrTableEntryHandler =
+ std::function<void(const struct pldm_bios_attr_table_entry*)>;
+
+void traverseBIOSAttrTable(const bios::Table& BIOSAttrTable,
+ AttrTableEntryHandler handler);
+
namespace bios
{
/** @brief Register handlers for command from the platform spec