Re: [core] YANG to CBOR mapping version 1

peter van der Stok <stokcons@xs4all.nl> Tue, 12 July 2016 10:07 UTC

Return-Path: <stokcons@xs4all.nl>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 81D4D12D0CE for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 03:07:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.621
X-Spam-Level:
X-Spam-Status: No, score=-2.621 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 KliXAtM_bPPu for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 03:07:44 -0700 (PDT)
Received: from lb2-smtp-cloud3.xs4all.net (lb2-smtp-cloud3.xs4all.net [194.109.24.26]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 065A912B017 for <core@ietf.org>; Tue, 12 Jul 2016 03:07:43 -0700 (PDT)
Received: from webmail.xs4all.nl ([194.109.20.200]) by smtp-cloud3.xs4all.net with ESMTP id Hm7i1t0074K0fSy01m7ifm; Tue, 12 Jul 2016 12:07:42 +0200
Received: from 2001:983:a264:1:dbf:8e04:7626:a035 by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Tue, 12 Jul 2016 12:07:42 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"; format="flowed"
Content-Transfer-Encoding: 7bit
Date: Tue, 12 Jul 2016 12:07:42 +0200
From: peter van der Stok <stokcons@xs4all.nl>
To: Michel Veillette <Michel.Veillette@trilliantinc.com>
Organization: vanderstok consultancy
Mail-Reply-To: consultancy@vanderstok.org
In-Reply-To: <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl> <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com>
Message-ID: <e18f0f45bfae89fc55df444fdd957550@xs4all.nl>
X-Sender: stokcons@xs4all.nl (pDm24dwfg/n4XQr7sdC5gmmbpdueUkGb)
User-Agent: XS4ALL Webmail
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/z0gl3MdeSEpNSNDUTNpBC5sVxxs>
Cc: Core <core@ietf.org>
Subject: Re: [core] YANG to CBOR mapping version 1
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
Reply-To: consultancy@vanderstok.org
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jul 2016 10:07:45 -0000

Hi Michel,

> 
> However, I am missing how to transport a given list instance with its
> key values in the CBOR encoding. Section 4.4 describes the encoding of
> a complete list not a subset of its instances.
> 
> [MV] A list instance is a collection which is described in section 4.2.
> _____________________________________________________________________________________________

With the current text I don't see how you distinguish instances with the 
same key from instances with different keys.

Example:

list server {
      key name;

      leaf name {
        type string;
      }
      leaf iburst {
        type boolean;
        default false;
    }

How to distinguish that in the list below that two instances are 
identical (should not occur)
    [
      {
        1755 : "NRC TIC server",          # name (SID 1755)
        1754 : false,                     # iburst (SID 1754)
      },
      {
        1755 : "NRC TIC server",          # name (SID 1755)
        1754 : true,                     # iburst (SID 1754)
      }
    ]

And the following two instances are different  (valid array)

    [
      {
        1755 : "NRC TAC server",          # name (SID 1755)
        1754 : true,                      # iburst (SID 1754)
      },
      {
        1755 : "NRC TIC server",          # name (SID 1755)
        1754 : true,                     # iburst (SID 1754)
      }
    ]