summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/PrivateLibrary
Commit message (Collapse)AuthorAgeFilesLines
* RedfishPkg/RedfishCrtLib: fix unresolved external symbol issueNickle Wang2024-02-292-1/+43
| | | | | | | | | | | | | | | -Fix below compiler error reported in edk2 CI. ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external symbol __ftol2 -The file MathFtol.c is copied from IntrinsicLib in CryptoPkg. -Add MathFtol.c to EccCheck IgnoreFiles. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com>
* RedfishPkg/RedfishCrtLib: handle floating point number in JSONNickle Wang2024-01-151-5/+27
| | | | | | | | | | | | | | When the value type is defined as number in Redfish schema, floating point number is allowed. RedfishCrtLib raises assert without handling this case now. Follow the way in EDK2 to call AsciiStrDecimalToUintnS and handle the floating point number. Only the integer value is returned. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
* RedfishPkg/RedfishLib: return HTTP headers to callerNickle Wang2023-10-261-3/+7
| | | | | | | | | | Call Ex interface to get HTTP headers and return to caller. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
* RedfishPkg/libredfish: introduce new interfaces.Nickle Wang2023-10-264-25/+394
| | | | | | | | | | | | | - Add new interfaces to return HTTP headers back to caller. New interfaces are: getUriFromServiceEx(), patchUriFromServiceEx(), postUriFromServiceEx() and putUriFromServiceEx(). - Fix compile error in payload.c Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
* RedfishPkg/RedfishLib: introduce new interfaces.Nickle Wang2023-10-263-20/+148
| | | | | | | | | | | | Add two new interface: RedfishServiceInPayload() and RedfishPutToUri() for Redfish HTTP protocol implementation. Fix several typos and add missing JsonLib in INF file. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
* RedfishPkg: Fix SortLib library class name typo.Mike Maslenkin2023-06-301-1/+1
| | | | | | | | | BaseSortLib is the library instance name not the class name. Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com>
* RedfishPkg: Use DEBUG_MANAGEABILITYAbner Chang2023-05-313-10/+10
| | | | | | | | | | Use debug print level DEBUG_MANAGEABILITY in RedfishPkg. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com>
* RedfishPkg: Update code to be more C11 compliant by using __func__Rebecca Cran2023-04-102-3/+3
| | | | | | | | | | | | | __FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99. Since it's more standard, replace __FUNCTION__ with __func__ throughout RedfishPkg. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Nickle Wang <nicklew@nvidia.com>
* RedfishPkg: Redfish functions for REST requests are not fully spec compliedAbner Chang2022-08-233-2/+231
| | | | | | | | | | | There is no function to send POST request with the ContentType different from "application\json". There is no function to send DELETE request with the body. Cc: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nickle.wang@hpe.com> Signed-off-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
* RedfishPkg: fix memory leak issueWenyi Xie2022-03-111-9/+7
| | | | | | | | | | | The calloc memory is not free when function collectionEvalOp return in the halfway. Cc: Abner Chang <abner.chang@hpe.com> Cc: Nickle Wang <nickle.wang@hpe.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
* RedfishPkg: Apply uncrustify changesMichael Kubacki2021-12-0711-1638/+2206
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the RedfishPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
* RedfishPkg: Change OPTIONAL keyword usage styleMichael D Kinney2021-12-071-1/+1
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
* RedfishPkg/RefishCrtLib: Public RefishCrtLibAbner Chang2021-08-113-3/+3
| | | | | | | | | | Public the header file, move RefishCrtLib.h from PrivateInclude/ to Include/. RefishCrtLib.lib will be public later. (Moved out from PrivateLibrary/) Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
* RedfishPkg/Library: RedfishLibAbner Chang2021-03-1111-0/+3862
| | | | | | | | | | | | | | | | | | | | | | | | | | | | EDK2 port of DMTF libredfish project. We clone the necessary files from open source project libredfish (https://github.com/DMTF/ libredfish) tag v1.0.0 and revise it to incorporate with edk2 firmware code base. The reason of cloning the necessary files instead of using extern submodule of libredfish project: libredfish as a C library which is executed under Windows and Linux. It could be binded with other programming languages such as java and python. The library uses curl library as the communication service with Redfish, which is not easy to be abstracted and replaced with EFI specific protocols (e.g. EFI_REST_EX_PROTOCOL or payload encode/decode library) and EFI data types. We had the conversation with DMTF community and they think edk2 is a firmware solution but not the programming language, therefore they rejected to have edk2 as a binding to libredfish. According to above, we decide to clone the necessary files from libredfish modify it to incorporate with edk2. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Ting Ye <ting.ye@intel.com> Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Fan Wang <fan.wang@intel.com> Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
* RedfishPkg/RedfishCrtLib: Add more CRT functionsAbner Chang2021-02-241-1/+121
| | | | | | | | | | | | | | | | | Add more functions which were missed in the first time commit, that causes the build error with EDK2 Redfish feature driver. strerror - We don't support this on edk2 environment. strpbrk - Cloned this function from edk2-LibC File operation functions - Not supported on edk2 environment. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Nickle Wang <nickle.wang@hpe.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Nickle Wang <nickle.wang@hpe.com> Acked-by: Leif Lindholm <leif@nuviainc.com>
* RedfishPkg/RedfishCrtLib: Redfish C runtime libraryAbner Chang2021-01-092-0/+847
Redfish CRT library is currently used by edk2 JsonLib (open source jansson project) and edk2 RedfishLib (libredfish open source project). Redfish CrtLib library provides the necessary C runtime equivalent edk2 functions for open source projects. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Nickle Wang <nickle.wang@hpe.com> Cc: Peter O'Hanley <peter.ohanley@hpe.com> Reviewed-by: Nickle Wang <nickle.wang@hpe.com> Acked-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>