From: Jeffrey Haas <[email protected]> Sent: 12 April 2023 18:04 Tom,
> On Apr 12, 2023, at 12:44 PM, tom petch <[email protected]> wrote: >> The reason to disconsider it is that within the same leaf, the value >> "changes meaning" once you end up with the new identity for the value when >> it's assigned and then end up with an orphaned identity. Implementations >> looking at that bit for that leaf now need to "know" they are equivalent. >> For the moment, the only hint that YANG can provide about this equivalency >> is in the description. >> >> At least within the bits construct, bit number assignment is always crystal >> clear. >> > <tp> > > That caught my eye and I am not sure I understand, As the I-D says, a bit is > identified by its name and the canonical form is a list of space-separated > names, bit number assignment I do not see except as a local convention > which I would not call crystal clear. With bits, if bit position 3 is "foo", you always know that foo is bit-position 3. <tp> No you do not. The protocol may define bit position 3 as foo but YANG does not. YANG defines bit with a name of foo as a bit with the name of foo and that is all that appears on the wire. Your local copy of the YANG module may optionally define a position of 3 and you may see that displayed on client or server but for both ends to agree that the position is 3 you need to know that that statement is present in the YANG module and that both ends of the wire are using the same revision, same augments of the YANG module(s) (and I do not know if that can be enforced with a YANG constraint). Otherwise the numeric value of position could be different. Tom Petch With identities, identity foo from base bar is simply "foo" and if it has anything to do with bit-position 3, it's listed by description. If you define foo2 and it's semantically the same as bit-position 3, an implementation could render "foo foo2", "foo", or "foo2". The underlying type doesn't provide machinery that enforces what you do. Somewhat maddening if you're trying to see what bits on the wire are. If you're driven to "just give me the hexdump", we've lost the ease of use game. -- Jeff _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
