pdr: Add pldm_pdr_find_last_in_range()

Adds a new libpldm API to find the last PDR record from the PDR repo
based on the range of record handle values given as input. This API is
used when a record needs to be added in a particular range of record
handles to the repo that contains all PDRs (inclusive of BMC and remote
endpoints).

Change-Id: Ica5187053361b27810577a4985fab4b994d35961
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/include/libpldm/pdr.h b/include/libpldm/pdr.h
index 7542624..dc4928c 100644
--- a/include/libpldm/pdr.h
+++ b/include/libpldm/pdr.h
@@ -167,6 +167,19 @@
 void pldm_pdr_update_TL_pdr(const pldm_pdr *repo, uint16_t terminus_handle,
 			    uint8_t tid, uint8_t tl_eid, bool valid);
 
+/** @brief Find the last record within the particular range
+ * of record handles
+ *
+ *  @param[in] repo - pointer acting as a PDR repo handle
+ *  @param[in] first - first record handle value of the records in the range
+ *  @param[in] last - last record handle value of the records in the range
+ *
+ *  @return pointer to the PDR record,will be NULL if record was not
+ *  found
+ */
+pldm_pdr_record *pldm_pdr_find_last_in_range(const pldm_pdr *repo,
+					     uint32_t first, uint32_t last);
+
 /* ======================= */
 /* FRU Record Set PDR APIs */
 /* ======================= */