Subject: [netmod] YANG 1.1 issue: make enum numbering purely informative and optional

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 24 Mar 2014 08:47:17 +0100

* make enum numbering purely informative and optional

** Description

In an enumeration type, each enum has an integer value assigned to it, either using the 'value' statement or via an automatic numbering procedure. From the NETCONF/RESTCONF protocol point of view, these values are irrelevant because they never appear on the wire. RFC 6020 also says in [[http://tools.ietf.org/html/rfc6020#section-9.6.4.2][Sec. 9.6.4.2]]: "The value is unused by YANG and the XML encoding, but is carried as a convenience to implementors."

However, RFC 6020 states in [[http://tools.ietf.org/html/rfc6020#section-10][Sec. 10]]:

   o  An "enumeration" type may have new enums added, provided the old
      enums's values do not change.

This rule makes updates of enumerations difficult and/or forces the data modeller to assign the values explicitly even if they have no meaning otherwise. The rule also contradicts the statement in Sec. 9.6.4.2 because the value in fact *is* used by YANG.

** Solution

Remove the auto-numbering procedure and the cited rule from Sec. 10. Numeric values can be assigned where they have some meaning outside NETCONF (e.g. protocols with port numbers), but they are indeed only informative.

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 24 Mar 2014 12:13:14 +0100 (CET)

Added as Y25.

/martin

Ladislav Lhotka <[email-masked]> wrote:
> In an enumeration type, each enum has an integer value assigned to it,
> either using the 'value' statement or via an automatic numbering
> procedure. From the NETCONF/RESTCONF protocol point of view, these
> values are irrelevant because they never appear on the wire. RFC 6020
> also says in
> [[http://tools.ietf.org/html/rfc6020#section-9.6.4.2][Sec. 9.6.4.2]]:
> "The value is unused by YANG and the XML encoding, but is carried as a
> convenience to implementors."
> 
> However, RFC 6020 states in
> [[http://tools.ietf.org/html/rfc6020#section-10][Sec. 10]]:
> 
> This rule makes updates of enumerations difficult and/or forces the
> data modeller to assign the values explicitly even if they have no
> meaning otherwise. The rule also contradicts the statement in
> Sec. 9.6.4.2 because the value in fact *is* used by YANG.
> 
> ** Solution
> 
> Remove the auto-numbering procedure and the cited rule from
> Sec. 10. Numeric values can be assigned where they have some meaning
> outside NETCONF (e.g. protocols with port numbers), but they are
> indeed only informative.
> 
> --