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 <[email protected]> wrote:
> 
> Tony Li <[email protected]> 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
>> [email protected]
>> https://www.ietf.org/mailman/listinfo/netmod
> 
> -- 
> Ladislav Lhotka
> Head, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67

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

Reply via email to