Re: [YANG] keyref

Martin Bjorklund <mbj@tail-f.com> Tue, 22 January 2008 14:44 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JHKMD-00025f-1j; Tue, 22 Jan 2008 09:44:09 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JHKMC-00025Z-4j for yang-confirm+ok@megatron.ietf.org; Tue, 22 Jan 2008 09:44:08 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JHKMB-00025R-R4 for yang@ietf.org; Tue, 22 Jan 2008 09:44:07 -0500
Received: from [213.180.94.162] (helo=mail.tail-f.com) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1JHKMB-0003uP-Cb for yang@ietf.org; Tue, 22 Jan 2008 09:44:07 -0500
Received: from localhost (138.162.241.83.in-addr.dgcsystems.net [83.241.162.138]) by mail.tail-f.com (Postfix) with ESMTP id B6F051B80C5; Tue, 22 Jan 2008 15:44:05 +0100 (CET)
Date: Tue, 22 Jan 2008 15:45:25 +0100 (CET)
Message-Id: <20080122.154525.119689047.mbj@tail-f.com>
To: ietf@andybierman.com
Subject: Re: [YANG] keyref
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <4795FECC.4090803@andybierman.com>
References: <20080122.094430.48542159.mbj@tail-f.com> <20080122085918.GC5210@elstar.local> <4795FECC.4090803@andybierman.com>
X-Mailer: Mew version 5.1.51 on Emacs 22.1 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 769a46790fb42fbb0b0cc700c82f7081
Cc: yang@ietf.org
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Andy Bierman <ietf@andybierman.com> wrote:
> Not only is the TC approach simpler

As Juergen pointed out, there is no formalism to help tools.  Also, it
becomes awkward to reference mulit-level and/or multi-key instances.

> but keyref does not support
> the ability to hold a 'not-set' value, such as InterfaceIndexOrZero.

Mark it as optional instead - why set to some in-band invalid value?

      leaf mgmt-interface {
          mandatory false;
          type keyref {
              path "/if:interfaces/if:interface/if:ifIndex";
          }
      }

If it is set, it has to point to an existing interface.

> YANG is also missing the ability to use key leafs from different
> tables, like SMIv2.

No:

  list myIfTable {
    key myIfIndex;
    leaf myIfIndex {
       type keyref {
         path "/if:interfaces/if:interface/if:ifIndex";
       }
     }
   }
       
covers this case.


>       leaf myInOctets {
>         type smi:Counter32;
>         leafref "/if:interfaces/if:interface/if:ifInOctets";
>       }
>    }

This is a very good example.  How can you tell which ifEntry's
ifInOctets this myInOctets actually refer to??


/martin


_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang