Carsten,

whatever you do, you will at the end need an extra bit. If BBF already
defined to use -1, so be it.

The alternative is to not instantiate the leaf if there is no value
and to accept that a client can't tell the difference between 'there
is no value' and 'the value has been suppressed by authorization'.

/js

PS: You can define a maybe-uint16 type as a union in YANG but yes
    there is no syntactic sugar to generalize this.

On Tue, Sep 14, 2021 at 08:36:12PM +0200, Carsten Bormann wrote:
> On 14. Sep 2021, at 19:17, Jürgen Schönwälder 
> <j.schoenwael...@jacobs-university.de> wrote:
> > 
> > If other data models use an extended integer range and -1 to indicate
> > a special case, then this may be a strong reason to do the same in the
> > IETF YANG data model.
> 
> Any data model based on FORTRAN certainly will do.
> Most other data modeling languages by now should have nullable/optional/Maybe 
> types.
> 
> Going from the actual data type, uint16, to int32, just to accommodate the 
> “not present” case, strikes me as a mistake.
> (Which doesn’t mean that you may not want to do this in an implementation, 
> after having validated the input data.)
> 
> Grüße, Carsten
> 

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

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to