Skip to content

implement ietf-system-capabilities and ietf-notification-capabilities#1715

Merged
michalvasko merged 1 commit intoCESNET:develfrom
jeremie6wind:devel
Apr 9, 2025
Merged

implement ietf-system-capabilities and ietf-notification-capabilities#1715
michalvasko merged 1 commit intoCESNET:develfrom
jeremie6wind:devel

Conversation

@jeremie6wind
Copy link
Contributor

This patch is an implementation of RFC9696
Link: https://datatracker.ietf.org/doc/html/rfc9196

netopeer2 can return the operational data of /ietf-system-capabilities:system-capabilities
which contains the limit values of several parameters.

max-nodes-per-update: there is no limit on the number of node to send inside a notif in sysrepo. The max unsigned integer value is set.
periodic-notifications-supported and on-change-supported: The publisher is capable of sending notifications for 'config false' and 'config true' nodes.
minimum-update-period and minimum-dampening-period: The minimum value is 0.
supported-excluded-change-type: All types of changes can be excluded.

A sysrepocfg command would give this result:

# sysrepocfg -f json -x "/ietf-system-capabilities:system-capabilities" -v2 -X -d operational

{
  "ietf-system-capabilities:system-capabilities": {
    "datastore-capabilities": [
      {
        "datastore": "ietf-datastores:startup",
        "per-node-capabilities": [
          {
            "ietf-notification-capabilities:subscription-capabilities": {
              "max-nodes-per-update": 4294967295,
              "periodic-notifications-supported": "config-changes state-changes",
              "minimum-update-period": 0,
              "on-change-supported": "config-changes state-changes",
              "minimum-dampening-period": 0,
              "supported-excluded-change-type": [
                "all"
              ]
            }
          }
        ]
      },
      {
        "datastore": "ietf-datastores:running",
        "per-node-capabilities": [
          {
            "ietf-notification-capabilities:subscription-capabilities": {
              "max-nodes-per-update": 4294967295,
              "periodic-notifications-supported": "config-changes state-changes",
              "minimum-update-period": 0,
              "on-change-supported": "config-changes state-changes",
              "minimum-dampening-period": 0,
              "supported-excluded-change-type": [
                "all"
              ]
            }
          }
        ]
      },
      {
        "datastore": "ietf-datastores:candidate",
        "per-node-capabilities": [
          {
            "ietf-notification-capabilities:subscription-capabilities": {
              "max-nodes-per-update": 4294967295,
              "periodic-notifications-supported": "config-changes state-changes",
              "minimum-update-period": 0,
              "on-change-supported": "config-changes state-changes",
              "minimum-dampening-period": 0,
              "supported-excluded-change-type": [
                "all"
              ]
            }
          }
        ]
      },
      {
        "datastore": "ietf-datastores:operational",
        "per-node-capabilities": [
          {
            "ietf-notification-capabilities:subscription-capabilities": {
              "max-nodes-per-update": 4294967295,
              "periodic-notifications-supported": "config-changes state-changes",
              "minimum-update-period": 0,
              "on-change-supported": "config-changes state-changes",
              "minimum-dampening-period": 0,
              "supported-excluded-change-type": [
                "all"
              ]
            }
          }
        ]
      }
    ],
    "ietf-notification-capabilities:subscription-capabilities": {
      "max-nodes-per-update": 4294967295,
      "periodic-notifications-supported": "config-changes state-changes",
      "minimum-update-period": 0,
      "on-change-supported": "config-changes state-changes",
      "minimum-dampening-period": 0,
      "supported-excluded-change-type": [
        "all"
      ]
    }
  }
}

Copy link
Member

@michalvasko michalvasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, no problem, just do a minor refactoring and it should be good to go.

@jktjkt
Copy link
Contributor

jktjkt commented Apr 2, 2025

periodic-notifications-supported and on-change-supported: The publisher is capable of sending notifications for 'config false' and 'config true' nodes.
minimum-update-period and minimum-dampening-period: The minimum value is 0.

When these fields are implemented, IMHO there's an expectation that the entire device (as visible over, say, NETCONF) will adhere to this behavior and send the updates based on the advertised intervals. But in case of sysrepo, I think this really depends on the way how your application-level CBs are set up -- isn't it? In that case, is it a good idea to possibly advertise features which are not met by the rest of the system?

@jeremie6wind
Copy link
Contributor Author

Hi,
thank you for your feedback.

I agree that the subscriptions set up defines the behavior of the notifications.
The idea here is to put default values for the fields.
For example, it is possible to configure 0 as the notification period for example, if nothing is implemented.
Other applications can subscribe to provide operational data and overwrite the values(define per node values)
according to the device capabilities thanks to the merge flag.
Would you prefer the content without the periods? without periodic-notifications-supported and on-change-supported?
Thanks

Add ietf-system-capabilities and ietf-notification-capabilities yang
modules.
Subscribe to provide /ietf-system-capabilities:system-capabilities
operational data. Use the SR_SUBSCR_OPER_MERGE flag such as another
application can overwrite the values.
Provide default possible values for all the fields.
Move sub_ntf_ds2ident to common.c.

Link: https://datatracker.ietf.org/doc/html/rfc9196
Signed-off-by: Jeremie Leska <jeremie.leska@6wind.com>
@michalvasko michalvasko merged commit 473e0ff into CESNET:devel Apr 9, 2025
7 checks passed
jeremie6wind added a commit to jeremie6wind/netopeer2 that referenced this pull request Mar 11, 2026
As per-node-capabilities is a keyless list. Create the node-selector
with lyd_new_term.

Fixes: 473e0ff ("main UPDATE implement capabilities modules (CESNET#1715)")
Link: https://datatracker.ietf.org/doc/html/rfc9196#section-4.2
Signed-off-by: Jeremie Leska <jeremie.leska@6wind.com>
jeremie6wind added a commit to jeremie6wind/netopeer2 that referenced this pull request Mar 11, 2026
Until now, "/" xpath was added to system-capabilities for all
datastores.
Both config and state changes for both periodic and on-change
notifications were set as supported.
Remove config-changes and state-changes from on-change-supported and
periodic-notifications-supported.
Other applications can merge custom xpaths with custom support.

Fixes: 473e0ff ("main UPDATE implement capabilities modules (CESNET#1715)")
Link: https://datatracker.ietf.org/doc/html/rfc9196
Signed-off-by: Jeremie Leska <jeremie.leska@6wind.com>
michalvasko pushed a commit that referenced this pull request Mar 11, 2026
As per-node-capabilities is a keyless list. Create the node-selector
with lyd_new_term.

Fixes: 473e0ff ("main UPDATE implement capabilities modules (#1715)")
Link: https://datatracker.ietf.org/doc/html/rfc9196#section-4.2
Signed-off-by: Jeremie Leska <jeremie.leska@6wind.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants