[yang-doctors] Identities vs enums

"Acee Lindem (acee)" <acee@cisco.com> Sat, 19 August 2017 19:02 UTC

Return-Path: <acee@cisco.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 66CB31329D1; Sat, 19 Aug 2017 12:02:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.52
X-Spam-Level:
X-Spam-Status: No, score=-14.52 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com
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 AyqIkHcCRnTZ; Sat, 19 Aug 2017 12:02:07 -0700 (PDT)
Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CFE841329CD; Sat, 19 Aug 2017 12:02:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2721; q=dns/txt; s=iport; t=1503169326; x=1504378926; h=from:to:cc:subject:date:message-id:mime-version; bh=FsXG7NEjt2jkg555/WphkxwY4K8omMS0ZHFxvTS+x9s=; b=nJBYe2bVyH9CbjXrS+h3t+x63VpGw7Fd5Fa/+vcq15m3wmzbpUjNFi/L wDY54q5zz5RWquJc3u0N4p6Y8x77xv4YKbNtlDAgYrQo76tiYFATlF9Th srT3eT/yVGFKtF3Q75Isw2hqw4LTuD3sc+RFSmK7+wmtxmhHGWBYOCvqw M=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CkAQCqiZhZ/40NJK1TCRkBAQEBAQEBAQEBAQcBAQEBAYJva4IAnh6SU4U5ghKFRxyDVEEWAQIBAQEBAQEBayiFQlYSAQwBPQIEMCcEAQ2JUmSwFYImi2UBAQEBAQEBAQEBAQEBAQEBAQEggyiCAoMvh3CDPYJhBaBPAoFmklqSXpYfASYCL4EKdxWHY4pKgQ8BAQE
X-IronPort-AV: E=Sophos;i="5.41,398,1498521600"; d="scan'208,217";a="474130368"
Received: from alln-core-8.cisco.com ([173.36.13.141]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Aug 2017 19:02:06 +0000
Received: from XCH-RTP-013.cisco.com (xch-rtp-013.cisco.com [64.101.220.153]) by alln-core-8.cisco.com (8.14.5/8.14.5) with ESMTP id v7JJ25IG016996 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sat, 19 Aug 2017 19:02:06 GMT
Received: from xch-rtp-015.cisco.com (64.101.220.155) by XCH-RTP-013.cisco.com (64.101.220.153) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Sat, 19 Aug 2017 15:02:05 -0400
Received: from xch-rtp-015.cisco.com ([64.101.220.155]) by XCH-RTP-015.cisco.com ([64.101.220.155]) with mapi id 15.00.1210.000; Sat, 19 Aug 2017 15:02:05 -0400
From: "Acee Lindem (acee)" <acee@cisco.com>
To: YANG Doctors <yang-doctors@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
CC: Rodney Cummings <rodney.cummings@ni.com>
Thread-Topic: Identities vs enums
Thread-Index: AQHTGR2lD0xqu8Yxx0SFPCqJBETSBw==
Date: Sat, 19 Aug 2017 19:02:04 +0000
Message-ID: <D5BE0363.C241B%acee@cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.116.152.201]
Content-Type: multipart/alternative; boundary="_000_D5BE0363C241Baceeciscocom_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/iqheA3PZXaQaWBJY2haYIf8Tkcg>
Subject: [yang-doctors] Identities vs enums
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 19 Aug 2017 19:02:08 -0000

All,
In the context iana-routing-types.yang, we’ve been having a discussion of the merits of identities vs enums. We’ve followed the lead of RFC 7224 and used identities which allow augmentation. However, for IANA code points, there could be merit in having the type represent the actual numeric value. Any thoughts on this?

In the next version of YANG, it would be useful for a base identity to allow it to have a "base-type" (mutually exclusive of "identity-ref"). For all identities a "base-value" would be allowed as long as it conformed to the constraints of the actual or inherited (via “identity-ref”) “base-type”.

Thanks,
Acee