Subject: [netmod] Question on range for parent-rel-pos in ietf-hatrdware.yang versus RFC 6933 entPhysicalParentRelPos

From: "Bogaert, Bart (Nokia - BE/Antwerp)" <[email-masked]>
Date: Thu, 8 Feb 2018 07:03:01 +0000

Hi,

During implementation we came across the following anomaly:

According to RFC 6933 entPhysicalParentRelPos the value should be set to -1 in case there is no parent.
The hardware YANG model defines this leaf as int32 with range "0 .. 2147483647",  To be in-line with the referred RFC, shouldn't the range be extended as "-1 .. 2147483647"?

Regards, Bart

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 08 Feb 2018 09:23:54 +0100 (CET)

"Bogaert, Bart (Nokia - BE/Antwerp)" <[email-masked]> wrote:
> The hardware YANG model defines this leaf as int32 with range "0
> .. 2147483647",  To be in-line with the referred RFC, shouldn't the
> range be extended as "-1 .. 2147483647"?

In MIBs, people often use special values to indicate that the
underlying thing doesn't exist.  In YANG we try to avoid this, and
instead not instantiate the node.  This should probably have been
clarified in the YANG module.

/martin

---

From: "Bogaert, Bart (Nokia - BE/Antwerp)" <[email-masked]>
Date: Thu, 8 Feb 2018 08:28:04 +0000

Thanks Martin, this makes sense.

Regards, Bart

-----Original Message-----
From: Martin Bjorklund [mailto:[email-masked]] 
Sent: Thursday, February 8, 2018 9:24 AM
To: Bogaert, Bart (Nokia - BE/Antwerp) <[email-masked]>
Cc: [email-masked]
Subject: Re: [netmod] Question on range for parent-rel-pos in ietf-hatrdware.yang versus RFC 6933 entPhysicalParentRelPos

"Bogaert, Bart (Nokia - BE/Antwerp)" <[email-masked]> wrote:
> The hardware YANG model defines this leaf as int32 with range "0 .. 
> 2147483647",  To be in-line with the referred RFC, shouldn't the range 
> be extended as "-1 .. 2147483647"?

In MIBs, people often use special values to indicate that the underlying thing doesn't exist.  In YANG we try to avoid this, and instead not instantiate the node.  This should probably have been clarified in the YANG module.

/martin