Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
LYD_TYPE_NOTIF_ENVELOPEtolyd_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 intree, including any headers added bysx:augment-structure, and the notification inside itscontentsis returned inop. Theietf-yp-notificationmodule must be implemented in the context.Also fixes the CBOR parser not marking extension instance data, such as
sx:structuredata, which failed an assert() when the data was validated.