commit | cf0c6423d30a51a59299d45582334eb6a4d3bd18 | [log] [tgz] |
---|---|---|
author | Tom Joseph <tomjoseph@in.ibm.com> | Sun Feb 10 21:37:44 2019 +0530 |
committer | Deepak Kodihalli <dkodihal@in.ibm.com> | Tue Feb 19 08:20:09 2019 -0600 |
tree | 2f866123bffea20138b0e56cfa44d108c453c2a4 | |
parent | e090e3ddbf9ffff4826723419fe86ce8b74780c0 [diff] |
Add clang format for C and C++ The libpldm is written in C and can be shared with projects other than OpenBMC. The code written in C follows the Linux kernel coding guidelines. The libpldmresponder and the application code follows the modern C++ and the clang format follows the OpenBMC coding guidelines. clang-format for each input file will try to find the .clang-format file located in the closest parent directory of the input file. Since the C code is in libpldm directory it has a specific .clang-format. Change-Id: I9346d454cb20009c6daf526d4ceb722d7400a8d1 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
At a high-level, code in this repository belongs to one of the following three components.
This is a library which deals with the encoding and decoding of PLDM messages. It should be possible to use this library by projects other than OpenBMC, and hence certain constraints apply to it:
Source files are named according to the PLDM Type, for eg base.[h/c], fru.[h/c], etc.
Given a PLDM command "foo", the library will provide the following API: For the Requester function:
encode_foo_req() - encode a foo request decode_foo_resp() - decode a response to foo
For the Responder function:
decode_foo_req() - decode a foo request encode_foo_resp() - encode a response to foo
The library also provides API to pack and unpack PLDM headers.
This library provides handlers for incoming PLDM request messages. It provides for a registration as well as a plug-in mechanism. The library is implemented in modern C++, and handles OpenBMC's platform specifics.
The handlers are of the form
Response handler(Request payload, size_t payloadLen)
Source files are named according to the PLDM Type, for eg base.[hpp/cpp], fru.[hpp/cpp], etc.
This is the PLDM daemon application that deals with various aspects of the requester and responder functions, as explained at https://github.com/openbmc/docs/blob/master/designs/pldm-stack.md.
Consider hosting libpldm above in a repo of its own, probably even outside the OpenBMC project? A separate repo would enable something like git submodule.