pdr: Implement terminus locator PDR for BMC

This commit creates the TL PDR for the BMC. The TID and MCTP EID for
BMC is static, 1 and 8 respectively. BMC PDRs are assigned the value
of 1 for PLDMTerminusHandle. Added the parser for terminus locator
PDR in pldmtool.

Tested:

/tmp/pldmtool platform GetPdr -d 0

nextRecordHandle: 2
responseCount: 19
recordHandle: 1
PDRHeaderVersion: 1
PDRType: 1
recordChangeNumber: 0
dataLength: 9

PLDMTerminusHandle: 1
validity: valid
TID: 1
containerID: 0
terminusLocatorType: MCTP_EID
terminusLocatorValueSize: 1
EID: 8

Change-Id: I596301d6c676b450ae1f2cef872966b4c40d8bae
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/libpldm/platform.h b/libpldm/platform.h
index ed175a9..91128b7 100644
--- a/libpldm/platform.h
+++ b/libpldm/platform.h
@@ -241,6 +241,22 @@
 	PLDM_EVENT_LOGGING_REJECTED = 0x05
 };
 
+/** @brief PLDM Terminus Locator PDR validity
+ */
+enum pldm_terminus_locator_pdr_validity {
+	PLDM_TL_PDR_NOT_VALID,
+	PLDM_TL_PDR_VALID
+};
+
+/** @brief PLDM Terminus Locator type
+ */
+enum pldm_terminus_locator_type {
+	PLDM_TERMINUS_LOCATOR_TYPE_UID,
+	PLDM_TERMINUS_LOCATOR_TYPE_MCTP_EID,
+	PLDM_TERMINUS_LOCATOR_TYPE_SMBUS_RELATIVE,
+	PLDM_TERMINUS_LOCATOR_TYPE_SYS_SW
+};
+
 /** @struct pldm_pdr_hdr
  *
  *  Structure representing PLDM common PDR header
@@ -253,6 +269,30 @@
 	uint16_t length;
 } __attribute__((packed));
 
+/** @struct pldm_terminus_locator_pdr
+ *
+ *  Structure representing PLDM terminus locator PDR
+ */
+struct pldm_terminus_locator_pdr {
+	struct pldm_pdr_hdr hdr;
+	uint16_t terminus_handle;
+	uint8_t validity;
+	uint8_t tid;
+	uint16_t container_id;
+	uint8_t terminus_locator_type;
+	uint8_t terminus_locator_value_size;
+	uint8_t terminus_locator_value[1];
+} __attribute__((packed));
+
+/** @struct pldm_terminus_locator_type_mctp_eid
+ *
+ *  Structure representing terminus locator value for
+ *  terminus locator type MCTP_EID
+ */
+struct pldm_terminus_locator_type_mctp_eid {
+	uint8_t eid;
+} __attribute__((packed));
+
 /** @struct pldm_pdr_entity_association
  *
  *  Structure representing PLDM Entity Association PDR