Tom,

I'm choosing to reply to this mail rather than your previous one since it 
covers the relevant point.


> On Apr 13, 2023, at 6:05 AM, tom petch <[email protected]> wrote:
>> 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.

The bits type includes its position and is a bit number/name mapping.  You're 
correct that all that appears on the wire is the name.

YANG 1.1 rules require that:
"All assigned names in a bits type MUST be unique."
(RFC 7950, §9.7.4)
Ergo, a name mapping is directly reversible to bit position.
>  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.

I think this is a strawman argument.

YANG 1.1 versioning rules do not permit modules to augment bits types.  You 
have to update the type in a new module.  (RFC 7950, §11)

If you have conflicting assignments for a bit vector because the models don't 
agree, you have a serious issue in version management and module maintenance.  
This is a bug.



-- Jeff

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to