Re: [netmod] Where can I use <CODE BEGINS> <CODE ENDS> ? - rfcstrip

Balázs Lengyel <balazs.lengyel@ericsson.com> Mon, 30 March 2020 16:10 UTC

Return-Path: <balazs.lengyel@ericsson.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2CC883A1871 for <netmod@ietfa.amsl.com>; Mon, 30 Mar 2020 09:10:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.2
X-Spam-Level:
X-Spam-Status: No, score=-0.2 tagged_above=-999 required=5 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wezn2LL59uLa for <netmod@ietfa.amsl.com>; Mon, 30 Mar 2020 09:10:30 -0700 (PDT)
Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0611.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::611]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B840A3A187E for <netmod@ietf.org>; Mon, 30 Mar 2020 09:10:29 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lg3ND9KsDyViBO0GMIO4HgUpMxA4pU6/gg8bhvayb6HZqAYAtc3JcWVwwwJHmfWJxeaWfcXJAUBnMmwbpqr+3rCJNhTsvVUXuhgXHO9b2De4+ry4NeeSunGjYzBVl9bYK4wjEpmXFZGP6Wz/W074ZZpmw+uIXuhA6sulmMVrtuC/GCOYEbGJpDC1enC/DJ0bntDgcPIaBm5qV4MgbrhCrBNeb5RDyEaBTEC6ZHwCTKVS79MgiSOOD/fIjN+T4yFoM6BlkHYr8nYaRCNdbD8/UtyO3s4SNDb9mrg3W/uPxVDDt2LZ81bdnYnpNLpuGSw8nEUdLAetLl/x7JTs4/iYvA==
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=ujrCTU0gXJL1naSa4YcdeuUc0RiXNAmYzaZFR0AZj50=; b=YeDRrBQT7NtffzqX9Sj9OhJaMJClklEIijwaY8lrTcVTp0PQ6bHZ54+U+LFxBlRun3/ASyKFPeySdwPfAETzFwi5aXrs4J4O+vySBCDq3fgSMptKfp5d0EZ9N7qFv/NlQ0NIp+bOj02OQvWNWHwWcYKxH26b+eWNCSZYYjBRTJUXBQv3Vw2FtneLPDZGgGxCzUbiVmUNa5fwax0BkXyhBBt6y7gReidbA30Gdhqtg7DCnkhooBlycw75th3VQY7TYgzGb0CZjEzPDdOJShrEKqoAuWXUg+loETwf66y1mTjdmqNss4GLQi6+An1Kxg9/ioo2HsV+5INdta5JrDWBug==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ujrCTU0gXJL1naSa4YcdeuUc0RiXNAmYzaZFR0AZj50=; b=MlIFluaKcJVH0yitD7wFhBHSDNEYBg+DQtXSTQ0n1iVhcgG0Y2ce9qUqHHUaFwWVtXBxISVmLcbFN3KQviydWXB/1lrXrpTrasUn8PgWLUMgryI4RJbnN33bvmjLDgTWaCtBA8yiExe5Ywe03afKOQ7ZAU1joE38wHOSXYyFULo=
Received: from DB7PR07MB4011.eurprd07.prod.outlook.com (52.134.97.155) by DB7PR07MB5481.eurprd07.prod.outlook.com (20.178.84.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.12; Mon, 30 Mar 2020 16:10:27 +0000
Received: from DB7PR07MB4011.eurprd07.prod.outlook.com ([fe80::a07e:3b6:fa05:3b37]) by DB7PR07MB4011.eurprd07.prod.outlook.com ([fe80::a07e:3b6:fa05:3b37%4]) with mapi id 15.20.2878.012; Mon, 30 Mar 2020 16:10:26 +0000
From: Balázs Lengyel <balazs.lengyel@ericsson.com>
To: Kent Watsen <kent+ietf@watsen.net>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] Where can I use <CODE BEGINS> <CODE ENDS> ? - rfcstrip
Thread-Index: AdYGrbEuw8PDX6utQLmcRUQIDUKJFg==
Date: Mon, 30 Mar 2020 16:10:26 +0000
Message-ID: <DB7PR07MB4011BBD7854EE286A76CAB28F0CB0@DB7PR07MB4011.eurprd07.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=balazs.lengyel@ericsson.com;
x-originating-ip: [80.98.254.17]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 0ae9ae77-3ee6-4fe0-84b4-08d7d4c4dc3c
x-ms-traffictypediagnostic: DB7PR07MB5481:
x-microsoft-antispam-prvs: <DB7PR07MB5481582BCB7AA81926000E29F0CB0@DB7PR07MB5481.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8273;
x-forefront-prvs: 0358535363
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR07MB4011.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(39860400002)(376002)(346002)(396003)(366004)(136003)(21490400003)(66476007)(85182001)(7696005)(52536014)(66946007)(66616009)(21615005)(9686003)(53546011)(316002)(478600001)(85202003)(6506007)(4326008)(66574012)(99936003)(66556008)(2906002)(66446008)(55016002)(26005)(8676002)(64756008)(8936002)(81156014)(9326002)(81166006)(966005)(186003)(71200400001)(76116006)(33656002)(5660300002)(86362001)(156123004); DIR:OUT; SFP:1101;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: AgKgAAJpymtnUaAXNu6noZtbeshVv3iXwPNsIZBf7Nbcc2DS8t3iJBk/pFNcRa/Hyp2pgVriwdnC9KVp/FaltynXF9+KUKrSkxFWaOPUFCB1eSf62ba8PI1mw0MXfB2uTzaAqUe4MRV55IaYSNTxTxrIDn8GkjP2wLuRWSK0y2V1Nhe3MMUjDSpaBsQ6T5M+s41gPnI5LDhPB38TEIZD+zgtYfEDTydG+4RISek+ao/xhLW1Qjlly5RD5aIRyyOk2xSc0G9o+kINP811YTSagE+NurpH7Q+n0yV0Kf++VfzjxHa2GZm8Koj/RCIs+26dMnGtwNQSte33B9HS0wX7gJtj3PqYYEqV7Locd+3nOs3QLMJOrUrpEF9uiCCzjLgl6kNtOxE7MrkmjjxAHyw1XPGu7hkOs2t53p4NbCJm6IyzeXChw2xK7xAzcfJTCO2SS/FYvKqYPtLbVEIbkYfBk850fC1JLoQ8biD1QjIBCmV7GSfPbRSmDALlCMvGEyWQpwkE5MDwjzvtwWzjfsbmpJ3I/U9VCN9XENtHEOu28DTM8NMhxXeJGkpRa5Elt+MU
x-ms-exchange-antispam-messagedata: pqBuSlYuy6j2dIj3uDL2bnC1piFKzWY7Yn6uuS5dGnOtObQugOfOg+NA+hhXwLCJs5w2pvrhxSoxD6iL84Uz0HYHehVMmA6zOs1YIqyHBE1u/vbRa7ZTpN8zjpaGmMDN2YZFtYIrjtWY+sjCsKDdLw==
x-ms-exchange-transport-forked: True
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="SHA1"; boundary="----=_NextPart_000_01A0_01D606BE.7C6F4C30"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0ae9ae77-3ee6-4fe0-84b4-08d7d4c4dc3c
X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2020 16:10:26.8757 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: i6dvi7duPWZOpNpmjLSxVLtas3VZlUTzOxihh5i9EDsR1uf8Qo8KfZjmFZsm3U/06JKkIo2htM9XVBmyHkiE956Pc57xchI6nik5JwNyjdI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB5481
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/_l0Q-Zrdcawy9lXWZX-mVSIV89I>
Subject: Re: [netmod] Where can I use <CODE BEGINS> <CODE ENDS> ? - rfcstrip
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Mar 2020 16:10:33 -0000

