Skip to content

tree data FEATURE yang-push notification envelope - #2620

Open
Roytak wants to merge 6 commits into
develfrom
yp-notif-envelope
Open

Roytak wants to merge 6 commits into
develfrom
yp-notif-envelope

Conversation

@Roytak

@Roytak Roytak commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Adds LYD_TYPE_NOTIF_ENVELOPE to lyd_parse_op() for parsing YANG-Push notifications wrapped in the notification envelope of draft-ietf-netconf-notif-envelope, in XML, JSON and CBOR.

The notification from its contents is returned as a separate data tree, like with the NETCONF and RESTCONF types, and is parsed as regular data, not as opaque anydata content. Creating and printing the envelope needs no new API because it is ordinary sx:structure data. sysrepo needs this to send and collect UDP-Notif messages in the envelope.

Also fixes 2 CBOR parser bugs:

  • validating extension instance data, such as an sx:structure, no longer fails an assertion,
  • LYD_PARSE_ANYDATA_STRICT is honored.

@Roytak
Roytak force-pushed the yp-notif-envelope branch 2 times, most recently from ac0153a to 420e372 Compare November 6, 2026 10:26
Unlike the XML and JSON parsers, the CBOR parser never set LYD_EXT on
the top-level node of extension instance data, such as an sx:structure.
Validation of such data then failed an assertion in
lyd_validate_tree_ext().
Unlike the XML and JSON parsers, the CBOR parser always parsed anydata
content as opaque nodes and ignored LYD_PARSE_ANYDATA_STRICT.
Add LYD_TYPE_NOTIF_ENVELOPE to parse the 'envelope' structure of
ietf-yp-notification (draft-ietf-netconf-notif-envelope) in XML, JSON
and CBOR. The envelope is regular structure data, so it is parsed by
the generic parsers and keeps its schema, including headers added by
sx:augment-structure. Unlike the NETCONF and RESTCONF types, no opaque
envelope is built.

A new internal parser option makes the parsers reject a root other
than the envelope, and an RPC, action or second notification in its
anydata, where the operation checks are otherwise skipped. The
notification in 'contents' is parsed like any other notification, not
as opaque anydata content, so an invalid value is rejected.

tree returns the envelope with an empty 'contents' and op the
notification, which may be nested, unlinked into a data tree of its
own as with the other types. Validation is left to the caller.
Add the ietf-yp-notification and ietf-yp-observation modules from
draft-ietf-netconf-notif-envelope-07 with their imports, and test
parsing the envelope in all formats: draft figures, round trip of an
envelope built with lyd_new_*(), nested notification, augmented
header, rejected inputs and the follow-up validation.
@Roytak
Roytak force-pushed the yp-notif-envelope branch from 420e372 to 530a741 Compare November 6, 2026 10:40
@Roytak
Roytak marked this pull request as ready for review November 6, 2026 10:45
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.

1 participant