Skip to content

tree data FEATURE yang-push notification envelope - #2620

Draft
Roytak wants to merge 3 commits into
develfrom
yp-notif-envelope
Draft

Roytak wants to merge 3 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 envelope is returned in tree, including any headers added by sx:augment-structure, and the notification inside its contents is returned in op. The ietf-yp-notification module must be implemented in the context.

Also fixes the CBOR parser not marking extension instance data, such as sx:structure data, which failed an assert() when the data was validated.

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().
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 a second notification in its anydata, where the
operation checks are otherwise skipped.

tree returns the envelope and op the single notification inside its
'contents', which may be nested. Validation is left to the caller, as
for the other types.
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.
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