Re: [netmod] choice/case in tree diagrams

Ladislav Lhotka <lhotka@nic.cz> Mon, 05 March 2018 14:41 UTC

Return-Path: <lhotka@nic.cz>
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 5AA1E124D68 for <netmod@ietfa.amsl.com>; Mon, 5 Mar 2018 06:41:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.009
X-Spam-Level:
X-Spam-Status: No, score=-7.009 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 5An7Sa8jDOTC for <netmod@ietfa.amsl.com>; Mon, 5 Mar 2018 06:41:20 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (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 6DF81120454 for <netmod@ietf.org>; Mon, 5 Mar 2018 06:41:20 -0800 (PST)
Received: from birdie (unknown [IPv6:2001:718:1a02:1::380]) by mail.nic.cz (Postfix) with ESMTPSA id B3AF36279C for <netmod@ietf.org>; Mon, 5 Mar 2018 15:41:18 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1520260878; bh=A4X14uXHZF98m0vdBc8aoMfF1focWYO/9Rnrc+kKir8=; h=From:To:Date; b=w8Bxjm4cpyWsL48bloRastFXKxTYlwLOq/DwNauizU0jOl8Xf2JBlhFcMQg1Uq9yq Wut/YUVACjUza8O75XuNP3gx6eiqO7JQJJnBYKs86wtJlpXWKqX+V2+ut6d8FcmnnJ rEYPTlkWeqkEF9XnExtOkFpzSTnzTNyh1Z3ep3zQ=
Message-ID: <1520260878.7198.28.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: netmod@ietf.org
Date: Mon, 05 Mar 2018 15:41:18 +0100
In-Reply-To: <20180305.152602.113020152789243398.mbj@tail-f.com>
References: <20180305134934.neam7t2snb2wdvon@elstar.local> <20180305.145418.2010818875235650756.mbj@tail-f.com> <20180305141355.gi6kfej3eifdxtjq@elstar.local> <20180305.152602.113020152789243398.mbj@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.26.5
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/0hOAzedWST1qOWwne0vVzW86OT8>
Subject: Re: [netmod] choice/case in tree diagrams
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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, 05 Mar 2018 14:41:22 -0000

On Mon, 2018-03-05 at 15:26 +0100, Martin Bjorklund wrote:
> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> > On Mon, Mar 05, 2018 at 02:54:18PM +0100, Martin Bjorklund wrote:
> > > > 
> > > > So it seems the running code got it right. ;-)
> > > 
> > > As the author of that code, I think that was purely by accident...
> > > 
> > > But I'm not convinced it is the correct solution.  We have one example
> > > in the other thread where someone was confused by the "rw" flag and
> > > thought that it implied that the node would be present in the data
> > > tree.
> > > 
> > 
> > So what does rw mean?
> > 
> > (i)  The schema node has a rw property.
> > (ii) The schema node can be instantiated and the instantiated data node
> >      has a rw property.
> > 
> > I think it is difficult to have both at the same time. If the tree is
> > a representation of schema nodes, then (i) seems to make more
> > sense. That said, the explanation in 2.6 is somewhat vague since it
> > says 'data' and not 'nodes' (like everywhere else):
> > 
> > OLD:
> > 
> >        <flags> is one of:
> >          rw  for configuration data
> >          ro  for non-configuration data, output parameters to rpcs
> >              and actions, and notification parameters
> > 
> > NEW:
> > 
> >        <flags> is one of:
> >          rw  for configuration data nodes
> >          ro  for non-configuration data nodes, output parameters to rpcs
> >              and actions, and notification parameters
> 
> I think this is ok.  But that means that we also have to add:
> 
>            --  for a choice or case node
> 
> But in order to be consistent, we should probably have:
> 
>            --  for a choice, case, input or output node

But unlike the three other statements, "choice" can have the config
substatement, so "rw/ro" makes sense there.

Lada

> 
> 
> This means that the correct tree syntax for choice and case will be:
> 
>      +-- (subnet)?
>         +-- :(prefix-length)
>         |  +--rw prefix-length?   uint8
>         +-- :(netmask)
>            +--rw netmask?         yang:dotted-quad
> 
> 
> /martin
> 
> 
> > The document (as far as I searched for it) does not clearly say that
> > 'node' means 'schema node'. In hindsight, it might have been useful to
> > explicitely import terminology from RFC 7950 and to use it carefully
> > (RFC 7950 has 'schema node' and 'data node' but here we largely talk
> > about 'nodes' - and my assumption is that this means 'schema nodes'.)
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67