From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.6095.1606974155316647802 for ; Wed, 02 Dec 2020 21:42:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=AhbvWgST; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0606acebf5=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B35gW0F008894; Thu, 3 Dec 2020 05:42:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=+M7W3HtMBSnFL4praEBNR06Xz4Kn37PS1OW57PDWCmE=; b=AhbvWgSTcq05cnBImoUK7iNVtqNEjaJWgp14q18wtIDpMzndMx5yhJHQHUOvZl2Jj/MK HH4DEBtBxgN7wwKKR+pPMIkgj0DNbB4a1retZnZ8XTKlXO+6C/9tMS8t7TtCS6jBNLeh d6ZcX7weq2RwamN31VegmWN/uJzf3g/uF2tDqCmn7834zxXcy8FAq5jusNWZSHW1orXv oM1Bxe/Op+FVRKgatd0gyYiZdq+jKkV/+o9pRsbzI/i1KL8fjf+wa8neSg27MBIPm4Ic Tk+ZDCNYZdECoWojzQC6E0xhRcY8+p+ZtPZddivi/shV3UBYLNZLR7ke7HC6k2IudweK 2w== Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 355rn2pge7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Dec 2020 05:42:32 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 601C5B1; Thu, 3 Dec 2020 05:42:31 +0000 (UTC) Received: from G4W9326.americas.hpqcorp.net (16.208.32.96) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Dec 2020 05:41:37 +0000 Received: from G9W9210.americas.hpqcorp.net (2002:10dc:429b::10dc:429b) by G4W9326.americas.hpqcorp.net (2002:10d0:2060::10d0:2060) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Dec 2020 05:41:37 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.241.52.12) by G9W9210.americas.hpqcorp.net (16.220.66.155) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 3 Dec 2020 05:41:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W2HhQiiCtxEQ7NaZsWVKYq7W3IlQ5slDqHBWn3VQm2wt9KiRrOQZX9twM/9pOBOYiKgKXurSFKgboUv8ZSVooxjfGou4phQ+ZzNccqqsq8kPYDjG1sJqls3PXxLolrWsCiKQCBkTXwkGiK6LIvDPlcV/DCRE6JijtzqGVgQFJl4xCRPY8R+UjmO6UK/uka/6e1q4sbx+4j3FXdFM63qqvQPMyxivroBB6DM1D98eIX56JVjg2kurNm1+2d9KKpB2L0CZy/+tt8SMqJ8L8qj9P5kGQuBOhGLna6q2bl0VVWvWjKK4xyv2fZdqegczdjmgAexxiwZnAZsCNPcYfBmy6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qOVIHz+Txm8C1RX7MPu98ippR5UKMIVUqNEznVWRP1U=; b=eV2RnEbDX3EtiHilLQ+iyC6HaOQAs9Sf5+ZUUQIHcaxpcg0wbALsemowvy5dOuvmeTW8mEbvkOrIV0DojnYAq4H0PrrFjM4CXiZI1IqiwI0C4bGw6JXk61f9r1mQdZ31Ry46cu405phmtJol4s+ISSwAaoKVPYxQXMpH9crz/c6FekBRUU72f0poTmXD216FCO2rXBsUK6kC529JtULuybUD3iSCP0/lj6H+sN2gesqiGrhc5SVc41grOI7WZRZlERXqTA2lNniuj5ue9d86+36IcNkLTGAC9Y/GGhStr1wsKTG2uPlhHNSnunfAo34dVoDv+sLKhTsJnvaHYNSvTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7508::16) by CS1PR8401MB0837.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:750e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.18; Thu, 3 Dec 2020 05:41:35 +0000 Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::a094:ed67:fb40:340e]) by CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::a094:ed67:fb40:340e%10]) with mapi id 15.20.3611.025; Thu, 3 Dec 2020 05:41:35 +0000 From: "Abner Chang" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Justen, Jordan L" , Andrew Fish , "Wang, Nickle (HPS SW)" , "O'Hanley, Peter (EXL)" Subject: Re: [edk2-devel] [Platform Redfish Host Interface PATCH 4/6] EmulatorPkg/Application: Publish Redfish Host Interface Record Thread-Topic: [edk2-devel] [Platform Redfish Host Interface PATCH 4/6] EmulatorPkg/Application: Publish Redfish Host Interface Record Thread-Index: AQHWs4fo8H9h1mRnSEK1HYCJp2rALanlAk0AgAADT0A= Date: Thu, 3 Dec 2020 05:41:35 +0000 Message-ID: References: <20201105143853.2180-1-abner.chang@hpe.com> <1644A5FE1ACD3DCB.8528@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=hpe.com; x-originating-ip: [16.242.247.131] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0c645f31-442c-4176-6547-08d8974e1901 x-ms-traffictypediagnostic: CS1PR8401MB0837: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:972; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sq3bQRoCz1FyTOmX1rt+UivRbz4rSNUSyDwb0TRTYW44+5UHD19oVKhWDD1FNURJaBStf8WjVg1gwMvZNXP10s8uMt9kuORzsh0jt0yxgxDJW3bizSdYtvF/xom95JA7YkkaBh13RO98oP+xJNyTYRDvPZeOSSkhns0leBcwFH1kAZbkL8qEAQx61asuroq3s3djj2Ic5UwMNjyS7p7qpzDBh0B35pWz7URK0vdkD2b6mm7yJPmp1CijHVENkrbwHrstAIxLg3NjgYouPgSgj5t0XiHWOkXGYz80EyfK5LN5iN50A6RCr40mWivrCUSU0GeyJn/4gwTCbruesIaUtkRFvvuVMNT+bSIyyxHDZteaLDu/vlB6fut9cGLl8LrHjwAHbsPsfzZa8bLLPaw4Jw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(136003)(346002)(366004)(376002)(396003)(39860400002)(316002)(8936002)(186003)(76116006)(9686003)(26005)(83380400001)(55016002)(52536014)(7696005)(2906002)(53546011)(6506007)(66556008)(66946007)(66446008)(66476007)(64756008)(966005)(478600001)(5660300002)(8676002)(4326008)(54906003)(19627235002)(110136005)(71200400001)(33656002)(86362001)(30864003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?0CHLCj07iduXt1YnMDnGY6jgJWBHWlwZs8m5oJpUc0EtxO3GIxGoN7SwDjUp?= =?us-ascii?Q?SQQX9OusmJGJ9rSdYRmfiet8gt0hsqhe7P2ziK02Y0akkFeWruyEsLlkEEwW?= =?us-ascii?Q?m3KwzJ6MgVs+5MjMp6J2JkCsn0bmMB7LPNvbXCX2tg1E7eeEXHyjHUb+LbJ4?= =?us-ascii?Q?D4JmTioMnyySeWUfe/5RHmi7BePr643RmwvbIt8NMyC3z0KyqutgCwK7emm9?= =?us-ascii?Q?RnmXM2AhJ1vI6/zh8AK+wEw+Ssfp8GnmOJcG0Xa4rJ0GnC+KTEzYll+SaK2T?= =?us-ascii?Q?G3fqJD5dtWePkdBSul+H31hCmHyp34hwfpRxODoz5kYNSwkVuWWiQsRJKKNv?= =?us-ascii?Q?yAvCcXzr/6Fciy6LtC3FhoU3bbP9I/L71GvPdlhsGuzXapET69Gx1Q2SSF1a?= =?us-ascii?Q?W8ggcO7+iY/ZyAMZhmEoykqB8R2oVbsJiNwZyzjKGg7GoBQepqGzkeXA5gkL?= =?us-ascii?Q?J6UrmObAiLVaADKOmltULoVkP/kigvaxnZUy4RrhE7GDWLTFOSPXb3SQ2JOE?= =?us-ascii?Q?AxBDV2elJP4Ib22nuJM6x6bwuKwvaZCW62eTIFb/TAfHhYJhd/S7OfSAeK9l?= =?us-ascii?Q?tlwcgAwww/RHQP2hRrpdPkSZW9P35+ueW0DBDPRifa+Rm/ECebBaJUNz8q6+?= =?us-ascii?Q?ECtBhVEj3NkadZjg+p3WvIOTkTf9b1mc4UEt5FbsBlzyWBRpTVSaqDEiJGg0?= =?us-ascii?Q?BSjK3hX2OldTxRl5jURb0OZx2zh9m1E4v5tXTFQ5rcZDSGTCDCU7N/4ptKbn?= =?us-ascii?Q?fe9qqW5DswqJ0dQNhz2NV96QBnAjFu7oVXF+14p51Ja3uE9VFC51OiXI5TP+?= =?us-ascii?Q?47IK5+2OHR5d+2EIBlE2XThQ+mcw9J1kgSjvo00WJphuWU55F0da1SM2U/lF?= =?us-ascii?Q?Vi3q2+eaYxh+cS7jo5lb4pMFYUbiCHmvnD8vRXCDGoh+0FW3NIjhW+qRegK5?= =?us-ascii?Q?Kc7KaNvJ+ipPFuwf8DiTNsHzPZ2Qr+q8SrXhgvM3Lu0=3D?= X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 0c645f31-442c-4176-6547-08d8974e1901 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2020 05:41:35.4960 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KVCijoPFrNrVq/uElg/t5D5oDaLRymZlNS9TKfprh1beu+7tFXwyj6H9k6UYdNQTaL3tt2HMFDYwPwXAMWu/Cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0837 X-OriginatorOrg: hpe.com 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-12-03_01:2020-11-30,2020-12-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 malwarescore=0 impostorscore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012030035 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Ray, all of the patches are reviewed. I will help to merge it to ed= k2 for the follow up contributions. Abner > -----Original Message----- > From: Ni, Ray [mailto:ray.ni@intel.com] > Sent: Thursday, December 3, 2020 1:25 PM > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > Cc: Justen, Jordan L ; Andrew Fish > ; Wang, Nickle (HPS SW) ; > O'Hanley, Peter (EXL) > Subject: RE: [edk2-devel] [Platform Redfish Host Interface PATCH 4/6] > EmulatorPkg/Application: Publish Redfish Host Interface Record >=20 > Acked-by: Ray Ni >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Chang, > > Abner (HPS SW/FW Technologist) > > Sent: Thursday, November 5, 2020 10:39 PM > > To: devel@edk2.groups.io > > Cc: Justen, Jordan L ; Andrew Fish > > ; Ni, Ray ; Wang, Nickle (HPS SW) > > ; O'Hanley, Peter (EXL) > > > Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 4/6] > > EmulatorPkg/Application: Publish Redfish Host Interface Record > > > > Signed-off-by: Jiaxin Wu > > Signed-off-by: Ting Ye > > Signed-off-by: Siyuan Fu > > Signed-off-by: Fan Wang > > Signed-off-by: Abner Chang > > > > Cc: Jordan Justen > > Cc: Andrew Fish > > Cc: Ray Ni > > Cc: Nickle Wang > > Cc: Peter O'Hanley > > --- > > .../RedfishPlatformConfig.c | 298 +++++++++++++++++= + > > .../RedfishPlatformConfig.inf | 42 +++ > > 2 files changed, 340 insertions(+) > > create mode 100644 > > EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig.c > > create mode 100644 > > EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig.in > > f > > > > diff --git > > a/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig. > > c > > b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig. > > c > > new file mode 100644 > > index 0000000000..89d4c760a7 > > --- /dev/null > > +++ > > b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig. > > c > > @@ -0,0 +1,298 @@ > > +/** @file > > + The implementation for Redfish Platform Configuration application. > > + > > + Copyright (c) 2019, Intel Corporation. All rights reserved.
> > + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
> > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +UINTN Argc; > > +CHAR16 **Argv; > > + > > +/** > > + > > + This function parse application ARG. > > + > > + @return Status > > +**/ > > +EFI_STATUS > > +GetArg ( > > + VOID > > + ) > > +{ > > + EFI_STATUS Status; > > + EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters; > > + > > + Status =3D gBS->HandleProtocol ( > > + gImageHandle, > > + &gEfiShellParametersProtocolGuid, > > + (VOID**)&ShellParameters > > + ); > > + if (EFI_ERROR(Status)) { > > + return Status; > > + } > > + > > + Argc =3D ShellParameters->Argc; > > + Argv =3D ShellParameters->Argv; > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + > > + This function print the help message. > > + > > +**/ > > +VOID > > +PrintHelp ( > > + VOID > > + ) > > +{ > > + Print (L"\n"); > > + Print (L"Format (Only Ipv4 Address is supported):\n"); > > + Print (L"RedfishPlatformConfig.efi -s HostIpAddress HostIpMask > > RedfishServiceIpAddress RedfishServiceIpMask RedfishServiceIpPort\n"); > > + Print (L"OR:\n"); > > + Print (L"RedfishPlatformConfig.efi -a RedfishServiceIpAddress > > RedfishServiceIpMask RedfishServiceIpPort\n"); > > + Print (L"\n"); > > +} > > + > > +/** > > + The user Entry Point for Application. The user code starts with > > +this function > > + as the real entry point for the application. > > + > > + @param[in] ImageHandle The firmware allocated handle for the EFI > image. > > + @param[in] SystemTable A pointer to the EFI System Table. > > + > > + @retval EFI_SUCCESS The entry point is executed successfully. > > + @retval other Some error occurs when executing this ent= ry point. > > + > > +**/ > > +EFI_STATUS > > +EFIAPI > > +UefiMain ( > > + IN EFI_HANDLE ImageHandle, > > + IN EFI_SYSTEM_TABLE *SystemTable > > + ) > > +{ > > + EFI_STATUS Status; > > + RETURN_STATUS ReturnStatus; > > + > > + UINT8 HostIpAssignmentType; > > + EFI_IPv4_ADDRESS HostIpAddress; > > + EFI_IPv4_ADDRESS HostIpMask; > > + EFI_IPv4_ADDRESS RedfishServiceIpAddress; EFI_IPv4_ADDRESS > > + RedfishServiceIpMask; > > + UINTN RedfishServiceIpPort; > > + > > + Status =3D GetArg(); > > + if (EFI_ERROR(Status)) { > > + return Status; > > + } > > + > > + // > > + // Format is like : > > + // RedfishPlatformConfig.efi -s HostIpAddress HostIpMask > > RedfishServiceIpAddress RedfishServiceIpMask RedfishServiceIpPort > > + // RedfishPlatformConfig.efi -a RedfishServiceIpAddress > > RedfishServiceIpMask RedfishServiceIpPort > > + // > > + if (Argc !=3D 7 && Argc !=3D 5) { > > + > > + PrintHelp(); > > + return EFI_UNSUPPORTED; > > + } > > + > > + if (StrCmp(Argv[1], L"-s") =3D=3D 0) { > > + > > + HostIpAssignmentType =3D 1; > > + > > + Status =3D NetLibStrToIp4 (Argv[2], &HostIpAddress); > > + if (EFI_ERROR (Status)) { > > + PrintHelp(); > > + return Status; > > + } > > + Status =3D NetLibStrToIp4 (Argv[3], &HostIpMask); > > + if (EFI_ERROR (Status)) { > > + PrintHelp(); > > + return Status; > > + } > > + Status =3D NetLibStrToIp4 (Argv[4], &RedfishServiceIpAddress); > > + if (EFI_ERROR (Status)) { > > + PrintHelp(); > > + return Status; > > + } > > + Status =3D NetLibStrToIp4 (Argv[5], &RedfishServiceIpMask); > > + if (EFI_ERROR (Status)) { > > + PrintHelp(); > > + return Status; > > + } > > + ReturnStatus =3D StrDecimalToUintnS (Argv[6], NULL, > &RedfishServiceIpPort); > > + if (RETURN_ERROR (ReturnStatus)) { > > + PrintHelp(); > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"HostIpAssignmentType", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (UINT8), > > + &HostIpAssignmentType > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"HostIpAddress", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (EFI_IPv4_ADDRESS), > > + &HostIpAddress > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"HostIpMask", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (EFI_IPv4_ADDRESS), > > + &HostIpMask > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"RedfishServiceIpAddress", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (EFI_IPv4_ADDRESS), > > + &RedfishServiceIpAddress > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"RedfishServiceIpMask", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (EFI_IPv4_ADDRESS), > > + &RedfishServiceIpMask > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"RedfishServiceIpPort", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (UINT16), > > + &RedfishServiceIpPort > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Print (L"\n"); > > + Print (L"HostIpAssignmentType is Static!\n"); > > + Print (L"HostIpAddress: %s has been set Successfully!\n", Argv[2]= ); > > + Print (L"HostIpMask: %s has been set Successfully!\n", Argv[3]); > > + Print (L"RedfishServiceIpAddress: %s has been set Successfully!\n= ", > Argv[4]); > > + Print (L"RedfishServiceIpMask: %s has been set Successfully!\n", > Argv[5]); > > + Print (L"RedfishServiceIpPort: %s has been set Successfully!\n", > Argv[6]); > > + Print (L"Please Restart!\n"); > > + > > + } else if (StrCmp(Argv[1], L"-a") =3D=3D 0) { > > + > > + HostIpAssignmentType =3D 3; > > + > > + Status =3D NetLibStrToIp4 (Argv[2], &RedfishServiceIpAddress); > > + if (EFI_ERROR (Status)) { > > + PrintHelp(); > > + return Status; > > + } > > + Status =3D NetLibStrToIp4 (Argv[3], &RedfishServiceIpMask); > > + if (EFI_ERROR (Status)) { > > + PrintHelp(); > > + return Status; > > + } > > + ReturnStatus =3D StrDecimalToUintnS (Argv[4], NULL, > &RedfishServiceIpPort); > > + if (RETURN_ERROR (ReturnStatus)) { > > + PrintHelp(); > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"HostIpAssignmentType", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (UINT8), > > + &HostIpAssignmentType > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"RedfishServiceIpAddress", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (EFI_IPv4_ADDRESS), > > + &RedfishServiceIpAddress > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"RedfishServiceIpMask", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (EFI_IPv4_ADDRESS), > > + &RedfishServiceIpMask > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Status =3D gRT->SetVariable ( > > + L"RedfishServiceIpPort", > > + &gEmuRedfishServiceGuid, > > + EFI_VARIABLE_NON_VOLATILE | > > EFI_VARIABLE_BOOTSERVICE_ACCESS, > > + sizeof (UINT16), > > + &RedfishServiceIpPort > > + ); > > + if (EFI_ERROR (Status)) { > > + return Status; > > + } > > + > > + Print (L"\n"); > > + Print (L"HostIpAssignmentType is Auto!\n"); > > + Print (L"RedfishServiceIpAddress: %s has been set Successfully!\n= ", > Argv[2]); > > + Print (L"RedfishServiceIpMask: %s has been set Successfully!\n", > Argv[3]); > > + Print (L"RedfishServiceIpPort: %s has been set Successfully!\n", > Argv[4]); > > + Print (L"Please Restart!\n"); > > + } else if (StrCmp(Argv[1], L"-h") =3D=3D 0 || StrCmp(Argv[1], L"-he= lp") > > + =3D=3D 0) { > > + > > + PrintHelp(); > > + } else { > > + > > + PrintHelp(); > > + return EFI_UNSUPPORTED; > > + } > > + > > + return EFI_SUCCESS; > > +} > > diff --git > > a/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig. > > inf > > b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig. > > inf > > new file mode 100644 > > index 0000000000..386c9bdd8c > > --- /dev/null > > +++ > > b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig. > > inf > > @@ -0,0 +1,42 @@ > > +## @file > > +# Sample UEFI Application Reference EDKII Module. > > +# > > +# Copyright (c) 2019, Intel Corporation. All rights reserved.
# > > +(C) Copyright 2020 Hewlett Packard Enterprise Development LP
# # > > +SPDX-License-Identifier: BSD-2-Clause-Patent # # ## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001000b > > + BASE_NAME =3D RedfishPlatformConfig > > + FILE_GUID =3D C02B67BB-3D19-4ACC-A080-1BDB575F= 8F36 > > + MODULE_TYPE =3D UEFI_APPLICATION > > + VERSION_STRING =3D 1.0 > > + ENTRY_POINT =3D UefiMain > > + > > +[Sources] > > + RedfishPlatformConfig.c > > + > > +[Packages] > > + EmulatorPkg/EmulatorPkg.dec > > + MdePkg/MdePkg.dec > > + MdeModulePkg/MdeModulePkg.dec > > + NetworkPkg/NetworkPkg.dec > > + RedfishPkg/RedfishPkg.dec > > + > > +[LibraryClasses] > > + DebugLib > > + NetLib > > + UefiApplicationEntryPoint > > + UefiLib > > + UefiBootServicesTableLib > > + UefiRuntimeServicesTableLib > > +[Protocols] > > + gEfiShellParametersProtocolGuid ## CONSUMES > > + gEfiShellProtocolGuid ## CONSUMES > > + > > +[Guids] > > + gEmuRedfishServiceGuid > > -- > > 2.17.1 > > > > > > > >=20 > >