From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.41.106; helo=nam03-dm3-obe.outbound.protection.outlook.com; envelope-from=atul.gupta@chelsio.com; receiver=edk2-devel@lists.01.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0106.outbound.protection.outlook.com [104.47.41.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 79214222CF1CB for ; Wed, 10 Jan 2018 23:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chelsious.onmicrosoft.com; s=selector1-chelsio-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wvMf8Rh76nxzpXt+OC9VdFjddXY+sM7Z7ATzouruZDs=; b=UYTER9j5h6jDXvnXwhdGeqlVNpjuI8akaulJyf68joibXNtdLZp0gB/BTUARyqIn1099a3cjTLVxjzzgL6EM001tWI5IbsbkfJp6D4qHv/NfEs7g+NhUlJXYLG1EW2WcSYd9aKHQlW/e0mdrMU7oU/z0ultZTz1aorxXX3obGTQ= Received: from CY4PR1201MB0230.namprd12.prod.outlook.com (10.172.79.7) by CY4PR1201MB0231.namprd12.prod.outlook.com (10.172.79.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 11 Jan 2018 07:57:23 +0000 Received: from CY4PR1201MB0230.namprd12.prod.outlook.com ([10.172.79.7]) by CY4PR1201MB0230.namprd12.prod.outlook.com ([10.172.79.7]) with mapi id 15.20.0386.008; Thu, 11 Jan 2018 07:57:23 +0000 From: Atul Gupta To: "Bi, Dandan" , "edk2-devel@lists.01.org" Thread-Topic: VFR validation of IP address and iSCSI IQN Thread-Index: AdOKp25VXWLFkJorTbCeN6qYgusQHQABQzhwAAEWpCA= Date: Thu, 11 Jan 2018 07:57:23 +0000 Message-ID: References: <3C0D5C461C9E904E8F62152F6274C0BB3BA0B5F3@shsmsx102.ccr.corp.intel.com> In-Reply-To: <3C0D5C461C9E904E8F62152F6274C0BB3BA0B5F3@shsmsx102.ccr.corp.intel.com> Accept-Language: en-IN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=atul.gupta@chelsio.com; x-originating-ip: [111.93.130.157] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR1201MB0231; 7:DlwmFr+SadGj15QhDq8FQL0j6QJfnwEAkfzmUEKa81waoYxBHP6BDd6/+axXL9wWOq2DD3+NKC75GiyXXS+aZaxK26Z+gpUQt/v/u1hcy28NUNIlgq3HuesZBQSuuRXi2XDTXCEsi42gY72LJRNYLVZOr5Ah20b55G7JO/l8cB5wNFZkknIfPiiUeMwUO0VokMWwDwPRIeATpWLIzjHJ+Udy6vLsun5GAAMIglDdQXnqeUlYkJLNDoda9VitkOIh x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 391b2e5b-0ba6-4e5e-eeb9-08d558c8f2d9 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(3008032)(4534020)(4602075)(4603075)(4627115)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:CY4PR1201MB0231; x-ms-traffictypediagnostic: CY4PR1201MB0231: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231023)(944501075)(6041268)(20161123560045)(20161123564045)(2016111802025)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6043046)(6072148)(201708071742011); SRVR:CY4PR1201MB0231; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR1201MB0231; x-forefront-prvs: 0549E6FD50 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(346002)(39840400004)(396003)(39380400002)(376002)(13464003)(51914003)(189003)(199004)(7696005)(33656002)(53546011)(66066001)(966005)(105586002)(229853002)(6506007)(97736004)(3660700001)(8936002)(2900100001)(59450400001)(99286004)(2950100002)(76176011)(3280700002)(106356001)(68736007)(6246003)(316002)(53936002)(14454004)(5660300001)(3846002)(25786009)(86362001)(74316002)(6436002)(102836004)(77096006)(110136005)(81166006)(2906002)(2501003)(478600001)(9686003)(7736002)(81156014)(55016002)(6116002)(305945005)(8676002)(6306002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR1201MB0231; H:CY4PR1201MB0230.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: chelsio.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: fJW+mO+ZMs3BzYLbnNHqxDuQj70bKxhgIYqJyeXr4CmSh+H+tEt/9VpzIqeFNW9GzgxjWoQpgRcQYFaUtj53vQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: chelsio.com X-MS-Exchange-CrossTenant-Network-Message-Id: 391b2e5b-0ba6-4e5e-eeb9-08d558c8f2d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2018 07:57:23.2771 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 065db76d-a7ae-4c60-b78a-501e8fc17095 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0231 Subject: Re: VFR validation of IP address and iSCSI IQN X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jan 2018 07:52:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the reply, My code works if INTERACTIVE flag is used and iqn validated using IScsiNorm= alizeName. I was looking for a way to validate iqn/ip-address within the vf= r i.e use " flags =3D 0" and have appropriate expression included in vfr. Thanks Atul -----Original Message----- From: Bi, Dandan [mailto:dandan.bi@intel.com]=20 Sent: Thursday, January 11, 2018 1:02 PM To: Atul Gupta ; edk2-devel@lists.01.org Subject: RE: VFR validation of IP address and iSCSI IQN Hi, (1) If you want the string can only be set with the one in STR_STRING_CHECK= , you can add following codes within the string opcode:=20 inconsistentif prompt =3D STRING_TOKEN(STR_INVALID_IQN), pushthis !=3D stringref(STRING_TOKEN(STR_STRING_CHECK)) endif; (2) If you want the string only cannot be set with the one in STR_STRING_CH= ECK, you can add following codes within the string opcode: inconsistentif prompt =3D STRING_TOKEN(STR_INVALID_IQN), pushthis =3D=3D stringref(STRING_TOKEN(STR_STRING_CHECK)) endif; For more examples you can refer to the vfr file in: edk2\MdeModulePkg\Unive= rsal\DriverSampleDxe\ Vfr.vfr. Thanks, Dandan -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Atul= Gupta Sent: Thursday, January 11, 2018 2:52 PM To: edk2-devel@lists.01.org Subject: [edk2] VFR validation of IP address and iSCSI IQN Hi, I want to validate IP address and iSCSI IQN within the vfr form. Want to av= oid callback hence removed the INTERACTIVE flags, tried few things but none= seems to work except for input length check, how to validate the input buf= fer. Eg: string name =3D iqn, varid =3D UD_CONFIG_IFR_NVDATA.InitiatorName, prompt =3D STRING_TOKEN(STR_ISCSI_CONFIG_INIT_NAME), help =3D STRING_TOKEN(STR_ISCSI_CONFIG_INIT_NAME_HELP), flags =3D 0, key =3D KEY_INITIATOR_NAME2, minsize =3D 8, maxsize =3D ISCSI_NAME_IFR_MAX_SIZE, inconsistentif prompt =3D STRI= NG_TOKEN(STR_INVALID_IQN), NOT pushthis !=3D stringref(STRING= _TOKEN(STR_STRING_CHECK)) endif endstring; also tried span (flags =3D LAST_NON_MATCH, pushthis, stringref(STRING_TOKEN(STR_STRING= _CHECK)), 0) !=3D 0, but did not help. Any reference to validate the input buffer? Thanks Atul _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel