Re: [YANG] default values

Martin Bjorklund <mbj@tail-f.com> Fri, 18 January 2008 14:48 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 1JFsWO-0002JF-MG; Fri, 18 Jan 2008 09:48:40 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JFsWN-0002J8-3e for yang-confirm+ok@megatron.ietf.org; Fri, 18 Jan 2008 09:48:39 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JFsWM-0002Iz-Q9 for yang@ietf.org; Fri, 18 Jan 2008 09:48:38 -0500
Received: from [213.180.94.162] (helo=mail.tail-f.com) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1JFsWM-0000or-FV for yang@ietf.org; Fri, 18 Jan 2008 09:48:38 -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 EB7691B80C9; Fri, 18 Jan 2008 15:48:37 +0100 (CET)
Date: Fri, 18 Jan 2008 15:49:49 +0100 (CET)
Message-Id: <20080118.154949.83008967.mbj@tail-f.com>
To: phil@juniper.net
Subject: Re: [YANG] default values
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <200801181409.m0IE9tmK010151@idle.juniper.net>
References: <47906FAB.2060505@ericsson.com> <200801181409.m0IE9tmK010151@idle.juniper.net>
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: 39bd8f8cbb76cae18b7e23f7cf6b2b9f
Cc: yang@ietf.org, lhotka@cesnet.cz
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

Phil Shafer <phil@juniper.net> wrote:
> Balazs Lengyel writes:

> >One more thing I think is still missing from the draft, is whether
> >must expressions consider default values or not?
> 
> We discussed this at some point and decided that "must"s must
> see defaults, but there needs to be a helper function to allow
> one to detect unconfigured values.
> 
>     must "../mtu < 1500 or not(yang:is-set(../mtu))";
> 
> I don't think this is in the current spec.

It's on my TODO list.

I was thinking the text should say that default values exist in the
data tree, and then clarify the text about XML encoding of leafs to
say that leafs which are set to their default values in the data tree
do not have to be sent.  The must description talks about the data
tree, so by adding the defaults to the data tree, the must expressions
are covered.

One question is how the xpath function should behave:

                            node set     node set to   node does
                            to default   other value   not exist
   --------------------------------------------------------------
   yang:has-default(node)    true          false         false
   yang:is-set(node)         false         true          false


Maybe it's no big deal - if you want to check for existance, that's
trivial in XPath.


/martin


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