Hello Kent, 

Sorry for not providing a clear pointer to my work. As you have already found it, I just include it here for reference to others: https://github.com/BalazsLengyel/rfcstrip 

I assume ggrep is the gnu grep ? Maybe we should make that a variable for grep like we have for AWK=awk

I do not see the additional ^@ at EOF.  I tested it on cygwin, which is mostly GNU compatible.

This is how my file ends

 

3c 2f 69 6e 73 74 61 6e 63 65 2d 64 61 74 61 2d 73 65 74 3e 00 ---- </instance-data-set>

Regards Balazs

 

From: Kent Watsen <kent+ietf@watsen.net> 
Sent: 2020. március 29., vasárnap 0:18
To: Balázs Lengyel <balazs.lengyel@ericsson.com>
Cc: netmod@ietf.org
Subject: Re: [netmod] Where can I use <CODE BEGINS> <CODE ENDS> ?

 

Firstly, thank you for trying to improve our tooling!

 

It took me some time to find, for others: https://github.com/BalazsLengyel/rfcstrip

 

Running `rfcstrip -a` throws errors on MacOS.  My workaround fix was to ` brew install grep` and 's/grep/ggrep/' on line 483.

 

All The extracted files (including the two that are NOT folded) contain a ‘^@‘ character at the EOF.   This must be something introduced by `rfcstrip` because `rfcfold` does a simple file-level copy when unfolding isn't needed.

 

