From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.4708.1606792336344158995 for ; Mon, 30 Nov 2020 19:12:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=Hn+6Jld0; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0604b27a75=abner.chang@hpe.com) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B1346RO024040; Tue, 1 Dec 2020 03:12:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version; s=pps0720; bh=LhBn6NXoJtMqSwjM0/jrPQeIoIqqjIikZopx9vpA/hE=; b=Hn+6Jld0AND7iYiRsId8uVQW0hGfinKZUzVCBZn7DvW2kDDOsWFQHKBl7upNbCzLF4N5 oR2QbxnrKvCgpqPukoLMgDWQmD6UBzm1QjizC086HzEO7kOINnnX7g96ccfM67JoVm1a b9m69R05Er0wb+OaxwQ5t7b9xBnq4kHsfXNe1PaWQRl8njpRnWE/rezxk+IwbUEudvGM i7uGiwQEuhkXiH/S5ZX6zcx+oU8v8Tv/7NRIqz159uZjTolYlw3F/8nKEjqZ+n+l9Qs4 JcMtBj+SUsg7qytioo3yB1jQbf5Dz52fpy3iNrJHQGCiT3XiX6hYB4wAZBuWZpwusk2G kQ== Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 35402mek17-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Dec 2020 03:12:13 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 8291455; Tue, 1 Dec 2020 03:12:12 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 7A12145; Tue, 1 Dec 2020 03:12:10 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Andrew Fish , Laszlo Ersek , Leif Lindholm , Michael D Kinney , Nickle Wang , Peter O'Hanley Subject: [PATCH v2 0/3] jansson edk2 port Date: Tue, 1 Dec 2020 10:25:41 +0800 Message-Id: <20201201022544.14608-1-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-30_12:2020-11-30,2020-11-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 impostorscore=0 malwarescore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012010019 edk2 JSON library is based on jansson open source (https://github.com/akheron/jansson) and wrapped as an edk2 library. edk2 JsonLib will be used by edk2 Redfish feature drivers (not contributed yet) and the edk2 port of libredfish library (not contributed yet) based on DMTF GitHub (https://github.com/DMTF/libredfish). Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2). It is used in production and its API is stable. In UEFI/EDKII environment, Redfish project consumes jansson to achieve JSON operations. * Jansson version on edk2: 2.13.1 * EDKII jansson library wrapper: - JsonLib.h: This is the denifitions of EDKII JSON APIs which are mapped to jannson funcitons accordingly. - JanssonJsonLibMapping.h: This is the wrapper file to map funcitons and definitions used in native jannson applications to edk2 JsonLib. This avoids the modifications on native jannson applications to be built under edk2 environment. *Known issue: Build fail with jansson/src/load.c, overrride and add code in load.c to conditionally use stdin according to HAVE_UNISTD_H macro. The PR is submitted to jansson open source community. https://github.com/akheron/jansson/pull/558 Signed-off-by: Abner Chang Cc: Jian J Wang Cc: Hao A Wu Cc: Andrew Fish Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Michael D Kinney Cc: Nickle Wang Cc: Peter O'Hanley Abner Chang (3): edk2: jansson submodule for edk2 JSON library RedfishPkg/library: EDK2 port of jansson library RedfishPkg: Add EDK2 port of jansson library to build .gitmodules | 3 + ReadMe.rst | 1 + .../Include/Library/JanssonJsonLibMapping.h | 63 + RedfishPkg/Include/Library/JsonLib.h | 767 ++++++++++++ .../Library/JsonLib/JanssonCrtLibSupport.c | 705 +++++++++++ .../Library/JsonLib/JanssonCrtLibSupport.h | 198 +++ RedfishPkg/Library/JsonLib/JsonLib.c | 960 ++++++++++++++ RedfishPkg/Library/JsonLib/JsonLib.inf | 103 ++ RedfishPkg/Library/JsonLib/JsonUtilities.c | 417 +++++++ RedfishPkg/Library/JsonLib/JsonUtilities.h | 69 + RedfishPkg/Library/JsonLib/Readme.txt | 40 + RedfishPkg/Library/JsonLib/assert.h | 16 + RedfishPkg/Library/JsonLib/errno.h | 16 + RedfishPkg/Library/JsonLib/jansson | 1 + RedfishPkg/Library/JsonLib/jansson_config.h | 60 + .../Library/JsonLib/jansson_private_config.h | 19 + RedfishPkg/Library/JsonLib/limits.h | 16 + RedfishPkg/Library/JsonLib/load.c | 1111 +++++++++++++++++ RedfishPkg/Library/JsonLib/math.h | 16 + RedfishPkg/Library/JsonLib/stdarg.h | 15 + RedfishPkg/Library/JsonLib/stddef.h | 16 + RedfishPkg/Library/JsonLib/stdio.h | 15 + RedfishPkg/Library/JsonLib/stdlib.h | 16 + RedfishPkg/Library/JsonLib/string.h | 16 + RedfishPkg/Library/JsonLib/sys/time.h | 15 + RedfishPkg/Library/JsonLib/sys/types.h | 15 + RedfishPkg/Library/JsonLib/time.h | 15 + RedfishPkg/RedfishLibs.dsc.inc | 1 + RedfishPkg/RedfishPkg.ci.yaml | 33 +- RedfishPkg/RedfishPkg.dec | 5 + RedfishPkg/RedfishPkg.dsc | 1 + 31 files changed, 4743 insertions(+), 1 deletion(-) create mode 100644 RedfishPkg/Include/Library/JanssonJsonLibMapping.h create mode 100644 RedfishPkg/Include/Library/JsonLib.h create mode 100644 RedfishPkg/Library/JsonLib/JanssonCrtLibSupport.c create mode 100644 RedfishPkg/Library/JsonLib/JanssonCrtLibSupport.h create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf create mode 100644 RedfishPkg/Library/JsonLib/JsonUtilities.c create mode 100644 RedfishPkg/Library/JsonLib/JsonUtilities.h create mode 100644 RedfishPkg/Library/JsonLib/Readme.txt create mode 100644 RedfishPkg/Library/JsonLib/assert.h create mode 100644 RedfishPkg/Library/JsonLib/errno.h create mode 160000 RedfishPkg/Library/JsonLib/jansson create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h create mode 100644 RedfishPkg/Library/JsonLib/jansson_private_config.h create mode 100644 RedfishPkg/Library/JsonLib/limits.h create mode 100644 RedfishPkg/Library/JsonLib/load.c create mode 100644 RedfishPkg/Library/JsonLib/math.h create mode 100644 RedfishPkg/Library/JsonLib/stdarg.h create mode 100644 RedfishPkg/Library/JsonLib/stddef.h create mode 100644 RedfishPkg/Library/JsonLib/stdio.h create mode 100644 RedfishPkg/Library/JsonLib/stdlib.h create mode 100644 RedfishPkg/Library/JsonLib/string.h create mode 100644 RedfishPkg/Library/JsonLib/sys/time.h create mode 100644 RedfishPkg/Library/JsonLib/sys/types.h create mode 100644 RedfishPkg/Library/JsonLib/time.h -- 2.17.1