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.c b/libpldm/pdr.c
index 3aa9541..92ac843 100644
--- a/libpldm/pdr.c
+++ b/libpldm/pdr.c
@@ -333,6 +333,13 @@
 	return ++tree->last_used_container_id;
 }
 
+pldm_entity pldm_entity_extract(pldm_entity_node *node)
+{
+	assert(node != NULL);
+
+	return node->entity;
+}
+
 pldm_entity_association_tree *pldm_entity_association_tree_init()
 {
 	pldm_entity_association_tree *tree =