pldmtool : File table parsing
This commit implements parsing of the file attribute
table by issuing the GetFileTable command with the
-t option which specifies the pldm file table type.
Tested:
./pldmtool oem-ibm -h
oem type command
Usage: ./pldmtool oem-ibm [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
Subcommands:
GetAlertStatus get alert status descriptor
GetFileTable get file table
./pldmtool oem-ibm GetFileTable
Request Message:
08 01 80 3f 01 00 00 00 00 01 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 = 11
Total length:71
Shutdown Socket successful : RC = 0
Response Message:
08 01 00 3f 01 00 00 00 00 00 05 00 00 00 00 0a 00 50 48 59 50 2d 4e 56 52 41 4d 00 b0 10 01 01 00 00 00 01 00 00 00 10 00 50 48 59 50 2d 4e 56 52 41 4d 2d 43 4b 53 55 4d 10 00 00 00 04 00 00 00 00 00 87 55 62 3e
FileHandle[0]:0
FileNameLength[0]:10
FileName[0]:PHYP-NVRAM
FileSize[0]:17870848
FileTraits[0]:1
FileHandle[1]:1
FileNameLength[1]:16
FileName[1]:PHYP-NVRAM-CKSUM
FileSize[1]:16
FileTraits[1]:4
Change-Id: I44de4dd33fee42df7cdc67eaaddf259ea83346ae
Signed-off-by: Pavithra Barithaya <pbaritha@in.ibm.com>
diff --git a/oem/ibm/libpldm/file_io.h b/oem/ibm/libpldm/file_io.h
index 38e50ca..2aa7bd4 100644
--- a/oem/ibm/libpldm/file_io.h
+++ b/oem/ibm/libpldm/file_io.h
@@ -178,6 +178,16 @@
uint8_t table_data[1]; //!< Table Data
} __attribute__((packed));
+/** @struct pldm_file_attr_table_entry
+ *
+ * Structure representing File attribute table entry
+ */
+struct pldm_file_attr_table_entry {
+ uint32_t file_handle; //!< File Handle
+ uint16_t file_name_length; //!< File name length
+ uint8_t file_attr_table_nst[1]; //!< File name size traits
+} __attribute__((packed));
+
/** @brief Decode GetFileTable command request data
*
* @param[in] msg - Pointer to PLDM request message