[yang-tooling] Re: PYANG Implementation of SID File Errata

Vojtech Vilimek <vojtech.vilimek@nic.cz> Sat, 06 June 2026 23:03 UTC

Return-Path: <vojtech.vilimek@nic.cz>
X-Original-To: yang-tooling@mail2.ietf.org
Delivered-To: yang-tooling@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id DE44EFC897C3 for <yang-tooling@mail2.ietf.org>; Sat, 6 Jun 2026 16:03:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1780787009; bh=F8Nu1YZB0cCZ5RuzdsZStYFkKLH6wAOD5mK18y86DTw=; h=Date:Subject:From:To:References:In-Reply-To; b=BHRxjcun80HDk0hIsOVU7owxvHz99+Zo4aQFzj8TUKBaBYuEA6Id1shIAQEuYodE2 NXmHs7QezREDhwEGK2c5GbusnKpeYkApYGMr1Kn3HeUrbRsfHFX9Uh4wEpFOo7PZCQ IRLEvIOUmt2uh1DuvAnXvopBlvQsyMirCHSFPUhI=
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -4.399
X-Spam-Level:
X-Spam-Status: No, score=-4.399 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xawOzD2Rjyp9 for <yang-tooling@mail2.ietf.org>; Sat, 6 Jun 2026 16:03:29 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 40D13FC897BD for <yang-tooling@ietf.org>; Sat, 6 Jun 2026 16:03:29 -0700 (PDT)
Received: from [192.168.50.142] (unknown [78.80.217.138]) by mail.nic.cz (Postfix) with ESMTPSA id ECFA61C1007 for <yang-tooling@ietf.org>; Sun, 7 Jun 2026 01:03:27 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nic.cz; s=default; t=1780787008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WJiscGInB3Du4dWzZfMx0Avqriw9BzXwujWT6k88iOY=; b=RyYV6mwZPP99stWjFb7qmnWD2hUd1Yjx7kEVRUDOH3zcZwMpdyVRyzgE6kvHlSo/ywxkgE KvnA9F4O+H0zloAqTQWsU320plkS+h99yizswF5l37PdwrdX7wyQrmAfqw+fJjKlJ3PRZN dUpgX9slVDHLrjiau2LwhLNtufs45XM=
Authentication-Results: mail.nic.cz; auth=pass smtp.auth=vojtech.vilimek@nic.cz smtp.mailfrom=vojtech.vilimek@nic.cz
Message-ID: <16f7070a-bf88-4af2-aea1-e4b25b4e1fe0@nic.cz>
Date: Sun, 07 Jun 2026 01:03:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Vojtech Vilimek <vojtech.vilimek@nic.cz>
To: "yang-tooling@ietf.org" <yang-tooling@ietf.org>
References: <1b8343eb-8c87-4cb1-bd11-7a9bb8c20a9b@nic.cz>
Content-Language: en-US
In-Reply-To: <1b8343eb-8c87-4cb1-bd11-7a9bb8c20a9b@nic.cz>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: ECFA61C1007
X-Rspamd-Server: mail
X-Rspamd-Action: no action
X-Spamd-Result: default: False [-0.10 / 16.00]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_ZERO(0.00)[0]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ASN(0.00)[asn:13036, ipnet:78.80.0.0/16, country:CZ]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM(-0.00)[-1.000]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[nic.cz:s=default]; TO_DN_EQ_ADDR_ALL(0.00)[]; LOCAL_OUTBOUND(0.00)[]; RCPT_COUNT_ONE(0.00)[1]
X-Spamd-Bar: /
Message-ID-Hash: RIOVACTRI57PZ3SLAEGLUZBKO56E2H5V
X-Message-ID-Hash: RIOVACTRI57PZ3SLAEGLUZBKO56E2H5V
X-MailFrom: vojtech.vilimek@nic.cz
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [yang-tooling] Re: PYANG Implementation of SID File Errata
List-Id: "Contributing to and tracking the progress of YANG tooling, as it concerns IETF work that uses YANG." <yang-tooling.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-tooling/HDJzeHUGczs_-CyFiu9rHnRuFk0>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-tooling>
List-Help: <mailto:yang-tooling-request@ietf.org?subject=help>
List-Owner: <mailto:yang-tooling-owner@ietf.org>
List-Post: <mailto:yang-tooling@ietf.org>
List-Subscribe: <mailto:yang-tooling-join@ietf.org>
List-Unsubscribe: <mailto:yang-tooling-leave@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.