Re: [netmod] Default choice case with only empty leaf - Is this allowed ?

Martin Bjorklund <mbj@tail-f.com> Tue, 05 November 2019 10:14 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 F3CDC120885 for <netmod@ietfa.amsl.com>; Tue, 5 Nov 2019 02:14:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=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 J_k2hNQExhXv for <netmod@ietfa.amsl.com>; Tue, 5 Nov 2019 02:14:43 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 6B9DF1200C7 for <netmod@ietf.org>; Tue, 5 Nov 2019 02:14:43 -0800 (PST)
Received: from localhost (unknown [173.38.220.41]) by mail.tail-f.com (Postfix) with ESMTPSA id A8F4C1AE0426; Tue, 5 Nov 2019 11:14:41 +0100 (CET)
Date: Tue, 05 Nov 2019 11:14:12 +0100 (CET)
Message-Id: <20191105.111412.1680377809294369950.mbj@tail-f.com>
To: yves.beauville@nokia.com
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <e0931dbe-5478-436b-c5de-ba6820c1b73d@nokia.com>
References: <e0931dbe-5478-436b-c5de-ba6820c1b73d@nokia.com>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/WPKPEAgka6O8ZmTo_BToYv47FJg>
Subject: Re: [netmod] Default choice case with only empty leaf - Is this allowed ?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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, 05 Nov 2019 10:14:45 -0000

Hi,

"Beauville, Yves (Nokia - BE/Antwerp)" <yves.beauville@nokia.com> wrote:
> Hello,
> 
> In the example provided in section 7.9.3 of RFC7950, is it legal to 
> redefine the default case like below?
> 
>       container transfer {
>         choice how {
>           default manual;     // redefined
>           case interval {
>             leaf interval {
>               type uint16;
>               units minutes;
>               default 30;
>             }
>           }
>           case daily {
>             leaf daily {
>               type empty;
>             }
>             leaf time-of-day {
>               type string;
>               units 24-hour-clock;
>               default "01.00";
>             }
>           }
>           case manual {
>             leaf manual {
>               type empty;
>             }
>           }
>         }
>       }

Section 7.9.3 says:

   The default case is only important when considering the "default"
   statements of nodes under the cases (i.e., default values of leafs
   and leaf-lists, and default cases of nested choices).  The default
   values and nested default cases under the default case are used if
   none of the nodes under any of the cases are present.

So, yes it is legal, but doesn't mean anything.

> What is expected to happen when an <edit-config> request creates the 
> 'transfer' container without providing any data for the choice 'how'?

The behaviour is the same as if you didn't have the default statement
in the choice.

> Since an empty leaf conveys information by its presence or absence, and 
> cannot have a default value, is it correct to assume that the 'manual' 
> leaf will be present, even though it was not explicitly created by the 
> <edit-config> request?

No.

> Can someone clarify?



/martin