libpldmresponder: Implement GetFRURecordByOption

Implement handler for GetFRURecordByOption command

Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: If2bc90872b2521f1771aa800de6fbce569a5b339
diff --git a/libpldm/fru.h b/libpldm/fru.h
index 3ec9e43..3739937 100644
--- a/libpldm/fru.h
+++ b/libpldm/fru.h
@@ -20,6 +20,10 @@
 
 #define FRU_TABLE_CHECKSUM_SIZE 4
 
+enum pldm_fru_completion_codes {
+	PLDM_FRU_DATA_STRUCTURE_TABLE_UNAVAILABLE = 0x85,
+};
+
 /** @brief PLDM FRU commands
  */
 enum pldm_fru_commands {
@@ -407,6 +411,19 @@
     uint32_t *next_transfer_handle, uint8_t *transfer_flag,
     struct variable_field *fru_structure_data);
 
+/** @brief Get FRU Record Table By Option
+ *  @param[in] table - The source fru record table
+ *  @param[in] table_size - Size of the source fru record table
+ *  @param[out] record_table - Fru table fetched based on the input option
+ *  @param[in/out] record_size - Size of the table fetched by fru record option
+ *  @param[in] rsi - FRU record set identifier
+ *  @param[in] rt - FRU record type
+ *  @param[in] ft - FRU field type
+ */
+void get_fru_record_by_option(const uint8_t *table, size_t table_size,
+			      uint8_t *record_table, size_t *record_size,
+			      uint16_t rsi, uint8_t rt, uint8_t ft);
+
 #ifdef __cplusplus
 }
 #endif