Kent // contributor

 





On Mar 26, 2020, at 5:45 PM, Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org <mailto:balazs.lengyel=40ericsson.com@dmarc.ietf.org> > wrote:

 

Hello,
I created an update to rfcstrip in Github.

Revision 1.1balazs - 2020-03-26
added -a option. If it is specified, the file must be an XML2RFC
XML file.
All artworks will be extracted from it if they carry a name attribute.
Artwork unfolding will also be executed.
If the artwork contains the , <CODE BEGIN/END> markers
they are removed.

Regards Balazs

-----Original Message-----
From: Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org <mailto:balazs.lengyel=40ericsson.com@dmarc.ietf.org> > 
Sent: 2020. március 26., csütörtök 11:55
To: Kent Watsen <kent@watsen.net <mailto:kent@watsen.net> >; Balázs Lengyel <balazs.lengyel@ericsson.com <mailto:balazs.lengyel@ericsson.com> >
Cc: netmod@ietf.org <mailto:netmod@ietf.org> 
Subject: RE: [netmod] Where can I use <CODE BEGINS> <CODE ENDS> ?

Hello Kent,
OK, as you are strongly opposed to it, I will remove <CODE BEGINS> <CODE ENDS> in the next version.
That said, I do not really agree with you. If interested see, below.
Regards Balazs

-----Original Message-----
From: netmod <netmod-bounces@ietf.org <mailto:netmod-bounces@ietf.org> > On Behalf Of Kent Watsen
Sent: 2020. március 25., szerda 18:25
To: Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org <mailto:balazs.lengyel=40ericsson.com@dmarc.ietf.org> >
Cc: netmod@ietf.org <mailto:netmod@ietf.org> 
Subject: Re: [netmod] Where can I use <CODE BEGINS> <CODE ENDS> ?

Balazs,

While possible to use the markers for instance examples...

 - they’ve never been used before, AFIAK  (historical context)
BALAZS: S0 I am a revolutionary :-)  
As I understand validation of examples have always been an issue, so making that more simple by automating extraction would be a step in the good direction.
 - they're unneeded, as examples don’t contain copyright (per Lada’s comment)
BALAZS: I agree that copyright is a non-issue for these examples. However <CODE BEGINS> is needed for another reason: easy extraction, which would make checking the data simpler.
 - they're disallowed by RFC 8407 for example modules (per Benoit comment)
BALAZS: strictly speaking that is about YANG examples not instance data examples. I also don't know/understand the reasoning behind it. A separate example tag would be nice, but we don't have one.
 - as a contributor, I don’t wish to birth a new convention of using the markers for examples.  

