libpldm: Add pldm_entity_extract method
Add the pldm_entity_extract method in libpldm/pdr.h and extract
pldm entity structure explicitly.
Tested: built pldm daemon successfully and the unit test passes.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I330e0c76e75d01093148c3a432fcc18cea1d36e3
diff --git a/libpldm/pdr.h b/libpldm/pdr.h
index 0489814..24137ab 100644
--- a/libpldm/pdr.h
+++ b/libpldm/pdr.h
@@ -244,6 +244,14 @@
void pldm_entity_association_tree_visit(pldm_entity_association_tree *tree,
pldm_entity **entities, size_t *size);
+/** @brief Extract pldm entity by the pldm_entity_node
+ *
+ * @param[in] node - opaque pointer to added entity
+ *
+ * @return pldm_entity - pldm entity
+ */
+pldm_entity pldm_entity_extract(pldm_entity_node *node);
+
/** @brief Destroy entity association tree
*
* @param[in] tree - opaque pointer acting as a handle to the tree