Re: [netmod] [yang-doctors] Recursive extensions?

Martin Bjorklund <mbj@tail-f.com> Tue, 18 October 2016 07:06 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 52691129574; Tue, 18 Oct 2016 00:06:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.332
X-Spam-Level:
X-Spam-Status: No, score=-2.332 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.431, SPF_PASS=-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 g1NRzl5bxf0V; Tue, 18 Oct 2016 00:06:51 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id CB3A412956B; Tue, 18 Oct 2016 00:06:50 -0700 (PDT)
Received: from localhost (h-85-226.a165.priv.bahnhof.se [94.254.85.226]) by mail.tail-f.com (Postfix) with ESMTPSA id EDB971AE0335; Tue, 18 Oct 2016 09:06:49 +0200 (CEST)
Date: Tue, 18 Oct 2016 09:06:49 +0200
Message-Id: <20161018.090649.1446133407542570739.mbj@tail-f.com>
To: andy@yumaworks.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <CABCOCHR1mO9iWOw8pR6VDV+C=1t6WiMi2JvXd=CG8CF-Q9Payw@mail.gmail.com>
References: <86d89b50-2177-d906-834f-f4dd505e2a0f@hq.sk> <CE328C22-AD71-4985-ABD4-3B075ADA0F95@lucidvision.com> <CABCOCHR1mO9iWOw8pR6VDV+C=1t6WiMi2JvXd=CG8CF-Q9Payw@mail.gmail.com>
X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/03sg0KRQrPZircLr_jtJZWxI_6k>
Cc: netmod@ietf.org, yang-doctors@ietf.org
Subject: Re: [netmod] [yang-doctors] Recursive extensions?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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, 18 Oct 2016 07:06:52 -0000

Andy Bierman <andy@yumaworks.com> wrote:
> On Mon, Oct 17, 2016 at 2:01 PM, Nadeau Thomas <tnadeau@lucidvision.com>
> wrote:
> 
> >
> >         Adding Yang Doctors to the thread.
> >
> >         —Tom
> >
> >
> > > On Oct 17, 2016:4:42 PM, at 4:42 PM, Robert Varga <nite@hq.sk> wrote:
> > >
> > > Hello everyone,
> > >
> > > neither RFC6020 nor RFC7950 seem to be explicit about this, so I thought
> > > I'd ask.
> > >
> > > Are recursive, directly or transitively, extensions valid yang?
> > >
> >
> 
> 
> Extensions are not recursive.
> Your syntax below is valid but not meaningful.

Here's a real (and meaningful) example of a "recursive" extension:

  extension substatement {
    argument name {
      tailf:arg-type {
        type string;
      }
    }
    tailf:use-in "extension";
    tailf:occurence "*";

    tailf:substatement "tailf:occurence";  // <-- reference to self
    description
      "Specifies which statements can occur as substatement to the
      given statement.";
  }

This is not different from how the core YANG statements can be used;
e.g., you can use "container" within "container".



/martin