Re: [netmod] tree diagrams - flags

Martin Bjorklund <mbj@tail-f.com> Tue, 21 March 2017 20:22 UTC

Return-Path: <mbj@tail-f.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 EB33D129BE8 for <netmod@ietfa.amsl.com>; Tue, 21 Mar 2017 13:22:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 6rdSpSyC76d0 for <netmod@ietfa.amsl.com>; Tue, 21 Mar 2017 13:22:56 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id CDAD71296D5 for <netmod@ietf.org>; Tue, 21 Mar 2017 13:22:55 -0700 (PDT)
Received: from localhost (h-148-188.a165.priv.bahnhof.se [176.10.148.188]) by mail.tail-f.com (Postfix) with ESMTPSA id 984DF1AE0310; Tue, 21 Mar 2017 21:22:54 +0100 (CET)
Date: Tue, 21 Mar 2017 21:22:54 +0100
Message-Id: <20170321.212254.1381357367952499259.mbj@tail-f.com>
To: worley@ariadne.com
Cc: lhotka@nic.cz, netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <87shm6tn2w.fsf@hobgoblin.ariadne.com>
References: <20170321.144353.1304796463767741047.mbj@tail-f.com> <87shm6tn2w.fsf@hobgoblin.ariadne.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Iub0tbQH5wQDfS9o-prypHtTgog>
Subject: Re: [netmod] tree diagrams - flags
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: Tue, 21 Mar 2017 20:22:59 -0000

worley@ariadne.com (Dale R. Worley) wrote:
> Martin Bjorklund <mbj@tail-f.com> writes:
> > Hmm, "*" was choosen b/c people are used to read it as
> > "zero or more".  So for example:
> >
> >      +---c server* [name]
> >          +--c name          string
> >          ...
> >
> > means zero or more "server" elements.  Each indexed by "name".
> 
> From RFC 7223:
> 
>    module ietf-interfaces {
>      ...
>      container interfaces {
>        ...
>        list interface {
>          key "name";
> 
>          leaf name {
>            type string;
>          }
> 
>          leaf description {
>            type string;
>          }
>    ...
> 
> There is a top-level container node "interfaces", which contains a list
> node "interface", which contains a sequence of list elements which
> consist of groups of (a leaf "name", a leaf "description", etc.), which
> elements are indexed by the value of the "name" leaf.

Aha, ok.  This description is not a correct description of the YANG
data tree (in which XPath expressions etc are evaluated).  There is
not a single "list node" called "interfaces".  Look at an example of
an XML instance document:

  <interfaces>
    <interface>
      <name>eth0</name>
      ...
    </interface>
    <interface>
      <name>eth1</name>
      ...
    </interface>
  </interfaces>

This also reflects the data tree.


/martin