Subject: [yang-tooling] Re: PYANG Implementation of SID File Errata
From: Vojtech Vilimek <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Sun, 7 Jun 2026 01:03:27 +0200
List-Id: "Contributing to and tracking the progress of YANG tooling, as it concerns IETF work that uses YANG." <yang-tooling.ietf.org>

Hi yang-tooling substribers,

I also want you to know that I wrote a yang-sid tool/library. It is 
based on top of Yangson and lets you print price of SID assignment for a 
data model.

uvx --from https://github.com/vvilimek/yang-sid yang-sid -t \
   --sid --sid-price --sid-path $SID_PATH -p $YANG_PATH yang-library.json

Example output:

   +---x ietf-system:set-current-datetime SID(1715) price 3
   |  +--ro input SID(1716) price 1
   |  |  +--ro current-datetime SID(1717) price 1
   |  +--ro output SID(1718) price 1
   +--rw ietf-system:system SID(1719) price 3
   |  +--rw clock SID(1744) price 2
   |  |  +--rw timezone
   |  |     +-- timezone-utc-offset
   |  |        +--rw timezone-utc-offset SID(1746) price 1
   |  +--rw contact SID(1747) price 2
   |  +--rw dns-resolver SID(1748) price 2
   |  |  +--rw options SID(1749) price 1
   |  |  |  +--rw attempts SID(1750) price 1
   |  |  |  +--rw timeout SID(1751) price 1
   |  |  +--rw search SID(1752) price 1
   |  |  +--rw server SID(1753) price 1
   |  |     +--rw name SID(1754) price 1
   |  |     +--rw transport
   |  |        +-- udp-and-tcp
   |  |           +--rw udp-and-tcp SID(1755) price 1
   |  |              +--rw address SID(1756) price 1
   |  +--rw hostname SID(1758) price 2
   |  +--rw location SID(1759) price 2
   +---x ietf-system:system-restart SID(1720) price 3
   |  +--ro input SID(1721) price 1
   |  +--ro output SID(1722) price 1
   +---x ietf-system:system-shutdown SID(1723) price 3
   |  +--ro input SID(1724) price 1
   |  +--ro output SID(1725) price 1
   +--ro ietf-system:system-state SID(1726) price 3
      +--ro clock SID(1727) price 1
      |  +--ro boot-datetime SID(1728) price 1
      |  +--ro current-datetime SID(1729) price 1
      +--ro platform SID(1730) price 1
         +--ro machine SID(1731) price 1
         +--ro os-name SID(1732) price 1
         +--ro os-release SID(1733) price 1
         +--ro os-version SID(1734) price 1

   Total price: 49

The "price" is number of bytes used during YANG-CBOR encoding for the
SID identifiers only (price 1 == 1 byte, only the CBOR data item header
with small int, price 2 == header + 1 byte value, ...). The price of a
data model is sum of all price parent -- child prices.

It let's you do simple comparisons of different SID number assignments.
Flaws:
* The list entries are counted as only single entry exists
* No filtering or restrictions is implemented
* No named-based string prices
* The result is most likely wrong for data models that do not have
   complete SID assignment.

I hope you find this interestring.

Have a nice day!

Best regards,
Vojtech Vilimek
CZ.NIC z.s.p.o.