Fix GetBIOSAttributeCurrentValueByHandle

Add certain headers to the response as per table 14
from DSP0247_1.1.0

Tested: did the same test as this commit:
8721ed6e368cb7765b59b1a3821ad59d3cc1292b, saw the
headers were added.

GetBIOSAttributeCurrentValueByHandle handle = 0x02
root@fp5280g2:/tmp# pldmtool raw --data 0x80 0x03 0x08 0x00 0x00 0x00 0x00 0x00 0x02 0x00
Encode request successfully
Request Message:
08 01 80 03 08 00 00 00 00 00 02 00
Success in creating the socket : RC = 3
Success in connecting to socket : RC = 0
Success in sending message type as pldm to mctp : RC = 0
Write to socket successful : RC = 12
Total length:12
Loopback response message:
08 01 80 03 08 00 00 00 00 00 02 00
On first recv(),response == request : RC = 0
Total length: 16
Shutdown Socket successful :  RC = 0
Response Message:
08 01 00 03 08 00 00 00 00 00 05 02 00 80 01 00

GetBIOSAttributeCurrentValueByHandle handle = 0x03
root@fp5280g2:/tmp# pldmtool raw --data 0x80 0x03 0x08 0x00 0x00 0x00 0x00 0x00 0x03 0x00
Encode request successfully
Request Message:
08 01 80 03 08 00 00 00 00 00 03 00
Success in creating the socket : RC = 3
Success in connecting to socket : RC = 0
Success in sending message type as pldm to mctp : RC = 0
Write to socket successful : RC = 12
Total length:12
Loopback response message:
08 01 80 03 08 00 00 00 00 00 03 00
On first recv(),response == request : RC = 0
Total length: 16
Shutdown Socket successful :  RC = 0
Response Message:
08 01 00 03 08 00 00 00 00 00 05 03 00 80 01 01

GetBIOSAttributeCurrentValueByHandle handle = 0x06
root@fp5280g2:/tmp# pldmtool raw --data 0x80 0x03 0x08 0x00 0x00 0x00 0x00 0x00 0x06 0x00
Encode request successfully
Request Message:
08 01 80 03 08 00 00 00 00 00 06 00
Success in creating the socket : RC = 3
Success in connecting to socket : RC = 0
Success in sending message type as pldm to mctp : RC = 0
Write to socket successful : RC = 12
Total length:12
Loopback response message:
08 01 80 03 08 00 00 00 00 00 06 00
On first recv(),response == request : RC = 0
Total length: 6
Shutdown Socket successful :  RC = 0
Response Message:
08 01 00 03 08 88

Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: If4456f7d73461e379a32d5a62f010e22565e8ad8
diff --git a/libpldm/bios_table.c b/libpldm/bios_table.c
index 6430923..e8b6607 100644
--- a/libpldm/bios_table.c
+++ b/libpldm/bios_table.c
@@ -699,30 +699,18 @@
 	return entry_length->entry_length_handler(entry);
 }
 
+size_t pldm_bios_table_attr_value_entry_length(
+    const struct pldm_bios_attr_val_table_entry *entry)
+{
+	return attr_value_table_entry_length(entry);
+}
+
 uint16_t pldm_bios_table_attr_value_entry_decode_handle(
     const struct pldm_bios_attr_val_table_entry *entry)
 {
 	return le16toh(entry->attr_handle);
 }
 
-size_t pldm_bios_table_attr_value_entry_value_length(
-    const struct pldm_bios_attr_val_table_entry *entry)
-{
-	size_t entry_length = attr_value_table_entry_length(entry);
-	size_t header_length =
-	    MEMBER_SIZE(pldm_bios_attr_val_table_entry, attr_handle) +
-	    MEMBER_SIZE(pldm_bios_attr_val_table_entry, attr_type);
-	assert(entry_length > header_length);
-
-	return (entry_length - header_length);
-}
-
-const uint8_t *pldm_bios_table_attr_value_entry_value(
-    const struct pldm_bios_attr_val_table_entry *entry)
-{
-	return entry->value;
-}
-
 static size_t pad_size_get(size_t size_without_pad)
 {
 	return ((size_without_pad % 4) ? (4 - size_without_pad % 4) : 0);
diff --git a/libpldm/bios_table.h b/libpldm/bios_table.h
index b1a7f51..8715bc7 100644
--- a/libpldm/bios_table.h
+++ b/libpldm/bios_table.h
@@ -524,18 +524,11 @@
 uint16_t pldm_bios_table_attr_value_entry_decode_handle(
     const struct pldm_bios_attr_val_table_entry *entry);
 
-/** @brief Get the value field length from the attribute value entry
+/** @brief Get the length of the attribute value entry
  *  @param[in] entry - Pointer to bios attribute value entry
- *  @return Length of the value filed
+ *  @return Length of the entry
  */
-size_t pldm_bios_table_attr_value_entry_value_length(
-    const struct pldm_bios_attr_val_table_entry *entry);
-
-/** @brief Get the value field address from the attribute value entry
- *  @param[in] entry - Pointer to bios attribute value entry
- *  @return Pointer to the value field in the attribute value entry;
- */
-const uint8_t *pldm_bios_table_attr_value_entry_value(
+size_t pldm_bios_table_attr_value_entry_length(
     const struct pldm_bios_attr_val_table_entry *entry);
 
 /** @brief Find an entry in attribute value table by handle
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index a92d3cd..3f0d4ec 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -937,16 +937,15 @@
         return ccOnlyResponse(request, PLDM_INVALID_BIOS_ATTR_HANDLE);
     }
 
-    auto valueLength = pldm_bios_table_attr_value_entry_value_length(entry);
-    auto valuePtr = pldm_bios_table_attr_value_entry_value(entry);
+    auto entryLength = pldm_bios_table_attr_value_entry_length(entry);
     Response response(sizeof(pldm_msg_hdr) +
                           PLDM_GET_BIOS_ATTR_CURR_VAL_BY_HANDLE_MIN_RESP_BYTES +
-                          valueLength,
+                          entryLength,
                       0);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
     rc = encode_get_bios_current_value_by_handle_resp(
-        request->hdr.instance_id, PLDM_SUCCESS, 0, PLDM_START_AND_END, valuePtr,
-        valueLength, responsePtr);
+        request->hdr.instance_id, PLDM_SUCCESS, 0, PLDM_START_AND_END,
+        reinterpret_cast<const uint8_t*>(entry), entryLength, responsePtr);
     if (rc != PLDM_SUCCESS)
     {
         return ccOnlyResponse(request, rc);
diff --git a/test/libpldm_bios_table_test.cpp b/test/libpldm_bios_table_test.cpp
index b573821..f1e0e56 100644
--- a/test/libpldm_bios_table_test.cpp
+++ b/test/libpldm_bios_table_test.cpp
@@ -522,10 +522,8 @@
     auto handle = pldm_bios_table_attr_value_entry_decode_handle(entry);
     EXPECT_EQ(0, handle);
 
-    auto valueLength = pldm_bios_table_attr_value_entry_value_length(entry);
-    EXPECT_EQ(5, valueLength);
-    auto value = pldm_bios_table_attr_value_entry_value(entry);
-    EXPECT_EQ(0, std::memcmp(value, stringEntry.data() + 3, valueLength));
+    auto entryLength = pldm_bios_table_attr_value_entry_length(entry);
+    EXPECT_EQ(stringEntry.size(), entryLength);
 }
 
 TEST(AttrValTable, integerEntryEncodeTest)