-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tcti-mssim: Replace liburiparser with custom key/value pair parser.
This removes our use of liburiparser with a custom key / value pair parser. The parser is implemented in the key-value-parse module under the util directory. The parser is designed to extract a series of key / value pairs where each key and value are separated by the '=' character and each pair is separated by the ',' character. The parser is composed of three parts: 1) The 'parse_key_value' function is used to extract key /value pairs separated by the '=' character. This function modifies the string by using the 'strok_r' function to extract the key and value. A reference to each is then returned to the caller using the key_value_t structure. 2) The 'parse_key_value_string' function is used to extract each key / value pair parsing the provided string on the ',' character using the same method as the 'parse_key_value' function. Each string containing a key / value pair is then passed to the 'parse_key_value' function to extract the individual components. 3) Finally the 'parse_key_value_string' function is passed a function pointer conforming to the 'KeyValueFunc' type. This function is invoked for each key / value pair extracted and is passed a reference to the key_value_t structure from the previous step. It is also passed a void pointer to some caller provided data structure which allows the callback to do something with the key / value pairs. For the purposes of the mssim TCTI we simply identify valid / invalid keys and store their values in a data structure. Once the parser is done extracting data from the provided string the mssim TCTI will either return an error indicating the configuration string was invalid, or continue initializing the TCTI based on the provided data. If a NULL configuration string is provided defaults are used. Additionally this commit: 1) Removes the check for liburiparser from the autoconf file. 2) Updates the .travis.yml file to no longer install liburiparser as a build dependency. 3) Adds unit tests for the functions described above. 4) Updates existing tests and test infrastructure to use configuration strings in the new format. 5) Updates the man page for the Tss2_Tcti_Mssim_Init fucntion to describe the new configuration string format. 6) Updates the default configuration string to use 'localhost' instead of a raw IPv4 address to make the library friendly to platforms that only support IPv6. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
- Loading branch information
Showing
13 changed files
with
592 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.