In order to support programmatic extraction of examples from drafts, please just set the “name” attribute on the <sourcecode> or <artwork> element in the XML draft. 
BALAZS: As far as I understand sourcecode is only available in XML2RFC v3.  Name is not handled by rfcstrip or xym. (I don't have time to update the tools right now.) It would be nice to have an update to rfcstrip that checks every <artwork> and if it has a name attribute, it extracts the content into a file called "name".


2.48.2.  "name" Attribute

  A filename suitable for the contents (such as for extraction to a
  local file).  This attribute can be helpful for other kinds of tools
  (such as automated syntax checkers, which work by extracting the
  source code).  Note that the "name" attribute does not need to be
  unique for <artwork> elements in a document.  If multiple
  <sourcecode> elements have the same "name" attribute, a formatter
  might assume that the elements are all fragments of a single file,
  and such a formatter can collect those fragments for later
  processing.


Kent







On Mar 24, 2020, at 11:33 AM, Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org <mailto:balazs.lengyel=40ericsson.com@dmarc.ietf.org> > wrote:

Hello,
A reply from the rfc-editor on <CODE BEGINS>. It seems it is OK.
Regards Balazs

-----Original Message-----
From: Alice Russo <arusso@amsl.com <mailto:arusso@amsl.com> > 
Sent: 2020. március 24., kedd 16:00
To: Balázs Lengyel <balazs.lengyel@ericsson.com <mailto:balazs.lengyel@ericsson.com> >
Cc: RFC Editor <rfc-editor@rfc-editor.org <mailto:rfc-editor@rfc-editor.org> >
Subject: Re: Where can I use <CODE BEGINS> <CODE ENDS> ?

Greetings,

Please see below.




On Mar 21, 2020, at 8:30 AM, Balázs Lengyel <balazs.lengyel@ericsson.com <mailto:balazs.lengyel@ericsson.com> > wrote:

Hello,
Sorry if I am sending this question to the wrong person. 
We have a discussion in the NETMOD workgroup about when is it appropriate/allowed to use the <CODE BEGINS> <CODE ENDS> markings in drafts and RFCs.
We regularly use it to bracket the YANG modules defined. 
e.g.    <CODE BEGINS> file "ietf-yang-instance-data@2020-03-19.yang <mailto:ietf-yang-instance-data@2020-03-19.yang> " 


Just FYI, if you are using the new XML vocabulary [1], the markers can be created automatically by using markers="true"
-- for example --
<sourcecode name="ietf-yang-instance-data@2020-03-19.yang <mailto:ietf-yang-instance-data@2020-03-19.yang> " type="yang" markers="true">




However is it allowed to use it to bracket XML or json examples in drafts/rfcs? 
e.g.    <CODE BEGINS> file read-only-acm-rules@2020-03-19.xml <mailto:read-only-acm-rules@2020-03-19.xml> 


Yes, it is allowed. The markers <CODE BEGINS> and <CODE ENDS> are mentioned in the Trust Legal Provisions [2].

[1] https://protect2.fireeye.com/v1/url?k=50261255-0cacc750-502652ce-861010bc36ff-8b3716f9fa495535 <https://protect2.fireeye.com/v1/url?k=50261255-0cacc750-502652ce-861010bc36ff-8b3716f9fa495535&q=1&e=11f6fa43-0168-4d1f-8f5d-bffd46fff0d3&u=https%3A%2F%2Fwww.rfc-editor.org%2Fmaterials%2FFAQ-xml2rfcv3.html> &q=1&e=11f6fa43-0168-4d1f-8f5d-bffd46fff0d3&u=https%3A%2F%2Fwww.rfc-editor.org%2Fmaterials%2FFAQ-xml2rfcv3.html
[2] https://trustee.ietf.org/license-info/IETF-TLP-5.htm (item 4d)

Thank you.
RFC Editor/ar





It is very handy that the rfcstrip tool can extract the CODE sections from a draft which facilitates checking these by external tools like yanglint. The checking is needed both for the YANG modules and the examples.
If you as an rfc-editor could give guidance on the issue it would be appreciated. I attached a planned draft.
Best regards Balazs Lengyel 

-- 
Balazs Lengyel                    Senior Specialist                       Ericsson Hungary Ltd. 
Mobile: +36-70-330-7909              email: Balazs.Lengyel@ericsson.com <mailto:Balazs.Lengyel@ericsson.com> 

<draft-ietf-netmod-yang-instance-file-format-11.txt>

_______________________________________________
netmod mailing list
netmod@ietf.org <mailto:netmod@ietf.org> 
https://www.ietf.org/mailman/listinfo/netmod


_______________________________________________
netmod mailing list
netmod@ietf.org <mailto:netmod@ietf.org> 
https://www.ietf.org/mailman/listinfo/netmod
_______________________________________________
netmod mailing list
netmod@ietf.org <mailto:netmod@ietf.org> 
https://www.ietf.org/mailman/listinfo/netmod