Subject: [netmod] bits lexical representation

From: William Lupton <[email-masked]>
Date: Fri, 17 Jun 2016 15:51:49 +0100

RFC 6020bis Section 9.7.2 is silent on the question of whether bit names can be repeated in a bits value, e.g is “uno dos dos tres” valid or invalid? Obviously repetition is not to be encouraged but is it forbidden? Maybe this is a case where the robustness principle should be applied? Thanks, William.

---

From: Martin Bjorklund <[email-masked]>
Date: Sat, 18 Jun 2016 15:37:04 +0200 (CEST)

William Lupton <[email-masked]> wrote:
> RFC 6020bis Section 9.7.2 is silent on the question of whether bit
> names can be repeated in a bits value, e.g is “uno dos dos tres” valid
> or invalid?

9.7.4 says:

  All assigned names in a bits type MUST be unique.

/martin

> Obviously repetition is not to be encouraged but is it
> forbidden? Maybe this is a case where the robustness principle should
> be applied? Thanks, William.
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Sat, 18 Jun 2016 18:21:50 +0200

>   All assigned names in a bits type MUST be unique.

I think this sentence says that

leaf a {
  type bits {
    bit a;
    bit a;
  }
}

is illegal while I think the question was about the value encoding,
that is, given the definition

leaf b {
  type bits {
    bit a;
    bit b;
  }
}

is <b>a b b</b> illegal. I do not think this is specified but of
course a decent implementation would not generate something like this
and an implementation following the robustness principle would simply
ignore bits that are encoded multiple times.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

---

From: Andy Bierman <[email-masked]>
Date: Sat, 18 Jun 2016 09:54:18 -0700

> ignore bits that are encoded multiple times.
I don't think this is "of course".  It should be clear 1 way or the other.
We do not have warnings in the protocols that are usable, so silently
ignoring
extra bits may not help the client developer find out why there is a
duplicate bit.
Probably a programming error and a different bit was meant to be set.
(So returning an error may be "of course").

> /js
Andy

---

From: William Lupton <[email-masked]>
Date: Sun, 19 Jun 2016 19:50:21 +0100

It was actually a YANG default that triggered my original question. If repetition were officially forbidden or discouraged then presumably it would be permissible for pyang (and other tools) to check for it and issue an error or warning if it finds it. W.

> On 18 Jun 2016, at 17:54, Andy Bierman <[email-masked]> wrote:
> 
> On Sat, Jun 18, 2016 at 9:21 AM, Juergen Schoenwaelder <[email-masked] <mailto:[email-masked]>> wrote:
> > William Lupton <[email-masked] <mailto:[email-masked]>> wrote:
> We do not have warnings in the protocols that are usable, so silently ignoring
> extra bits may not help the client developer find out why there is a duplicate bit.
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/ <http://www.jacobs-university.de/>>
> 
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>
>