Skip to content

tree data FEATURE notification envelope detection - #2630

Merged
michalvasko merged 6 commits into
develfrom
yp-notif-auto
Nov 12, 2026
Merged

michalvasko merged 6 commits into
develfrom
yp-notif-auto

Conversation

@Roytak

@Roytak Roytak commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Adds LYD_TYPE_NOTIF_AUTO to lyd_parse_op(), which parses a notification in either the YANG-Push envelope of draft-ietf-netconf-notif-envelope or the NETCONF/RESTCONF one, detected from the input.

Also fixes JSON parser error messages reporting a wrong line number after the parser looked ahead in the input.

@michalvasko michalvasko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine, just fix the version conflicts, please.

The message parsers also read the NETCONF and RESTCONF envelopes, so
name the internal flag after the YANG-Push envelope it stands for.
A UDP-Notif collector learns only the encoding of a notification, not
its envelope, and had to sniff the root element itself to choose the
data type.

LYD_TYPE_NOTIF_AUTO parses a notification in the YANG-Push envelope or
in the NETCONF/RESTCONF one. The message parsers decide by the root
element they read first anyway, so the input is not tokenized and CBOR
not decoded twice. The 'ietf-yp-notification' module is required only
once its envelope is found.

LYD_TYPE_NOTIF_ENVELOPE goes through the same message parsers with the
detection skipped, so both types share one envelope path.
The JSON parser backup kept the input position but not its line, so
newlines read before a restore were counted twice and every later
error reported a line too far. LYD_TYPE_NOTIF_AUTO detection peeks at
the first member this way.
@michalvasko
michalvasko marked this pull request as draft November 12, 2026 07:47
@michalvasko
michalvasko marked this pull request as ready for review November 12, 2026 08:00
@michalvasko
michalvasko merged commit 04ccb68 into devel Nov 12, 2026
13 checks passed
@michalvasko
michalvasko deleted the yp-notif-auto branch November 12, 2026 08:00
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.

2 participants