diff options
Diffstat (limited to 'src/usr/errl/plugins/errludstring.H')
-rw-r--r-- | src/usr/errl/plugins/errludstring.H | 104 |
1 files changed, 99 insertions, 5 deletions
diff --git a/src/usr/errl/plugins/errludstring.H b/src/usr/errl/plugins/errludstring.H index 51f91d5f8..9fbd185f1 100644 --- a/src/usr/errl/plugins/errludstring.H +++ b/src/usr/errl/plugins/errludstring.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -79,14 +81,106 @@ public: } } -private: - // Disabled - ErrlUserDetailsParserString(const ErrlUserDetailsParserString &); + private: + + // Parser isn't compiled with c++11 in all environments, and therefore + // "delete" of unused interfaces (like below) is not supported, nor are + // functions with move semantics + + // Disable compiler provided default functions + ErrlUserDetailsParserString( + const ErrlUserDetailsParserString &); ErrlUserDetailsParserString & operator=( const ErrlUserDetailsParserString &); + +}; + +/** + * @class ErrlUserDetailsParserStringSet + * + * Parses string set user details from an error log + */ +class ErrlUserDetailsParserStringSet : public ErrlUserDetailsParser +{ + + public: + + /** + * @brief Constructor + */ + ErrlUserDetailsParserStringSet() + { + } + + /** + * @brief Destructor + */ + virtual ~ErrlUserDetailsParserStringSet() + { + } + + /** + * @brief Parses string set user details data from an error log + * + * @param i_version Version of the data + * @param i_parse ErrlUsrParser object for outputting information + * @param i_pBuffer Pointer to buffer containing detail data + * @param i_buflen Length of the buffer + */ + virtual void parse( + errlver_t i_version, + ErrlUsrParser& i_parser, + void* i_pBuffer, + const uint32_t i_buflen) const + { + // [Input Buffer Memory Layout] + // + // The input buffer contains N sequentially packed pairs of variable + // length, NULL terminated strings, where each string pair is also + // sequentially packed and the sum of the lengths of all such pairs + // exactly equals the input buffer length. Each string pair is + // formatted as below, beginning from either the start of the buffer or + // the end of the previous string pair: + // + // Offset Size Description + // ===================================================================== + // 0 Y NULL terminated description string describing the + // significance of the string to follow, Y=strlen(this + // string) + length (1) of NULL terminator. + // Y Z NULL terminated FFDC string, where Z=strlen(this + // string) + length (1) of NULL terminator. + + const char* pBuf = static_cast<const char*>(i_pBuffer); + const size_t len = static_cast<size_t>(i_buflen); + const char* pBufEnd = pBuf + len; + while(pBuf < pBufEnd) + { + const size_t descriptionStringSize = strlen(pBuf) + 1; + const char* const pDescriptionString = pBuf; + pBuf += descriptionStringSize; + + const size_t stringSize = strlen(pBuf) + 1; + const char* const pString = pBuf; + pBuf += stringSize; + + i_parser.PrintString(pDescriptionString,pString); + } + } + + private: + + // Parser isn't compiled with c++11 in all environments, and therefore + // "delete" of unused interfaces (like below) is not supported, nor are + // functions with move semantics + + // Disable compiler provided default functions + ErrlUserDetailsParserStringSet( + const ErrlUserDetailsParserStringSet&); + ErrlUserDetailsParserStringSet & operator=( + const ErrlUserDetailsParserStringSet&); }; -} +} // End ERRLOG namespace #endif |