Hi Tony, I would argue that YANG is a data modeling language. Another disadvantage of the bits type that it isn't augmentable with new bits. Hence, usage of unused bits requires a new version of the module as opposed to an augmentation. For that reason, we greatly limited their usage in routing modules and used identities instead.
Thanks, Acee On 4/2/21, 12:14 PM, "netmod on behalf of Tony Li" <netmod-boun...@ietf.org on behalf of tony...@tony.li> wrote: Hi Lada, Thanks for your reply. At heart, I guess I’m asking a more fundamental question: is YANG intended as a data modelling language or as a data structure modelling language? Your reply suggests the former: structure is irrelevant to YANG. If that’s true, then what’s the point in ‘position’? And why do you need ‘bits’ when you have ‘binary’? Confused, Tony > On Apr 2, 2021, at 1:27 AM, Ladislav Lhotka <ladislav.lho...@nic.cz> wrote: > > Tony Li <tony...@tony.li> writes: > >> Hi, >> >> I have some basic questions about YANG. I’m pretty certain this is NOT the right place to ask them, so please feel free to redirect me. >> >> >> 1) Is there a way to define the width of an enumeration? Suppose I had an enumeration that was in a 16 bit field, how do I describe that? > > In the description, if necessary. However, this should be an implementation detail, as long as the underlying numeric type can accommodate all enums. > > You could perhaps also define and enum for the highest possible value and make in reserved. > >> >> 2) How do I model a non-octet sized multi-bit field? For example, if there is a 5 bit numeric value as part of some ‘bits’? Position only takes a single value, I can’t really say ‘position 3-7’. > > In this case, I would question whether the 'bits' type is really appropriate. It might be useful to split the value into multiple items in YANG. > > Lada > >> >> Thanks, >> Tony >> _______________________________________________ >> netmod mailing list >> netmod@ietf.org >> https://www.ietf.org/mailman/listinfo/netmod > > -- > Ladislav Lhotka > Head, CZ.NIC Labs > PGP Key ID: 0xB8F92B08A9F76C67 _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod